Skip to content

Commit

Permalink
[CE-48] Add store statement for user dashboard
Browse files Browse the repository at this point in the history
And refine redirect after user login

Change-Id: I8af515682990c5733c001856747629b3063e710b
Signed-off-by: lixucheng <lixucheng@aliyun.com>
  • Loading branch information
xuchengli committed May 17, 2017
1 parent da38561 commit 7758c75
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 2 deletions.
1 change: 1 addition & 0 deletions user-dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ app.use("/dashboard", require("./routes/dashboard/home"));
app.use("/dashboard", require("./routes/dashboard/chain"));
app.use("/dashboard", require("./routes/dashboard/contract"));
app.use("/dashboard", require("./routes/dashboard/analytics"));
app.use("/dashboard", require("./routes/dashboard/store"));
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.send(err.message);
Expand Down
12 changes: 12 additions & 0 deletions user-dashboard/public/css/dashboard/store.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@CHARSET "UTF-8";
.ds-store-list{width:80%;margin-top:60px;font-family:"Helvetica Neue",Arial,sans-serif;
text-align:center;padding-top:10%;}
.ds-store-list h1{font-size:24px;color:#4178BE;margin-top:42px;border-bottom:2px solid #4178BE;}
.dashboard-bgi{position:fixed;top:0;left:0;width:100%;height:100%;
background-image:url(/images/dashboard-bgi.jpg);
background-position:center center;
background-repeat:no-repeat;
-webkit-background-size:cover;
background-size:cover;
z-index:-1;
}
12 changes: 12 additions & 0 deletions user-dashboard/public/js/app/dashboard/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Created by lixuc on 2017/5/17.
*/
define([
"jquery",
"app/dashboard/profile",
"uikit"
], function($, Profile) {
$(function() {
new Profile();
});
});
7 changes: 5 additions & 2 deletions user-dashboard/public/js/app/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
define([
"jquery",
"cookie",
"app/index/login",
"uikit"
], function($, login) {
], function($, Cookies, login) {
$(function() {
$("#signin").click(function() {
login.show();
Expand All @@ -11,8 +12,10 @@ define([
if ($("#apikey").val() == "") {
login.show();
} else {
var referer = Cookies.get("referer");
Cookies.remove("referer");
$(this).attr("disabled", true).append($("<i class='uk-icon-spinner uk-icon-spin'></i>"));
$(location).attr("href", "/dashboard");
$(location).attr("href", referer || "/dashboard");
}
});
});
Expand Down
6 changes: 6 additions & 0 deletions user-dashboard/public/js/entry/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Created by lixuc on 2017/5/17.
*/
requirejs(["../common"], function(common) {
requirejs(["app/dashboard/store"]);
});
1 change: 1 addition & 0 deletions user-dashboard/routes/dashboard/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ router.get([
next(e);
});
} else {
res.cookie("referer", req.originalUrl);
res.redirect("/");
}
});
Expand Down
10 changes: 10 additions & 0 deletions user-dashboard/routes/dashboard/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Created by lixuc on 2017/5/17.
*/
var express = require("express");
var router = express.Router();

router.get("/store", function(req, res) {
res.render("dashboard/store");
});
module.exports = router;
15 changes: 15 additions & 0 deletions user-dashboard/views/dashboard/store.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends ../layout

block css
link(rel="stylesheet", href="/css/dashboard/navbar.css")
link(rel="stylesheet", href="/css/dashboard/store.css")
block js
script(data-main="/js/entry/store" src="/js/lib/require.js")
block content
include includes/navbar.pug
+active("store")
section.ds-store-list.uk-container.uk-container-center
.dashboard-bgi
label(style="font-size:52px;font-style:italic;color:#4178BE;")
i.uk-icon-warning.uk-margin-right
| Under construction...

0 comments on commit 7758c75

Please sign in to comment.