added "usecdn" to sitesettings

This commit is contained in:
PaulDevenneyBede
2015-02-07 17:55:23 +00:00
committed by agriffard
parent 611b3dde44
commit efc573992c
8 changed files with 32 additions and 0 deletions

View File

@@ -76,6 +76,11 @@ namespace Orchard.Tests.Stubs {
set { throw new NotImplementedException(); }
}
public bool UseCdn {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public int PageSize {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }

View File

@@ -44,6 +44,11 @@ namespace Orchard.Core.Settings.Models {
get { return this.Retrieve(x => x.ResourceDebugMode); }
set { this.Store(x => x.ResourceDebugMode, value); }
}
public bool UseCdn {
get { return this.Retrieve(x => x.UseCdn); }
set { this.Store(x=> x.UseCdn, value); }
}
public int PageSize {
get { return this.Retrieve(x => x.PageSize, DefaultPageSize); }

View File

@@ -46,6 +46,11 @@ namespace Orchard.Core.Settings.ViewModels {
set { Site.ResourceDebugMode = value; }
}
public bool UseCdn {
get { return Site.UseCdn; }
set { Site.UseCdn = value; }
}
public int PageSize {
get { return Site.PageSize; }
set { Site.PageSize = value; }

View File

@@ -58,6 +58,11 @@
@Html.DropDownList("ResourceDebugMode", resourceDebugMode)
<span class="hint">@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</span>
</div>
<div>
@Html.LabelFor(m => m.UseCdn, T("Use CDN"))
@Html.CheckBoxFor(m => m.UseCdn)
<span class="hint">@T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version")</span>
</div>
<div>
<label for="DefaultPageSize">@T("Default number of items per page")</label>
@Html.TextBoxFor(m => m.PageSize, new { @class = "text small" })

View File

@@ -401,6 +401,7 @@ namespace Orchard.Core.Shapes {
}
var defaultSettings = new RequireSettings {
DebugMode = debugMode,
CdnMode = site.UseCdn,
Culture = _workContext.Value.CurrentCulture,
};
var requiredResources = _resourceManager.Value.BuildRequiredResources(resourceType);

View File

@@ -186,6 +186,11 @@ namespace Orchard.Setup {
set { throw new NotImplementedException(); }
}
public bool UseCdn {
get { return false; }
set { throw new NotImplementedException(); }
}
public int PageSize {
get { return SiteSettingsPart.DefaultPageSize; }
set { throw new NotImplementedException(); }

View File

@@ -80,6 +80,11 @@ namespace Orchard.Tokens.Tests {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public bool UseCdn {
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
public int PageSize {
get { throw new NotImplementedException(); }

View File

@@ -13,6 +13,7 @@ namespace Orchard.Settings {
string SiteCulture { get; set; }
string SiteCalendar { get; set; }
ResourceDebugMode ResourceDebugMode { get; set; }
bool UseCdn { get; set; }
int PageSize { get; set; }
int MaxPageSize { get; set; }
int MaxPagedCount { get; set; }