From 2d148844548fa5e1a93cd9a76293745b61464b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 20 May 2016 09:37:12 +0200 Subject: [PATCH] * Fixed time picker not working on chrome * Added warn on service being replaced by new publication --- server/src/uds/models/ServicesPool.py | 6 ++-- .../uds/static/adm/js/bootstrap-timepicker.js | 6 ++-- server/src/uds/static/adm/js/gui-tools.coffee | 30 ++++++++++--------- .../uds/admin/tmpl/calendar_rule.html | 10 +++---- .../transports/SPICE/BaseSPICETransport.py | 2 +- server/src/uds/web/views/index.py | 4 +-- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/server/src/uds/models/ServicesPool.py b/server/src/uds/models/ServicesPool.py index d8e97b7fd..b65a5baf1 100644 --- a/server/src/uds/models/ServicesPool.py +++ b/server/src/uds/models/ServicesPool.py @@ -61,7 +61,7 @@ from datetime import datetime, timedelta import logging import pickle -__updated__ = '2016-05-19' +__updated__ = '2016-05-20' logger = logging.getLogger(__name__) @@ -195,8 +195,8 @@ class DeployedService(UUIDModel, TaggingMixin): def toBeReplaced(self): # return datetime.now() activePub = self.activePublication() - if activePub is None or activePub.revision == self.current_pub_revision - 1: - return None + # if activePub is None or activePub.revision == self.current_pub_revision - 1: + # return None # Return the date ret = self.recoverValue('toBeReplacedIn') diff --git a/server/src/uds/static/adm/js/bootstrap-timepicker.js b/server/src/uds/static/adm/js/bootstrap-timepicker.js index f2be14787..bbb923c5e 100644 --- a/server/src/uds/static/adm/js/bootstrap-timepicker.js +++ b/server/src/uds/static/adm/js/bootstrap-timepicker.js @@ -1,7 +1,7 @@ /*! * Timepicker Component for Twitter Bootstrap * - * Copyright 2013 Joris de Wit + * Copyright 2013 Joris de Wit and bootstrap-timepicker contributors * * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors * @@ -174,10 +174,12 @@ case 9: //tab if (e.shiftKey) { if (this.highlightedUnit === 'hour') { + this.hideWidget(); break; } this.highlightPrevUnit(); } else if ((this.showMeridian && this.highlightedUnit === 'meridian') || (this.showSeconds && this.highlightedUnit === 'second') || (!this.showMeridian && !this.showSeconds && this.highlightedUnit ==='minute')) { + this.hideWidget(); break; } else { this.highlightNextUnit(); @@ -887,7 +889,7 @@ } else { if (hour >= this.maxHours) { hour = this.maxHours - 1; - } else if (hour < 0) { + } else if ((hour < 0) || (hour === 12 && timeMode === 1)){ hour = 0; } } diff --git a/server/src/uds/static/adm/js/gui-tools.coffee b/server/src/uds/static/adm/js/gui-tools.coffee index 35e1ae490..4d4dad69b 100644 --- a/server/src/uds/static/adm/js/gui-tools.coffee +++ b/server/src/uds/static/adm/js/gui-tools.coffee @@ -18,11 +18,11 @@ selector = selector or "" selector += " .btn3d" $.each $(selector), (index, value) -> - + # If no events associated, return $this = $(@) clkEvents = [] - + # Store old click events, so we can reconstruct click chain later try $.each $._data(value, "events").click, (index, fnc) -> @@ -32,20 +32,20 @@ return $this.unbind "click" - - # If Mousedown registers a temporal mouseUp event on parent, to lauch button click + + # If Mousedown registers a temporal mouseUp event on parent, to lauch button click $this.mousedown (event) -> $("body").mouseup (e) -> # Remove temporal mouseup handler $(this).unbind "mouseup" - + # If movement of mouse is not too far... (16 px maybe well for 3d buttons?) x = event.pageX - e.pageX y = event.pageY - e.pageY dist_square = x * x + y * y if dist_square < 16 * 16 - + # Register again old event handlers $.each clkEvents, (index, fnc) -> $this.click fnc.handler @@ -62,7 +62,7 @@ return applyCustoms: (selector) -> - + # Activate "custom" styles $.each $(selector + " input:checkbox"), (index, tspn) -> $tspn = $(tspn) @@ -89,12 +89,14 @@ $tspn.parent().datepicker options # timepicker - $.each $(selector + " input[type=time]:not([readonly])"), (index, tspn) -> + $.each $(selector + " input[type=udstime]:not([readonly])"), (index, tspn) -> $tspn = $(tspn) - opts = + opts = showMeridian: false defaultTime: false + $tspn.attr("type", "text") + $tspn.timepicker opts # Activate "cool" selects @@ -129,10 +131,10 @@ max: maxVal postfix: postfix decimals: 0 - + # TEST: cooler on mobile devices $(selector + " .selectpicker").selectpicker "mobile" if /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) - + # Activate tooltips $(selector + " [data-toggle=\"tooltip\"]").tooltip delay: @@ -141,12 +143,12 @@ placement: "auto right" - + # Fix 3d buttons gui.tools.fix3dButtons selector return - + # Datetime renderer (with specified format) renderDate: (format) -> (data, type, full) -> @@ -157,7 +159,7 @@ val = api.tools.strftime(format, new Date(data * 1000)) return "" + val + "" - + # Log level rendererer renderLogLovel: -> levels = diff --git a/server/src/uds/templates/uds/admin/tmpl/calendar_rule.html b/server/src/uds/templates/uds/admin/tmpl/calendar_rule.html index 53186797c..eb2edeb57 100644 --- a/server/src/uds/templates/uds/admin/tmpl/calendar_rule.html +++ b/server/src/uds/templates/uds/admin/tmpl/calendar_rule.html @@ -24,10 +24,10 @@
- + -
-
+ +
@@ -35,7 +35,7 @@
- +
-
+
diff --git a/server/src/uds/transports/SPICE/BaseSPICETransport.py b/server/src/uds/transports/SPICE/BaseSPICETransport.py index 704a3ba97..7d0c8434f 100644 --- a/server/src/uds/transports/SPICE/BaseSPICETransport.py +++ b/server/src/uds/transports/SPICE/BaseSPICETransport.py @@ -44,7 +44,7 @@ from uds.services.OVirt.OVirtProvider import Provider as oVirtProvider import logging import os -__updated__ = '2016-04-18' +__updated__ = '2016-05-19' logger = logging.getLogger(__name__) diff --git a/server/src/uds/web/views/index.py b/server/src/uds/web/views/index.py index 44b2dcf28..67505d6f0 100644 --- a/server/src/uds/web/views/index.py +++ b/server/src/uds/web/views/index.py @@ -52,7 +52,7 @@ import logging logger = logging.getLogger(__name__) -__updated__ = '2016-05-19' +__updated__ = '2016-05-20' def about(request): @@ -174,7 +174,7 @@ def index(request): tbr = svr.toBeReplaced() if tbr is not None: tbr = formats.date_format(tbr, "SHORT_DATETIME_FORMAT") - tbrt = ugettext('This service is about to be replaced by a new version. Please, close the session & save all your work to avoid loosing it.
This action will be executed at {}').format(tbr) + tbrt = ugettext('This service is about to be replaced by a new version. Please, close the session before {} and save all your work to avoid loosing it.').format(tbr) else: tbrt = ''