Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
10d623b
mgdl -> mg/dl
AdrianLxM Mar 6, 2018
bde4750
Merge pull request #9 from inventor96/update-virtual-assistants-v2
inventor96 Nov 7, 2019
378406b
Merge pull request #10 from nightscout/dev
inventor96 Dec 7, 2019
e4e417b
Merge branch 'dev' of github.com:inventor96/cgm-remote-monitor into dev
inventor96 Dec 17, 2019
14e8c8c
Bump version to 13.0.2-dev
sulkaharo Dec 18, 2019
e0667c9
fix some random test failures (#5341)
jpcunningh Dec 20, 2019
6f43f47
Merge branch 'dev' of github.com:inventor96/cgm-remote-monitor into dev
inventor96 Dec 27, 2019
0c9f819
Added support for asking delta
inventor96 Dec 27, 2019
a4c0425
Added time reference
inventor96 Dec 27, 2019
a7e49b3
Made delta reading more informative
inventor96 Dec 27, 2019
7a1fc6d
Corrected time reference
inventor96 Dec 27, 2019
c9c9495
Try shortening the response
inventor96 Dec 27, 2019
014df85
Revert attempt
inventor96 Dec 27, 2019
6475310
Updated templates and documentation
inventor96 Dec 27, 2019
161c496
Minor improvement in response when delta is 0
inventor96 Dec 27, 2019
23d25a4
German translations improved and added (#5360)
tanja3981 Jan 1, 2020
aeebf0b
Delta support in virtual assistants (#5376)
sulkaharo Jan 1, 2020
9718bc7
Fix Alexa Launch and SessionEnded Requests (#5377)
Bartlomiejsz Jan 1, 2020
a4ce06f
Fix #5149 - discord link on CONTRIBUTING.md doesn't do anything (#5380)
Bartlomiejsz Jan 1, 2020
8139cb9
Fix #5146 - display of treatment with only Fat and Protein set (#5381)
Bartlomiejsz Jan 1, 2020
f7922a6
Basic report page style fixes and updates (#5387)
andrew-dixon Jan 1, 2020
031c5be
Add missing Polish translations and improve existing (#5382)
Bartlomiejsz Jan 1, 2020
1c579a7
Addressed virtual assistant usage with Authentication Roles (#5388)
inventor96 Jan 1, 2020
78be0f6
mgdl -> mg/dl (#3423)
sulkaharo Jan 1, 2020
44519b9
Fix timeago alarms (again). The changes to the rendered had an uninte…
sulkaharo Jan 1, 2020
9817b03
Remove the server side test
sulkaharo Jan 1, 2020
df03577
Merge pull request #5394 from nightscout/fix_timeago
sulkaharo Jan 1, 2020
60be07c
Fix Graph Display Without Recent Devicestatus (#5409)
jpcunningh Jan 6, 2020
ee0b1e8
Update Russian (#5415)
apanasef Jan 6, 2020
0def1f2
Add server teardown ability (#5410)
PetrOndrusek Jan 6, 2020
bb34500
Additional German Translations and corrections (#5405)
herzogmedia Jan 6, 2020
5e47c4d
Fix #5188 - move predictions to bundle and don't render chart on pred…
Bartlomiejsz Jan 6, 2020
ddbda15
Move toolbar and authentication status to partial and include on each…
Bartlomiejsz Jan 6, 2020
4098689
Virtual assistant code simplification (#5400)
inventor96 Jan 11, 2020
4f9f735
Pr/5379 (#5441)
sulkaharo Jan 11, 2020
c49ea37
Volunteer for Polish translations (#5396)
Bartlomiejsz Jan 11, 2020
2f60d8d
Api3 output renderers (#5425)
PetrOndrusek Jan 12, 2020
5c15243
Restore glucose distribution test (#5434)
jakobsandberg Jan 12, 2020
81d926a
Increase coverage of tests on units utility and clean up timeago test…
jakobsandberg Jan 12, 2020
937aa47
Refactor to encapsulate duplicated settings logic (#5426)
jakobsandberg Jan 12, 2020
64663d2
Send coverage reports to Codacy (#5444)
sulkaharo Jan 12, 2020
7dc292e
Resolve unnecessary uses of eslint-ignore (#5436)
jakobsandberg Jan 12, 2020
3a1d9be
Fix eslint errors and add npm script for eslint (#5427)
jakobsandberg Jan 14, 2020
04edbec
Remove redundant checks on entry ID (#5440)
jakobsandberg Jan 14, 2020
d095482
Run CI Action for Pull Requests
sulkaharo Jan 14, 2020
3386ac6
Update DayToDay report for Loop Overrides (#5452)
jonfawcett Jan 18, 2020
baad198
Fix earlier merge error with predictions having moved to the report b…
sulkaharo Jan 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move toolbar and authentication status to partial and include on each…
… page (nightscout#5393)

* Move authentication status to partial and include on each page

* Move toolbar to partial

Co-authored-by: Sulka Haro <[email protected]>
  • Loading branch information
Bartlomiejsz and sulkaharo committed Jan 6, 2020
commit ddbda15c0a25d8149fa60b76c8e3cbaa4ef7c22c
59 changes: 38 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,36 +131,53 @@ function create (env, ctx) {
}
}));

const clockviews = require('./lib/server/clocks.js')(env, ctx);
clockviews.setLocals(app.locals);

app.use("/clock", clockviews);

app.get("/", (req, res) => {
res.render("index.html", {
locals: app.locals
});
});

var appPages = {
"/clock-color.html": "clock-color.html"
, "/admin": "adminindex.html"
, "/profile": "profileindex.html"
, "/food": "foodindex.html"
, "/bgclock.html": "bgclock.html"
, "/report": "reportindex.html"
, "/translations": "translationsindex.html"
, "/clock.html": "clock.html"
"/": {
file: "index.html"
, type: "index"
}
, "/admin": {
file: "adminindex.html"
, title: 'Admin Tools'
, type: 'admin'
}
, "/food": {
file: "foodindex.html"
, title: 'Food Editor'
, type: 'food'
}
, "/profile": {
file: "profileindex.html"
, title: 'Profile Editor'
, type: 'profile'
}
, "/report": {
file: "reportindex.html"
, title: 'Nightscout reporting'
, type: 'report'
}
, "/translations": {
file: "translationsindex.html"
, title: 'Nightscout translations'
, type: 'translations'
}
};

Object.keys(appPages).forEach(function(page) {
app.get(page, (req, res) => {
res.render(appPages[page], {
locals: app.locals
res.render(appPages[page].file, {
locals: app.locals,
title: appPages[page].title ? appPages[page].title : '',
type: appPages[page].type ? appPages[page].type : '',
});
});
});

const clockviews = require('./lib/server/clocks.js')(env, ctx);
clockviews.setLocals(app.locals);

app.use("/clock", clockviews);

app.get("/appcache/*", (req, res) => {
res.render("nightscout.appcache", {
locals: app.locals
Expand Down
48 changes: 33 additions & 15 deletions static/css/drawer.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,34 +207,49 @@ h1, legend,
}

#toolbar {
background: url(/images/logo2.png) no-repeat 3px 3px #333;
border-bottom: 1px solid #999;
top: 0;
margin: 0;
height: 44px;
text-shadow: 0 0 5px black;
display: flex;
height: 44px;
margin: 0 0 10px;
padding: 0 15px 0 40px;
position: relative;
align-items: center;
background: url(/images/logo2.png) no-repeat 3px center #333;
border-bottom: 1px solid #999;
justify-content: space-between;
}

#toolbar .customTitle {
color: #ccc;
font-size: 16px;
margin-top: 0;
margin-left: 42px;
padding-top: 10px;
padding-right: 150px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

#toolbar .button-close {
color: #404040;
text-align: center;
text-shadow: none;
height: 20px;
width: 20px;
padding: 5px;
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
background: grey;
border: 2px solid #404040;
border-radius: 5px;
}

#toolbar .button-close + #buttonbar {
margin-right: 40px;
}

#buttonbar {
margin-right: 50px;
padding-right: 15px;
height: 44px;
opacity: 0.75;
vertical-align: middle;
position: absolute;
right: 0;
z-index: 500;
}

#buttonbar a,
Expand All @@ -244,14 +259,17 @@ h1, legend,
height: 44px;
line-height: 44px;
}

#buttonbar .selected {
color: red;
}

#buttonbar a {
float: left;
text-decoration: none;
width: 34px;
}

#buttonbar i {
padding-left: 12px;
}
Expand Down
22 changes: 20 additions & 2 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,30 @@ a, a:visited, a:link {
display: none;
}

#authorizationstatus a {
.toolbar-title {
text-align: left;
padding: 0 10px;
}

.toolbar-title h2 {
margin: 0;
}

.page-content {
padding: 10px;
}

.authentication-status {
padding: 10px;
border-top: 1px solid #bdbdbd;
}

.authentication-status a {
color: #2196f3;
text-decoration: underline;
}

#authorizationstatus .small {
.authentication-status .small {
font-size: 12px;
}

Expand Down
26 changes: 0 additions & 26 deletions static/css/report.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,6 @@ body {
color: black;
}

header {
display: flex;
justify-content: flex-start;
align-items: center;
margin: 10px;
}

.close {
color: #000;
display: block;
position: absolute;
background: #fff;
border-radius: 5px;
border: 1px solid #000;
padding: 5px 10px;
text-decoration: none;
top: 10px;
right: 10px;
}

.pagetitle {
font-weight: bold;
font-size: 14pt;
text-transform: uppercase;
}

.centeraligned {
text-align:center;
}
Expand Down
13 changes: 12 additions & 1 deletion static/css/translations.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
td,th {
body {
color: black;
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
background-color: white;
}

th,
td {
vertical-align: top;
text-align: left;
border: 1px solid
}

#translations {
padding: 15px;
}
19 changes: 4 additions & 15 deletions views/adminindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,12 @@
<link rel="preload" href="/css/ui-darkness/jquery-ui.min.css?v=<%= locals.cachebuster %>" as="style" onload="this.onload=null;this.rel='stylesheet'">
<% include preloadCSS %>
</head>
<body>

<a href="/"><div style="position: absolute; top: 10px; color: #404040; right: 10px; background: grey; border-radius: 5px; border: 2px solid #404040; padding: 5px; width: 20px; height: 20px; ">X</div></a>

<div id="toolbar">
<h1 class="customTitle">Nightscout</h1>
</div>

<div id="admin-tools">
<h1 class="translate">Admin Tools</h1>
</div>
<body>
<%- include('partials/toolbar') %>

<div id="admin_placeholder"></div>

<hr>
<b><span class="translate">Authentication status</span>: </b>
<span id="authentication_placeholder"></span>

<%- include('partials/authentication-status') %>

<script src="<%= locals.bundle %>/js/bundle.app.js?v=<%= locals.cachebuster %>"></script>
<script src="/socket.io/socket.io.js?v=<%= locals.cachebuster %>"></script>
Expand Down
23 changes: 5 additions & 18 deletions views/foodindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,9 @@
<% include preloadCSS %>

</head>
<body>
<body>
<%- include('partials/toolbar') %>

<a href="/"><div style="z-index: 1000; position: absolute; top: 10px; color: #404040; right: 10px; background: grey; border-radius: 5px; border: 2px solid #404040; padding: 5px; width: 20px; height: 20px; ">X</div></a>


<div id="toolbar">
<div id="buttonbar">
<b> <span class="translate">Status</span>:</b> <span id="fe_status" class="translate">Not loaded</span>
</div>
<h1 class="customTitle">Nightscout</h1>
<div id="food-editor">
<h1 class="translate">Food Editor</h1>
</div>
</div>

<br>
<div id="fe_form">
<fieldset class="browserSettings">
<legend class="translate">Your database</legend>
Expand Down Expand Up @@ -121,10 +108,10 @@ <h1 class="translate">Food Editor</h1>
</legend>
<div id="fe_picklist"></div>
</fieldset>
<b><span class="translate">Authentication status</span>: </b>
<span id="authentication_placeholder"></span>
</div>


<%- include('partials/authentication-status') %>

<script src="<%= locals.bundle %>/js/bundle.app.js?v=<%= locals.cachebuster %>"></script>
<script src="/socket.io/socket.io.js?v=<%= locals.cachebuster %>"></script>
<script src="/food/js/food.js?v=<%= locals.cachebuster %>"></script>
Expand Down
16 changes: 3 additions & 13 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,8 @@
</div>
</div>
<div class="container loading" id="container">
<div id="toolbar">
<div id="buttonbar" style="margin-right: 0px;" role="navigation" aria-label="Menu" >
<a id="editbutton" class="tip" original-title="Edit Mode" aria-label="Edit Mode" href="#" style="display:none;"><i class="icon-edit"></i></a>
<a id="testAlarms" class="tip" original-title="Alarm Test / Smartphone Enable" aria-label="Alarm Test / Smartphone Enable" href="#"><i class="icon-volume"></i></a>
<a id="drawerToggle" class="tip" original-title="Settings" aria-label="Settings" href="#"><i class="icon-menu"></i></a>
<a id="lockedToggle" class="tip" original-title="Token needed for Care Portal" aria-label="Token needed for Care Portal" href="#" style="display:none;"><i class="icon-lock"></i></a>
<a id="treatmentDrawerToggle" class="tip" original-title="Care Portal" aria-label="Care Portal" href="#" style="display:none;"><i class="icon-plus"></i></a>
<a id="boluscalcDrawerToggle" class="tip" original-title="Bolus Wizard" aria-label="Bolus Wizard" href="#" style="display:none;"><i class="icon-calc"></i></a>
</div>
<div class="customTitle">Nightscout</div>
</div>
<%- include('partials/toolbar') %>

<div id="notification" role="region" aria-label="Notification">
<a href="#" aria-label="cancel" ><span></span><i class="icon-cancel-circled"></i></a>
</div>
Expand Down Expand Up @@ -277,8 +268,7 @@
<a id="useDefaults" class="pull-right translate" href="">Reset, and use defaults</a>
</div>

<hr>
<span id="authentication_placeholder"></span>
<%- include('partials/authentication-status') %>

<fieldset id="about">
<legend class="translate">About</legend>
Expand Down
3 changes: 3 additions & 0 deletions views/partials/authentication-status.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="authentication-status">
<strong><span class="translate">Authentication status</span>: </strong><span id="authentication_placeholder"></span>
</div>
34 changes: 34 additions & 0 deletions views/partials/toolbar.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div id="toolbar">
<h1 class="customTitle">Nightscout</h1>

<%if (type !== 'index') { %>
<a href="/" class="closeButton button-close"><span>X</span></a>
<% } %>

<%if (type === 'food') { %>
<div id="buttonbar">
<b> <span class="translate">Status</span>:</b> <span id="fe_status" class="translate">Not loaded</span>
</div>
<% } %>
<%if (type === 'profile') { %>
<div id="buttonbar">
<b> <span class="translate">Status</span>:</b> <span class="pe_status translate">Not loaded</span>
</div>
<% } %>
<%if (type === 'index') { %>
<div id="buttonbar" role="navigation" aria-label="Menu" >
<a id="editbutton" class="tip" original-title="Edit Mode" aria-label="Edit Mode" href="#" style="display:none;"><i class="icon-edit"></i></a>
<a id="testAlarms" class="tip" original-title="Alarm Test / Smartphone Enable" aria-label="Alarm Test / Smartphone Enable" href="#"><i class="icon-volume"></i></a>
<a id="drawerToggle" class="tip" original-title="Settings" aria-label="Settings" href="#"><i class="icon-menu"></i></a>
<a id="lockedToggle" class="tip" original-title="Token needed for Care Portal" aria-label="Token needed for Care Portal" href="#" style="display:none;"><i class="icon-lock"></i></a>
<a id="treatmentDrawerToggle" class="tip" original-title="Care Portal" aria-label="Care Portal" href="#" style="display:none;"><i class="icon-plus"></i></a>
<a id="boluscalcDrawerToggle" class="tip" original-title="Bolus Wizard" aria-label="Bolus Wizard" href="#" style="display:none;"><i class="icon-calc"></i></a>
</div>
<% } %>
</div>

<%if (title) { %>
<div class="toolbar-title">
<h2 class="translate"><%= title %></h1>
</div>
<% } %>
Loading