-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Route persistence, dashboard enhancements
- Loading branch information
Adam Hopkins
committed
Feb 12, 2017
1 parent
8805a40
commit 4953cc3
Showing
15 changed files
with
238 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
// p.router.add('/inbox', views.inbox, true); | ||
p.router.add('/inbox', views.inbox); | ||
p.router.add('/inbox', views.inbox, true); | ||
p.router.add('/', views.dashboard, true); | ||
|
||
p.router.trigger(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,75 @@ | ||
var pView = function (templateName, context, logic, elem) { | ||
var pView = function (templateName, context, preLogic, postLogic, elem) { | ||
return function (e) { | ||
logic = logic || null; | ||
preLogic = preLogic || null; | ||
postLogic = postLogic || null; | ||
elem = elem || p.one('#content'); | ||
|
||
if (typeof logic == 'function') { | ||
logic.call(); | ||
if (typeof preLogic == 'function') { | ||
preLogic.call(); | ||
} | ||
|
||
var template = nunjucks.render(templateName, context); | ||
elem.innerHTML = template; | ||
|
||
p.load(); | ||
|
||
if (typeof postLogic == 'function') { | ||
postLogic.call(); | ||
} | ||
}; | ||
}; | ||
|
||
var views = { | ||
inbox: pView('templates/views/inbox.html', {name: 'Adam'}) | ||
inbox: pView('templates/views/inbox.html', {name: 'Adam'}), | ||
dashboard: pView('templates/views/dashboard.html', null, null, function () { | ||
var data = { | ||
datasets: [{ | ||
data: [ | ||
11, | ||
16, | ||
7, | ||
3, | ||
14, | ||
21 | ||
], | ||
backgroundColor: [ | ||
"#fd0328", | ||
"#fdd803", | ||
"#5b03fd", | ||
"#03fd5b", | ||
"#FD5B03", | ||
"#4d4d4d" | ||
], | ||
// hoverBackgroundColor: [ | ||
// "#FD5B03", | ||
// "#FD5B03", | ||
// "#FD5B03", | ||
// "#FD5B03", | ||
// "#FD5B03", | ||
// "#FD5B03" | ||
// ], | ||
label: 'My dataset' // for legend | ||
}], | ||
labels: [ | ||
"Red", | ||
"Green", | ||
"Yellow", | ||
"Grey", | ||
"Blue", | ||
"Last" | ||
] | ||
}; | ||
|
||
new Chart(p.one("#recipient-chart"), { | ||
data: data, | ||
type: 'polarArea', | ||
options: { | ||
elements: { | ||
arc: { | ||
// borderColor: "#757575" | ||
} | ||
} | ||
} | ||
}); | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,4 @@ | ||
<main> | ||
{% include "templates/layouts/breadcrumbs.html" %} | ||
{# <div id="content"></div> #} | ||
|
||
{# THIS IS A MOCKUP ONLY #} | ||
<div id="content"> | ||
<div class="vertical-wrapper"> | ||
<div class="vertical-center horizontal-wrapper"> | ||
<div class="row dashboard-details"> | ||
<div class="sm-1 md-1-2 horizontal-center"> | ||
<div class="number"> | ||
<h3>Emails sent this week</h3> | ||
<strong>24</strong> | ||
<p>That is <em>5%</em> more than last week.</p> | ||
</div> | ||
<div class="number"> | ||
<h3>Emails received this week</h3> | ||
<strong>38</strong> | ||
<p>That is <em class="negative">8%</em> less than last week.</p> | ||
</div> | ||
</div> | ||
<div class="sm-1 md-1-2 horizontal-center"> | ||
<h3>Top email participants</h3> | ||
<canvas id="recipient-chart" width="400" height="400"></canvas> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="content"></div> | ||
</main> |
Oops, something went wrong.