sinatra-hexacta 0.3.15 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfaf2ff3db1224e3e36a9969b568991b2e8b1cdceb152e6f38a4ab1c5eb42f8d
4
- data.tar.gz: a2c287bd2ef9a8fb5fea7fe435ada97ef45d0eecefbd9f77d9be3d3be07f4258
3
+ metadata.gz: e93327f1a9af39595f3d181a38731f5426574cd7d9d3b78c5862a4e42179fff2
4
+ data.tar.gz: 5689c062d590de61782ab4deb1932802a64ec70e6343f2d6b41eafef5cc8915f
5
5
  SHA512:
6
- metadata.gz: 31d9b12396ae6e69d7fc4f0f1ff8bec5795c36bdb5e1a1836b3ccb747d065ce5de5aaff947532b27b6cab7d0890d286a58aa1f9fc920802dd99374b7ddd8c128
7
- data.tar.gz: aabb71927d365a7550e6c127f0e24c98e618d102be411e950a735a2bca06ffbf0e57368826e6b000e25a0e90cc8150a62e96130598bbb2eafea90bf2f1e80f1b
6
+ metadata.gz: 9cda35449a8c44fd63017fc8280be87e6eda0f4dfc46c52acb85cefccf1093901441654e01297e056fa5f35d0bee638e67f323639dd86f421dab50c2daf8a260
7
+ data.tar.gz: 60109fb96322cf42c721fc4bec2d391d9499cb4ba593e8319c2e928e67ba57b92f43b6a567786a9e3bae991c84c7a35f7ad1d55709c62f68ca4856c706d88a67
@@ -10,17 +10,24 @@ module Sinatra
10
10
  error_template(404)
11
11
  error_template(403)
12
12
  error_template(500)
13
+ error_template(Sequel::DatabaseDisconnectError)
14
+ error_template(Sequel::DatabaseConnectionError)
13
15
  end
14
16
 
15
17
  def error_template(code)
16
- ErrorHandler.copy_file("/lib/sinatra/views/errors/#{code}.slim","/app/views/#{Hexacta::GEM_FILE_DIR}/errors/#{code}.slim")
18
+ if code.is_a? Numeric
19
+ template_code = code
20
+ else
21
+ template_code = code.to_s.split('::').last
22
+ end
23
+ ErrorHandler.copy_file("/lib/sinatra/views/errors/#{template_code}.slim","/app/views/#{Hexacta::GEM_FILE_DIR}/errors/#{template_code}.slim")
17
24
  error code do
18
25
  if code == 500
19
26
  title = env['sinatra.error'].message.split(':')[0].gsub('#<','');
20
27
  message = (["in #{request.url}"] + env['sinatra.error'].backtrace).join(',');
21
28
  NotificationSender.instance.send_error(authenticated(User),title,message)
22
29
  end
23
- slim "#{Hexacta::GEM_FILE_DIR}/errors/#{code}".to_sym, locals: { :params => params }
30
+ slim "#{Hexacta::GEM_FILE_DIR}/errors/#{template_code}".to_sym, locals: { :params => params }
24
31
  end
25
32
  end
26
33
 
@@ -11247,10 +11247,6 @@ body:not(.sw-toggled) #sidebar {
11247
11247
  }
11248
11248
  }
11249
11249
 
11250
- .listview.lv-lg .lv-item:hover {
11251
- background-color: #FFFFDB;
11252
- }
11253
-
11254
11250
  .listview .lv-item {
11255
11251
  position: relative;
11256
11252
  display: block;
@@ -16359,4 +16355,35 @@ svg.ct-chart-bar, svg.ct-chart-line{
16359
16355
  .ct-legend .ct-series-14:before {
16360
16356
  background-color: #a748ca;
16361
16357
  border-color: #a748ca;
16362
- }
16358
+ }
16359
+
16360
+ /* HEADER RESULTS */
16361
+
16362
+ #header .results {
16363
+ display:block;
16364
+ position: absolute;
16365
+ width: 500px;
16366
+ background: white;
16367
+ margin-left: 20px;
16368
+ margin-top: 5px;
16369
+ border-radius: 2px;
16370
+ overflow: auto;
16371
+ max-height: 0px;
16372
+ opacity: 0;
16373
+ -webkit-transition: all 0.2s ease-in-out;
16374
+ -o-transition: all 0.2s ease-in-out;
16375
+ transition: all 0.2s ease-in-out;
16376
+ }
16377
+ #header .results.toggled {
16378
+ opacity: 1;
16379
+ max-height: 400px;
16380
+ }
16381
+
16382
+ .progressive {
16383
+ animation: load 5s cubic-bezier(0.165, 0.840, 0.440, 1.000) forwards;
16384
+ }
16385
+
16386
+ @keyframes load {
16387
+ 0% { width: 0; }
16388
+ 100% { width: 100%; }
16389
+ }
@@ -0,0 +1,73 @@
1
+ class Finder {
2
+
3
+ static find(query){
4
+ $.ajax({
5
+ url: "/find",
6
+ type: 'GET',
7
+ data: { query: query }
8
+ }).done(function(result) {
9
+ $("#header .results").html(result);
10
+ });
11
+ }
12
+
13
+ static do_find(url,query,html){
14
+ $.ajax({
15
+ url: url,
16
+ type: 'GET',
17
+ data: { query: query }
18
+ }).done(function(result) {
19
+ $(html).html(result);
20
+ });
21
+ }
22
+ }
23
+
24
+ var header_input_timeout = null;
25
+ $.xhrPool = [];
26
+
27
+ $.xhrPool.abortAll = function() {
28
+ $(this).each(function(idx, jqXHR) {
29
+ jqXHR.abort();
30
+ });
31
+ $(this).each(function(idx, jqXHR) {
32
+ var index = $.inArray(jqXHR, $.xhrPool);
33
+ if (index > -1) {
34
+ $.xhrPool.splice(index, 1);
35
+ }
36
+ });
37
+ };
38
+
39
+ $.ajaxSetup({
40
+ beforeSend: function(jqXHR) {
41
+ $.xhrPool.push(jqXHR);
42
+ },
43
+ complete: function(jqXHR) {
44
+ var index = $.inArray(jqXHR, $.xhrPool);
45
+ if (index > -1) {
46
+ $.xhrPool.splice(index, 1);
47
+ }
48
+ }
49
+ });
50
+
51
+ $(document).ready(function(){
52
+
53
+ $("#header input").focusin(function() {
54
+ $("#header .results").addClass("toggled");
55
+ })
56
+ $("#header input").focusout(function() {
57
+ $("#header .results").removeClass("toggled");
58
+ })
59
+ $('#header .results').click(function() {
60
+ $("#header input").focus();
61
+ });
62
+
63
+ $('#header input').keyup(function() {
64
+ clearTimeout(header_input_timeout);
65
+
66
+ if($('#header input').val().length > 2 && $.trim($('#header input').val())) {
67
+ header_input_timeout = setTimeout(function() {
68
+ $.xhrPool.abortAll();
69
+ Finder.find($('#header input').val());
70
+ }, 500);
71
+ }
72
+ });
73
+ });
@@ -1,4 +1,4 @@
1
- .lv-item.p-20.bgm-blue.m-b-5
1
+ .lv-item.p-20.bgm-blue
2
2
  .media
3
3
  .pull-left
4
4
  i.zmdi.zmdi-hc-3x.zmdi-info.c-white
@@ -0,0 +1,27 @@
1
+ .row
2
+ .col-xs-12
3
+ .progress.progress-striped.active.bgm-red style="height:80px;"
4
+ .progress-bar.progress-bar-danger 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-cloud-off.c-white
9
+ .media-body
10
+ .lv-title.c-white Error de conexión con la base de datos
11
+ small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
12
+
13
+
14
+ javascript:
15
+ $(document).ready(function() {
16
+ setTimeout(function(){
17
+ window.location.reload(1);
18
+ }, 5000);
19
+
20
+ update_progress();
21
+
22
+ function update_progress() {
23
+ var current = $(".progress-bar").width() / $('.progress-bar').parent().width() * 100;
24
+ $(".progress-bar").width( current + 10 + "%");
25
+ setTimeout(update_progress, 100);
26
+ }
27
+ });
@@ -0,0 +1,29 @@
1
+ .row
2
+ .col-xs-12
3
+ .progress.progress-striped.active.bgm-orange style="height:80px;"
4
+ .progress-bar.progress-bar-warning 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-cloud-off.c-white
9
+ .media-body
10
+ .lv-title.c-white Conexión con la base de datos
11
+ small.lv-small.c-white Espera unos segundos mientras se reestablece la conexión.
12
+
13
+
14
+
15
+ javascript:
16
+ $(document).ready(function() {
17
+ setTimeout(function(){
18
+ window.location.reload(1);
19
+ }, 5000);
20
+
21
+ update_progress();
22
+
23
+ function update_progress() {
24
+ var current = $(".progress-bar").width() / $('.progress-bar').parent().width() * 100;
25
+ $(".progress-bar").width( current + 10 + "%");
26
+ setTimeout(update_progress, 100);
27
+ }
28
+ });
29
+
@@ -6,3 +6,4 @@ script src="/sinatra-hexacta/vendors/chartist/chartist.min.js"
6
6
  script src="/sinatra-hexacta/vendors/chartist/chartist-plugin-legend.js"
7
7
 
8
8
  script src="/sinatra-hexacta/js/app.js?ver=#{settings.version}" type='text/javascript'
9
+ script src="/sinatra-hexacta/js/finder.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.3.15
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -110,10 +110,11 @@ files:
110
110
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.svg
111
111
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
112
112
  - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
113
+ - lib/sinatra/public/img/finder.jpg
113
114
  - lib/sinatra/public/img/select.png
114
115
  - lib/sinatra/public/img/select@2x.png
115
116
  - lib/sinatra/public/js/app.js
116
- - lib/sinatra/public/js/form_validator.js
117
+ - lib/sinatra/public/js/finder.js
117
118
  - lib/sinatra/public/vendors/animate.css/animate.min.css
118
119
  - lib/sinatra/public/vendors/bootstrap-validator/validator.js
119
120
  - lib/sinatra/public/vendors/bootstrap/bootstrap.min.js
@@ -157,6 +158,8 @@ files:
157
158
  - lib/sinatra/views/errors/403.slim
158
159
  - lib/sinatra/views/errors/404.slim
159
160
  - lib/sinatra/views/errors/500.slim
161
+ - lib/sinatra/views/errors/DatabaseConnectionError.slim
162
+ - lib/sinatra/views/errors/DatabaseDisconnectError.slim
160
163
  - lib/sinatra/views/inputs/date.slim
161
164
  - lib/sinatra/views/inputs/input.slim
162
165
  - lib/sinatra/views/inputs/month.slim
@@ -1,29 +0,0 @@
1
-
2
- $(':input[required]').each(function() {
3
- console.log($(this).val());
4
- if ($(this).val() == "" || $(this).val() == null) {
5
- $(this).parent().removeClass("has-success");
6
- $(this).parent().addClass("has-error");
7
- } else {
8
- $(this).parent().removeClass("has-error");
9
- $(this).parent().addClass("has-success");
10
- }
11
- })
12
-
13
-
14
- $(function() { //shorthand document.ready function
15
- $('form').on('submit', function(e) { //use on if jQuery 1.7+
16
- $(this).find(':input[required]').each(function() {
17
- if ($(this).val() == "" || $(this).val() == null) {
18
- $(this).parent().removeClass("success");
19
- $(this).parent().addClass("error");
20
- } else {
21
- $(this).parent().removeClass("error");
22
- $(this).parent().addClass("success");
23
- }
24
- })
25
- if ($(this).find(':input[required]').length > 0) {
26
- e.preventDefault();
27
- }
28
- });
29
- });