mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
* Fixed time picker not working on chrome
* Added warn on service being replaced by new publication
This commit is contained in:
parent
ba4eeffc77
commit
2d14884454
@ -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')
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 "<span data-date=\"" + data + "\">" + val + "</span>"
|
||||
|
||||
|
||||
|
||||
# Log level rendererer
|
||||
renderLogLovel: ->
|
||||
levels =
|
||||
|
@ -24,10 +24,10 @@
|
||||
<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="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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@ -35,7 +35,7 @@
|
||||
<div class="col-sm-9">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<input id="id-rule-duration" name="rule_duration" type="numeric" value="0" data-minval="0" class="form-control" autofocus required>
|
||||
<input id="id-rule-duration" name="rule_duration" type="numeric" value="0" data-minval="0" class="form-control" autofocus required>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<select class="selectpicker show-menu-arrow show-tick" name="rule_duration_unit" data-style="btn-default" data-width="100%" id="id-rule-duration-unit" required>
|
||||
@ -66,7 +66,7 @@
|
||||
<div class="input-group date">
|
||||
<input type="date" required placeholder="Never" id="id-rule-end" name="rule_end_date" clear="true" class="form-control modal_field_data " aria-required="true"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -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__)
|
||||
|
@ -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.<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:
|
||||
tbrt = ''
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user