sinatra-hexacta 0.3.7 → 0.3.8
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/helpers/init.rb +0 -1
- data/lib/sinatra/views/inputs/input.slim +12 -2
- metadata +1 -2
- data/lib/sinatra/helpers/subscriptions.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ade8d77e4a11dd25fac0d078c8c80956e6969beaa4cad5745f6f75720d146966
|
4
|
+
data.tar.gz: dae2ef0fe98be2e088b40dec42901d1d012a077815dc10e64e90fdbecfe53a49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd319e6461b25be1994ed4a2d6a3c1f3b39dfe6a722952ce4b2ac239568f2a56b1cfa2020d181d652da50caf0606fb8da31cec5bb292385aef55b731c5f5c7ef
|
7
|
+
data.tar.gz: a4a78b99e4763ea4e8f51c1304ea9063ceff8700a01bbabed082452144d87f79558849faa48db62a51e002eac4902c0504a85ef67c3157ea90fb069da431e9da
|
data/lib/sinatra/helpers/init.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
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
|