mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Incremental work
This commit is contained in:
1037
src/.vs/config/applicationhost.config
Normal file
1037
src/.vs/config/applicationhost.config
Normal file
File diff suppressed because it is too large
Load Diff
@@ -37,5 +37,14 @@ namespace Orchard.Autoroute {
|
|||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom3() {
|
||||||
|
|
||||||
|
SchemaBuilder.AlterTable("AutoroutePartRecord", table => table
|
||||||
|
.AddColumn<bool>("UseCulturePattern", c => c.WithDefault(false))
|
||||||
|
);
|
||||||
|
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,10 @@ namespace Orchard.Autoroute.Models {
|
|||||||
get { return Retrieve(x => x.UseCustomPattern); }
|
get { return Retrieve(x => x.UseCustomPattern); }
|
||||||
set { Store(x => x.UseCustomPattern, value); }
|
set { Store(x => x.UseCustomPattern, value); }
|
||||||
}
|
}
|
||||||
|
public bool UseCulturePattern {
|
||||||
|
get { return Retrieve(x => x.UseCulturePattern); }
|
||||||
|
set { Store(x => x.UseCulturePattern, value); }
|
||||||
|
}
|
||||||
public string DisplayAlias {
|
public string DisplayAlias {
|
||||||
get { return Retrieve(x => x.DisplayAlias); }
|
get { return Retrieve(x => x.DisplayAlias); }
|
||||||
set { Store(x => x.DisplayAlias, value); }
|
set { Store(x => x.DisplayAlias, value); }
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace Orchard.Autoroute.Models {
|
|||||||
public class AutoroutePartRecord : ContentPartVersionRecord {
|
public class AutoroutePartRecord : ContentPartVersionRecord {
|
||||||
|
|
||||||
public virtual bool UseCustomPattern { get; set; }
|
public virtual bool UseCustomPattern { get; set; }
|
||||||
|
|
||||||
|
public virtual bool UseCulturePattern { get; set; }
|
||||||
|
|
||||||
[StringLength(2048)]
|
[StringLength(2048)]
|
||||||
public virtual string CustomPattern { get; set; }
|
public virtual string CustomPattern { get; set; }
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Orchard.Autoroute.Settings {
|
|||||||
public AutorouteSettings() {
|
public AutorouteSettings() {
|
||||||
PerItemConfiguration = false;
|
PerItemConfiguration = false;
|
||||||
AllowCustomPattern = true;
|
AllowCustomPattern = true;
|
||||||
|
UseCulturePattern = false;
|
||||||
AutomaticAdjustmentOnEdit = false;
|
AutomaticAdjustmentOnEdit = false;
|
||||||
PatternDefinitions = "[]";
|
PatternDefinitions = "[]";
|
||||||
DefaultPatternDefinitions = "[]";
|
DefaultPatternDefinitions = "[]";
|
||||||
@@ -24,6 +25,7 @@ namespace Orchard.Autoroute.Settings {
|
|||||||
|
|
||||||
public bool PerItemConfiguration { get; set; }
|
public bool PerItemConfiguration { get; set; }
|
||||||
public bool AllowCustomPattern { get; set; }
|
public bool AllowCustomPattern { get; set; }
|
||||||
|
public bool UseCulturePattern { get; set; }
|
||||||
public bool AutomaticAdjustmentOnEdit { get; set; }
|
public bool AutomaticAdjustmentOnEdit { get; set; }
|
||||||
public bool? IsDefault { get; set; }
|
public bool? IsDefault { get; set; }
|
||||||
public List<string> SiteCultures { get; set; }
|
public List<string> SiteCultures { get; set; }
|
||||||
@@ -91,6 +93,7 @@ namespace Orchard.Autoroute.Settings {
|
|||||||
public void Build(ContentTypePartDefinitionBuilder builder) {
|
public void Build(ContentTypePartDefinitionBuilder builder) {
|
||||||
builder.WithSetting("AutorouteSettings.PerItemConfiguration", PerItemConfiguration.ToString(CultureInfo.InvariantCulture));
|
builder.WithSetting("AutorouteSettings.PerItemConfiguration", PerItemConfiguration.ToString(CultureInfo.InvariantCulture));
|
||||||
builder.WithSetting("AutorouteSettings.AllowCustomPattern", AllowCustomPattern.ToString(CultureInfo.InvariantCulture));
|
builder.WithSetting("AutorouteSettings.AllowCustomPattern", AllowCustomPattern.ToString(CultureInfo.InvariantCulture));
|
||||||
|
builder.WithSetting("AutorouteSettings.UseCulturePattern", UseCulturePattern.ToString(CultureInfo.InvariantCulture));
|
||||||
builder.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", AutomaticAdjustmentOnEdit.ToString(CultureInfo.InvariantCulture));
|
builder.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", AutomaticAdjustmentOnEdit.ToString(CultureInfo.InvariantCulture));
|
||||||
builder.WithSetting("AutorouteSettings.PatternDefinitions", PatternDefinitions);
|
builder.WithSetting("AutorouteSettings.PatternDefinitions", PatternDefinitions);
|
||||||
builder.WithSetting("AutorouteSettings.DefaultPatternDefinitions", DefaultPatternDefinitions);
|
builder.WithSetting("AutorouteSettings.DefaultPatternDefinitions", DefaultPatternDefinitions);
|
||||||
|
|||||||
@@ -22,6 +22,15 @@
|
|||||||
<span class="hint">@T("This option will cause the Url to automatically be regenerated when you edit existing content and publish it again, otherwise it will always keep the old route, or you have to perform bulk update in the Autoroute admin.")</span>
|
<span class="hint">@T("This option will cause the Url to automatically be regenerated when you edit existing content and publish it again, otherwise it will always keep the old route, or you have to perform bulk update in the Autoroute admin.")</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@if (Model.SiteCultures.Count > 1) {
|
||||||
|
<fieldset>
|
||||||
|
<div>
|
||||||
|
@Html.CheckBoxFor(m => m.UseCulturePattern)
|
||||||
|
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.UseCulturePattern)">@T("Use culture pattern(s)")</label>
|
||||||
|
<span class="hint">@T("Allow to set pattern(s) for each culture. If left unchecked this means it will use the default website culture pattern(s).")</span>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<h4>@T("Patterns") :</h4>
|
<h4>@T("Patterns") :</h4>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -30,17 +39,28 @@
|
|||||||
<ul class="autoroute-cultures localmenu group">
|
<ul class="autoroute-cultures localmenu group">
|
||||||
@{
|
@{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
string cssClass = "";
|
||||||
}
|
}
|
||||||
@foreach (var culture in Model.SiteCultures) {
|
@foreach (var culture in Model.SiteCultures) {
|
||||||
var cssClass = i == 0 ? "selected first" : i == Model.SiteCultures.Count - 1 ? "last" : "middle";
|
cssClass = "";
|
||||||
<li class="@cssClass"><a class="culture" href="#cat-@culture">@culture</a></li>
|
if (Model.UseCulturePattern) {
|
||||||
|
cssClass = i == 0 ? "first selected" : i == Model.SiteCultures.Count - 1 ? "last" : "middle";
|
||||||
|
<li class="@cssClass"><a class="culture" href="#cat-@culture">@culture</a></li>
|
||||||
|
} else {
|
||||||
|
cssClass = i == 0 ? "first" : i == Model.SiteCultures.Count - 1 ? "last" : "middle";
|
||||||
|
if (culture == Model.DefaultSiteCulture) {
|
||||||
|
<li class="@cssClass"><a class="culture" href="#cat-@culture">@culture</a></li>
|
||||||
|
} else {
|
||||||
|
<li class="@cssClass" style="display:none;"><a class="culture" href="#cat-@culture">@culture</a></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
@foreach (var culture in Model.SiteCultures) {
|
@foreach (var culture in Model.SiteCultures) {
|
||||||
<fieldset id="cat-@culture" class="items" style="@(cultureCount == 0 ? "display:block;" : "display:none;" )">
|
<fieldset id="cat-@culture" class="items" style="@(cultureCount == 0 ? "display:block;" : "display:none;")">
|
||||||
<table class="autoroute-settings-patterns">
|
<table class="autoroute-settings-patterns">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="autoroute-settings-default">@T("Default")</th>
|
<th class="autoroute-settings-default">@T("Default")</th>
|
||||||
@@ -67,4 +87,5 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
@Display.TokenHint()
|
@Display.TokenHint()
|
||||||
|
|||||||
@@ -225,11 +225,11 @@
|
|||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||||
<WebProjectProperties>
|
<WebProjectProperties>
|
||||||
<UseIIS>False</UseIIS>
|
<UseIIS>True</UseIIS>
|
||||||
<AutoAssignPort>False</AutoAssignPort>
|
<AutoAssignPort>False</AutoAssignPort>
|
||||||
<DevelopmentServerPort>30321</DevelopmentServerPort>
|
<DevelopmentServerPort>30321</DevelopmentServerPort>
|
||||||
<DevelopmentServerVPath>/OrchardLocal</DevelopmentServerVPath>
|
<DevelopmentServerVPath>/OrchardLocal</DevelopmentServerVPath>
|
||||||
<IISUrl>http://localhost:30322/OrchardLocal</IISUrl>
|
<IISUrl>http://localhost:30322</IISUrl>
|
||||||
<NTLMAuthentication>False</NTLMAuthentication>
|
<NTLMAuthentication>False</NTLMAuthentication>
|
||||||
<UseCustomServer>False</UseCustomServer>
|
<UseCustomServer>False</UseCustomServer>
|
||||||
<CustomServerUrl>
|
<CustomServerUrl>
|
||||||
|
|||||||
Reference in New Issue
Block a user