Hiding the Register link if registering is not allowed (by default)

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-11-01 13:16:55 -07:00
parent 75efbf5f0a
commit c2f46861bc

View File

@@ -1,7 +1,12 @@
@model Orchard.Users.ViewModels.LogOnViewModel
@using Orchard.ContentManagement;
@{
var userCanRegister = @WorkContext.CurrentSite.As<Orchard.Users.Models.RegistrationSettingsPart>().UsersCanRegister;
}
<h1 class="page-title">@Html.TitleForPage(Model.Title)</h1>
<p>@T("Please enter your username and password.") @Html.ActionLink("Register", "Register") @T(" if you don't have an account.")</p>
<p>@T("Please enter your username and password.") @if(userCanRegister) { <text> </text> @Html.ActionLink("Register", "Register") @T(" if you don't have an account.") }</p>
@Html.ValidationSummary(T("Login was unsuccessful. Please correct the errors and try again.").ToString())
@using (Html.BeginFormAntiForgeryPost(Url.Action("LogOn", new {ReturnUrl = Request.QueryString["ReturnUrl"]}))) {