From 926516ac65518fd6503b29cd0b3a837e560727cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Thu, 22 Sep 2016 21:43:49 +0200 Subject: [PATCH] Small style changes. --- openslides/agenda/migrations/0002_duration.py | 4 ++-- openslides/agenda/static/js/agenda/site.js | 2 +- openslides/core/static/js/core/base.js | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/openslides/agenda/migrations/0002_duration.py b/openslides/agenda/migrations/0002_duration.py index 3c183544f..8ea380bed 100644 --- a/openslides/agenda/migrations/0002_duration.py +++ b/openslides/agenda/migrations/0002_duration.py @@ -9,7 +9,6 @@ def convert_duration(apps, schema_editor): Item = apps.get_model('agenda', 'item') for item in Item.objects.all(): duration = item.duration - item.duration_tmp = None if is_int(duration): # assuming that these are minutes @@ -26,9 +25,10 @@ def convert_duration(apps, schema_editor): def is_int(s): try: int(s) - return True except ValueError: return False + else: + return True class Migration(migrations.Migration): diff --git a/openslides/agenda/static/js/agenda/site.js b/openslides/agenda/static/js/agenda/site.js index 5c9e06eb5..0c458db0f 100644 --- a/openslides/agenda/static/js/agenda/site.js +++ b/openslides/agenda/static/js/agenda/site.js @@ -129,7 +129,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda']) if (startTime) { var timestamp = Date.parse(startTime) + totalDuration * 60 * 1000; var endDate = new Date(timestamp); - var mm = ("0"+endDate.getMinutes()).slice(-2); + var mm = ("0" + endDate.getMinutes()).slice(-2); var dateStr = endDate.getHours() + ':' + mm; return dateStr; } else { diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js index 147a03819..8b6438704 100644 --- a/openslides/core/static/js/core/base.js +++ b/openslides/core/static/js/core/base.js @@ -433,10 +433,8 @@ angular.module('OpenSlidesApp.core', [ .filter('osMinutesToTime', [ function () { return function (totalminutes) { - if (!totalminutes) { - return ''; - } else { - var time = ""; + var time = ''; + if (totalminutes) { if (totalminutes < 0) { time = "-"; totalminutes = -totalminutes; @@ -444,10 +442,10 @@ angular.module('OpenSlidesApp.core', [ var hh = Math.floor(totalminutes / 60); var mm = Math.floor(totalminutes % 60); // Add leading "0" for double digit values - mm = ("0"+mm).slice(-2); + mm = ("0" + mm).slice(-2); time += hh + ":" + mm; - return time; } + return time; }; } ])