glib-web 0.5.23 → 0.5.24

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: 96a374e3289f6a60740734297d8916d0d812d179522a6f8bb90b081fc250384b
4
- data.tar.gz: 5a7cd0858950a75f72c4a0746345c11f4229a3caede190fe0b038385307fceee
3
+ metadata.gz: dc406a3897c823c3c4c9d9470811460a5c08a469178fcb965459b91cbef9b37a
4
+ data.tar.gz: 3e38269b7c876f08e084aaa83a12bbe7476cc8724775e8f09ce429d927a133a9
5
5
  SHA512:
6
- metadata.gz: 93a2a7ec3a7200cffe50217bbf485ef5544dcd8ea5df41c72edd6dacc6d245cd375150cf22c8da2c0ce0d1cd33ba02985cad24c32b9ff97fbf62f030635e4c10
7
- data.tar.gz: 864b0889dfb2213830fc8e4fab34baecb3a9d896406f2bb12c3d8adf31e315fb06ff5edcdca03f90bafada56f57dd81ed0dc5220a57d3de8b6b3cecb520a073a
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
- # TODO: Deprecated
20
- def analytics(value)
21
- if value.is_a?(String)
22
- @analyticsEnabled = true
23
- @analyticsId = value
24
- else
25
- @analyticsEnabled = value == true
26
- end
27
- end
28
-
29
- # Override
30
- def created
31
- # TODO: Deprecated
32
- if @analyticsEnabled
33
- suffix = @analyticsId
34
- # TODO: recognize_path() needs `method` as a second argument for POST request
35
- if suffix.nil? && @url && (route = Rails.application.routes.recognize_path(@url))
36
- suffix = "#{route[:controller]}_#{route[:action]}"
37
- end
38
-
39
- if suffix
40
- json.analytics do
41
- json.track :event
42
- json.nameSuffix suffix
43
- end
44
- end
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
- row.thumbnail title: "Item #{index}"
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.23
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