glib-web 0.5.23 → 0.5.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/glib/json_ui/action_builder.rb +27 -30
- data/app/helpers/glib/json_ui/list_builders.rb +3 -0
- data/app/views/json_ui/garage/lists/_autoload_section.json.jbuilder +7 -1
- data/app/views/json_ui/garage/lists/index.json.jbuilder +3 -0
- data/app/views/json_ui/garage/lists/reordering.json.jbuilder +24 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc406a3897c823c3c4c9d9470811460a5c08a469178fcb965459b91cbef9b37a
|
4
|
+
data.tar.gz: 3e38269b7c876f08e084aaa83a12bbe7476cc8724775e8f09ce429d927a133a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b048d67cd2cf79dc3b7e4f72d0da7ecfb8001a6d504cf933bacc46875f9ad044c1d704621794fea22439eb17bbabd3ca90e5c0ae8cd7b77e5b8e14c0fde86469
|
7
|
+
data.tar.gz: b58a6fcacead2d9a23e37220fa39a108e1fb147d6e8109d1fabeabb17020647dba8968052015e083824d013c6decd3d3bb9df6ebae9389e2e7d532e35c890ed6
|
@@ -16,36 +16,33 @@ module Glib
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class Action < JsonUiElement
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
#
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
19
|
+
# def analytics(value)
|
20
|
+
# if value.is_a?(String)
|
21
|
+
# @analyticsEnabled = true
|
22
|
+
# @analyticsId = value
|
23
|
+
# else
|
24
|
+
# @analyticsEnabled = value == true
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
|
28
|
+
# # Override
|
29
|
+
# def created
|
30
|
+
# if @analyticsEnabled
|
31
|
+
# suffix = @analyticsId
|
32
|
+
# # TODO: recognize_path() needs `method` as a second argument for POST request
|
33
|
+
# if suffix.nil? && @url && (route = Rails.application.routes.recognize_path(@url))
|
34
|
+
# suffix = "#{route[:controller]}_#{route[:action]}"
|
35
|
+
# end
|
36
|
+
|
37
|
+
# if suffix
|
38
|
+
# json.analytics do
|
39
|
+
# json.track :event
|
40
|
+
# json.nameSuffix suffix
|
41
|
+
# end
|
42
|
+
# end
|
43
|
+
|
44
|
+
# end
|
45
|
+
# end
|
49
46
|
end
|
50
47
|
|
51
48
|
### Action definitions
|
@@ -35,6 +35,9 @@ module Glib
|
|
35
35
|
action :onLongPress
|
36
36
|
icon :icon
|
37
37
|
bool :avatar
|
38
|
+
action :onReorder
|
39
|
+
string :paramNameForFormData
|
40
|
+
string :paramNameForNewIndex
|
38
41
|
|
39
42
|
# # NOTE: Experimental. Still deciding whether this needs to be a full blown panel or
|
40
43
|
# # an array of badges (with relevant properties, e.g. text, color, etc)
|
@@ -17,6 +17,12 @@ section.rows builder: ->(row) do
|
|
17
17
|
batch_count = 30
|
18
18
|
batch_count.times do |i|
|
19
19
|
index = page_index * batch_count + i
|
20
|
-
|
20
|
+
if local_assigns[:reorder]
|
21
|
+
row.thumbnail title: "Item #{index}", onReorder: ->(action) do
|
22
|
+
action.dialogs_alert
|
23
|
+
end, paramNameForFormData: 'message', paramNameForNewIndex: 'new_index'
|
24
|
+
else
|
25
|
+
row.thumbnail title: "Item #{index}"
|
26
|
+
end
|
21
27
|
end
|
22
28
|
end
|
@@ -23,6 +23,9 @@ json_ui_page json do |page|
|
|
23
23
|
template.thumbnail title: 'Autoload All', onClick: ->(action) do
|
24
24
|
action.windows_open url: json_ui_garage_url(path: 'lists/autoload_all')
|
25
25
|
end
|
26
|
+
template.thumbnail title: 'Reordering', onClick: ->(action) do
|
27
|
+
action.windows_open url: json_ui_garage_url(path: 'lists/reordering')
|
28
|
+
end
|
26
29
|
end
|
27
30
|
|
28
31
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
page_index = params[:page].to_i
|
2
|
+
next_page = {
|
3
|
+
url: json_ui_garage_url(path: 'lists/reordering', page: page_index + 1, section_only: 'v1'),
|
4
|
+
autoload: 'asNeeded'
|
5
|
+
}
|
6
|
+
|
7
|
+
page = json_ui_page json
|
8
|
+
|
9
|
+
if params[:section_only].present?
|
10
|
+
json.nextPage next_page if page_index < 3
|
11
|
+
json.sections do
|
12
|
+
json.child! do
|
13
|
+
render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reorder: true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
else
|
17
|
+
json.title 'Lists'
|
18
|
+
|
19
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
20
|
+
|
21
|
+
page.list nextPage: next_page, firstSection: ->(section) do
|
22
|
+
render 'json_ui/garage/lists/autoload_section', page: page, page_index: page_index, reorder: true
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- app/views/json_ui/garage/lists/edit_actions.json.jbuilder
|
152
152
|
- app/views/json_ui/garage/lists/fab.json.jbuilder
|
153
153
|
- app/views/json_ui/garage/lists/index.json.jbuilder
|
154
|
+
- app/views/json_ui/garage/lists/reordering.json.jbuilder
|
154
155
|
- app/views/json_ui/garage/lists/templating.json.jbuilder
|
155
156
|
- app/views/json_ui/garage/notifications/android_post.json.jbuilder
|
156
157
|
- app/views/json_ui/garage/notifications/index.json.jbuilder
|