Merge branch 'maintenance' into devel

This commit is contained in:
Gina Häußge committed 2017-11-27 17:27:30 +01:00
commit 48fceac0fe
5 files changed
+20 -10

No files matched your search

+1 -1
View File
@@ -1258,7 +1258,7 @@ class Server(object):
# JS
js_filters = ["sourcemap_remove", "js_delimiter_bundler"]
js_plugin_filters = ["sourcemap_remove", "js_plugin_delimiter_bundler"]
js_plugin_filters = ["sourcemap_remove", "js_delimiter_bundler"] # TODO: replace with IIFE wrapper again, see #2200
js_libs_bundle = Bundle(*js_libs, output="webassets/packed_libs.js", filters=",".join(js_filters))
+16 -6
View File
@@ -416,7 +416,7 @@ function formatFuzzyPrintTime(totalSeconds) {
var seconds = d.seconds();
var minutes = d.minutes();
var hours = d.hours();
var days = d.asDays();
var days = d.days();
var replacements = {
days: days,
@@ -432,11 +432,16 @@ function formatFuzzyPrintTime(totalSeconds) {
// days
if (hours >= 16) {
replacements.days += 1;
text = gettext("%(days)d days");
if (replacements.days === 1) {
text = gettext("%(days)d day");
} else {
text = gettext("%(days)d days");
}
} else if (hours >= 8 && hours < 16) {
text = gettext("%(days)d.5 days");
} else {
if (days == 1) {
if (days === 1) {
text = gettext("%(days)d day");
} else {
text = gettext("%(days)d days");
@@ -447,7 +452,7 @@ function formatFuzzyPrintTime(totalSeconds) {
if (hours < 12) {
if (minutes < 15) {
// less than .15 => .0
if (hours == 1) {
if (hours === 1) {
text = gettext("%(hours)d hour");
} else {
text = gettext("%(hours)d hours");
@@ -458,10 +463,15 @@ function formatFuzzyPrintTime(totalSeconds) {
} else {
// over .75 => hours + 1
replacements.hours += 1;
text = gettext("%(hours)d hours");
if (replacements.hours === 1) {
text = gettext("%(hours)d hour");
} else {
text = gettext("%(hours)d hours");
}
}
} else {
if (hours == 23 && minutes > 30) {
if (hours === 23 && minutes > 30) {
// over 23.5 hours => 1 day
text = gettext("1 day");
} else {
@@ -137,7 +137,7 @@
<label class="control-label">{{ _('Current API Key') }}</label>
<div class="controls">
<div class="input-append input-block-level">
<input type="text" disabled="disabled" data-bind="value: $root.users.editorApikey, valueUpdate: 'input', attr: {placeholder: '{{ _('N/A') }}'}">
<input type="text" readonly="readonly" data-bind="value: $root.users.editorApikey, valueUpdate: 'input', attr: {placeholder: '{{ _('N/A') }}'}">
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: $root.users.copyApikey, enable: $root.users.editorApikey"><i class="fa fa-copy"></i></a>
<a class="btn add-on" title="Generate new API Key" data-bind="click: function() { $root.users.confirmGenerateApikey(); }"><i class="fa fa-refresh"></i></a>
<a class="btn add-on btn-danger" title="Delete API Key" data-bind="click: function() { $root.users.confirmDeleteApikey(); }"><i class="fa fa-trash-o"></i></a>
@@ -17,7 +17,7 @@
<label class="control-label" for="settings-apiKey">{{ _('API Key') }}</label>
<div class="controls">
<div class="input-append input-block-level">
<input type="text" disabled="disabled" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A') }}'}">
<input type="text" readonly="readonly" id="settings-apikey" data-bind="value: api_key, attr: {placeholder: '{{ _('N/A') }}'}">
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApiKey, enable: api_key"><i class="fa fa-copy"></i></a>
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApiKey, enable: api_key"><i class="fa fa-refresh"></i></a>
</div>
@@ -24,7 +24,7 @@
<label class="control-label" for="userSettings-access_apikey">{{ _('Current API Key') }}</label>
<div class="controls">
<div class="input-append input-block-level">
<input type="text" disabled="disabled" id="userSettings-access_apikey" data-bind="value: access_apikey, attr: {placeholder: '{{ _('N/A') }}'}">
<input type="text" readonly="readonly" id="userSettings-access_apikey" data-bind="value: access_apikey, attr: {placeholder: '{{ _('N/A') }}'}">
<a class="btn add-on" title="Copy API Key to clipboard" data-bind="click: copyApikey, enable: access_apikey"><i class="fa fa-copy"></i></a>
<a class="btn add-on" title="Generate new API Key" data-bind="click: generateApikey"><i class="fa fa-refresh"></i></a>
<a class="btn btn-danger add-on" title="Delete API Key" data-bind="click: deleteApikey, enable: access_apikey"><i class="fa fa-trash-o"></i></a>