mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixed autoroute part editor template.
This fixes an issue where the alias text field becomes hidden when the content is the homepage, while given the home alias updates you should still be able to change the alias of the content item.
This commit is contained in:
@@ -18,45 +18,46 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<fieldset class="permalink">
|
||||
<label>@T("Permalink")</label>
|
||||
@if (Model.Settings.AllowCustomPattern) {
|
||||
<span class="permalink-definition" dir="ltr">
|
||||
<span>@Url.MakeAbsolute("/")@urlPrefix</span>
|
||||
<span>@Html.TextBoxFor(m => m.CurrentUrl, new { @class = "text is-url" })</span>
|
||||
</span>
|
||||
<span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}.", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
}
|
||||
else {
|
||||
var hintClass = string.Empty;
|
||||
if (!string.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
hintClass = "hint";
|
||||
<span>@Url.MakeAbsolute("/")@urlPrefix@Model.CurrentUrl</span>
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Model.CurrentUrl)
|
||||
|| (!string.IsNullOrEmpty(Model.CurrentUrl) && Model.Settings.AutomaticAdjustmentOnEdit)) {
|
||||
<span class="@hintClass">@T("Save the current item and the url will be generated using the pattern {0} e.g., {1}.", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
}
|
||||
}
|
||||
@if (!String.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
<span>
|
||||
@Html.Link(
|
||||
T("View").Text,
|
||||
Url.MakeAbsolute("/") + urlPrefix + Model.CurrentUrl.TrimStart('/'),
|
||||
new { target = "_blank" })
|
||||
</span>
|
||||
}
|
||||
|
||||
</fieldset>
|
||||
@if (!Model.IsHomePage) {
|
||||
<fieldset class="permalink">
|
||||
<label>@T("Permalink")</label>
|
||||
@if (Model.Settings.AllowCustomPattern) {
|
||||
<span class="permalink-definition" dir="ltr">
|
||||
<span>@Url.MakeAbsolute("/")@urlPrefix</span>
|
||||
<span>@Html.TextBoxFor(m => m.CurrentUrl, new { @class = "text is-url" })</span>
|
||||
</span>
|
||||
<span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
}
|
||||
else {
|
||||
var hintClass = string.Empty;
|
||||
if (!string.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
hintClass = "hint";
|
||||
<span>@Url.MakeAbsolute("/")@urlPrefix@Model.CurrentUrl</span>
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(Model.CurrentUrl)
|
||||
|| (!string.IsNullOrEmpty(Model.CurrentUrl) && Model.Settings.AutomaticAdjustmentOnEdit)) {
|
||||
<span class="@hintClass">@T("Save the current item and the url will be generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
}
|
||||
}
|
||||
@if (!String.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
<span>
|
||||
@Html.Link(
|
||||
T("View").Text,
|
||||
Url.MakeAbsolute("/") + urlPrefix + Model.CurrentUrl.TrimStart('/'),
|
||||
new { target = "_blank" })
|
||||
</span>
|
||||
}
|
||||
|
||||
</fieldset>
|
||||
if (AuthorizedFor(Permissions.SetHomePage)) {
|
||||
<fieldset>
|
||||
<span class="checkbox-and-label">
|
||||
@Html.EditorFor(m => m.PromoteToHomePage)
|
||||
@Html.CheckBoxFor(m => m.PromoteToHomePage)
|
||||
<label for="@Html.FieldIdFor(m => m.PromoteToHomePage)" class="forcheckbox">@T("Set as home page")</label>
|
||||
</span>
|
||||
<span class="hint">@T("Check to promote this content as the home page")</span>
|
||||
<span class="hint">@T("Check to promote this content as the home page.")</span>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user