sinatra-hexacta 0.8.8 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/extensions/init.rb +1 -0
- data/lib/sinatra/extensions/menu.rb +27 -0
- data/lib/sinatra/helpers/init.rb +1 -0
- data/lib/sinatra/helpers/menu.rb +15 -0
- data/lib/sinatra/public/css/app.min.1.css +16 -0
- data/lib/sinatra/views/menu/menu.slim +68 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aaec32790752b72c99527ea6fab74f017349baa383b7e34c806d0d51abc97be
|
4
|
+
data.tar.gz: e2eea2b2586a3c8fa5ba99981b1c2bcb5896566721dba5ffc7e5194f9e0af4cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc9c270af10de54c5bb1d7e56c1b901892dc4dc035267fb439101ea94797a7d11942fe925cc0f740123894b327a2926f18e154008faf5e8a0df79fc39d29aaea
|
7
|
+
data.tar.gz: 7fac0d0de897c15fcf63055e7c3b650f95dad234ad3bf599f019cc9bfa57b7cd8249df4ec8fe225220e18b40b1a0c78d2c867b004153a20e40e80dcfa5d05d24
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
class MenuBuilder
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@elements = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def dropdown(text,icon,submenu)
|
9
|
+
@elements << { :type => 'dropdown' , :text => text, :icon => icon, :link => submenu }
|
10
|
+
return self
|
11
|
+
end
|
12
|
+
|
13
|
+
def link(text,icon,link,target)
|
14
|
+
@elements << { :type => 'link' , :text => text, :icon => icon, :link => link, :target => target }
|
15
|
+
return self
|
16
|
+
end
|
17
|
+
|
18
|
+
def modal(text,icon,link)
|
19
|
+
@elements << { :type => 'modal' , :text => text, :icon => icon, :link => link }
|
20
|
+
return self
|
21
|
+
end
|
22
|
+
|
23
|
+
def build
|
24
|
+
@elements
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/lib/sinatra/helpers/init.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Sinatra
|
3
|
+
module MenuHelper
|
4
|
+
extend Hexacta
|
5
|
+
|
6
|
+
def menu(option_hash)
|
7
|
+
slim "#{Hexacta::GEM_FILE_DIR}/menu/menu".to_sym, locals: option_hash
|
8
|
+
end
|
9
|
+
|
10
|
+
setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/menu")
|
11
|
+
copy_all_files("/lib/sinatra/views/menu","/app/views/#{Hexacta::GEM_FILE_DIR}/menu")
|
12
|
+
end
|
13
|
+
|
14
|
+
helpers MenuHelper
|
15
|
+
end
|
@@ -13894,6 +13894,22 @@ fieldset[disabled] .btn-inverse:active {
|
|
13894
13894
|
bottom: 340px;
|
13895
13895
|
}
|
13896
13896
|
|
13897
|
+
.footer-text :nth-child(7), .footer-btn :nth-child(7) {
|
13898
|
+
bottom: 400px;
|
13899
|
+
}
|
13900
|
+
|
13901
|
+
.footer-text :nth-child(8), .footer-btn :nth-child(8) {
|
13902
|
+
bottom: 460px;
|
13903
|
+
}
|
13904
|
+
|
13905
|
+
.footer-text :nth-child(9), .footer-btn :nth-child(9) {
|
13906
|
+
bottom: 520px;
|
13907
|
+
}
|
13908
|
+
|
13909
|
+
.footer-text :nth-child(10), .footer-btn :nth-child(10) {
|
13910
|
+
bottom: 580px;
|
13911
|
+
}
|
13912
|
+
|
13897
13913
|
.footer-text .text {
|
13898
13914
|
position: fixed;
|
13899
13915
|
right: 100px;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
.footer-text
|
2
|
+
a.text.btn.bgm-white.c-gray onclick='toggle_menu()' Menu
|
3
|
+
|
4
|
+
.actions-menu.hidden
|
5
|
+
-for item in menu
|
6
|
+
-idx = menu.index(item) + 1
|
7
|
+
-if item[:type] == 'link'
|
8
|
+
a.text.btn.bgm-white.c-gray type="button" href="#{item[:link]}" target="#{item[:target]}" style="bottom:#{50+idx*45}px;animation-duration: 0.#{idx+1}s" #{item[:text]}
|
9
|
+
-if item[:type] == 'modal'
|
10
|
+
a.text.btn.bgm-white.c-gray type="button" data-toggle="modal" data-target="#{item[:link]}" style="bottom:#{50+idx*45}px;animation-duration: 0.#{idx+1}s" #{item[:text]}
|
11
|
+
|
12
|
+
.footer-btn
|
13
|
+
a.btn.btn-float.bgm-blue.m-btn.waves-effect.waves-circle.waves-float onclick='toggle_menu()'
|
14
|
+
i.zmdi.zmdi-menu
|
15
|
+
|
16
|
+
.actions-menu.hidden
|
17
|
+
-for item in menu
|
18
|
+
-idx = menu.index(item) + 1
|
19
|
+
-if item[:type] == 'link'
|
20
|
+
a.btn.btn-float.bgm-blue.m-btn.waves-effect.waves-circle.waves-float type="button" href="#{item[:link]}" target="#{item[:target]}" style="bottom:#{50+idx*45}px;animation-duration: 0.#{idx+1}s"
|
21
|
+
i.zmdi class="zmdi-#{item[:icon]}"
|
22
|
+
|
23
|
+
-if item[:type] == 'modal'
|
24
|
+
a.btn.btn-float.bgm-blue.m-btn.waves-effect.waves-circle.waves-float type="button" data-toggle="modal" data-target="#{item[:link]}" style="bottom:#{50+idx*45}px;animation-duration: 0.#{idx+1}s"
|
25
|
+
i.zmdi class="zmdi-#{item[:icon]}"
|
26
|
+
|
27
|
+
|
28
|
+
css:
|
29
|
+
.actions-menu .btn-float {
|
30
|
+
width: 40px;
|
31
|
+
height: 40px;
|
32
|
+
line-height : 30px !Important;
|
33
|
+
margin-right: 5px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.actions-menu .btn-float i {
|
37
|
+
font-size: 17px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.actions-menu .text {
|
41
|
+
position: fixed;
|
42
|
+
right: 100px;
|
43
|
+
margin-bottom: 6px;
|
44
|
+
border-radius: 20px;
|
45
|
+
font-size: 8pt;
|
46
|
+
z-index: 9;
|
47
|
+
}
|
48
|
+
|
49
|
+
javascript:
|
50
|
+
function toggle_menu() {
|
51
|
+
if ($(".actions-menu.hidden")[0]) {
|
52
|
+
show_menu();
|
53
|
+
} else {
|
54
|
+
hide_menu();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
function hide_menu() {
|
58
|
+
$(".actions-menu a" ).removeClass('animated fadeInUp')
|
59
|
+
$(".actions-menu a" ).addClass('animated fadeOutDown');
|
60
|
+
setTimeout(function(){
|
61
|
+
$(".actions-menu" ).addClass("hidden");
|
62
|
+
}, 300);
|
63
|
+
}
|
64
|
+
function show_menu() {
|
65
|
+
$(".actions-menu a" ).removeClass('animated fadeOutDown')
|
66
|
+
$(".actions-menu a" ).addClass('animated fadeInUp');
|
67
|
+
$(".actions-menu" ).removeClass("hidden");
|
68
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-hexacta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Zanger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sucker_punch
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/sinatra/extensions/mail.rb
|
81
81
|
- lib/sinatra/extensions/mailbuilder.rb
|
82
82
|
- lib/sinatra/extensions/mailsender.rb
|
83
|
+
- lib/sinatra/extensions/menu.rb
|
83
84
|
- lib/sinatra/extensions/notification.rb
|
84
85
|
- lib/sinatra/extensions/processmanager.rb
|
85
86
|
- lib/sinatra/handlers/errors.rb
|
@@ -94,6 +95,7 @@ files:
|
|
94
95
|
- lib/sinatra/helpers/init.rb
|
95
96
|
- lib/sinatra/helpers/inputs.rb
|
96
97
|
- lib/sinatra/helpers/libraries.rb
|
98
|
+
- lib/sinatra/helpers/menu.rb
|
97
99
|
- lib/sinatra/helpers/reports.rb
|
98
100
|
- lib/sinatra/helpers/schedule.rb
|
99
101
|
- lib/sinatra/hexacta.rb
|
@@ -203,6 +205,7 @@ files:
|
|
203
205
|
- lib/sinatra/views/libraries/include_css.slim
|
204
206
|
- lib/sinatra/views/libraries/include_js_after.slim
|
205
207
|
- lib/sinatra/views/libraries/include_js_before.slim
|
208
|
+
- lib/sinatra/views/menu/menu.slim
|
206
209
|
- lib/sinatra/views/notifications.slim
|
207
210
|
- lib/sinatra/views/notifications/form.slim
|
208
211
|
- lib/sinatra/views/notifications/item.slim
|