sinatra-hexacta 0.8.8 → 0.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0dd060b73a298d6478e00bcbb9bdc8d756941ea0f8bd4722f6fc1b5391d81e0
4
- data.tar.gz: 3a52a4a4698b47f2f6f7fa5fcfced960744dba7e92c6e25e1d330986a89ed68a
3
+ metadata.gz: 6884934e4cc519d87597493303f9a125118d60297589eb52a70f12a17646a83d
4
+ data.tar.gz: aa29474ab59cac85241982115645260e091cae81d1a26478d6b7b09e928978a9
5
5
  SHA512:
6
- metadata.gz: 030ceff7353e3653f0077dd2c0176fb6200c8a38db4d29a5f62f892c188f2a7165aff6e2949fb12cd864911dce32a51ccf59df6d5b2b9ca132372932cb213d08
7
- data.tar.gz: a487d657ce41bf225bf1681bfb4948e328340b60482d4f8eca570dbf861bfbd09c8ba12e31422f026c6877ae1ca3ef8e8653a996ed2e1f086acd57548a9ae22c
6
+ metadata.gz: 39d714392cac7c9f2b0502530aa1041c7a8b6b1d7f41c7adcf574e7f96c3195f96159d3f539bcdcb0bbd5309a3a737324660ba5002892b0d59556b9aef59ce8d
7
+ data.tar.gz: 97812801c6f809c9265092fc445c79f6fa577adef853da00704647af74749e79daa941a217160c07797ab0d1f3456254c39351e1fd368fee77145971195d6ed5
@@ -7,3 +7,4 @@ require_relative 'mail'
7
7
  require_relative 'generalmail'
8
8
  require_relative 'mailbuilder'
9
9
  require_relative 'processmanager'
10
+ require_relative 'menu'
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+ class MenuBuilder
3
+
4
+ def new
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 => 'dropdown' , :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
@@ -6,3 +6,4 @@ require_relative 'cas'
6
6
  require_relative 'schedule'
7
7
  require_relative 'alerts'
8
8
  require_relative 'reports'
9
+ require_relative 'menu'
@@ -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
@@ -0,0 +1,42 @@
1
+ .actions-menu.m-b-20
2
+ .btn-group.p-fixed style="border-radius: 5px;z-index:5;"
3
+ -for item in menu
4
+ -if item[:type] == 'dropdown'
5
+ .btn-group
6
+ a.btn.btn-default.dropdown-toggle.waves-effect.btn-icon-text aria-expanded="true" data-toggle="dropdown" type="button"
7
+ i.zmdi class="zmdi-#{item[:icon]}"
8
+ | #{item[:text]}
9
+
10
+ ul.dropdown-menu role="menu" style="border-radius: 5px;"
11
+ -for subitem in item[:link]
12
+ -if subitem[:type] == 'link'
13
+ li
14
+ a.btn-icon-text href="#{subitem[:link]}" target="#{subitem[:target]}"
15
+ i.zmdi class="zmdi-#{subitem[:icon]}"
16
+ | #{subitem[:text]}
17
+
18
+ -if item[:type] == 'link'
19
+ a.btn.btn-default.waves-effect.btn-icon-text type="button" href="#{item[:link]}" target="#{item[:target]}"
20
+ i.zmdi class="zmdi-#{item[:icon]}"
21
+ | #{item[:text]}
22
+
23
+ -if item[:type] == 'modal'
24
+ a.btn.btn-default.waves-effect.btn-icon-text type="button" data-toggle="modal" data-target="#{item[:link]}"
25
+ i.zmdi class="zmdi-#{item[:icon]}"
26
+ | #{item[:text]}
27
+
28
+
29
+ css:
30
+ .actions-menu {
31
+ height: 38px;
32
+ }
33
+ .actions-menu a.btn {
34
+ padding: 10px;
35
+ border-radius: 5px;
36
+ border-left: 1px solid #eee;
37
+ }
38
+
39
+ .actions-menu a:hover {
40
+ background: #2196f3 !important;
41
+ color: white !important;
42
+ }
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.8.8
4
+ version: 0.9.0
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-06-04 00:00:00.000000000 Z
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