Skip to content
Permalink
Browse files

Removed dropdown menu

  • Loading branch information...
davidmerfield committed Mar 8, 2019
1 parent 44e7504 commit 3d5dc773728f6f062ffab4c8e8455e880a980d20
@@ -254,6 +254,18 @@ dashboard.use(require("./render"));

dashboard.use('/account', require("./routes/account"));


dashboard.use(function(req, res, next){
res.locals.breadcrumbs = new Breadcrumbs();
res.locals.breadcrumbs.add("Your blogs", "/");
next();
});

dashboard.get("/", function(req, res, next){
res.render("index")
});


dashboard.use(debug("before loading folder state"));

// Load the files and folders inside a blog's folder
@@ -283,16 +295,12 @@ function Breadcrumbs() {
return list;
}

dashboard.use(function(req, res, next){
res.locals.breadcrumbs = new Breadcrumbs();
next();
});

dashboard.use(debug("after loading folder state"));


require("./routes/tools")(dashboard);


dashboard.use(require("./routes/settings"));


@@ -20,7 +20,7 @@ SwitchBlog.route("/")
if (err) return next(err);
req.session.blogID = req.body.to;

res.redirect('/');
res.redirect('/settings');
});
});

@@ -9,44 +9,18 @@ var Template = require("template");
var Blog = require("blog");
var load = require("./load");

settings.use(function(req, res, next){
res.locals.selected = {settings: 'selected'};
settings.use(function(req, res, next) {
res.locals.selected = { settings: "selected" };
next();
});

settings.get("/settings", function(req, res, next) {
res.redirect("/");
});


settings.use(function(req, res, next) {

res.locals.breadcrumbs.add("Settings", "/settings");
res.locals.breadcrumbs.add(req.blog.title, "/settings");
res.locals.setup = !!req.query.setup;

next();
});


var index = settings.route("/");

index.get(
load.template,
debug("template loaded"),
load.menu,
debug("menu loaded"),
load.client,
debug("client loaded"),
load.dates,
debug("dates loaded"),
load.permalinkFormats,
debug("permalinks loaded"),
function(req, res) {
res.render("settings", { title: "Dashboard" });
}
);


settings
.route("/settings")
.post(
@@ -61,27 +35,46 @@ settings
save.removeTmpFiles,
debug("removed any tmp files"),
save.finish
)
.get(
load.template,
debug("template loaded"),
load.menu,
debug("menu loaded"),
load.client,
debug("client loaded"),
load.dates,
debug("dates loaded"),
load.permalinkFormats,
debug("permalinks loaded"),
function(req, res) {
res.render("settings", { title: "Dashboard" });
}
);



settings.get("/settings/urls", function(req, res, next) {
res.locals.edit = !!req.query.edit;
next();
});

settings.get("/settings/profile", load.menu, load.timezones, load.dates, function(req, res, next){
res.locals.setup_title = true;
next();
});
settings.get(
"/settings/profile",
load.menu,
load.timezones,
load.dates,
function(req, res, next) {
res.locals.setup_title = true;
next();
}
);

settings.get("/settings/menu", load.menu);
settings.get("/settings/date", load.timezones, load.dates);
settings.get("/settings/services", load.plugins);
settings.get("/settings/urls", load.permalinkFormats);

settings.use('/settings/urls/*', function(req, res, next){
res.locals.breadcrumbs.add('URLs', 'urls');
settings.use("/settings/urls/*", function(req, res, next) {
res.locals.breadcrumbs.add("URLs", "urls");
next();
});

@@ -96,11 +89,10 @@ settings
require("./save/404")
);


settings.get('/settings/urls/redirects', load.redirects, function(req, res){
res.locals.breadcrumbs.add('Redirects', 'redirects');
res.locals.partials.subpage = "settings/redirects";
res.render("settings/subpage", { title: 'Redirects' });
settings.get("/settings/urls/redirects", load.redirects, function(req, res) {
res.locals.breadcrumbs.add("Redirects", "redirects");
res.locals.partials.subpage = "settings/redirects";
res.render("settings/subpage", { title: "Redirects" });
});

// Load the list of templates for this user
@@ -110,31 +102,31 @@ settings.use("/settings/theme", load.theme, function(req, res, next) {
next();
});

settings.use('/settings/client', require('./client'));
settings.use("/settings/client", require("./client"));

settings
.route("/settings/theme")
.get(function(req, res) {
res.render("theme", {title: "Template"});
res.render("theme", { title: "Template" });
})
.post(require('./save/theme'));
.post(require("./save/theme"));

settings
.route("/settings/theme/new")
.get(function(req, res) {
res.locals.breadcrumbs.add("New", "new");
res.render("theme/new", {title: 'New template'});
res.render("theme/new", { title: "New template" });
})
.post(require('./save/newTheme'));
.post(require("./save/newTheme"));

settings
.route("/settings/theme/past")
.all(load.pastTemplates)
.get(function(req, res) {
res.locals.breadcrumbs.add("Past", "past");
res.render("theme/past", {title: 'Past templates'});
res.render("theme/past", { title: "Past templates" });
});

settings.get("/settings/:view", function(req, res) {
var uppercaseName = req.params.view;

@@ -1274,10 +1274,7 @@ p.sub {
}

.dropdown .menu {
box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, rgba(15, 15, 15, 0.05) 0px 3px 6px, rgba(15, 15, 15, 0.1) 0px 9px 24px;
z-index: 20;
background: #fffcfa;
margin: 11px 0;
}

.dropdown .menu button {text-align: left;}
@@ -0,0 +1 @@
{{> dropdown}}
@@ -1,18 +1,14 @@

<div class="dropdown closed">
<div class="dropdown">

{{#blogs}}{{#isCurrent}}
<a href="#!" class="opener nav-bar show" style="line-height:inherit;padding:11px 20px;">
{{#avatar}}<span class="photo-holder"><img src="{{avatar}}"></span>{{/avatar}}{{title}}{{! Show to blog's domain if the user has removed their title}}{{^title}}{{blog.pretty.url}}{{/title}}<img src="/images/dropdown.svg" width=8 style="margin-left:16px">
</a>
{{/isCurrent}}{{/blogs}}


{{! The opener link floats to the right so we need a clearfix}}
<div class="clear"></div>

<div class="menu">
{{#blogs}}
<form action="/account/switch-blog" method="POST" {{#isCurrent}}style="height:0;visibility:hidden"{{/isCurrent}}>
<form action="/account/switch-blog" method="POST" >
<input type="hidden" name="_csrf" value="{{csrftoken}}">
<input type="hidden" name="to" value="{{id}}">
<button type="submit" style="display:flex;line-height:inherit;padding:11px 30px 11px 20px;color:#111;font-weight:500">
@@ -4,9 +4,7 @@

<div class="wrapper">

<div style="margin:0 40px 0 20px;display:flex;flex-direction:column">
{{> dropdown}}
</div>



<div style="flex-basis:50%;display:flex;flex-direction:column;margin:0 40px">

0 comments on commit 3d5dc77

Please sign in to comment.
You can’t perform that action at this time.