Skip to content

Commit 7758c75

Browse files
committed
[CE-48] Add store statement for user dashboard
And refine redirect after user login Change-Id: I8af515682990c5733c001856747629b3063e710b Signed-off-by: lixucheng <lixucheng@aliyun.com>
1 parent da38561 commit 7758c75

File tree

8 files changed

+62
-2
lines changed

8 files changed

+62
-2
lines changed

user-dashboard/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ app.use("/dashboard", require("./routes/dashboard/home"));
3030
app.use("/dashboard", require("./routes/dashboard/chain"));
3131
app.use("/dashboard", require("./routes/dashboard/contract"));
3232
app.use("/dashboard", require("./routes/dashboard/analytics"));
33+
app.use("/dashboard", require("./routes/dashboard/store"));
3334
app.use(function(err, req, res, next) {
3435
res.status(err.status || 500);
3536
res.send(err.message);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@CHARSET "UTF-8";
2+
.ds-store-list{width:80%;margin-top:60px;font-family:"Helvetica Neue",Arial,sans-serif;
3+
text-align:center;padding-top:10%;}
4+
.ds-store-list h1{font-size:24px;color:#4178BE;margin-top:42px;border-bottom:2px solid #4178BE;}
5+
.dashboard-bgi{position:fixed;top:0;left:0;width:100%;height:100%;
6+
background-image:url(/images/dashboard-bgi.jpg);
7+
background-position:center center;
8+
background-repeat:no-repeat;
9+
-webkit-background-size:cover;
10+
background-size:cover;
11+
z-index:-1;
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Created by lixuc on 2017/5/17.
3+
*/
4+
define([
5+
"jquery",
6+
"app/dashboard/profile",
7+
"uikit"
8+
], function($, Profile) {
9+
$(function() {
10+
new Profile();
11+
});
12+
});

user-dashboard/public/js/app/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
define([
22
"jquery",
3+
"cookie",
34
"app/index/login",
45
"uikit"
5-
], function($, login) {
6+
], function($, Cookies, login) {
67
$(function() {
78
$("#signin").click(function() {
89
login.show();
@@ -11,8 +12,10 @@ define([
1112
if ($("#apikey").val() == "") {
1213
login.show();
1314
} else {
15+
var referer = Cookies.get("referer");
16+
Cookies.remove("referer");
1417
$(this).attr("disabled", true).append($("<i class='uk-icon-spinner uk-icon-spin'></i>"));
15-
$(location).attr("href", "/dashboard");
18+
$(location).attr("href", referer || "/dashboard");
1619
}
1720
});
1821
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Created by lixuc on 2017/5/17.
3+
*/
4+
requirejs(["../common"], function(common) {
5+
requirejs(["app/dashboard/store"]);
6+
});

user-dashboard/routes/dashboard/filter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ router.get([
3333
next(e);
3434
});
3535
} else {
36+
res.cookie("referer", req.originalUrl);
3637
res.redirect("/");
3738
}
3839
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Created by lixuc on 2017/5/17.
3+
*/
4+
var express = require("express");
5+
var router = express.Router();
6+
7+
router.get("/store", function(req, res) {
8+
res.render("dashboard/store");
9+
});
10+
module.exports = router;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends ../layout
2+
3+
block css
4+
link(rel="stylesheet", href="/css/dashboard/navbar.css")
5+
link(rel="stylesheet", href="/css/dashboard/store.css")
6+
block js
7+
script(data-main="/js/entry/store" src="/js/lib/require.js")
8+
block content
9+
include includes/navbar.pug
10+
+active("store")
11+
section.ds-store-list.uk-container.uk-container-center
12+
.dashboard-bgi
13+
label(style="font-size:52px;font-style:italic;color:#4178BE;")
14+
i.uk-icon-warning.uk-margin-right
15+
| Under construction...

0 commit comments

Comments
 (0)