diff --git a/zero.Web/App/Resources/sections.js b/zero.Web/App/Resources/sections.js
new file mode 100644
index 00000000..aad850e5
--- /dev/null
+++ b/zero.Web/App/Resources/sections.js
@@ -0,0 +1,10 @@
+import Axios from 'axios';
+
+export default {
+
+ // get all texts
+ getAll()
+ {
+ return Axios.get(zero.path + 'api/sections/getAll').then(res => Promise.resolve(res.data));
+ }
+};
\ No newline at end of file
diff --git a/zero.Web/App/app.vue b/zero.Web/App/app.vue
index 683548fe..b8b88d3f 100644
--- a/zero.Web/App/app.vue
+++ b/zero.Web/App/app.vue
@@ -1,33 +1,21 @@
- count: {{count}}
-
add
+
\ No newline at end of file
diff --git a/zero.Web/App/navigation.vue b/zero.Web/App/navigation.vue
new file mode 100644
index 00000000..2f26d1ca
--- /dev/null
+++ b/zero.Web/App/navigation.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/zero.Web/Controllers/IndexController.cs b/zero.Web/Controllers/IndexController.cs
index c57a9975..63db1fad 100644
--- a/zero.Web/Controllers/IndexController.cs
+++ b/zero.Web/Controllers/IndexController.cs
@@ -9,9 +9,11 @@ namespace zero.Web.Controllers
[AllowAnonymous]
public class IndexController : BackofficeController
{
+ private ZeroOptions Options { get; set; }
+
public IndexController(IZeroConfiguration config, IOptionsMonitor options) : base(config)
{
-
+ Options = options.CurrentValue;
}
@@ -22,7 +24,7 @@ namespace zero.Web.Controllers
return RedirectToAction("Index", "Setup");
}
- return View("/Views/Index.cshtml");
+ return View("/Views/Index.cshtml", Options);
}
}
}
diff --git a/zero.Web/Controllers/SectionController.cs b/zero.Web/Controllers/SectionsController.cs
similarity index 70%
rename from zero.Web/Controllers/SectionController.cs
rename to zero.Web/Controllers/SectionsController.cs
index 1687736c..8dbad72d 100644
--- a/zero.Web/Controllers/SectionController.cs
+++ b/zero.Web/Controllers/SectionsController.cs
@@ -7,11 +7,11 @@ using zero.Core;
namespace zero.Web.Controllers
{
[AllowAnonymous]
- public class SectionController : BackofficeController
+ public class SectionsController : BackofficeController
{
private ZeroOptions Options { get; set; }
- public SectionController(IZeroConfiguration config, IOptionsMonitor options) : base(config)
+ public SectionsController(IZeroConfiguration config, IOptionsMonitor options) : base(config)
{
Options = options.CurrentValue;
}
diff --git a/zero.Web/Controllers/SetupController.cs b/zero.Web/Controllers/SetupController.cs
index b7ce349c..63be9c15 100644
--- a/zero.Web/Controllers/SetupController.cs
+++ b/zero.Web/Controllers/SetupController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
using System;
using System.Linq;
using System.Threading.Tasks;
@@ -21,18 +22,21 @@ namespace zero.Web.Setup
protected IWebHostEnvironment Environment { get; private set; }
+ protected ZeroOptions Options { get; private set; }
- public SetupController(IZeroConfiguration config, ISetupApi api, IWebHostEnvironment env) : base(config) // UserManager userManager
+
+ public SetupController(IZeroConfiguration config, ISetupApi api, IWebHostEnvironment env, IOptionsMonitor options) : base(config) // UserManager userManager
{
Api = api;
Environment = env;
+ Options = options.CurrentValue;
}
public IActionResult Index()
{
if (!Configuration.ZeroVersion.IsNullOrEmpty())
{
- return RedirectToAction("Index", "Index");
+ return Redirect(Options.BackofficePath);
}
return View("/Views/Setup.cshtml");
diff --git a/zero.Web/Sass/Canvas/_all.scss b/zero.Web/Sass/Canvas/_all.scss
index e69de29b..000895f0 100644
--- a/zero.Web/Sass/Canvas/_all.scss
+++ b/zero.Web/Sass/Canvas/_all.scss
@@ -0,0 +1,4 @@
+
+@import "canvas";
+
+@import "navigation";
\ No newline at end of file
diff --git a/zero.Web/Sass/Canvas/_canvas.scss b/zero.Web/Sass/Canvas/_canvas.scss
new file mode 100644
index 00000000..04870772
--- /dev/null
+++ b/zero.Web/Sass/Canvas/_canvas.scss
@@ -0,0 +1,42 @@
+
+
+body, html
+{
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ font-size: 16px;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+html
+{
+ height: 100%;
+ -webkit-text-size-adjust: 100%;
+}
+
+body
+{
+ height: 100%;
+ background: var(--color-bg);
+ color: var(--color-fg);
+ font-size: 16px;
+ @extend %font;
+}
+
+.clear
+{
+ display: block;
+ clear: both;
+ float: none;
+}
+
+.app
+{
+ height: 100%;
+ min-height: 100%;
+ display: grid;
+ grid-template-columns: auto 1fr;
+ justify-content: stretch;
+}
\ No newline at end of file
diff --git a/zero.Web/Sass/Canvas/_navigation.scss b/zero.Web/Sass/Canvas/_navigation.scss
new file mode 100644
index 00000000..55ef80b6
--- /dev/null
+++ b/zero.Web/Sass/Canvas/_navigation.scss
@@ -0,0 +1,58 @@
+
+
+.app-nav
+{
+ background: var(--color-secondary);
+ width: 250px;
+ color: white;
+
+ a, button
+ {
+ outline: none !important;
+ }
+}
+
+.app-nav-headline
+{
+ display: flex;
+ align-items: center;
+ padding: 0 var(--padding);
+ font-size: 2.2em;
+ line-height: 1;
+ font-weight: 700;
+ height: var(--height-top);
+ margin: 0;
+}
+
+.app-nav-switch
+{
+ padding: 20px var(--padding) 30px;
+
+ .ui-button.type-outline
+ {
+ background: var(--color-secondary);
+ color: var(--color-fg-reverse-mid);
+ border-color: rgba(white, 0.1);
+ padding-left: 20px;
+ }
+}
+
+.app-nav-item
+{
+ display: grid;
+ grid-template-columns: 30px 1fr auto;
+ grid-gap: 6px;
+ align-items: center;
+ font-size: $font-size;
+ padding: 0 var(--padding);
+ height: 56px;
+}
+
+.app-nav-item-icon
+{
+ font-size: 18px;
+ line-height: 1;
+ font-weight: 400;
+ position: relative;
+ top: -1px;
+}
\ No newline at end of file
diff --git a/zero.Web/Sass/Core/_settings.scss b/zero.Web/Sass/Core/_settings.scss
index 9278759a..8720e06e 100644
--- a/zero.Web/Sass/Core/_settings.scss
+++ b/zero.Web/Sass/Core/_settings.scss
@@ -3,7 +3,7 @@
{
// accent colors
--color-primary: #45acd7;
- --color-secondary: #2f3a43;
+ --color-secondary: #1f272e;
--color-negative: #d82853;
// foreground/text color
@@ -11,6 +11,9 @@
--color-fg-mid: #6f7375;
--color-fg-light: #919294;
+ --color-fg-reverse: #fff;
+ --color-fg-reverse-mid: #c1c5c9;
+
// background color shades
--color-bg: #fff;
--color-bg-light: #f8f9fa;
@@ -19,6 +22,12 @@
// line colors
--color-line: #eaebec;
--color-line-mid: #d7d8d9;
+
+
+ // sizes
+
+ --padding: 32px;
+ --height-top: 74px;
}
diff --git a/zero.Web/Sass/Modules/Buttons/_button.scss b/zero.Web/Sass/Modules/Buttons/_button.scss
index ad458030..ca98099b 100644
--- a/zero.Web/Sass/Modules/Buttons/_button.scss
+++ b/zero.Web/Sass/Modules/Buttons/_button.scss
@@ -67,6 +67,12 @@ button
padding: 0 30px;
}
+ &.type-block
+ {
+ display: flex;
+ width: 100%;
+ }
+
& + .ui-button
{
margin-left: 10px;
diff --git a/zero.Web/Startup.cs b/zero.Web/Startup.cs
index f2e2cbd4..3a5ddb0c 100644
--- a/zero.Web/Startup.cs
+++ b/zero.Web/Startup.cs
@@ -134,6 +134,17 @@ namespace zero.Web
app.UseEndpoints(endpoints =>
{
+ // setup route
+ endpoints.MapControllerRoute(
+ name: "setup",
+ pattern: zeroPath + "setup",
+ defaults: new
+ {
+ controller = "Setup",
+ action = "Index"
+ }
+ );
+
// routes for API
endpoints.MapControllerRoute(
name: "api",
diff --git a/zero.Web/Views/Index.cshtml b/zero.Web/Views/Index.cshtml
index 4ea026bd..279d9ec9 100644
--- a/zero.Web/Views/Index.cshtml
+++ b/zero.Web/Views/Index.cshtml
@@ -1,4 +1,6 @@
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@using zero.Core.Extensions
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@model zero.Core.ZeroOptions
@{
Layout = null;
}
@@ -19,6 +21,10 @@
+