sinatra-hexacta 1.7.3 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sinatra/extensions/date.rb +1 -1
- data/lib/sinatra/extensions/date_time.rb +12 -0
- data/lib/sinatra/extensions/init.rb +1 -0
- data/lib/sinatra/public/js/app.js +72 -58
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aedcbf3c2bb769f1f78b351b42f5f65e0171624401e1fb136cc1d198635344e4
|
4
|
+
data.tar.gz: 9fe730e6c6acd693bebab4559366dcf7992ff1f6cd3ec935632fdfee27b0a1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ad947c31a166651792b67ef220958d3c7384c576a8c010db018877102d14fd6dc5736788e0545cca6c6613c73730cd5c4691fc065421f7a77f2e514512ee01
|
7
|
+
data.tar.gz: 0f785d4d9da08111214c39f34d066729aaf329815163a3b17e2d60bc1f73e7081dd0eefead30d786ded60caabd98271a04bbff8dcab3293ecf701ed20a44d3dd
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
class DateTime
|
3
|
+
|
4
|
+
def display
|
5
|
+
"#{Configuration::DAYS[self.wday]} #{self.day} de #{Configuration::MONTHS[self.month-1]} #{self.year == Date.today.year ? '' : self.year}"
|
6
|
+
end
|
7
|
+
|
8
|
+
def short_display
|
9
|
+
self.strftime('%-d/%-m/%Y')
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -27,6 +27,31 @@ function update_html_elements() {
|
|
27
27
|
|
28
28
|
$("form.async").unbind("submit").submit(function(e){
|
29
29
|
e.preventDefault();
|
30
|
+
|
31
|
+
|
32
|
+
$(this).find(':input[required]').each(function() {
|
33
|
+
if ($(this).val() == "" || $(this).val() == null) {
|
34
|
+
$(this).parent().removeClass("success");
|
35
|
+
$(this).parent().addClass("error");
|
36
|
+
} else {
|
37
|
+
$(this).parent().removeClass("error");
|
38
|
+
$(this).parent().addClass("success");
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
$(this).find('.chosen[required]').each(function() {
|
43
|
+
if ($(this).val() == "" || $(this).val() == null) {
|
44
|
+
$(this).parent().removeClass("success");
|
45
|
+
$(this).parent().addClass("error");
|
46
|
+
} else {
|
47
|
+
$(this).parent().removeClass("error");
|
48
|
+
$(this).parent().addClass("success");
|
49
|
+
}
|
50
|
+
});
|
51
|
+
if ($(this).find('.error').length > 0 ) {
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
|
30
55
|
var datastring = $(this).serialize();
|
31
56
|
var url = $(this).attr('action');
|
32
57
|
$(this).closest('.modal').modal('hide');
|
@@ -125,63 +150,6 @@ function update_html_elements() {
|
|
125
150
|
}
|
126
151
|
}
|
127
152
|
|
128
|
-
/*
|
129
|
-
* Sidebar
|
130
|
-
*/
|
131
|
-
(function(){
|
132
|
-
//Toggle
|
133
|
-
$('body').on('click', '#menu-trigger', function(e){
|
134
|
-
e.preventDefault();
|
135
|
-
var x = $(this).data('trigger');
|
136
|
-
|
137
|
-
$(x).toggleClass('toggled');
|
138
|
-
$(this).toggleClass('open');
|
139
|
-
|
140
|
-
//Close opened sub-menus
|
141
|
-
$('.sub-menu.toggled').not('.active').each(function(){
|
142
|
-
$(this).removeClass('toggled');
|
143
|
-
$(this).find('ul').hide();
|
144
|
-
});
|
145
|
-
|
146
|
-
$('.profile-menu .main-menu').hide();
|
147
|
-
|
148
|
-
if (x == '#sidebar') {
|
149
|
-
|
150
|
-
$elem = '#sidebar';
|
151
|
-
$elem2 = '#menu-trigger';
|
152
|
-
|
153
|
-
$('#chat-trigger').removeClass('open');
|
154
|
-
|
155
|
-
if (!$('#chat').hasClass('toggled')) {
|
156
|
-
$('#header').toggleClass('sidebar-toggled');
|
157
|
-
}
|
158
|
-
else {
|
159
|
-
$('#chat').removeClass('toggled');
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
//When clicking outside
|
164
|
-
if ($('#header').hasClass('sidebar-toggled')) {
|
165
|
-
$(document).on('click', function (e) {
|
166
|
-
if (($(e.target).closest($elem).length === 0) && ($(e.target).closest($elem2).length === 0)) {
|
167
|
-
setTimeout(function(){
|
168
|
-
$($elem).removeClass('toggled');
|
169
|
-
$('#header').removeClass('sidebar-toggled');
|
170
|
-
$($elem2).removeClass('open');
|
171
|
-
});
|
172
|
-
}
|
173
|
-
});
|
174
|
-
}
|
175
|
-
})
|
176
|
-
|
177
|
-
//Submenu
|
178
|
-
$('body').on('click', '.sub-menu > a', function(e){
|
179
|
-
e.preventDefault();
|
180
|
-
$(this).next().slideToggle(200);
|
181
|
-
$(this).parent().toggleClass('toggled');
|
182
|
-
});
|
183
|
-
})();
|
184
|
-
|
185
153
|
/*
|
186
154
|
* Clear Notification
|
187
155
|
*/
|
@@ -539,6 +507,48 @@ function update_html_elements() {
|
|
539
507
|
$(this).find(':submit').attr("disabled",false);
|
540
508
|
});
|
541
509
|
|
510
|
+
/*
|
511
|
+
* Sidebar
|
512
|
+
*/
|
513
|
+
(function(){
|
514
|
+
//Toggle
|
515
|
+
$('#menu-trigger').unbind('click').on('click', function(e){
|
516
|
+
e.preventDefault();
|
517
|
+
var x = $(this).data('trigger');
|
518
|
+
|
519
|
+
$(x).toggleClass('toggled');
|
520
|
+
$(this).toggleClass('open');
|
521
|
+
|
522
|
+
//Close opened sub-menus
|
523
|
+
$('.sub-menu.toggled').not('.active').each(function(){
|
524
|
+
$(this).removeClass('toggled');
|
525
|
+
$(this).find('ul').hide();
|
526
|
+
});
|
527
|
+
|
528
|
+
$('.profile-menu .main-menu').hide();
|
529
|
+
|
530
|
+
//When clicking outside
|
531
|
+
if ($('#header').hasClass('sidebar-toggled')) {
|
532
|
+
$(document).on('click', function (e) {
|
533
|
+
if (($(e.target).closest($elem).length === 0) && ($(e.target).closest($elem2).length === 0)) {
|
534
|
+
setTimeout(function(){
|
535
|
+
$($elem).removeClass('toggled');
|
536
|
+
$('#header').removeClass('sidebar-toggled');
|
537
|
+
$($elem2).removeClass('open');
|
538
|
+
});
|
539
|
+
}
|
540
|
+
});
|
541
|
+
}
|
542
|
+
})
|
543
|
+
|
544
|
+
//Submenu
|
545
|
+
$('.sub-menu > a').unbind('click').on('click', function(e){
|
546
|
+
e.preventDefault();
|
547
|
+
$(this).next().slideToggle(200);
|
548
|
+
$(this).parent().toggleClass('toggled');
|
549
|
+
});
|
550
|
+
|
551
|
+
})();
|
542
552
|
}
|
543
553
|
|
544
554
|
const elementToObserve = document.querySelector("body");
|
@@ -670,5 +680,9 @@ function read_notify(id,url) {
|
|
670
680
|
}
|
671
681
|
|
672
682
|
function capitalize(word) {
|
673
|
-
|
683
|
+
if (word == "") {
|
684
|
+
return "";
|
685
|
+
} else {
|
686
|
+
return word[0].toUpperCase() + word.slice(1).toLowerCase();
|
687
|
+
}
|
674
688
|
}
|
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: 1.7.
|
4
|
+
version: 1.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
@@ -88,6 +88,7 @@ extra_rdoc_files: []
|
|
88
88
|
files:
|
89
89
|
- lib/sinatra/extensions/antiquity.rb
|
90
90
|
- lib/sinatra/extensions/date.rb
|
91
|
+
- lib/sinatra/extensions/date_time.rb
|
91
92
|
- lib/sinatra/extensions/generalmail.rb
|
92
93
|
- lib/sinatra/extensions/generalmailnolink.rb
|
93
94
|
- lib/sinatra/extensions/init.rb
|