* Fixed time picker not working on chrome

* Added warn on service being replaced by new publication
This commit is contained in:
Adolfo Gómez García 2016-05-20 09:37:12 +02:00
parent ba4eeffc77
commit 2d14884454
6 changed files with 31 additions and 27 deletions

View File

@ -61,7 +61,7 @@ from datetime import datetime, timedelta
import logging import logging
import pickle import pickle
__updated__ = '2016-05-19' __updated__ = '2016-05-20'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -195,8 +195,8 @@ class DeployedService(UUIDModel, TaggingMixin):
def toBeReplaced(self): def toBeReplaced(self):
# return datetime.now() # return datetime.now()
activePub = self.activePublication() activePub = self.activePublication()
if activePub is None or activePub.revision == self.current_pub_revision - 1: # if activePub is None or activePub.revision == self.current_pub_revision - 1:
return None # return None
# Return the date # Return the date
ret = self.recoverValue('toBeReplacedIn') ret = self.recoverValue('toBeReplacedIn')

View File

@ -1,7 +1,7 @@
/*! /*!
* Timepicker Component for Twitter Bootstrap * 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 * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
* *
@ -174,10 +174,12 @@
case 9: //tab case 9: //tab
if (e.shiftKey) { if (e.shiftKey) {
if (this.highlightedUnit === 'hour') { if (this.highlightedUnit === 'hour') {
this.hideWidget();
break; break;
} }
this.highlightPrevUnit(); this.highlightPrevUnit();
} else if ((this.showMeridian && this.highlightedUnit === 'meridian') || (this.showSeconds && this.highlightedUnit === 'second') || (!this.showMeridian && !this.showSeconds && this.highlightedUnit ==='minute')) { } else if ((this.showMeridian && this.highlightedUnit === 'meridian') || (this.showSeconds && this.highlightedUnit === 'second') || (!this.showMeridian && !this.showSeconds && this.highlightedUnit ==='minute')) {
this.hideWidget();
break; break;
} else { } else {
this.highlightNextUnit(); this.highlightNextUnit();
@ -887,7 +889,7 @@
} else { } else {
if (hour >= this.maxHours) { if (hour >= this.maxHours) {
hour = this.maxHours - 1; hour = this.maxHours - 1;
} else if (hour < 0) { } else if ((hour < 0) || (hour === 12 && timeMode === 1)){
hour = 0; hour = 0;
} }
} }

View File

@ -89,12 +89,14 @@
$tspn.parent().datepicker options $tspn.parent().datepicker options
# timepicker # timepicker
$.each $(selector + " input[type=time]:not([readonly])"), (index, tspn) -> $.each $(selector + " input[type=udstime]:not([readonly])"), (index, tspn) ->
$tspn = $(tspn) $tspn = $(tspn)
opts = opts =
showMeridian: false showMeridian: false
defaultTime: false defaultTime: false
$tspn.attr("type", "text")
$tspn.timepicker opts $tspn.timepicker opts
# Activate "cool" selects # Activate "cool" selects

View File

@ -24,7 +24,7 @@
<label for="id-rule-start-time" class="col-sm-3 control-label" data-toggle="tooltip" data-title="{% trans 'Starting hour'%}">{% trans 'Starting hour' %}</label> <label for="id-rule-start-time" class="col-sm-3 control-label" data-toggle="tooltip" data-title="{% trans 'Starting hour'%}">{% trans 'Starting hour' %}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="input-group bootstrap-timepicker timepicker"> <div class="input-group bootstrap-timepicker timepicker">
<input type="time" value="00:00" id="id-rule-start-time" name="rule_start_time" class="form-control input-small"> <input type="udstime" value="00:00" id="id-rule-start-time" name="rule_start_time" class="form-control input-small">
<span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
</div> </div>
</div> </div>

View File

@ -44,7 +44,7 @@ from uds.services.OVirt.OVirtProvider import Provider as oVirtProvider
import logging import logging
import os import os
__updated__ = '2016-04-18' __updated__ = '2016-05-19'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -52,7 +52,7 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__updated__ = '2016-05-19' __updated__ = '2016-05-20'
def about(request): def about(request):
@ -174,7 +174,7 @@ def index(request):
tbr = svr.toBeReplaced() tbr = svr.toBeReplaced()
if tbr is not None: if tbr is not None:
tbr = formats.date_format(tbr, "SHORT_DATETIME_FORMAT") 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.<br>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: else:
tbrt = '' tbrt = ''