Skip to content

Commit

Permalink
Add 4 hour option to view (#5289)
Browse files Browse the repository at this point in the history
* Revert "change default back to 3HR"

This reverts commit e60ff3a.

* shorten HR to H to avoid line-wrapping on mobile

* try larger label font: 35 instead of 25 (vs. 40)

* add comma

* deviceInfo.recent null check

* default back to 3, w/ 4 as an option

* re-add H to single-digit hours

* * Don't use cache manifest all all for development
* Add 4 hours option to view and change the labelling to remove language issues
* Have page scale the minor pill widths more gracefully
  • Loading branch information
sulkaharo authored Dec 14, 2019
1 parent 5cc19ae commit 04b47f6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 138 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ function create (env, ctx) {

app.locals.bundle = '/bundle';

app.locals.mode = 'production';

if (process.env.NODE_ENV === 'development') {

console.log('Development mode');

app.locals.mode = 'development';
app.locals.bundle = '/devbundle';

const webpack = require('webpack');
Expand Down
154 changes: 24 additions & 130 deletions lib/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -4900,136 +4900,6 @@ function init() {
,zh_cn: '静音2小时'
,zh_tw: '靜音2小時'
}
,'2HR' : {
cs: '2hod'
,de: '2h'
,es: '2h'
,fr: '2hr'
,el: '2 ώρες'
,he: 'שעתיים'
,pt: '2h'
,sv: '2tim'
,ro: '2h'
,bg: '2часа'
,hr: '2h'
,it: '2ORE'
,ja: '2時間'
,dk: '2t'
,fi: '2h'
,nb: '2t'
,pl: '2h'
,ru: '2ч'
,sk: '2 hod'
,nl: '2uur'
,ko: '2시간'
,tr: '2sa.'
,zh_cn: '2小时'
,zh_tw: '2小時'
}
,'3HR' : {
cs: '3hod'
,he: 'שלוש שעות'
,de: '3h'
,es: '3h'
,fr: '3hr'
,el: '3 ώρες'
,pt: '3h'
,sv: '3tim'
,ro: '3h'
,bg: '3часа'
,hr: '3h'
,it: '3ORE'
,ja: '3時間'
,dk: '3t'
,fi: '3h'
,nb: '3t'
,pl: '3h'
,ru: '3ч'
,sk: '3 hod'
,nl: '3uur'
,ko: '3시간'
,tr: '3sa.'
,zh_cn: '3小时'
,zh_tw: '3小時'
}
,'6HR' : {
cs: '6hod'
,he: 'שש שעות'
,de: '6h'
,es: '6h'
,fr: '6hr'
,el: '6 ώρες'
,pt: '6h'
,sv: '6tim'
,ro: '6h'
,bg: '6часа'
,hr: '6h'
,it: '6ORE'
,ja: '6時間'
,dk: '6t'
,fi: '6h'
,nb: '6t'
,pl: '6h'
,ru: '6ч'
,sk: '6 hod'
,nl: '6uur'
,ko: '6시간'
,tr: '6sa.'
,zh_cn: '6小时'
,zh_tw: '6小時'
}
,'12HR' : {
cs: '12hod'
,he: 'שתים עשרה שעות'
,de: '12h'
,es: '12h'
,fr: '12hr'
,el: '12 ώρες'
,pt: '12h'
,sv: '12t'
,ro: '12h'
,bg: '12часа'
,hr: '12h'
,it: '12ORE'
,ja: '12時間'
,dk: '12t'
,fi: '12h'
,nb: '12t'
,pl: '12h'
,ru: '12ч'
,sk: '12 hod'
,nl: '12uur'
,ko: '12시간'
,tr: '12sa.'
,zh_cn: '12小时'
,zh_tw: '12小時'
}
,'24HR' : {
cs: '24hod'
,he: 'עשרים וארבע שעות'
,de: '24h'
,es: '24h'
,fr: '24hr'
,el: '24 ώρες'
,pt: '24h'
,sv: '24tim'
,ro: '24h'
,bg: '24часа'
,hr: '24h'
,it: '24ORE'
,ja: '24時間'
,dk: '24t'
,fi: '24h'
,nb: '24t'
,pl: '24h'
,ru: '24ч'
,sk: '24 hod'
,nl: '24uur'
,ko: '24시간'
,tr: '24sa.'
,zh_cn: '24小时'
,zh_tw: '24小時'
}
,'Settings' : {
cs: 'Nastavení'
,he: 'הגדרות'
Expand Down Expand Up @@ -8684,6 +8554,30 @@ function init() {
,tr: 'İnsülin/Karbonhidrat oranı (I:C)'
,zh_cn: '碳水化合物系数(ICR)'
}
,'Hours:' : {
cs: 'Hodin:'
,he: 'שעות:'
,ro: 'Ore:'
,el: 'ώρες:'
,fr: 'Heures:'
,de: 'Stunden:'
,es: 'Horas:'
,dk: 'Timer:'
,sv: 'Timmar:'
,nb: 'Timer:'
,fi: 'Tunnit:'
,bg: 'часове:'
,hr: 'Sati:'
,pl: 'Godziny:'
,pt: 'Horas:'
,ru: 'час:'
,sk: 'Hodiny:'
,nl: 'Uren:'
,ko: '시간:'
,it: 'Ore:'
,tr: 'Saat:'
,zh_cn: '小时:'
}
,'hours' : {
cs: 'hodin'
,he: 'שעות '
Expand Down
4 changes: 2 additions & 2 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ a, a:visited, a:link {
font-size: 12px;
}

@media (max-width: 800px) {
@media (max-width: 1000px) {
.bgStatus {
width: 300px;
width: 450px;
}

.bgButton {
Expand Down
19 changes: 13 additions & 6 deletions views/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!DOCTYPE html>
<html manifest="appcache/nightscout-<%= locals.cachebuster %>.appcache">
<html<%if (locals.mode == 'production') { %>
manifest="appcache/nightscout-<%= locals.cachebuster %>.appcache"
<% } %>>
<head>
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -150,14 +152,19 @@
</div>
</div>
</div>
<div></div>

<ul class="focus-range">
<li data-hours="2" class="translate">2HR</li>
<li data-hours="3" class="translate">3HR</li>
<li data-hours="6" class="translate">6HR</li>
<li data-hours="12" class="translate">12HR</li>
<li data-hours="24" class="translate">24HR</li>
<li data-hours="1" class="translate">Hours:</li>
<li data-hours="2">2</li>
<li data-hours="3">3</li>
<li data-hours="4">4</li>
<li data-hours="6">6</li>
<li data-hours="12">12</li>
<li data-hours="24">24</li>
<li>...</li>
</ul>
</div>
<ul class="dropdown-menu" id="viewMenu"></ul>
</div>
<div class="row-fluid section1">
Expand Down

0 comments on commit 04b47f6

Please sign in to comment.