sinatra-hexacta 0.3.7 → 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: 13a1128e0dc835950253887ee65a8f1f94ce1a15de078e9a165ea021f102df5b
4
- data.tar.gz: b5421aa1195eb39f3393e2f3a14b7e96d6e3856c3117dfbfe0a0b266db6c57f7
3
+ metadata.gz: ade8d77e4a11dd25fac0d078c8c80956e6969beaa4cad5745f6f75720d146966
4
+ data.tar.gz: dae2ef0fe98be2e088b40dec42901d1d012a077815dc10e64e90fdbecfe53a49
5
5
  SHA512:
6
- metadata.gz: 73b9769956ce9793c62a840fa9b5b51528cf63eb3acc68edd6cd5c812c41cc8cf47c3f5728cd02bcc8a35e7d45a349b5cc5d3ba93ce628851343a7342b583504
7
- data.tar.gz: 00b0874df5506aa8654c8ba198de9698424c07e195d7883b61494c966891235c917ec8b2ef786a3221572f3a059b45a66f39f1350dfce088f27ccd4afdc9e084
6
+ metadata.gz: dd319e6461b25be1994ed4a2d6a3c1f3b39dfe6a722952ce4b2ac239568f2a56b1cfa2020d181d652da50caf0606fb8da31cec5bb292385aef55b731c5f5c7ef
7
+ data.tar.gz: a4a78b99e4763ea4e8f51c1304ea9063ceff8700a01bbabed082452144d87f79558849faa48db62a51e002eac4902c0504a85ef67c3157ea90fb069da431e9da
@@ -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'
@@ -6,14 +6,24 @@
6
6
  - placeholder = "..."
7
7
  -unless defined? onkeyup
8
8
  -onkeyup = ''
9
+ -unless defined? readonly
10
+ -readonly = false
11
+
9
12
 
10
13
  -if required
11
14
  .form-group.has-feedback.has-success
12
15
  label #{title}
13
16
  .fg-line
14
- input.form-control.fg-input id="#{id}" type="#{type}" placeholder=("#{placeholder}") name="#{name}" required="" value="#{value}" onkeyup="#{onkeyup}"
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
+
15
22
  -else
16
23
  .form-group
17
24
  label #{title}
18
25
  .fg-line
19
- input.form-control.fg-input id="#{id}" type="#{type}" placeholder=("#{placeholder}") name="#{name}" value="#{value}" onkeyup="#{onkeyup}"
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}"
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.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -80,7 +80,6 @@ files:
80
80
  - lib/sinatra/helpers/libraries.rb
81
81
  - lib/sinatra/helpers/reports.rb
82
82
  - lib/sinatra/helpers/schedule.rb
83
- - lib/sinatra/helpers/subscriptions.rb
84
83
  - lib/sinatra/hexacta.rb
85
84
  - lib/sinatra/public/css/app.min.1.css
86
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