Commit 727904ec246f1de212c7e1f9fc42d2f64ae4fcda

Authored by Adhidarma Hadiwinoto
1 parent f410645402
Exists in master

template

Showing 2 changed files with 19 additions and 1 deletions Side-by-side Diff

lib/modem-dashboard/index.js
... ... @@ -22,6 +22,10 @@ nunjucks.configure(__dirname + '/views', {
22 22 express: app
23 23 });
24 24  
  25 +app.use(function(req, res, next) {
  26 + res.locals.site_name = config.handler_name;
  27 +})
  28 +
25 29 function modemSignal(req, res, next) {
26 30 const signal_strength = matrix && matrix.modem && matrix.modem.signal_strength ? matrix.modem.signal_strength : 0;
27 31 res.locals.signal_strength = signal_strength;
lib/modem-dashboard/views/template.html
... ... @@ -15,7 +15,14 @@
15 15 {{ page_title }}
16 16 -
17 17 {% endif %}
  18 +
18 19 Modem Dashboard
  20 +
  21 + {% if site_name %}
  22 + -
  23 + {{ site_name }}
  24 + {% endif %}
  25 +
19 26 </title>
20 27  
21 28 <!-- Latest compiled and minified CSS -->
... ... @@ -55,12 +62,19 @@
55 62 <span class="icon-bar"></span>
56 63 <span class="icon-bar"></span>
57 64 </button>
58   - <a class="navbar-brand" href="/">Modem Dashboard</a>
  65 + <a class="navbar-brand" href="/">
  66 + {% if site_name %}
  67 + {{ site_name}}
  68 + {% else %}
  69 + Modem Dashboard
  70 + {% endif %}
  71 + </a>
59 72 </div>
60 73 <div id="navbar" class="collapse navbar-collapse">
61 74 <ul class="nav navbar-nav">
62 75 <li><a href="/sms">SMS</a></li>
63 76 <li><a href="/ussd">USSD</a></li>
  77 + <li><a href="/stocks">Stok</a></li>
64 78 </ul>
65 79 </div><!--/.nav-collapse -->
66 80 </div>