sinatra-hexacta 0.3.3 → 0.3.8

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: 88ea51caa7a52f637935c32abc1f7afa106c04edaa2272883fbae5e893f97d63
4
- data.tar.gz: fd772074d655d5a9d1e3c4b55f946e26ce48c7ba11c9d5e53595d33da1e795fd
3
+ metadata.gz: ade8d77e4a11dd25fac0d078c8c80956e6969beaa4cad5745f6f75720d146966
4
+ data.tar.gz: dae2ef0fe98be2e088b40dec42901d1d012a077815dc10e64e90fdbecfe53a49
5
5
  SHA512:
6
- metadata.gz: d74e7e326295bcaf359eb3dba3e9e1c272d29d49d3b1dda7996b43c7b72ebf23e4179afa37b4be7b8e468e7f4065bc3fef49c6a8529d263d1b737d4ca8dfca07
7
- data.tar.gz: f7dc72f4b88e48dcebce5a626de936f291b5e0eaf9e6a8b1aa02ae443a588d4cfb7f873d53a1b80f3898737102a586a43d06eda17714c58444c7d5f5332d504d
6
+ metadata.gz: dd319e6461b25be1994ed4a2d6a3c1f3b39dfe6a722952ce4b2ac239568f2a56b1cfa2020d181d652da50caf0606fb8da31cec5bb292385aef55b731c5f5c7ef
7
+ data.tar.gz: a4a78b99e4763ea4e8f51c1304ea9063ceff8700a01bbabed082452144d87f79558849faa48db62a51e002eac4902c0504a85ef67c3157ea90fb069da431e9da
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+ class GeneralMailNoLink < Mail
3
+
4
+ def initialize(args)
5
+ super(args)
6
+ @subject = args[:subject]
7
+ @description = args[:description]
8
+ end
9
+
10
+ def template
11
+ 'general_no_link'
12
+ end
13
+
14
+ def subject
15
+ @subject
16
+ end
17
+
18
+ def values
19
+ data = {}
20
+ data["{description}"] = @description
21
+ data
22
+ end
23
+
24
+ end
@@ -28,11 +28,20 @@ class MailBuilder
28
28
 
29
29
  def send
30
30
  @from ||= "apps@hexacta.com"
31
- GeneralMail.new({ :to => @to,
32
- :from => @from,
33
- :subject => @subject,
34
- :description => @description,
35
- :link => @link
36
- }).send
31
+ if @link.nil?
32
+ GeneralMailNoLink.new({ :to => @to,
33
+ :from => @from,
34
+ :subject => @subject,
35
+ :description => @description
36
+ }).send
37
+ else
38
+ GeneralMail.new({ :to => @to,
39
+ :from => @from,
40
+ :subject => @subject,
41
+ :description => @description,
42
+ :link => @link
43
+ }).send
44
+
45
+ end
37
46
  end
38
47
  end
@@ -2,7 +2,6 @@
2
2
  require_relative 'libraries'
3
3
  require_relative 'inputs'
4
4
  require_relative 'charts'
5
- require_relative 'subscriptions'
6
5
  require_relative 'cas'
7
6
  require_relative 'schedule'
8
7
  require_relative 'alerts'
@@ -36,7 +36,7 @@ $(document).ready(function(){
36
36
  }
37
37
  });
38
38
  if ($(this).find('.error').length == 0 ) {
39
- $(this).find('#submit').attr('disabled','disabled');
39
+ $(this).find(':submit').attr('disabled','disabled');
40
40
  }
41
41
  });
42
42
 
@@ -469,7 +469,7 @@ $(document).ready(function(){
469
469
  * Modal hide
470
470
  */
471
471
  $('.modal').bind('shown.bs.modal', function (e) {
472
- $(this).find('#submit').attr("disabled",false);
472
+ $(this).find(':submit').attr("disabled",false);
473
473
  });
474
474
 
475
475
  });
@@ -4,15 +4,26 @@
4
4
  - id = "#{name}_#{rand(1000)}"
5
5
  - unless defined? placeholder
6
6
  - placeholder = "..."
7
+ -unless defined? onkeyup
8
+ -onkeyup = ''
9
+ -unless defined? readonly
10
+ -readonly = false
7
11
 
8
12
 
9
13
  -if required
10
14
  .form-group.has-feedback.has-success
11
15
  label #{title}
12
16
  .fg-line
13
- input.form-control.fg-input id="#{id}" type="#{type}" placeholder=("#{placeholder}") name="#{name}" required="" value="#{value}"
17
+ -if readonly
18
+ input.form-control.fg-input id="#{id}" type="#{type}" placeholder="#{placeholder}" name="#{name}" required="" value="#{value}" onkeyup="#{onkeyup}" readonly=''
19
+ -else
20
+ input.form-control.fg-input id="#{id}" type="#{type}" placeholder="#{placeholder}" name="#{name}" required="" value="#{value}" onkeyup="#{onkeyup}"
21
+
14
22
  -else
15
23
  .form-group
16
24
  label #{title}
17
25
  .fg-line
18
- input.form-control.fg-input id="#{id}" type="#{type}" placeholder=("#{placeholder}") name="#{name}" value="#{value}"
26
+ -if readonly
27
+ input.form-control.fg-input id="#{id}" type="#{type}" placeholder="#{placeholder}" name="#{name}" value="#{value}" onkeyup="#{onkeyup}" readonly=''
28
+ -else
29
+ input.form-control.fg-input id="#{id}" type="#{type}" placeholder="#{placeholder}" name="#{name}" value="#{value}" onkeyup="#{onkeyup}"
@@ -4,11 +4,13 @@
4
4
  - id = "#{name}_#{rand(1000)}"
5
5
  - unless defined? placeholder
6
6
  - placeholder = "Escribe aquí..."
7
+ - unless defined? rows
8
+ - rows = 5
7
9
 
8
10
  .form-group
9
11
  .fg-line
10
12
  label.fg-label #{title}
11
13
  - if required
12
- textarea.form-control name="#{name}" placeholder=("#{placeholder}") rows="5" maxlength="#{length}" required="" #{value}
14
+ textarea.form-control id="#{id}" name="#{name}" placeholder=("#{placeholder}") rows="#{rows}" maxlength="#{length}" required="" #{value}
13
15
  - else
14
- textarea.form-control name="#{name}" placeholder=("#{placeholder}") rows="5" maxlength="#{length}" #{value}
16
+ textarea.form-control id="#{id}" name="#{name}" placeholder=("#{placeholder}") rows="#{rows}" maxlength="#{length}" #{value}
@@ -18,4 +18,4 @@
18
18
 
19
19
  .modal-footer
20
20
  button.btn.btn-link.waves-effect data-dismiss="modal" type="button" Cerrar
21
- button.btn.btn-link.waves-effect#submit Enviar
21
+ button.btn.btn-link.waves-effect type="submit" Enviar
@@ -11,4 +11,4 @@
11
11
 
12
12
  .modal-footer
13
13
  button.btn.btn-link.waves-effect data-dismiss="modal" type="button" Cerrar
14
- button.btn.btn-link.waves-effect#submit Descargar reporte
14
+ button.btn.btn-link.waves-effect type="submit" Descargar reporte
@@ -13,4 +13,4 @@
13
13
 
14
14
  .modal-footer
15
15
  button.btn.btn-link.waves-effect data-dismiss="modal" type="button" Cerrar
16
- button.btn.btn-link.waves-effect#submit Descargar reporte
16
+ button.btn.btn-link.waves-effect type="submit" Descargar reporte
@@ -11,4 +11,4 @@
11
11
 
12
12
  .modal-footer
13
13
  button.btn.btn-link.waves-effect data-dismiss="modal" type="button" Cerrar
14
- button.btn.btn-link.waves-effect#submit Descargar reporte
14
+ button.btn.btn-link.waves-effect type="submit" Descargar reporte
@@ -11,4 +11,4 @@
11
11
 
12
12
  .modal-footer
13
13
  button.btn.btn-link.waves-effect data-dismiss="modal" type="button" Cerrar
14
- button.btn.btn-link.waves-effect#submit Descargar reporte
14
+ button.btn.btn-link.waves-effect type="submit" Descargar reporte
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.3
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -61,6 +61,7 @@ files:
61
61
  - lib/sinatra/extensions/antiquity.rb
62
62
  - lib/sinatra/extensions/date.rb
63
63
  - lib/sinatra/extensions/generalmail.rb
64
+ - lib/sinatra/extensions/generalmailnolink.rb
64
65
  - lib/sinatra/extensions/init.rb
65
66
  - lib/sinatra/extensions/mail.rb
66
67
  - lib/sinatra/extensions/mailbuilder.rb
@@ -79,7 +80,6 @@ files:
79
80
  - lib/sinatra/helpers/libraries.rb
80
81
  - lib/sinatra/helpers/reports.rb
81
82
  - lib/sinatra/helpers/schedule.rb
82
- - lib/sinatra/helpers/subscriptions.rb
83
83
  - lib/sinatra/hexacta.rb
84
84
  - lib/sinatra/public/css/app.min.1.css
85
85
  - lib/sinatra/public/css/app.min.2.css
@@ -1,44 +0,0 @@
1
- # encoding: utf-8
2
- module Sinatra
3
- module SubscriptionHelper
4
-
5
- def notify_to(user,creator,title,message,label,link=nil)
6
- notification = Notification.find_or_create(:user_id => user.id,
7
- :creator_id => creator.id,
8
- :title => title,
9
- :message => message,
10
- :label => label,
11
- :link => link,
12
- :creation_date => Date.today)
13
- if link.nil?
14
- notification.link = "/notifications/#{notification.id}"
15
- notification.save
16
- end
17
- notification
18
- end
19
-
20
- def notify(creator,title,message,label,link=nil)
21
- Subscription.where(:label => label).all.each do |subscription|
22
- notification = notify_to(subscription.user,creator,title,message,label,link)
23
- end
24
- end
25
-
26
- def notify_error(creator,title,message)
27
- Subscription.where(:label => 'error').all.each do |subscription|
28
- creator = subscription.user if creator.nil?
29
- notification = Notification.find(:user_id => subscription.user_id,
30
- :creator_id => creator.id,
31
- :title => title,
32
- :message => message,
33
- :label => 'error',
34
- :read_date => nil)
35
- if notification.nil?
36
- notification = notify_to(subscription.user,creator,title,message,'error')
37
- end
38
- end
39
-
40
- end
41
- end
42
-
43
- helpers SubscriptionHelper
44
- end