Permalink
Browse files

can now log into dashboard & view list of pages in new headless CMS p…

…roject
  • Loading branch information...
markentingh committed Sep 5, 2017
1 parent 0d0a40b commit abb23a1e014dc809f60f7c10d0482f34cf486390
Showing with 916 additions and 4,575 deletions.
  1. BIN .vs/Websilk/v15/sqlite3/storage.ide
  2. +0 −117 App/CSS/colors/editor/dark.less
  3. +0 −26 App/CSS/colors/websites/beach.less
  4. +3 −3 App/Core.cs
  5. +39 −31 App/Dashboard/Dashboard.cs
  6. +11 −16 App/Dashboard/Downloads/Downloads.cs
  7. +61 −174 App/Dashboard/Pages/Pages.cs
  8. +0 −10 App/Dashboard/Pages/history-item.html
  9. +0 −11 App/Dashboard/Pages/history.html
  10. +2 −14 App/Dashboard/Pages/pages.html
  11. +5 −84 App/Dashboard/Pages/pages.js
  12. +13 −16 App/Dashboard/Photos/Photos.cs
  13. +8 −20 App/Dashboard/Settings/Themes/Themes.cs
  14. +9 −27 App/Dashboard/Timeline/Timeline.cs
  15. +15 −18 App/Dashboard/Users/Users.cs
  16. +33 −0 App/Login/Login.cs
  17. +25 −0 App/Login/login.html
  18. +22 −0 App/Login/login.js
  19. +32 −0 App/Login/new-pass.html
  20. +54 −0 App/Login/new-pass.js
  21. +32 −0 App/Models/Content.cs
  22. +18 −0 App/Models/Pages.cs
  23. +34 −5 App/Page.cs
  24. +1 −1 App/Pipeline/PageRequest.cs
  25. +0 −2 App/Pipeline/WebService.cs
  26. +1 −1 App/Properties/launchSettings.json
  27. +0 −25 App/Scripts/core/editor.js
  28. +0 −75 App/Scripts/editor/_init.js
  29. +0 −1,294 App/Scripts/editor/components.js
  30. +0 −6 App/Scripts/editor/dashboard.js
  31. +0 −13 App/Scripts/editor/debugger.js
  32. +0 −150 App/Scripts/editor/drag.js
  33. +0 −189 App/Scripts/editor/hotkeys.js
  34. +0 −340 App/Scripts/editor/layout.js
  35. +0 −19 App/Scripts/editor/resize.js
  36. +0 −74 App/Scripts/editor/save.js
  37. +0 −49 App/Scripts/editor/support.js
  38. +0 −23 App/Scripts/editor/toolbar.js
  39. +0 −50 App/Scripts/editor/utility.js
  40. +0 −119 App/Scripts/editor/viewport.js
  41. +0 −427 App/Scripts/editor/window.js
  42. +0 −124 App/Scripts/platform/ajax.js
  43. +13 −13 App/Scripts/{core → utility}/velocity.min.js
  44. +14 −0 App/Server.cs
  45. +36 −0 App/Services/User.cs
  46. +11 −0 App/Services/Users.cs
  47. +0 −76 App/Sql/SqlEditor.cs
  48. +0 −188 App/Sql/SqlPage.cs
  49. +10 −8 App/Startup.cs
  50. +2 −6 App/Tests/Icons.cs
  51. +0 −258 App/Tests/Init.cs
  52. +7 −18 App/User.cs
  53. +32 −0 App/layout.html
  54. BIN App/wwwroot/images/editor/gridleft.jpg
  55. BIN App/wwwroot/images/editor/gridright.jpg
  56. +7 −21 Query/Models/Page.cs
  57. +17 −0 Query/Models/Website.cs
  58. +88 −1 Query/Query/Pages.cs
  59. +9 −0 Query/Query/Users.cs
  60. +24 −0 Query/Query/Websites.cs
  61. +3 −3 Query/Sql.cs
  62. +3 −46 Sql/SqlServer/PostDeployment.sql
  63. +13 −16 Sql/SqlServer/Sql.sqlproj
  64. +5 −0 Sql/SqlServer/dbo/Sequences/SequencePages.sql
  65. +0 −6 Sql/SqlServer/dbo/Sequences/SequencePhotoFolders.sql
  66. +38 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Page_Create.sql
  67. +9 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Page_Delete.sql
  68. +16 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Page_Get.sql
  69. +14 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Page_Update.sql
  70. +5 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Page_UpdateModified.sql
  71. +32 −0 Sql/SqlServer/dbo/Stored Procedures/Pages/Pages_GetList.sql
  72. +0 −20 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Create.sql
  73. +0 −13 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Delete.sql
  74. +0 −14 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Folder_Create.sql
  75. +0 −16 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Folder_Delete.sql
  76. +0 −14 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Folders_GetList.sql
  77. +0 −14 Sql/SqlServer/dbo/Stored Procedures/Photos/Photo_Get.sql
  78. +0 −25 Sql/SqlServer/dbo/Stored Procedures/Photos/Photos_Delete.sql
  79. +0 −59 Sql/SqlServer/dbo/Stored Procedures/Photos/Photos_GetList.sql
  80. +0 −27 Sql/SqlServer/dbo/Stored Procedures/Photos/Photos_Move.sql
  81. +2 −2 Sql/SqlServer/dbo/Stored Procedures/Security/Security_Create.sql
  82. +1 −1 Sql/SqlServer/dbo/Stored Procedures/Security/Security_GetFeature.sql
  83. +1 −1 Sql/SqlServer/dbo/Stored Procedures/Security/Security_GetWebsite.sql
  84. +3 −2 Sql/SqlServer/dbo/Stored Procedures/Users/User_UpdateEmail.sql
  85. +9 −0 Sql/SqlServer/dbo/Stored Procedures/Users/Users_HasPasswords.sql
  86. +12 −23 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_Create.sql
  87. +1 −2 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_Delete.sql
  88. +0 −29 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_DeletePermanently.sql
  89. +0 −4 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_Domains_GetList.sql
  90. +5 −7 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_Get.sql
  91. +1 −1 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_UpdateStatus.sql
  92. +1 −2 Sql/SqlServer/dbo/Stored Procedures/Websites/Website_UpdateTitle.sql
  93. +7 −8 Sql/SqlServer/dbo/Stored Procedures/Websites/Websites_GetList.sql
  94. +26 −0 Sql/SqlServer/dbo/Tables/Pages.sql
  95. +0 −11 Sql/SqlServer/dbo/Tables/PhotoFolders.sql
  96. +0 −14 Sql/SqlServer/dbo/Tables/Photos.sql
  97. +11 −11 Sql/SqlServer/dbo/Tables/{PasswordReset.sql → UsersPasswordReset.sql}
  98. +8 −0 Sql/SqlServer/dbo/Views/View_PageInfo.sql
  99. +2 −42 gulpfile.js
Binary file not shown.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -8,7 +8,7 @@ public class Core
{
public Server Server;
public Utility.Util Util;
public UserSession User;
public User User;
public HttpContext Context;
public HttpRequest Request;
public HttpResponse Response;
@@ -23,12 +23,12 @@ public Core(Server server, HttpContext context)
Request = context.Request;
Response = context.Response;
Session = context.Session;
User = new UserSession();
User = new User();
//load user session
if (Session.Get("user") != null)
{
User = (UserSession)Util.Serializer.ReadObject(Util.Str.GetString(Session.Get("user")), User.GetType());
User = (User)Util.Serializer.ReadObject(Util.Str.GetString(Session.Get("user")), User.GetType());
}
User.Init(this);
}
View
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using Websilk.Services;
using System.Linq;
namespace Websilk.Pages
@@ -19,28 +18,31 @@ public struct structMenuItem
public Dashboard(Core WebsilkCore): base(WebsilkCore){}
public override string Render(string[] path, string query)
public override string Render(string[] path, string query = "", string body = "")
{
websiteId = 1;
if (!S.User.checkSecurity(websiteId,"websilk", User.enumSecurity.read)) { return AccessDenied(); }
//set up client-side dependencies
colorsCss = "/css/colors/dashboard/aqua.css";
headCss += "<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/dashboard/dashboard.css\"/>";
scripts += "<script src=\"/js/dashboard/dashboard.js\"></script>";
//load the dashboard layout
var scaffold = new Scaffold(S, "/Dashboard/dashboard.html");
var scaffMenu = new Scaffold(S, "/Dashboard/menu-item.html");
var queryWebsites = new Query.Websites(S.SqlConnectionString);
var website = queryWebsites.GetWebsiteInfo(websiteId);
//load user profile
scaffold.Data["profile-img"] = "";
scaffold.Data["btn-edit-img"] = "";
scaffold.Data["profile-name"] = S.User.displayName;
//load website info
//var domains = page.getDomainsForWebsite();
//var domain = "";
//if(domains.Count > 0)
//{
// domain = domains[0].domain;
// scaffold.Data["has-domain"] = "true";
// scaffold.Data["website-name"] = page.websiteTitle;
// scaffold.Data["website-url"] = "http://www." + domain;
// scaffold.Data["website-url-name"] = "www." + domain;
//}
scaffold.Data["website-name"] = website.title;
scaffold.Data["website-url"] = "http://" + website.liveUrl;
scaffold.Data["website-url-name"] = website.liveUrl;
//generate menu system
var menu = new StringBuilder();
@@ -54,16 +56,14 @@ public override string Render(string[] path, string query)
menuItem("Users", "users", "/dashboard/users", "users"),
menuItem("Settings", "settings", "/dashboard/settings", "settings",
new List<structMenuItem>{
menuItem("Domains", "settings-domains", "/dashboard/settings/domains", "domains"),
menuItem("Themes", "settings-themes", "/dashboard/settings/themes", "themes"),
menuItem("Color Schemes", "settings-colorschemes", "/dashboard/settings/colors", "colors"),
menuItem("Cache", "settings-cache", "/dashboard/settings/cache", "cache"),
menuItem("Advanced", "settings-advanced", "/dashboard/settings/advanced", "component-admin")
}
)
};
//TODO: get apps available to the user for this website
//TODO: get vendor apps available to the user for this website
//render menu system
foreach (var item in menus)
@@ -75,19 +75,27 @@ public override string Render(string[] path, string query)
//finally, add content of dashboard section
var subPath = "";
if (S.Request.Path.ToString() != "dashboard")
{
subPath = S.Request.Path.ToString().Replace("dashboard/", "");
}
else
{
subPath = S.Request.Path.ToString().Replace("dashboard", "").Substring(1);
if(subPath == "") {
subPath = "pages";
}
scaffold.Data["body"] = LoadSubPage(subPath);
return scaffold.Render();
var html = "";
Page subpage = null;
var t = LoadSubPage(subPath);
subpage = t.Item1;
html = t.Item2;
scaffold.Data["body"] = html;
if(html == "") { return AccessDenied(); }
//set up page info
title = website.title + " - Dashboard - " + subpage.title;
scripts += subpage.scripts;
return base.Render(path, query, scaffold.Render());
}
private string LoadSubPage(string path)
private Tuple<Page, string> LoadSubPage(string path)
{
//get correct sub page from path
Page service = null;
@@ -97,17 +105,14 @@ private string LoadSubPage(string path)
if (paths[0] == "downloads") {
service = new DashboardPages.Downloads(S);
html = service.Render(subpath);
}
else if (paths[0] == "pages")
{
service = new DashboardPages.Pages(S);
html = service.Render(subpath);
}
else if (paths[0] == "photos")
{
service = new DashboardPages.Photos(S);
html = service.Render(subpath);
}
else if (paths[0] == "settings")
{
@@ -116,21 +121,24 @@ private string LoadSubPage(string path)
if(paths[1] == "themes")
{
service = new DashboardPages.Settings.Themes(S);
html = service.Render(paths.Skip(2).ToArray());
subpath = paths.Skip(2).ToArray();
}
}
}
else if (paths[0] == "timeline")
{
service = new DashboardPages.Timeline(S);
html = service.Render(subpath);
}
else if (paths[0] == "users")
{
service = new DashboardPages.Users(S);
html = service.Render(subpath);
}
return html;
//render sub page
service.websiteId = websiteId;
html = service.Render(subpath);
return new Tuple<Page, string>(service, html);
}
private structMenuItem menuItem(string label, string id, string href, string icon, List<structMenuItem> submenu = null)
@@ -1,21 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Websilk.Pages.DashboardPages
namespace Websilk.Pages.DashboardPages
{
public class Downloads: StaticPage
public class Downloads: Page
{
public Downloads(Core WebsilkCore, Page page): base(WebsilkCore, page) { }
public Downloads(Core WebsilkCore) : base(WebsilkCore)
{
}
public override Services.Inject LoadSubPage(string path)
public override string Render(string[] path, string query = "", string body = "")
{
var inject = new Services.Inject();
if(path != "")
if(path.Length > 0)
{
//load sub page
switch (path)
switch (path[0])
{
case "folders":
@@ -24,11 +20,10 @@ public override Services.Inject LoadSubPage(string path)
}else
{
//load downloads list
scaffold = new Scaffold(S, "/Dashboard/Downloads/downloads.html");
var scaffold = new Scaffold(S, "/Dashboard/Downloads/downloads.html");
return scaffold.Render();
}
inject.html = scaffold.Render();
return inject;
return "";
}
}
}
Oops, something went wrong.

0 comments on commit abb23a1

Please sign in to comment.