sinatra-hexacta 0.8.7 → 0.9.3
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/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/public/js/process.js +18 -5
- data/lib/sinatra/views/menu/menu.slim +68 -0
- data/lib/sinatra/views/notifications/item.slim +1 -1
- data/lib/sinatra/views/notifications/modal.slim +1 -1
- data/lib/sinatra/views/notifications/view.slim +1 -1
- 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: 0b63ced983a9ed988a44fc0d9372b974311c161e6a62eda6c86c522ea57c65cd
|
4
|
+
data.tar.gz: c5b3afa56953ffcd4b32470a33f795e8b5f288aefec1c4e266153619c53b2fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348e7dea6a1134c12bab47fa82e791b04b1943e26c9e87dc9c5f047a717af822b9e2dcda51d754bae367b3d1d8d44d058d7e223714c1818d44e6488836111bf2
|
7
|
+
data.tar.gz: bdb1f871698710ce3d72028c5b197538adf5779b88de7d111af9ff38755cdee9cb853e1ebc1796f1d2eb3c1e7239d55272a10f60a9e59a814433441d6b9b2c40
|
@@ -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;
|
@@ -55,6 +55,7 @@ class ProcessManager {
|
|
55
55
|
}
|
56
56
|
|
57
57
|
static start(clazz) {
|
58
|
+
ProcessManager.show(clazz);
|
58
59
|
$.ajax({
|
59
60
|
url: "/process",
|
60
61
|
type: 'POST',
|
@@ -69,6 +70,7 @@ class ProcessManager {
|
|
69
70
|
}
|
70
71
|
|
71
72
|
static start_with_map(clazz,map) {
|
73
|
+
ProcessManager.show(clazz);
|
72
74
|
map['class'] = clazz;
|
73
75
|
$.ajax({
|
74
76
|
url: "/process",
|
@@ -90,11 +92,9 @@ class ProcessManager {
|
|
90
92
|
data: { class : clazz },
|
91
93
|
success: function(result) {
|
92
94
|
if (result != "") {
|
95
|
+
ProcessManager.show(result.name);
|
93
96
|
if (result.progress >= 100.0) {
|
94
|
-
ProcessManager.
|
95
|
-
ProcessManager.cleanProcess(clazz);
|
96
|
-
} else {
|
97
|
-
ProcessManager.show(result.name);
|
97
|
+
ProcessManager.completeProcess(clazz);
|
98
98
|
}
|
99
99
|
ProcessManager.update(result.progress);
|
100
100
|
}
|
@@ -105,6 +105,19 @@ class ProcessManager {
|
|
105
105
|
});
|
106
106
|
}
|
107
107
|
|
108
|
+
static completeProcess(clazz) {
|
109
|
+
$.ajax({
|
110
|
+
url: "/processes/" + clazz,
|
111
|
+
type: 'POST',
|
112
|
+
success: function(result) {
|
113
|
+
ProcessManager.complete()
|
114
|
+
},
|
115
|
+
error: function(error) {
|
116
|
+
ProcessManager.error();
|
117
|
+
}
|
118
|
+
});
|
119
|
+
}
|
120
|
+
|
108
121
|
static cleanProcess(clazz) {
|
109
122
|
$.ajax({
|
110
123
|
url: "/processes/" + clazz,
|
@@ -113,7 +126,7 @@ class ProcessManager {
|
|
113
126
|
ProcessManager.cancel();
|
114
127
|
},
|
115
128
|
error: function(error) {
|
116
|
-
|
129
|
+
ProcessManager.error();
|
117
130
|
}
|
118
131
|
});
|
119
132
|
}
|
@@ -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)
|
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)
|
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
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
a.lv-item style="padding:10px 15px;#{notification.pending?? 'background-color: #ECF9FF;' : ''}" role="button" onclick="#{notification.pending?? "read_notify(#{notification.id},'#{notification.link}');this.onclick=\'\'" : ''}" href="#{notification.pending?? '#' : notification.link}"
|
2
2
|
.media
|
3
3
|
.pull-left.text-center.p-r-15
|
4
|
-
img.lv-img-sm alt="" src="#{Configuration::USER_PHOTO_URL}#{notification.creator.hxt_id}" title="#{notification.creator.full_name}"
|
4
|
+
img.lv-img-sm alt="" src="#{Configuration::USER_PHOTO_URL}#{notification.creator.hxt_id}" title="#{notification.creator.full_name}" onError="this.onerror=null;this.src='/sinatra-hexacta/img/noimage.jpg';"
|
5
5
|
br
|
6
6
|
-if notification.label == 'error'
|
7
7
|
.btn.btn-link.bgm-red.btn-xs style="font-size:6pt" #{notification.label}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.card-header
|
6
6
|
.media
|
7
7
|
.pull-left
|
8
|
-
img.lv-img alt="" src="#{Configuration::USER_PHOTO_URL}#{notification.creator.hxt_id}" title="#{notification.creator.full_name}"
|
8
|
+
img.lv-img alt="" src="#{Configuration::USER_PHOTO_URL}#{notification.creator.hxt_id}" title="#{notification.creator.full_name}" onError="this.onerror=null;this.src='/sinatra-hexacta/img/noimage.jpg';"
|
9
9
|
.media-body.m-t-5
|
10
10
|
h2
|
11
11
|
| #{notification.title}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
.col-xs-2
|
11
11
|
.card.profile-view
|
12
12
|
.pv-header.bgm-teal style="height:70px;"
|
13
|
-
img.pv-main style="width: 100px;height: 100px;bottom: -50px;margin-left: -50px;" alt="" src="#{Configuration::USER_PHOTO_URL}#{user.hxt_id}"
|
13
|
+
img.pv-main style="width: 100px;height: 100px;bottom: -50px;margin-left: -50px;" alt="" src="#{Configuration::USER_PHOTO_URL}#{user.hxt_id}" onError="this.onerror=null;this.src='/sinatra-hexacta/img/noimage.jpg';"
|
14
14
|
.pv-body style="padding: 0 20px 10px;"
|
15
15
|
h2 style="font-size:14px;font-weight: 500;"
|
16
16
|
| #{user.first_name}
|
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.3
|
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
|