sinatra-hexacta 0.7.1 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/extensions/init.rb +1 -1
- data/lib/sinatra/extensions/processmanager.rb +2 -2
- data/lib/sinatra/handlers/init.rb +1 -1
- data/lib/sinatra/handlers/processes.rb +6 -4
- data/lib/sinatra/helpers/alerts.rb +4 -0
- data/lib/sinatra/public/css/app.min.1.css +36 -0
- data/lib/sinatra/public/img/noimage.jpg +0 -0
- data/lib/sinatra/public/js/process.js +72 -0
- data/lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.es.js +19 -0
- data/lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.css +7 -0
- data/lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.js +7 -0
- data/lib/sinatra/views/alerts/process.slim +11 -0
- data/lib/sinatra/views/libraries/include_css.slim +3 -0
- data/lib/sinatra/views/libraries/include_js_after.slim +4 -0
- data/lib/sinatra/views/libraries/include_js_before.slim +1 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0befef98fe4dd879c83aa2bef032f9c14b0fd7d99827624d29eac4534410aa7
|
4
|
+
data.tar.gz: 15ff5feba0286aa289d1c37a3a197d4d6ab21c0ca5cac8b7a715470b4c676bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f927ed2709ef6473f7931efc27846e0cb8c22733d54d0cc72db124ae5d20c6f50f9ca7590af33e7fb398993b4b5d75b775c6c993335561a0d1750bcc8d8a0cc
|
7
|
+
data.tar.gz: 272264081fd19267b2faad9450f7085c27df83fe0031f9465ec28af67677abd6bceb74422788e9aaac0a9f90091d51aaa34df5edb0e4e41827479a25c09c62e7
|
@@ -93,14 +93,14 @@ class ProcessManager
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def clean(clazz)
|
96
|
-
@handlers.select { |handler|
|
96
|
+
@handlers.select { |handler| handler.clazz == clazz }.each do |handler|
|
97
97
|
handler.interrupt
|
98
98
|
self.finish(handler)
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
102
|
def running?(clazz)
|
103
|
-
!@handlers.select { |handler| handler.clazz == clazz }.empty
|
103
|
+
!@handlers.select { |handler| handler.clazz == clazz }.empty?
|
104
104
|
end
|
105
105
|
|
106
106
|
end
|
@@ -9,15 +9,17 @@ module Sinatra
|
|
9
9
|
get '/processes' do
|
10
10
|
return "" if ProcessManager.instance.find(params[:class]).nil?
|
11
11
|
content_type :json
|
12
|
-
return {
|
12
|
+
return { 'name' => ProcessManager.instance.find(params[:class]).name, 'progress' => ProcessManager.instance.find(params[:class]).progress }.to_json
|
13
13
|
end
|
14
14
|
|
15
|
-
post '/processes/:
|
16
|
-
ProcessManager.instance.
|
15
|
+
post '/processes/:clazz' do |clazz|
|
16
|
+
ProcessManager.instance.clean(clazz)
|
17
|
+
200
|
17
18
|
end
|
18
19
|
|
19
20
|
post '/process' do
|
20
|
-
|
21
|
+
klass = Object.const_get("#{params[:class]}")
|
22
|
+
a_handler = ProcessManager.instance.run(klass,params)
|
21
23
|
a_handler.to_json
|
22
24
|
end
|
23
25
|
end
|
@@ -23,6 +23,10 @@ module Sinatra
|
|
23
23
|
slim "#{Hexacta::GEM_FILE_DIR}/alerts/error".to_sym, locals: option_hash
|
24
24
|
end
|
25
25
|
|
26
|
+
def process_alert(option_hash)
|
27
|
+
slim "#{Hexacta::GEM_FILE_DIR}/alerts/process".to_sym, locals: option_hash
|
28
|
+
end
|
29
|
+
|
26
30
|
setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
|
27
31
|
copy_all_files("/lib/sinatra/views/alerts","/app/views/#{Hexacta::GEM_FILE_DIR}/alerts")
|
28
32
|
end
|
@@ -16387,3 +16387,39 @@ svg.ct-chart-bar, svg.ct-chart-line{
|
|
16387
16387
|
0% { width: 0; }
|
16388
16388
|
100% { width: 100%; }
|
16389
16389
|
}
|
16390
|
+
|
16391
|
+
@-webkit-keyframes rotating /* Safari and Chrome */ {
|
16392
|
+
from {
|
16393
|
+
-webkit-transform: rotate(0deg);
|
16394
|
+
-o-transform: rotate(0deg);
|
16395
|
+
transform: rotate(0deg);
|
16396
|
+
}
|
16397
|
+
to {
|
16398
|
+
-webkit-transform: rotate(360deg);
|
16399
|
+
-o-transform: rotate(360deg);
|
16400
|
+
transform: rotate(360deg);
|
16401
|
+
}
|
16402
|
+
}
|
16403
|
+
@keyframes rotating {
|
16404
|
+
from {
|
16405
|
+
-ms-transform: rotate(0deg);
|
16406
|
+
-moz-transform: rotate(0deg);
|
16407
|
+
-webkit-transform: rotate(0deg);
|
16408
|
+
-o-transform: rotate(0deg);
|
16409
|
+
transform: rotate(0deg);
|
16410
|
+
}
|
16411
|
+
to {
|
16412
|
+
-ms-transform: rotate(360deg);
|
16413
|
+
-moz-transform: rotate(360deg);
|
16414
|
+
-webkit-transform: rotate(360deg);
|
16415
|
+
-o-transform: rotate(360deg);
|
16416
|
+
transform: rotate(360deg);
|
16417
|
+
}
|
16418
|
+
}
|
16419
|
+
.rotating {
|
16420
|
+
-webkit-animation: rotating 2s linear infinite;
|
16421
|
+
-moz-animation: rotating 2s linear infinite;
|
16422
|
+
-ms-animation: rotating 2s linear infinite;
|
16423
|
+
-o-animation: rotating 2s linear infinite;
|
16424
|
+
animation: rotating 2s linear infinite;
|
16425
|
+
}
|
Binary file
|
@@ -0,0 +1,72 @@
|
|
1
|
+
class ProcessManager {
|
2
|
+
|
3
|
+
static show(clazz) {
|
4
|
+
$("#processes").css("height","80px");
|
5
|
+
$("#processes .title").html(clazz);
|
6
|
+
}
|
7
|
+
|
8
|
+
static hide() {
|
9
|
+
$("#processes").css("height","0px");
|
10
|
+
}
|
11
|
+
|
12
|
+
static update(progress) {
|
13
|
+
$("#processes .progress-bar").css("width",progress + "%");
|
14
|
+
}
|
15
|
+
|
16
|
+
static complete() {
|
17
|
+
$("#processes .progress-bar").css("width","100%");
|
18
|
+
$("#processes .rotating").removeClass("rotating");
|
19
|
+
$("#processes .zmdi").removeClass("zmdi-settings").addClass("zmdi-check-circle");
|
20
|
+
$("#processes .progress").removeClass("active");
|
21
|
+
$("#processes .progress-bar").addClass("progress-bar-success");
|
22
|
+
$("#processes .detail").html("Completado. Refresca la pantalla para actualizar la información.");
|
23
|
+
}
|
24
|
+
|
25
|
+
static start(clazz) {
|
26
|
+
$.ajax({
|
27
|
+
url: "/process",
|
28
|
+
type: 'POST',
|
29
|
+
data: { class : clazz },
|
30
|
+
success: function(result) {
|
31
|
+
ProcessManager.show('Cargando...');
|
32
|
+
ProcessManager.update(0);
|
33
|
+
},
|
34
|
+
error: function(error) {
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
|
39
|
+
static getProcesses(clazz) {
|
40
|
+
$.ajax({
|
41
|
+
url: "/processes",
|
42
|
+
type: 'GET',
|
43
|
+
data: { class : clazz },
|
44
|
+
success: function(result) {
|
45
|
+
if (result != "") {
|
46
|
+
if (result.progress >= 100.0) {
|
47
|
+
//ProcessManager.hide();
|
48
|
+
ProcessManager.complete()
|
49
|
+
ProcessManager.cleanProcess(clazz);
|
50
|
+
} else {
|
51
|
+
ProcessManager.show(result.name);
|
52
|
+
}
|
53
|
+
ProcessManager.update(result.progress);
|
54
|
+
|
55
|
+
}
|
56
|
+
},
|
57
|
+
error: function(error) {
|
58
|
+
}
|
59
|
+
});
|
60
|
+
}
|
61
|
+
|
62
|
+
static cleanProcess(clazz) {
|
63
|
+
$.ajax({
|
64
|
+
url: "/processes/" + clazz,
|
65
|
+
type: 'POST',
|
66
|
+
success: function(result) {
|
67
|
+
},
|
68
|
+
error: function(error) {
|
69
|
+
}
|
70
|
+
});
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Spanish translation for bootstrap-year-calendar
|
3
|
+
* Paul DAVID-SIVELLE
|
4
|
+
* Based on
|
5
|
+
* Spanish translation for bootstrap-datepicker
|
6
|
+
* Bruno Bonamin <bruno.bonamin@gmail.com>
|
7
|
+
*/
|
8
|
+
|
9
|
+
;(function($){
|
10
|
+
$.fn.calendar.dates['es'] = {
|
11
|
+
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
|
12
|
+
daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"],
|
13
|
+
daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
|
14
|
+
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
|
15
|
+
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
|
16
|
+
weekShort: 'S',
|
17
|
+
weekStart: 1
|
18
|
+
};
|
19
|
+
}(jQuery));
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* Bootstrap year calendar v1.1.0
|
3
|
+
* Created by Paul David-Sivelle
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
5
|
+
*/
|
6
|
+
|
7
|
+
.calendar{padding:4px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;overflow:auto;direction:ltr;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.calendar.calendar-rtl{direction:rtl}.calendar.calendar-rtl table tr td span{float:right}.calendar table{margin:auto}.calendar table td,.calendar table th{text-align:center;width:20px;height:20px;border:none;padding:4px 5px;font-size:12px}.calendar .calendar-header{width:100%;margin-bottom:20px}.calendar .calendar-header table{width:100%}.calendar .calendar-header table th{font-size:22px;padding:5px 10px}.calendar .calendar-header table th:hover{background:#eee;cursor:pointer}.calendar .calendar-header table th.disabled,.calendar .calendar-header table th.disabled:hover{background:0 0;cursor:default;color:#fff}.calendar .calendar-header table th.next,.calendar .calendar-header table th.prev{width:20px}.calendar .year-title{font-weight:700;text-align:center;height:20px;width:auto}.calendar .year-neighbor{color:#aaa}.calendar .year-neighbor2,.calendar table.month tr td.disabled,.calendar table.month tr td.disabled:hover{color:#ddd}.calendar .months-container{width:100%;display:none}.calendar .month-container{min-width:180px;text-align:center;height:200px;padding:0}.calendar table.month th.month-title{font-size:16px;padding-bottom:5px}.calendar table.month th.day-header{font-size:14px}.calendar table.month tr td,.calendar table.month tr th{padding:0}.calendar table.month td.week-number{cursor:default;font-weight:700;border-right:1px solid #eee;padding:5px}.calendar .round-left{-webkit-border-radius:8px 0 0 8px;-moz-border-radius:8px 0 0 8px;border-radius:8px 0 0 8px}.calendar .round-right{webkit-border-radius:0 8px 8px 0;-moz-border-radius:0 8px 8px 0;border-radius:0 8px 8px 0}.calendar table.month tr td .day-content{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:5px 6px}.table-striped .calendar table.month tr td,.table-striped .calendar table.month tr th{background-color:transparent}.calendar table.month td.day .day-content:hover{background:rgba(0,0,0,.2);cursor:pointer}.calendar table.month td.day.disabled .day-content:hover,.calendar table.month tr td.new,.calendar table.month tr td.new:hover,.calendar table.month tr td.old,.calendar table.month tr td.old:hover{background:0 0;cursor:default}.calendar table.month tr td.range .day-content{background:rgba(0,0,0,.2);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.calendar table.month tr td.range.range-start .day-content{border-top-left-radius:4px;border-bottom-left-radius:4px}.calendar table.month tr td.range.range-end .day-content{border-top-right-radius:4px;border-bottom-right-radius:4px}.calendar-context-menu,.calendar-context-menu .submenu{border:1px solid #ddd;background-color:#fff;box-shadow:2px 2px 5px rgba(0,0,0,.2);-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.2);position:absolute;display:none}.calendar-context-menu .item{padding:5px 10px;cursor:pointer;display:table;width:100%}.calendar-context-menu .item:hover{background:#eee}.calendar-context-menu .item .content{display:table-cell}.calendar-context-menu .item span{display:table-cell;padding-left:10px;text-align:right}.calendar-context-menu .item span:last-child{display:none}.calendar-context-menu .submenu{left:100%;margin-top:-6px}.calendar-context-menu .item:hover>.submenu{display:block}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* Bootstrap year calendar v1.1.0
|
3
|
+
* Created by Paul David-Sivelle
|
4
|
+
* Licensed under the Apache License, Version 2.0
|
5
|
+
*/
|
6
|
+
|
7
|
+
!function(e){var t=function(e,t){this.element=e,this.element.addClass("calendar"),this._initializeEvents(t),this._initializeOptions(t),this._render()};t.prototype={constructor:t,_initializeOptions:function(t){null==t&&(t=[]),this.options={startYear:isNaN(parseInt(t.startYear))?(new Date).getFullYear():parseInt(t.startYear),minDate:t.minDate instanceof Date?t.minDate:null,maxDate:t.maxDate instanceof Date?t.maxDate:null,language:null!=t.language&&null!=n[t.language]?t.language:"en",allowOverlap:null!=t.allowOverlap?t.allowOverlap:!0,displayWeekNumber:null!=t.displayWeekNumber?t.displayWeekNumber:!1,alwaysHalfDay:null!=t.alwaysHalfDay?t.alwaysHalfDay:!1,enableRangeSelection:null!=t.enableRangeSelection?t.enableRangeSelection:!1,disabledDays:t.disabledDays instanceof Array?t.disabledDays:[],roundRangeLimits:null!=t.roundRangeLimits?t.roundRangeLimits:!1,dataSource:t.dataSource instanceof Array!=null?t.dataSource:[],style:"background"==t.style||"border"==t.style||"custom"==t.style?t.style:"border",enableContextMenu:null!=t.enableContextMenu?t.enableContextMenu:!1,contextMenuItems:t.contextMenuItems instanceof Array?t.contextMenuItems:[],customDayRenderer:e.isFunction(t.customDayRenderer)?t.customDayRenderer:null,customDataSourceRenderer:e.isFunction(t.customDataSourceRenderer)?t.customDataSourceRenderer:null},this._initializeDatasourceColors()},_initializeEvents:function(e){null==e&&(e=[]),e.renderEnd&&this.element.bind("renderEnd",e.renderEnd),e.clickDay&&this.element.bind("clickDay",e.clickDay),e.dayContextMenu&&this.element.bind("dayContextMenu",e.dayContextMenu),e.selectRange&&this.element.bind("selectRange",e.selectRange),e.mouseOnDay&&this.element.bind("mouseOnDay",e.mouseOnDay),e.mouseOutDay&&this.element.bind("mouseOutDay",e.mouseOutDay)},_initializeDatasourceColors:function(){for(var e in this.options.dataSource)null==this.options.dataSource[e].color&&(this.options.dataSource[e].color=a[e%a.length])},_render:function(){this.element.empty(),this._renderHeader(),this._renderBody(),this._renderDataSource(),this._applyEvents(),this.element.find(".months-container").fadeIn(500),this._triggerEvent("renderEnd",{currentYear:this.options.startYear})},_renderHeader:function(){var t=e(document.createElement("div"));t.addClass("calendar-header panel panel-default");var n=e(document.createElement("table")),a=e(document.createElement("th"));a.addClass("prev"),null!=this.options.minDate&&this.options.minDate>new Date(this.options.startYear-1,11,31)&&a.addClass("disabled");var s=e(document.createElement("span"));s.addClass("glyphicon glyphicon-chevron-left"),a.append(s),n.append(a);var i=e(document.createElement("th"));i.addClass("year-title year-neighbor2 hidden-sm hidden-xs"),i.text(this.options.startYear-2),null!=this.options.minDate&&this.options.minDate>new Date(this.options.startYear-2,11,31)&&i.addClass("disabled"),n.append(i);var o=e(document.createElement("th"));o.addClass("year-title year-neighbor hidden-xs"),o.text(this.options.startYear-1),null!=this.options.minDate&&this.options.minDate>new Date(this.options.startYear-1,11,31)&&o.addClass("disabled"),n.append(o);var r=e(document.createElement("th"));r.addClass("year-title"),r.text(this.options.startYear),n.append(r);var d=e(document.createElement("th"));d.addClass("year-title year-neighbor hidden-xs"),d.text(this.options.startYear+1),null!=this.options.maxDate&&this.options.maxDate<new Date(this.options.startYear+1,0,1)&&d.addClass("disabled"),n.append(d);var l=e(document.createElement("th"));l.addClass("year-title year-neighbor2 hidden-sm hidden-xs"),l.text(this.options.startYear+2),null!=this.options.maxDate&&this.options.maxDate<new Date(this.options.startYear+2,0,1)&&l.addClass("disabled"),n.append(l);var u=e(document.createElement("th"));u.addClass("next"),null!=this.options.maxDate&&this.options.maxDate<new Date(this.options.startYear+1,0,1)&&u.addClass("disabled");var c=e(document.createElement("span"));c.addClass("glyphicon glyphicon-chevron-right"),u.append(c),n.append(u),t.append(n),this.element.append(t)},_renderBody:function(){var t=e(document.createElement("div"));t.addClass("months-container");for(var a=0;12>a;a++){var s=e(document.createElement("div"));s.addClass("month-container"),s.data("month-id",a);var i=new Date(this.options.startYear,a,1),o=e(document.createElement("table"));o.addClass("month");var r=e(document.createElement("thead")),d=e(document.createElement("tr")),l=e(document.createElement("th"));l.addClass("month-title"),l.attr("colspan",this.options.displayWeekNumber?8:7),l.text(n[this.options.language].months[a]),d.append(l),r.append(d);var u=e(document.createElement("tr"));if(this.options.displayWeekNumber){var c=e(document.createElement("th"));c.addClass("week-number"),c.text(n[this.options.language].weekShort),u.append(c)}var h=n[this.options.language].weekStart;do{var m=e(document.createElement("th"));m.addClass("day-header"),m.text(n[this.options.language].daysMin[h]),u.append(m),h++,h>=7&&(h=0)}while(h!=n[this.options.language].weekStart);r.append(u),o.append(r);for(var p=new Date(i.getTime()),g=new Date(this.options.startYear,a+1,0),f=n[this.options.language].weekStart;p.getDay()!=f;)p.setDate(p.getDate()-1);for(;g>=p;){var D=e(document.createElement("tr"));if(this.options.displayWeekNumber){var c=e(document.createElement("td"));c.addClass("week-number"),c.text(this.getWeekNumber(p)),D.append(c)}do{var y=e(document.createElement("td"));if(y.addClass("day"),i>p)y.addClass("old");else if(p>g)y.addClass("new");else{if(null!=this.options.minDate&&p<this.options.minDate||null!=this.options.maxDate&&p>this.options.maxDate)y.addClass("disabled");else if(this.options.disabledDays.length>0)for(var h in this.options.disabledDays)if(p.getTime()==this.options.disabledDays[h].getTime()){y.addClass("disabled");break}var v=e(document.createElement("div"));v.addClass("day-content"),v.text(p.getDate()),y.append(v),this.options.customDayRenderer&&this.options.customDayRenderer(v,p)}D.append(y),p.setDate(p.getDate()+1)}while(p.getDay()!=f);o.append(D)}s.append(o),t.append(s)}this.element.append(t)},_renderDataSource:function(){var t=this;null!=this.options.dataSource&&this.options.dataSource.length>0&&this.element.find(".month-container").each(function(){var n=e(this).data("month-id"),a=new Date(t.options.startYear,n,1),s=new Date(t.options.startYear,n+1,0);if((null==t.options.minDate||s>=t.options.minDate)&&(null==t.options.maxDate||a<=t.options.maxDate)){var i=[];for(var o in t.options.dataSource)(!(t.options.dataSource[o].startDate>s)||t.options.dataSource[o].endDate<a)&&i.push(t.options.dataSource[o]);i.length>0&&e(this).find(".day-content").each(function(){var a=new Date(t.options.startYear,n,e(this).text()),s=[];if((null==t.options.minDate||a>=t.options.minDate)&&(null==t.options.maxDate||a<=t.options.maxDate)){for(var o in i)i[o].startDate<=a&&i[o].endDate>=a&&s.push(i[o]);s.length>0&&t._renderDataSourceDay(e(this),a,s)}})}})},_renderDataSourceDay:function(e,t,n){switch(this.options.style){case"border":var a=0;if(1==n.length?a=4:n.length<=3?a=2:e.parent().css("box-shadow","inset 0 -4px 0 0 black"),a>0){var s="";for(var i in n)""!=s&&(s+=","),s+="inset 0 -"+(parseInt(i)+1)*a+"px 0 0 "+n[i].color;e.parent().css("box-shadow",s)}break;case"background":e.parent().css("background-color",n[n.length-1].color);var o=t.getTime();if(n[n.length-1].startDate.getTime()==o)if(e.parent().addClass("day-start"),n[n.length-1].startHalfDay||this.options.alwaysHalfDay){e.parent().addClass("day-half");for(var r="transparent",i=n.length-2;i>=0;i--)if(n[i].startDate.getTime()!=o||!n[i].startHalfDay&&!this.options.alwaysHalfDay){r=n[i].color;break}e.parent().css("background","linear-gradient(-45deg, "+n[n.length-1].color+", "+n[n.length-1].color+" 49%, "+r+" 51%, "+r+")")}else this.options.roundRangeLimits&&e.parent().addClass("round-left");else if(n[n.length-1].endDate.getTime()==o)if(e.parent().addClass("day-end"),n[n.length-1].endHalfDay||this.options.alwaysHalfDay){e.parent().addClass("day-half");for(var r="transparent",i=n.length-2;i>=0;i--)if(n[i].endDate.getTime()!=o||!n[i].endHalfDay&&!this.options.alwaysHalfDay){r=n[i].color;break}e.parent().css("background","linear-gradient(135deg, "+n[n.length-1].color+", "+n[n.length-1].color+" 49%, "+r+" 51%, "+r+")")}else this.options.roundRangeLimits&&e.parent().addClass("round-right");break;case"custom":this.options.customDataSourceRenderer&&this.options.customDataSourceRenderer.call(this,e,t,n)}},_applyEvents:function(){var t=this;this.element.find(".year-neighbor, .year-neighbor2").click(function(){e(this).hasClass("disabled")||t.setYear(parseInt(e(this).text()))}),this.element.find(".calendar-header .prev").click(function(){e(this).hasClass("disabled")||t.element.find(".months-container").animate({"margin-left":"100%"},100,function(){t.element.find(".months-container").hide(),t.element.find(".months-container").css("margin-left","0"),setTimeout(function(){t.setYear(t.options.startYear-1)},50)})}),this.element.find(".calendar-header .next").click(function(){e(this).hasClass("disabled")||t.element.find(".months-container").animate({"margin-left":"-100%"},100,function(){t.element.find(".months-container").hide(),t.element.find(".months-container").css("margin-left","0"),setTimeout(function(){t.setYear(t.options.startYear+1)},50)})});var n=this.element.find(".day:not(.old, .new, .disabled)");n.click(function(n){n.stopPropagation();var a=t._getDate(e(this));t._triggerEvent("clickDay",{element:e(this),which:n.which,date:a,events:t.getEvents(a)})}),n.bind("contextmenu",function(n){t.options.enableContextMenu&&(n.preventDefault(),t.options.contextMenuItems.length>0&&t._openContextMenu(e(this)));var a=t._getDate(e(this));t._triggerEvent("dayContextMenu",{element:e(this),date:a,events:t.getEvents(a)})}),this.options.enableRangeSelection&&(n.mousedown(function(n){if(1==n.which){var a=t._getDate(e(this));(t.options.allowOverlap||0==t.getEvents(a).length)&&(t._mouseDown=!0,t._rangeStart=t._rangeEnd=a,t._refreshRange())}}),n.mouseenter(function(n){if(t._mouseDown){var a=t._getDate(e(this));if(!t.options.allowOverlap){var s=new Date(t._rangeStart.getTime());if(a>s)for(var i=new Date(s.getFullYear(),s.getMonth(),s.getDate()+1);a>s&&!(t.getEvents(i).length>0);)s.setDate(s.getDate()+1),i.setDate(i.getDate()+1);else for(var i=new Date(s.getFullYear(),s.getMonth(),s.getDate()-1);s>a&&!(t.getEvents(i).length>0);)s.setDate(s.getDate()-1),i.setDate(i.getDate()-1);a=s}var o=t._rangeEnd;t._rangeEnd=a,o.getTime()!=t._rangeEnd.getTime()&&t._refreshRange()}}),e(window).mouseup(function(e){if(t._mouseDown){t._mouseDown=!1,t._refreshRange();var n=t._rangeStart<t._rangeEnd?t._rangeStart:t._rangeEnd,a=t._rangeEnd>t._rangeStart?t._rangeEnd:t._rangeStart;t._triggerEvent("selectRange",{startDate:n,endDate:a})}})),n.mouseenter(function(n){if(!t._mouseDown){var a=t._getDate(e(this));t._triggerEvent("mouseOnDay",{element:e(this),date:a,events:t.getEvents(a)})}}),n.mouseleave(function(n){var a=t._getDate(e(this));t._triggerEvent("mouseOutDay",{element:e(this),date:a,events:t.getEvents(a)})}),setInterval(function(){var n=e(t.element).width(),a=e(t.element).find(".month").first().width()+10,s="month-container";s+=n>6*a?" col-xs-2":n>4*a?" col-xs-3":n>3*a?" col-xs-4":n>2*a?" col-xs-6":" col-xs-12",e(t.element).find(".month-container").attr("class",s)},300)},_refreshRange:function(){var t=this;if(this.element.find("td.day.range").removeClass("range"),this.element.find("td.day.range-start").removeClass("range-start"),this.element.find("td.day.range-end").removeClass("range-end"),this._mouseDown){var n=t._rangeStart<t._rangeEnd?t._rangeStart:t._rangeEnd,a=t._rangeEnd>t._rangeStart?t._rangeEnd:t._rangeStart;this.element.find(".month-container").each(function(){var s=e(this).data("month-id");n.getMonth()<=s&&a.getMonth()>=s&&e(this).find("td.day:not(.old, .new)").each(function(){var s=t._getDate(e(this));s>=n&&a>=s&&(e(this).addClass("range"),s.getTime()==n.getTime()&&e(this).addClass("range-start"),s.getTime()==a.getTime()&&e(this).addClass("range-end"))})})}},_openContextMenu:function(t){var n=e(".calendar-context-menu");n.length>0?(n.hide(),n.empty()):(n=e(document.createElement("div")),n.addClass("calendar-context-menu"),e("body").append(n));var a=this._getDate(t),s=this.getEvents(a);for(var i in s){var o=e(document.createElement("div"));o.addClass("item"),o.css("border-left","4px solid "+s[i].color);var r=e(document.createElement("div"));r.addClass("content"),r.text(s[i].name),o.append(r);var d=e(document.createElement("span"));d.addClass("glyphicon glyphicon-chevron-right"),o.append(d),this._renderContextMenuItems(o,this.options.contextMenuItems,s[i]),n.append(o)}n.children().length>0&&(n.css("left",t.offset().left+25+"px"),n.css("top",t.offset().top+25+"px"),n.show(),e(window).one("mouseup",function(){n.hide()}))},_renderContextMenuItems:function(t,n,a){var s=e(document.createElement("div"));s.addClass("submenu");for(var i in n)if(!n[i].visible||n[i].visible(a)){var o=e(document.createElement("div"));o.addClass("item");var r=e(document.createElement("div"));r.addClass("content"),r.text(n[i].text),o.append(r),n[i].click&&!function(e){o.click(function(){n[e].click(a)})}(i);var d=e(document.createElement("span"));d.addClass("glyphicon glyphicon-chevron-right"),o.append(d),n[i].items&&n[i].items.length>0&&this._renderContextMenuItems(o,n[i].items,a),s.append(o)}s.children().length>0&&t.append(s)},_getColor:function(t){var n=e("<div />");n.css("color",t)},_getDate:function(e){var t=e.children(".day-content").text(),n=e.closest(".month-container").data("month-id"),a=this.options.startYear;return new Date(a,n,t)},_triggerEvent:function(t,n){var a=e.Event(t);for(var s in n)a[s]=n[s];this.element.trigger(a)},getWeekNumber:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},getEvents:function(e){var t=[];if(this.options.dataSource&&e)for(var n in this.options.dataSource)this.options.dataSource[n].startDate<=e&&this.options.dataSource[n].endDate>=e&&t.push(this.options.dataSource[n]);return t},getYear:function(){return this.options.startYear},setYear:function(e){var t=parseInt(e);isNaN(t)||(this.options.startYear=t,this._render())},getMinDate:function(){return this.options.minDate},setMinDate:function(e){e instanceof Date&&(this.options.minDate=e,this._render())},getMaxDate:function(){return this.options.maxDate},setMaxDate:function(e){e instanceof Date&&(this.options.maxDate=e,this._render())},getStyle:function(){return this.options.style},setStyle:function(e){this.options.style="background"==e||"border"==e||"custom"==e?e:"border",this._render()},getAllowOverlap:function(){return this.options.allowOverlap},setAllowOverlap:function(e){this.options.allowOverlap=e},getDisplayWeekNumber:function(){return this.options.displayWeekNumber},setDisplayWeekNumber:function(e){this.options.displayWeekNumber=e,this._render()},getAlwaysHalfDay:function(){return this.options.alwaysHalfDay},setAlwaysHalfDay:function(e){this.options.alwaysHalfDay=e,this._render()},getEnableRangeSelection:function(){return this.options.enableRangeSelection},setEnableRangeSelection:function(e){this.options.enableRangeSelection=e,this._render()},getDisabledDays:function(){return this.options.disabledDays},setDisabledDays:function(e){this.options.disabledDays=e instanceof Array?e:[],this._render()},getRoundRangeLimits:function(){return this.options.roundRangeLimits},setRoundRangeLimits:function(e){this.options.roundRangeLimits=e,this._render()},getEnableContextMenu:function(){return this.options.enableContextMenu},setEnableContextMenu:function(e){this.options.enableContextMenu=e,this._render()},getContextMenuItems:function(){return this.options.contextMenuItems},setContextMenuItems:function(e){this.options.contextMenuItems=e instanceof Array?e:[],this._render()},getCustomDayRenderer:function(){return this.options.customDayRenderer},setCustomDayRenderer:function(t){this.options.customDayRenderer=e.isFunction(t)?t:null,this._render()},getCustomDataSourceRenderer:function(){return this.options.customDataSourceRenderer},setCustomDataSourceRenderer:function(t){this.options.customDataSourceRenderer=e.isFunction(t)?t:null,this._render()},getLanguage:function(){return this.options.language},setLanguage:function(e){null!=e&&null!=n[e]&&(this.options.language=e,this._render())},getDataSource:function(){return this.options.dataSource},setDataSource:function(e){this.options.dataSource=e instanceof Array?e:[],this._initializeDatasourceColors(),this._render()},addEvent:function(e){this.options.dataSource.push(e),this._render()}},e.fn.calendar=function(n){var a=new t(e(this),n);return e(this).data("calendar",a),a},e.fn.renderEnd=function(t){e(this).bind("renderEnd",t)},e.fn.clickDay=function(t){e(this).bind("clickDay",t)},e.fn.dayContextMenu=function(t){e(this).bind("dayContextMenu",t)},e.fn.selectRange=function(t){e(this).bind("selectRange",t)},e.fn.mouseOnDay=function(t){e(this).bind("mouseOnDay",t)},e.fn.mouseOutDay=function(t){e(this).bind("mouseOutDay",t)};var n=e.fn.calendar.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekShort:"W",weekStart:0}},a=e.fn.calendar.colors=["#2C8FC9","#9CB703","#F5BB00","#FF4A32","#B56CE2","#45A597"];e(function(){e('[data-provide="calendar"]').each(function(){e(this).calendar()})})}(window.jQuery);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.row#processes style="height:0px;overflow: hidden;-webkit-transition: all 0.5s ease-in-out;-o-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;"
|
2
|
+
.col-xs-12
|
3
|
+
.progress.progress-striped.active style="height:80px;"
|
4
|
+
.progress-bar aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar" style="width: 0%;text-align:left;"
|
5
|
+
.lv-item.p-20.p-fixed
|
6
|
+
.media
|
7
|
+
.pull-left
|
8
|
+
i.zmdi.zmdi-hc-3x.zmdi-settings.c-white.rotating
|
9
|
+
.media-body
|
10
|
+
.lv-title.c-white.title
|
11
|
+
small.lv-small.c-white.detail Espera por favor...
|
@@ -28,6 +28,9 @@ link href="/sinatra-hexacta/vendors/daterangepicker/daterangepicker.css" rel="st
|
|
28
28
|
/calendar
|
29
29
|
link href="/sinatra-hexacta/vendors/fullcalendar/main.min.css" rel="stylesheet"
|
30
30
|
|
31
|
+
/year calendar
|
32
|
+
link href="/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.css" rel="stylesheet"
|
33
|
+
|
31
34
|
/general app
|
32
35
|
link href="/sinatra-hexacta/css/app.min.1.css?version=#{settings.version}" rel="stylesheet"
|
33
36
|
link href="/sinatra-hexacta/css/app.min.2.css?version=#{settings.version}" rel="stylesheet"
|
@@ -34,3 +34,7 @@ script src="/sinatra-hexacta/vendors/daterangepicker/daterangepicker.js" type='t
|
|
34
34
|
/fullcalendar
|
35
35
|
script src="/sinatra-hexacta/vendors/fullcalendar/main.min.js" type='text/javascript'
|
36
36
|
script src="/sinatra-hexacta/vendors/fullcalendar/locales-all.min.js" type='text/javascript'
|
37
|
+
|
38
|
+
/year calendar
|
39
|
+
script src="/sinatra-hexacta/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.js" type='text/javascript'
|
40
|
+
script src="/sinatra-hexacta/vendors/bootstrap-year-calendar/bootstrap-year-calendar.es.js" type='text/javascript'
|
@@ -8,3 +8,4 @@ script src="/sinatra-hexacta/vendors/chartist/chartist-plugin-legend.js"
|
|
8
8
|
|
9
9
|
script src="/sinatra-hexacta/js/app.js?ver=#{settings.version}" type='text/javascript'
|
10
10
|
script src="/sinatra-hexacta/js/finder.js?ver=#{settings.version}" type='text/javascript'
|
11
|
+
script src="/sinatra-hexacta/js/process.js?ver=#{settings.version}" type='text/javascript'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-hexacta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
@@ -125,12 +125,17 @@ files:
|
|
125
125
|
- lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
|
126
126
|
- lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
|
127
127
|
- lib/sinatra/public/img/finder.jpg
|
128
|
+
- lib/sinatra/public/img/noimage.jpg
|
128
129
|
- lib/sinatra/public/img/select.png
|
129
130
|
- lib/sinatra/public/img/select@2x.png
|
130
131
|
- lib/sinatra/public/js/app.js
|
131
132
|
- lib/sinatra/public/js/finder.js
|
133
|
+
- lib/sinatra/public/js/process.js
|
132
134
|
- lib/sinatra/public/vendors/animate.css/animate.min.css
|
133
135
|
- lib/sinatra/public/vendors/bootstrap-validator/validator.js
|
136
|
+
- lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.es.js
|
137
|
+
- lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.css
|
138
|
+
- lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.min.js
|
134
139
|
- lib/sinatra/public/vendors/bootstrap/bootstrap.min.js
|
135
140
|
- lib/sinatra/public/vendors/chartist/chartist-plugin-legend.js
|
136
141
|
- lib/sinatra/public/vendors/chartist/chartist.min.css
|
@@ -171,6 +176,7 @@ files:
|
|
171
176
|
- lib/sinatra/views/alerts/empty.slim
|
172
177
|
- lib/sinatra/views/alerts/error.slim
|
173
178
|
- lib/sinatra/views/alerts/info.slim
|
179
|
+
- lib/sinatra/views/alerts/process.slim
|
174
180
|
- lib/sinatra/views/alerts/success.slim
|
175
181
|
- lib/sinatra/views/alerts/warning.slim
|
176
182
|
- lib/sinatra/views/charts/bar.slim
|