@using (Html.BeginForm())
diff --git a/src/ZKEACMS.SectionWidget/Controllers/SectionContentVideoController.cs b/src/ZKEACMS.SectionWidget/Controllers/SectionContentVideoController.cs
index c1f26cb51..5e25c6d72 100644
--- a/src/ZKEACMS.SectionWidget/Controllers/SectionContentVideoController.cs
+++ b/src/ZKEACMS.SectionWidget/Controllers/SectionContentVideoController.cs
@@ -9,6 +9,7 @@
using Easy.Mvc.Authorize;
using Easy.Extend;
using System.Text.RegularExpressions;
+using ZKEACMS.Filter;
namespace ZKEACMS.SectionWidget.Controllers
{
@@ -62,6 +63,7 @@ public JsonResult Delete(string Id)
return Json(true);
}
+ [Themed]
public ActionResult Play(string Id)
{
SectionContentVideo video = _sectionContentProviderService.GetContent(Id) as SectionContentVideo;
diff --git a/src/ZKEACMS.Shop/ShopPlug.cs b/src/ZKEACMS.Shop/ShopPlug.cs
index 64c31b3c1..49feb0bdb 100644
--- a/src/ZKEACMS.Shop/ShopPlug.cs
+++ b/src/ZKEACMS.Shop/ShopPlug.cs
@@ -54,7 +54,7 @@ public override IEnumerable
AdminMenu()
{
Title = "E-commerce",
Icon = "glyphicon-shopping-cart",
- Order = 9,
+ Order = 40,
Children = new List
{
new AdminMenu
diff --git a/src/ZKEACMS.StyleEditor/Views/StyleEditor/Edit.cshtml b/src/ZKEACMS.StyleEditor/Views/StyleEditor/Edit.cshtml
index 752c45459..9f364825a 100644
--- a/src/ZKEACMS.StyleEditor/Views/StyleEditor/Edit.cshtml
+++ b/src/ZKEACMS.StyleEditor/Views/StyleEditor/Edit.cshtml
@@ -66,13 +66,8 @@
-
diff --git a/src/ZKEACMS.Swagger/ZKEACMS.Swagger.csproj b/src/ZKEACMS.Swagger/ZKEACMS.Swagger.csproj
index 82142fbb0..a1ca7d5ff 100644
--- a/src/ZKEACMS.Swagger/ZKEACMS.Swagger.csproj
+++ b/src/ZKEACMS.Swagger/ZKEACMS.Swagger.csproj
@@ -16,7 +16,7 @@
-
+
false
runtime
diff --git a/src/ZKEACMS.Updater/Service/DbUpdaterService.cs b/src/ZKEACMS.Updater/Service/DbUpdaterService.cs
index 05e846ca6..780301a78 100644
--- a/src/ZKEACMS.Updater/Service/DbUpdaterService.cs
+++ b/src/ZKEACMS.Updater/Service/DbUpdaterService.cs
@@ -31,6 +31,7 @@ public class DbUpdaterService : IDbUpdaterService
private readonly IWebClient _webClient;
private readonly ILogger _logger;
private readonly IDBContextProvider _dbContextProvider;
+ private readonly bool isDevelopment;
private const int DBVersionRecord = 1;
private readonly string _scriptFileName;
private string availableSource;
@@ -38,13 +39,15 @@ public DbUpdaterService(DatabaseOption databaseOption,
IOptions dbVersionOption,
IWebClient webClient,
IDBContextProvider dbContextProvider,
- ILogger logger)
+ ILogger logger,
+ IWebHostEnvironment hostEnvironment)
{
_dbVersionOption = dbVersionOption.Value;
_webClient = webClient;
_scriptFileName = $"{databaseOption.DbType}.sql";//MsSql.sql, MySql.sql, Sqlite.sql
_logger = logger;
_dbContextProvider = dbContextProvider;
+ isDevelopment = hostEnvironment.IsDevelopment();
}
public void UpdateDatabase()
@@ -141,6 +144,8 @@ private void SaveVersionToFile(Easy.Version version)
{
try
{
+ if (isDevelopment) return;
+
var plugPath = PluginBase.GetPath();
var versionFile = Path.Combine(plugPath, "appsettings.json");
_dbVersionOption.DBVersion = version.ToString();
@@ -289,11 +294,12 @@ private IEnumerable ConvertToScripts(byte[] package)
{
using (ZipArchive archive = new ZipArchive(memoryStream, ZipArchiveMode.Read))
{
+ string rankScriptFileName = $"{Version.Rank}.{_scriptFileName}";
foreach (ZipArchiveEntry entry in archive.Entries)
{
//There three scripts in the package, MsSql.sql, MySql.sql, Sqlite.sql
//Pick up matched script to execute.
- if (!entry.Name.Equals(_scriptFileName, StringComparison.OrdinalIgnoreCase)) continue;
+ if (!entry.Name.Equals(_scriptFileName, StringComparison.OrdinalIgnoreCase) && !entry.Name.Equals(rankScriptFileName, StringComparison.OrdinalIgnoreCase)) continue;
using (StreamReader reader = new StreamReader(entry.Open()))
{
@@ -302,7 +308,7 @@ private IEnumerable ConvertToScripts(byte[] package)
}
}
}
- throw new Exception($"{_scriptFileName} is not in the update package.");
+ return Enumerable.Empty();
}
private byte[] GetUpdateScriptsFromLocalCache(string version)
{
@@ -387,6 +393,7 @@ private bool ExecuteScripts(DbContext dbContext, IEnumerable sqlScripts)
foreach (var sql in sqlScripts)
{
if (sql.IsNullOrWhiteSpace()) continue;
+
using (var command = dbConnection.CreateCommand())
{
command.Transaction = dbTransaction;
@@ -396,9 +403,7 @@ private bool ExecuteScripts(DbContext dbContext, IEnumerable sqlScripts)
}
}
-
dbTransaction.Commit();
-
return true;
}
catch (Exception ex)
@@ -413,7 +418,6 @@ private bool ExecuteScripts(DbContext dbContext, IEnumerable sqlScripts)
dbConnection.Close();
}
}
-
}
return false;
}
diff --git a/src/ZKEACMS.Updater/appsettings.json b/src/ZKEACMS.Updater/appsettings.json
index 7165174d7..763abcabe 100644
--- a/src/ZKEACMS.Updater/appsettings.json
+++ b/src/ZKEACMS.Updater/appsettings.json
@@ -1,6 +1,5 @@
{
"DBVersionOption": {
- "DBVersion": "4.0.0.0",
"BaseVersion": "3.3.5",
"Source": [
"https://gitee.com/seriawei/ZKEACMS.Core/raw/develop/Database",
diff --git a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ArticleSelector.cshtml b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ArticleSelector.cshtml
index 90f53c6a9..b706f4b35 100644
--- a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ArticleSelector.cshtml
+++ b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ArticleSelector.cshtml
@@ -9,12 +9,7 @@
diff --git a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ProductSelector.cshtml b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ProductSelector.cshtml
index 29530cfa9..7a234d370 100644
--- a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ProductSelector.cshtml
+++ b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/ProductSelector.cshtml
@@ -9,12 +9,7 @@
diff --git a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/String.cshtml b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/String.cshtml
index bc83f9709..909b3156f 100644
--- a/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/String.cshtml
+++ b/src/ZKEACMS.WebHost/Views/Shared/EditorTemplates/String.cshtml
@@ -37,12 +37,7 @@
}
-
+
diff --git a/src/ZKEACMS.WebHost/Views/Shared/Partial.PageFooter.cshtml b/src/ZKEACMS.WebHost/Views/Shared/Partial.PageFooter.cshtml
new file mode 100644
index 000000000..e67de8764
--- /dev/null
+++ b/src/ZKEACMS.WebHost/Views/Shared/Partial.PageFooter.cshtml
@@ -0,0 +1,10 @@
+@StyleAtFoot()
+@ScriptAtFoot()
+@foreach (var item in this.WorkContext().CurrentPage.FooterScripts)
+{
+ @item.Render()
+}
+@foreach (var item in this.WorkContext().CurrentPage.BodyFooter)
+{
+ @item
+}
\ No newline at end of file
diff --git a/src/ZKEACMS.WebHost/Views/Shared/Partial.PageHeader.cshtml b/src/ZKEACMS.WebHost/Views/Shared/Partial.PageHeader.cshtml
new file mode 100644
index 000000000..2de2fa297
--- /dev/null
+++ b/src/ZKEACMS.WebHost/Views/Shared/Partial.PageHeader.cshtml
@@ -0,0 +1,59 @@
+@inject IApplicationSettingService applicationSettingService
+@{
+ var currentPage = this.WorkContext().CurrentPage;
+ foreach (var item in currentPage.StyleNames)
+ {
+ Style.Reqiured(item).AtHead();
+ }
+ foreach (var item in currentPage.ScriptNames)
+ {
+ Script.Reqiured(item).AtFoot();
+ }
+ var favicon = applicationSettingService.Get(SettingKeys.Favicon, "~/favicon.ico");
+}
+
+@StyleAtHead()
+@ScriptAtHead()
+@foreach (var item in currentPage.Header)
+{
+ @item
+}
+@foreach (var item in currentPage.StyleSheets)
+{
+ @item.Render()
+}
+@foreach (var item in currentPage.Style)
+{
+ @item.Render()
+}
+@foreach (var item in currentPage.HeaderScripts)
+{
+ @item.Render()
+}
\ No newline at end of file
diff --git a/src/ZKEACMS.WebHost/Views/Shared/_AdminLayout.cshtml b/src/ZKEACMS.WebHost/Views/Shared/_AdminLayout.cshtml
index a915b301b..939b026dd 100644
--- a/src/ZKEACMS.WebHost/Views/Shared/_AdminLayout.cshtml
+++ b/src/ZKEACMS.WebHost/Views/Shared/_AdminLayout.cshtml
@@ -8,25 +8,16 @@
Style.Reqiured("admin").AtHead();
Script.Reqiured("admin").AtHead();
List