Release 2.9.0
This commit is contained in:
1 parent
9097d45d6a
commit
3de0e89e94
67 files changed
+1767
-98
No files matched your search
@@ -0,0 +1,16 @@
|
||||
const { renderView } = require('../../../view');
|
||||
|
||||
function formatInterval(value, unit) {
|
||||
const amount = Math.max(1, Number(value) || 0);
|
||||
const normalized = String(unit || 'minutes');
|
||||
return 'Every ' + amount + ' ' + normalized.replace(/s$/, '') + (amount === 1 ? '' : 's');
|
||||
}
|
||||
|
||||
module.exports = function renderWeatherLocationsPage(data, message, currentUser) {
|
||||
return renderView('data-sources/weather/list', {
|
||||
title: 'Weather locations', active: 'weather', message, currentUser: currentUser || null,
|
||||
weatherLocations: (data.weatherLocations || []).map(function (location) {
|
||||
return Object.assign({}, location, { intervalLabel: formatInterval(location.update_interval_value, location.update_interval_unit) });
|
||||
}), pagination: data.pagination || null
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user