drg_cms 0.6.1.5 → 0.6.1.11

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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +203 -24
  3. data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
  4. data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
  5. data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
  6. data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
  7. data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
  8. data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
  9. data/app/assets/javascripts/drg_cms/drg_cms.js +253 -106
  10. data/app/assets/stylesheets/drg_cms/drg_cms.css +670 -521
  11. data/app/assets/stylesheets/drg_cms_application.css +1 -1
  12. data/app/assets/stylesheets/drg_cms_cms.css +1 -4
  13. data/app/controllers/cmsedit_controller.rb +33 -211
  14. data/app/controllers/dc_application_controller.rb +98 -22
  15. data/app/controllers/dc_common_controller.rb +9 -22
  16. data/app/controls/browse_models_control.rb +18 -27
  17. data/app/controls/cmsedit_control.rb +129 -0
  18. data/app/controls/dc_help_control.rb +1 -1
  19. data/app/controls/dc_page_control.rb +0 -1
  20. data/app/controls/dc_poll_result_control.rb +1 -1
  21. data/app/controls/dc_report.rb +2 -2
  22. data/app/controls/design_element_settings_control.rb +1 -1
  23. data/app/forms/all_options.yml +25 -7
  24. data/app/forms/cms_menu.yml +24 -24
  25. data/app/forms/dc_browse_fields.yml +13 -9
  26. data/app/forms/dc_browse_models.yml +24 -2
  27. data/app/forms/dc_poll_result_export.yml +1 -1
  28. data/app/forms/dc_site.yml +2 -5
  29. data/app/forms/dc_steps_template.yml +51 -0
  30. data/app/helpers/cms_common_helper.rb +73 -6
  31. data/app/helpers/cms_edit_helper.rb +275 -159
  32. data/app/helpers/cms_helper.rb +152 -59
  33. data/app/helpers/cms_index_helper.rb +220 -172
  34. data/app/helpers/dc_application_helper.rb +40 -67
  35. data/app/models/concerns/dc_page_concern.rb +1 -1
  36. data/app/models/concerns/dc_site_concern.rb +9 -3
  37. data/app/models/dc_filter.rb +30 -22
  38. data/app/models/dc_journal.rb +2 -2
  39. data/app/models/dc_json_ld.rb +19 -42
  40. data/app/models/dc_part.rb +19 -9
  41. data/app/models/dc_site.rb +0 -1
  42. data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
  43. data/app/models/drgcms_form_fields/link_to.rb +1 -1
  44. data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
  45. data/app/models/drgcms_form_fields/readonly.rb +4 -1
  46. data/app/models/drgcms_form_fields/select.rb +10 -9
  47. data/app/models/drgcms_form_fields/text_autocomplete.rb +20 -12
  48. data/app/models/drgcms_form_fields/text_with_select.rb +1 -0
  49. data/app/renderers/dc_common_renderer.rb +20 -3
  50. data/app/renderers/dc_part_renderer.rb +1 -1
  51. data/app/renderers/dc_poll_renderer.rb +1 -1
  52. data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
  53. data/app/views/cmsedit/_form.html.erb +19 -12
  54. data/app/views/cmsedit/edit.html.erb +10 -6
  55. data/app/views/cmsedit/index.html.erb +5 -3
  56. data/app/views/cmsedit/login.html.erb +1 -1
  57. data/app/views/cmsedit/new.html.erb +9 -5
  58. data/app/views/dc_common/_help.html.erb +1 -0
  59. data/app/views/dc_common/paste_clipboard.html.erb +1 -1
  60. data/app/views/layouts/cms.html.erb +3 -5
  61. data/config/locales/drgcms_en.yml +7 -1
  62. data/config/locales/drgcms_sl.yml +7 -1
  63. data/config/locales/kaminari.yml +1 -1
  64. data/drg_cms.gemspec +2 -2
  65. data/lib/drg_cms/version.rb +1 -1
  66. data/lib/drg_cms.rb +4 -4
  67. metadata +16 -10
  68. data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
  69. data/app/views/cmsedit/__show.html.erb +0 -21
@@ -1,4 +1,3 @@
1
- #encoding: utf-8
2
1
  #--
3
2
  # Copyright (c) 2014+ Damjan Rems
4
3
  #
@@ -26,31 +25,19 @@
26
25
  #
27
26
  ######################################################################
28
27
  module BrowseModelsControl
29
- include DcApplicationHelper
30
-
31
- #########################################################################
32
- # Determine model class from filename.
33
- #########################################################################
34
- def determine_model(path)
35
- path =~ /(.*)\/(.*).rb/
36
- begin
37
- $2.camelize.constantize
38
- $2
39
- rescue Exception # it happends
40
- nil
41
- end
42
- end
43
28
 
44
29
  #########################################################################
45
30
  # Return array of all models found in application.
46
31
  #########################################################################
47
- def all_collections()
32
+ def all_collections
48
33
  collections = []
49
34
  DrgCms.paths(:forms).each do |path|
50
35
  models_dir = File.expand_path("../models", path)
51
- Dir["#{models_dir}/*.rb"].each do |model_file|
52
- collection_name = determine_model(model_file)
53
- collections << collection_name if collection_name
36
+ Dir["#{models_dir}/*.rb"].each do |model_file|
37
+ model_file =~ /(.*)\/(.*).rb/
38
+ # check if model exists
39
+ collection = $2.camelize.constantize.new rescue nil
40
+ collections << collection.class.to_s.underscore if collection&.respond_to?(:_id)
54
41
  end
55
42
  end
56
43
  collections.sort
@@ -59,10 +46,12 @@ end
59
46
  ######################################################################
60
47
  # List all collections
61
48
  ######################################################################
62
- def collections()
49
+ def collections
63
50
  @records = []
64
51
  all_collections.each do |collection|
65
- @records << {'id' => collection, 'description' => t("helpers.label.#{collection}.tabletitle") }
52
+ next if params[:filter] && !collection.match(/#{params[:filter]}/i)
53
+
54
+ @records << DcMemory.new({'id' => collection, 'description' => t("helpers.label.#{collection}.tabletitle") })
66
55
  end
67
56
  @records
68
57
  end
@@ -70,7 +59,7 @@ end
70
59
  ######################################################################
71
60
  # List field definition for single model
72
61
  ######################################################################
73
- def all_fields()
62
+ def all_fields
74
63
  @records = []
75
64
  model = params[:id].classify.constantize
76
65
  document = model.new
@@ -80,25 +69,27 @@ def all_fields()
80
69
  description = I18n.t("helpers.label.#{params[:id]}.#{attribute_name}") if description.match('missing:')
81
70
  description = attribute_name if description.match('missing:')
82
71
 
83
- @records << {'collection' => params[:id],
72
+ @records << DcMemory.new({id: attribute_name,
73
+ 'collection' => params[:id],
84
74
  'field' => attribute_name,
85
75
  'type' => options[:type],
86
76
  'description' => description,
87
77
  '_default' => options[:default]
88
- }
78
+ })
89
79
  end
90
- # embedded documents
80
+ # embedded documents
91
81
  document.embedded_relations.each do |a_embedded|
92
82
  embedded = a_embedded.last
93
83
  description = I18n.t("helpers.help.#{params[:id]}.#{embedded.key}")
94
84
  description = I18n.t("helpers.label.#{params[:id]}.#{embedded.key}") if description.match('missing:')
95
85
  description = embedded.key if description.match('missing:')
96
86
 
97
- @records << {'collection' => params[:id],
87
+ @records << DcMemory.new({ id: embedded.key,
88
+ 'collection' => params[:id],
98
89
  'field' => embedded.key,
99
90
  'type' => 'Embedded:' + embedded.class_name,
100
91
  'description' => description
101
- }
92
+ })
102
93
  end
103
94
 
104
95
  @records
@@ -0,0 +1,129 @@
1
+ #--
2
+ # Copyright (c) 2022+ Damjan Rems
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ ######################################################################
25
+ # Common controls for cms controller
26
+ ######################################################################
27
+ module CmseditControl
28
+
29
+ ######################################################################
30
+ # Clear current form filter
31
+ ######################################################################
32
+ def filter_off
33
+ table_name = CmsHelper.table_param(params).strip.split(';').first.underscore
34
+ session[table_name][:filter] = nil
35
+ session[table_name][:page] = 1
36
+ url = url_for( controller: 'cmsedit', t: table_name, f: CmsHelper.form_param(params))
37
+
38
+ render json: { url: url }
39
+ end
40
+
41
+ ######################################################################
42
+ # Set current form filter
43
+ ######################################################################
44
+ def filter_on
45
+ table_name = CmsHelper.table_param(params).strip.split(';').first.underscore
46
+ session[table_name] ||= {}
47
+ session[table_name][:page] = 1
48
+ set_session_filter(table_name)
49
+ url = url_for( controller: 'cmsedit', t: table_name, f: CmsHelper.form_param(params))
50
+
51
+ respond_to do |format|
52
+ format.json { render json: { url: url } }
53
+ format.html { redirect_to url }
54
+ end
55
+ end
56
+
57
+ ########################################################################
58
+ # Will check and set sorting options for current result set. Subroutine of index method.
59
+ ########################################################################
60
+ def sort
61
+ return if params['sort'].nil?
62
+
63
+ table_name = CmsHelper.table_param(params).strip.split(';').first.underscore
64
+ old_sort = session[table_name][:sort].to_s
65
+ sort, direction = old_sort.split(' ')
66
+ # reverse sort if same selected
67
+ direction = (direction == '1') ? '-1' : '1' if params['sort'] == sort
68
+ direction ||= '1'
69
+ session[table_name][:sort] = "#{params[:sort]} #{direction}"
70
+ session[table_name][:page] = 1
71
+ params['sort'] = nil # otherwise there is problem with other links
72
+ url = url_for( controller: 'cmsedit', t: table_name, f: CmsHelper.form_param(params))
73
+
74
+ render json: { url: url }
75
+ end
76
+
77
+ private
78
+ ########################################################################
79
+ # Will set session[table_name][:filter] and save last filter settings to session.
80
+ # subroutine of check_filter_options.
81
+ ########################################################################
82
+ def set_session_filter(table_name)
83
+ # models that can not be filtered (for now)
84
+ return if %w(dc_temp dc_memory).include?(CmsHelper.table_param(params))
85
+ # field_name should exist on set filter condition
86
+ return if params[:filter_oper] && params[:filter_field].blank?
87
+
88
+ filter_value = if params[:filter_value].nil?
89
+ #NIL indicates that no filtering is needed
90
+ '#NIL'
91
+ else
92
+ if params[:filter_value].class == String && params[:filter_value][0] == '@'
93
+ # Internal value. Remove leading @ and evaluate expression
94
+ expression = DcInternals.get(params[:filter_value])
95
+ eval(expression) rescue '#NIL'
96
+ else
97
+ # No filter when empty
98
+ params[:filter_value] == '' ? '#NIL' : params[:filter_value]
99
+ end
100
+ end
101
+ # if filter field parameter is omitted then just set filter value
102
+ session[table_name][:filter] =
103
+ if params[:filter_field].nil?
104
+ saved = YAML.load(session[table_name][:filter])
105
+ saved['value'] = filter_value
106
+ saved.to_yaml
107
+ else
108
+ # as field defined. Split name and alternative input field
109
+ field = if params[:filter_field].match(' as ')
110
+ params[:filter_input] = params[:filter_field].split(' as ').last.strip
111
+ params[:filter_field].split(' as ').first.strip
112
+ else
113
+ params[:filter_field]
114
+ end
115
+
116
+ {'field' => field,
117
+ 'operation' => params[:filter_oper],
118
+ 'value' => filter_value,
119
+ 'input' => params[:filter_input],
120
+ 'table' => table_name }.to_yaml
121
+ end
122
+ # must be. Otherwise kaminari includes parames on paging links
123
+ params[:filter_id] = nil
124
+ params[:filter_oper] = nil
125
+ params[:filter_input] = nil
126
+ params[:filter_field] = nil
127
+ end
128
+
129
+ end
@@ -49,7 +49,7 @@ def project_refresh
49
49
  updated_at: File.mtime(file_name)).save
50
50
  end
51
51
  end
52
- render json: { url: url_for(controller: :cmsedit, table: :dc_temp, form_name: :dc_help_1) }
52
+ render json: { url: url_for(controller: 'cmsedit', table: :dc_temp, form_name: :dc_help_1) }
53
53
  end
54
54
 
55
55
  ######################################################################
@@ -1,4 +1,3 @@
1
- #encoding: utf-8
2
1
  #--
3
2
  # Copyright (c) 2014+ Damjan Rems
4
3
  #
@@ -38,7 +38,7 @@ end
38
38
  # Filter action called. Update url to reflect filter conditions and reload form.
39
39
  ######################################################################
40
40
  def do_filter
41
- url = url_for(controller: :cmsedit, action: :index, table: :dc_poll_result,
41
+ url = url_for(controller: 'cmsedit', action: :index, table: :dc_poll_result,
42
42
  'record[dc_poll_id]' => params[:record][:dc_poll_id],
43
43
  'record[start_date]' => params[:record][:start_date],
44
44
  'record[end_date]' => params[:record][:end_date]
@@ -39,7 +39,7 @@ end
39
39
  # If exists, set report section as form, so it can be used to display result.
40
40
  ######################################################################
41
41
  def dc_update_form
42
- return unless @form && @form['report'] && params[:table] == 'dc_temp'
42
+ return unless @form && @form['report'] && CmsHelper.table_param(params) == 'dc_temp'
43
43
 
44
44
  @form = @form['report']
45
45
  end
@@ -132,7 +132,7 @@ end
132
132
  # Export data to Excel
133
133
  ######################################################################
134
134
  def export_to_excel(report_id)
135
- read_drg_form if @form.blank?
135
+ dc_form_read if @form.blank?
136
136
  # use report options if present
137
137
  columns = (@form['report'] ? @form['report'] : @form)['result_set']['columns'].sort
138
138
 
@@ -58,7 +58,7 @@ def get_settings()
58
58
  # Check fild name
59
59
  begin
60
60
  document = model.find(params[:id])
61
- params[:field_name] ||= (params[:location] == 'dc_site' ? 'options' : 'params')
61
+ params[:field_name] ||= (params[:location] == 'dc_site' ? 'settings' : 'params')
62
62
  # field not defined on document
63
63
  raise unless document.respond_to?(params[:field_name])
64
64
  yaml = document[params[:field_name]] || ''
@@ -51,6 +51,14 @@ index:
51
51
  eval: ModulClassName.menu_for(self)
52
52
  caption: Some caption
53
53
 
54
+ # result_set method
55
+ result_set:
56
+ type: method
57
+ eval: my_helper_method
58
+ # or
59
+ view: path_to/_partial
60
+
61
+ # result_set default
54
62
  result_set:
55
63
  filter: custom_filter
56
64
  footer: custom_footer
@@ -86,7 +94,7 @@ result_set:
86
94
  type: delete
87
95
  title: Delete it
88
96
  icon: delete.png
89
- icon: arrow-left
97
+ icon: arrow_back
90
98
  icon: home
91
99
  4:
92
100
  type: link
@@ -140,8 +148,17 @@ form:
140
148
  method: (get),put,post
141
149
  caption: ajax_call
142
150
  control: control_name.method_to_call
143
- when_new: false
144
- show: default always readonly
151
+ show: default || always || readonly
152
+
153
+ active: not_new_record
154
+ active: new_record
155
+ active: SomeClass.is_active_method
156
+ or
157
+ active:
158
+ method: SomeClass.is_active_method
159
+ html:
160
+ data-validate: no
161
+
145
162
  5:
146
163
  type: window
147
164
  controller: cmsedit
@@ -150,15 +167,17 @@ form:
150
167
  action: edit
151
168
  method: (get),put,post
152
169
  caption: Edit linked document
153
- when_new: false
154
170
  params:
155
171
  id:
156
172
  object: record (can be omitted)
157
173
  method: page_id
158
174
  user:
159
175
  object: session
160
- method: user_id
161
-
176
+ method: user_id
177
+ html:
178
+ data-x: 800
179
+ data-y: 400
180
+ data-fields: field1,field2,...
162
181
  6:
163
182
  type: script
164
183
  caption: Cancle
@@ -166,7 +185,6 @@ form:
166
185
  7:
167
186
  type: submit
168
187
  caption: Send
169
- when_new: false
170
188
  params:
171
189
  before-save: send_mail
172
190
  after-save: return_to parent.reload
@@ -24,124 +24,124 @@
24
24
  menu:
25
25
  10_system_menu:
26
26
  caption: drgcms.cms_main
27
- icon: support lg
27
+ icon: support
28
28
 
29
29
  items:
30
30
  10:
31
31
  caption: helpers.label.dc_site.tabletitle
32
32
  controller: cmsedit
33
- icon: globe lg
33
+ icon: public
34
34
  table: dc_site
35
35
  20:
36
36
  caption: helpers.label.dc_design.tabletitle
37
37
  controller: cmsedit
38
- icon: credit-card lg
38
+ icon: web
39
39
  table: dc_design
40
40
  30:
41
41
  caption: helpers.label.dc_page.tabletitle
42
42
  controller: cmsedit
43
- icon: file-text-o lg
43
+ icon: description-o
44
44
  table: dc_page
45
45
  50:
46
46
  caption: helpers.label.dc_piece.tabletitle
47
47
  controller: cmsedit
48
- icon: puzzle-piece lg
48
+ icon: extension-o
49
49
  table: dc_piece
50
50
  60:
51
51
  caption: helpers.label.dc_link.tabletitle
52
52
  controller: cmsedit
53
- icon: link lg
53
+ icon: link
54
54
  table: dc_link
55
55
  70:
56
56
  caption: helpers.label.dc_menu.tabletitle
57
57
  controller: cmsedit
58
- icon: th-list lg
58
+ icon: menu
59
59
  table: dc_menu
60
60
  80:
61
61
  caption: helpers.label.dc_simple_menu.tabletitle
62
62
  controller: cmsedit
63
- icon: ellipsis-h lg
63
+ icon: more_horiz-o
64
64
  table: dc_simple_menu
65
65
  90:
66
66
  caption: helpers.label.dc_category.tabletitle
67
67
  controller: cmsedit
68
- icon: list lg
68
+ icon: list
69
69
  table: dc_category
70
70
  100:
71
71
  caption: helpers.label.dc_poll.tabletitle
72
72
  controller: cmsedit
73
- icon: list-alt lg
73
+ icon: poll-o
74
74
  table: dc_poll
75
75
  110:
76
76
  caption: helpers.label.dc_poll_result.tabletitle
77
77
  controller: cmsedit
78
- icon: database lg
78
+ icon: leaderboard
79
79
  table: dc_poll_result
80
80
  120:
81
81
  caption: helpers.label.dc_ad.tabletitle
82
82
  controller: cmsedit
83
- icon: money lg
83
+ icon: ads_click
84
84
  table: dc_ad
85
85
 
86
86
  11_system_menu:
87
87
  caption: drgcms.cms_advanced
88
- icon: star lg
88
+ icon: star
89
89
  items:
90
90
  10:
91
91
  caption: helpers.label.dc_user.tabletitle
92
92
  controller: cmsedit
93
- icon: users lg
93
+ icon: account_circle-o
94
94
  table: dc_user
95
95
  20:
96
96
  caption: helpers.label.dc_policy_role.tabletitle
97
97
  controller: cmsedit
98
- icon: user-secret lg
98
+ icon: manage_accounts
99
99
  table: dc_policy_role
100
100
  30:
101
101
  caption: helpers.label.dc_permission.tabletitle
102
102
  controller: cmsedit
103
- icon: shield lg
103
+ icon: security
104
104
  table: dc_permission
105
105
  40:
106
106
  caption: helpers.label.dc_folder_permission.tabletitle
107
107
  controller: cmsedit
108
- icon: shield lg
108
+ icon: shield-o
109
109
  table: dc_folder_permission
110
110
  60:
111
111
  caption: helpers.label.dc_big_table.tabletitle
112
112
  controller: cmsedit
113
- icon: table lg
113
+ icon: topic-o
114
114
  table: dc_big_table
115
115
  70:
116
116
  caption: helpers.label.dc_key_value_store.tabletitle
117
117
  controller: cmsedit
118
- icon: list lg
118
+ icon: view_list
119
119
  table: dc_key_value_store
120
120
  80:
121
121
  caption: helpers.label.dc_filter.tabletitle
122
122
  controller: cmsedit
123
- icon: filter lg
123
+ icon: topic-o
124
124
  table: dc_filter
125
125
  90:
126
126
  caption: helpers.label.dc_removed_url.tabletitle
127
127
  controller: cmsedit
128
- icon: trash-o lg
128
+ icon: link_off
129
129
  table: dc_removed_url
130
130
  400:
131
131
  caption: drgcms.dc_help.title
132
132
  controller: cmsedit
133
- icon: question-circle lg
133
+ icon: help-o
134
134
  table: dc_temp
135
135
  form_name: dc_help_1
136
136
  500:
137
137
  caption: helpers.label.dc_journal.tabletitle
138
138
  controller: cmsedit
139
- icon: history lg
139
+ icon: history
140
140
  table: dc_journal
141
141
 
142
142
  600:
143
143
  caption: drgcms.browse_collections
144
144
  controller: cmsedit
145
- icon: table lg
145
+ icon: list_alt
146
146
  table: dc_memory
147
147
  form_name: dc_browse_models
@@ -6,27 +6,31 @@ controls: browse_models
6
6
  permissions:
7
7
  can_view: admin
8
8
 
9
+ index:
10
+ actions:
11
+ 1: back
12
+
9
13
  result_set:
10
- filter: fields
11
- tr_style:
12
- eval: "document['field'] == document['description'] ? 'color: #669;' : 'color: #000;'"
14
+ filter: all_fields
13
15
 
14
16
  columns:
15
17
  10:
16
18
  name: collection
17
19
  caption: Collection
18
- td_style: 'width: 150px;'
19
- 20:
20
+ width: 10%
21
+ 20:
20
22
  name: field
21
23
  caption: Field name
22
- td_style: 'width: 150px;'
23
- 30:
24
+ 30:
24
25
  name: type
25
26
  caption: Field type
26
- 40:
27
+ 40:
27
28
  name: description
28
29
  caption: description
29
- 50:
30
+ width: 25%
31
+ style:
32
+ eval: "document['field'] == document['description'] ? 'color: #f43;' : 'color: #000;'"
33
+ 50:
30
34
  name: _default
31
35
  caption: Default
32
36
 
@@ -6,6 +6,16 @@ controls: browse_models
6
6
  permissions:
7
7
  can_view: admin
8
8
 
9
+ index:
10
+ actions:
11
+ 10:
12
+ type: field
13
+ name: filter
14
+ field_type: text_field
15
+ caption: Filter
16
+ size: 10
17
+
18
+
9
19
  result_set:
10
20
  filter: collections
11
21
 
@@ -19,8 +29,20 @@ result_set:
19
29
  10:
20
30
  name: id
21
31
  caption: Collection
22
- td_style: 'font-weight: bold;width: 150px;'
23
-
32
+ td_style: 'font-weight: bold;'
33
+
24
34
  20:
25
35
  name: description
26
36
  caption: Decription
37
+
38
+ script: '
39
+ $(document).ready( function() {
40
+ $("#record_filter").keydown( function(e) {
41
+ if (e.which == "13" || e.which == "9") {
42
+ let url = "/cmsedit?form_name=dc_browse_models&table=dc_memory&filter=" + this.value;
43
+ window.location.href = url;
44
+ e.preventDefault();
45
+ };
46
+ });
47
+ });
48
+ '
@@ -8,7 +8,7 @@ form:
8
8
  type: script
9
9
  caption: drgcms.back
10
10
  js: 'history.back();'
11
- icon: arrow-left
11
+ icon: arrow_back
12
12
 
13
13
  3:
14
14
  type: ajax
@@ -84,12 +84,8 @@ form:
84
84
  name: document_extension
85
85
  type: text_field
86
86
  size: 10
87
- 25:
88
- name: site_layout
89
- type: text_field
90
- size: 20
91
87
  30:
92
- name: page_table
88
+ name: site_layout
93
89
  type: text_field
94
90
  size: 20
95
91
  40:
@@ -152,3 +148,4 @@ form:
152
148
  caption: false
153
149
  type: embedded
154
150
  form_name: dc_part
151
+ load: delay
@@ -0,0 +1,51 @@
1
+ ## Template for standard options on wizard form
2
+ form:
3
+ css: '#dc-form-left {display: block;width: 20%}'
4
+ actions:
5
+ 1:
6
+ type: ajax
7
+ caption: drgcms.cancel
8
+ icon: cancel
9
+ method: post
10
+ form_name: x
11
+ action: run
12
+ control: x.steps_cancel
13
+ params:
14
+ step: x
15
+ next_step: x
16
+
17
+ 10:
18
+ type: ajax
19
+ caption: drgcms.back
20
+ icon: arrow-back
21
+ method: post
22
+ form_name: x
23
+ action: run
24
+ control: x.steps
25
+ params:
26
+ step: x
27
+ next_step: x
28
+
29
+ 20:
30
+ type: ajax
31
+ caption: drgcms.next
32
+ icon: arrow-forward
33
+ method: post
34
+ form_name: x
35
+ action: run
36
+ control: x.steps
37
+ params:
38
+ step: x
39
+ next_step: x
40
+
41
+ 100:
42
+ type: ajax
43
+ caption: drgcms.finish
44
+ icon: done
45
+ method: post
46
+ form_name: x
47
+ action: run
48
+ control: x.steps_finish
49
+ params:
50
+ step: x
51
+ next_step: x