#19406: Adding missing base url prefixes in some views

Work Item: 19406

--HG--
branch : 1.x
extra : rebase_source : 70717c414f4f13109a2c9a531ca99aff78fca92a
This commit is contained in:
Jimasp 2013-07-10 14:40:23 -07:00
parent 49b32de9b0
commit 8162f99dbf
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
@model Orchard.Autoroute.ViewModels.AutoroutePartEditViewModel
@using Orchard.Autoroute
@using Orchard.Utility.Extensions;
@using Orchard.Environment.Configuration
@if(Model.Settings.DefaultPatternIndex == -1) {
<div class="message message-Error">@T("The current Content Type does not have a default Autoroute Pattern. Please edit the settings first.")</div>
@ -9,17 +10,21 @@
@{
var defaultPattern = Model.Settings.Patterns[Model.Settings.DefaultPatternIndex];
var urlPrefix = WorkContext.Resolve<ShellSettings>().RequestUrlPrefix;
if (!String.IsNullOrWhiteSpace(urlPrefix)) {
urlPrefix += "/";
}
}
@if (!Model.PromoteToHomePage) {
<fieldset class="permalink">
<label>@T("Permalink")</label>
@if (Model.Settings.AllowCustomPattern) {
<span>@ViewContext.RequestContext.HttpContext.Request.ToApplicationRootUrlString()/</span>
<span>@ViewContext.RequestContext.HttpContext.Request.ToApplicationRootUrlString()/@urlPrefix</span>
<span>@Html.TextBoxFor(m => m.CurrentUrl, new {@class = "text"})</span>
}
else {
<span>@ViewContext.RequestContext.HttpContext.Request.ToApplicationRootUrlString()/@Model.CurrentUrl</span>
<span>@ViewContext.RequestContext.HttpContext.Request.ToApplicationRootUrlString()/@urlPrefix</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}", defaultPattern.Name, defaultPattern.Description)</span>

View File

@ -1,4 +1,5 @@
@model Orchard.ContentPicker.ViewModels.ContentMenuItemEditViewModel
@using Orchard.Environment.Configuration
@model Orchard.ContentPicker.ViewModels.ContentMenuItemEditViewModel
@{
Script.Require("ContentPicker").AtFoot();
var title = Model.Part.Content == null ? new HtmlString(T("Empty").Text) : Html.ItemDisplayText(Model.Part.Content);
@ -29,7 +30,7 @@
menuText.val(data.displayText);
}
},
baseUrl: '@Url.Content("~/")'
baseUrl: '@HttpUtility.JavaScriptStringEncode(Url.Content("~/" + WorkContext.Resolve<ShellSettings>().RequestUrlPrefix))'
});
});
//]]>