drg_cms 0.6.1.0 → 0.6.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -10
  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 +178 -55
  10. data/app/assets/stylesheets/drg_cms/drg_cms.css +218 -94
  11. data/app/assets/stylesheets/drg_cms/select-multiple.css +1 -1
  12. data/app/controllers/cmsedit_controller.rb +29 -24
  13. data/app/controllers/dc_application_controller.rb +78 -166
  14. data/app/controllers/dc_common_controller.rb +56 -47
  15. data/app/controls/dc_help_control.rb +12 -0
  16. data/app/controls/dc_report.rb +7 -9
  17. data/app/controls/design_element_settings_control.rb +1 -1
  18. data/app/forms/all_options.yml +25 -6
  19. data/app/forms/dc_big_table.yml +0 -2
  20. data/app/forms/dc_big_table_value.yml +0 -2
  21. data/app/forms/dc_design.yml +1 -2
  22. data/app/forms/dc_folder_permission.yml +0 -2
  23. data/app/forms/dc_help_1.yml +2 -1
  24. data/app/forms/dc_json_ld.yml +0 -3
  25. data/app/forms/dc_menu.yml +6 -12
  26. data/app/forms/dc_menu_item.yml +1 -3
  27. data/app/forms/dc_page.yml +5 -2
  28. data/app/forms/dc_policy.yml +2 -5
  29. data/app/forms/dc_poll.yml +10 -16
  30. data/app/forms/dc_seo.yml +1 -2
  31. data/app/forms/dc_simple_menu.yml +1 -2
  32. data/app/forms/dc_site.yml +5 -7
  33. data/app/helpers/cms_common_helper.rb +2 -3
  34. data/app/helpers/cms_edit_helper.rb +41 -31
  35. data/app/helpers/cms_helper.rb +6 -6
  36. data/app/helpers/cms_index_helper.rb +79 -34
  37. data/app/helpers/dc_application_helper.rb +99 -85
  38. data/app/models/concerns/dc_page_concern.rb +3 -2
  39. data/app/models/concerns/dc_piece_concern.rb +1 -1
  40. data/app/models/concerns/dc_site_concern.rb +10 -4
  41. data/app/models/concerns/dc_user_concern.rb +3 -3
  42. data/app/models/dc_big_table.rb +2 -2
  43. data/app/models/dc_filter.rb +28 -22
  44. data/app/models/dc_site.rb +0 -1
  45. data/app/models/dc_temp.rb +7 -0
  46. data/app/models/drgcms_form_fields/comment.rb +11 -2
  47. data/app/models/drgcms_form_fields/date_picker.rb +2 -0
  48. data/app/models/drgcms_form_fields/drgcms_field.rb +2 -1
  49. data/app/models/drgcms_form_fields/embedded.rb +4 -2
  50. data/app/models/drgcms_form_fields/number_field.rb +4 -3
  51. data/app/models/drgcms_form_fields/readonly.rb +13 -17
  52. data/app/models/drgcms_form_fields/select.rb +16 -18
  53. data/app/models/drgcms_form_fields/text_autocomplete.rb +39 -23
  54. data/app/renderers/dc_page_renderer.rb +7 -6
  55. data/app/renderers/dc_poll_renderer.rb +16 -20
  56. data/app/views/cmsedit/_edit_stuff.html.erb +5 -2
  57. data/app/views/cmsedit/_form.html.erb +3 -2
  58. data/app/views/cmsedit/_result.html.erb +21 -18
  59. data/app/views/cmsedit/edit.html.erb +2 -1
  60. data/app/views/cmsedit/index.html.erb +1 -1
  61. data/app/views/cmsedit/new.html.erb +3 -2
  62. data/app/views/dc_common/_help.html.erb +12 -3
  63. data/app/views/layouts/cms.html.erb +3 -5
  64. data/config/locales/drgcms_en.yml +5 -2
  65. data/config/locales/drgcms_sl.yml +5 -2
  66. data/config/locales/models_en.yml +2 -0
  67. data/config/locales/models_sl.yml +5 -3
  68. data/drg_cms.gemspec +16 -16
  69. data/lib/drg_cms/version.rb +1 -1
  70. data/lib/drg_cms.rb +46 -12
  71. metadata +35 -29
@@ -45,30 +45,36 @@ layout false
45
45
  ########################################################################
46
46
  def autocomplete
47
47
  # table parameter must be defined. If not, get it from search parameter
48
- if params['table'].nil? and params['search'].match(/\./)
48
+ if params['table'].nil? && params['search'].match(/\./)
49
49
  name = params['search'].split('.').first
50
50
  params['table'] = name.underscore
51
51
  end
52
-
53
- return render plain: t('drgcms.not_authorized') unless dc_user_can(DcPermission::CAN_VIEW)
54
- # TODO Double check if previous line works as it should.
55
- table = params['table'].classify.constantize
56
- id = [params['id']] || '_id'
57
- # call method in class if search parameter has . This is for user defined searches
58
- # result must be returned as array of [id, search_field_value]
59
- a = if params['search'].match(/\./)
60
- name, method = params['search'].split('.')
61
- table.send(method, params['input']).inject([]) do |r,v|
62
- r << { label: v[0], value: v[0], id: (v[1] || v[0]).to_s }
63
- end
64
- # simply search which will search and return field_name defined in params['search']
52
+ if params['table'].match('_control')
53
+ # it must be at least logged on
54
+ return render json: { label: t('drgcms.not_authorized') } unless dc_user_can(DcPermission::CAN_VIEW, 'dc_memory')
65
55
  else
66
- table.where(params['search'] => /#{params['input']}/i).limit(20).inject([]) do |r,v|
67
- r << { label: v[params['search']], value: v[params['search']], id: v.id.to_s }
68
- end
56
+ return render json: { label: t('drgcms.not_authorized') } unless dc_user_can(DcPermission::CAN_VIEW)
69
57
  end
70
58
 
71
- render plain: a.to_json
59
+ table = params['table'].classify.constantize
60
+ input = params['input'].gsub(/\(|\)|\[|\]|\{|\|\.|\,}/, '')
61
+ # call method in class if search parameter contains . This is for user defined searches
62
+ a = if params['search'].match(/\./)
63
+ #method, additional_params = params['search'].split('.')
64
+ #data = additional_params ? table.send(method, input, additional_params, self) : table.send(method, input)
65
+ name, method = params['search'].split('.')
66
+ data = table.send(method, input)
67
+ data.map do |v|
68
+ { label: v[0], value: v[0], id: (v[1] || v[0]).to_s }
69
+ end
70
+ # will search and return field_name defined in params['search']
71
+ else
72
+ table.where(params['search'] => /#{input}/i).limit(20).map do |v|
73
+ { label: v[params['search']], value: v[params['search']], id: v.id.to_s }
74
+ end
75
+ end
76
+
77
+ render json: a
72
78
  end
73
79
 
74
80
  ########################################################################
@@ -92,18 +98,19 @@ end
92
98
  ##########################################################################
93
99
  def toggle_edit_mode
94
100
  session[:edit_mode] ||= 0
95
- # error when not logged in
96
- return dc_render_404 if session[:edit_mode] < 1
97
- # if return_to_ypos parameter is present it will forward it and thus scroll to
98
- # aproximate position it was when toggle was clicked
101
+ # error when not logged in
102
+ return dc_render_404 if session[:edit_mode] < 1
103
+
104
+ # if return_to_ypos parameter is present it will forward it and thus scroll to
105
+ # aproximate position it was when toggle was clicked
99
106
  session[:edit_mode] = (session[:edit_mode] == 1) ? 2 : 1
100
107
  uri = Rack::Utils.parse_nested_query(request.url)
101
- # it parses only on & so first (return_to) parameter also contains url
108
+ # it parses only on & so first (return_to) parameter also contains url
102
109
  url = uri.first.last
103
110
  if (i = url.index('return_to_ypos')).to_i > 0
104
- url = url[0,i-1]
111
+ url = url[0, i-1]
105
112
  end
106
- # offset CMS menu
113
+ # offset CMS menu
107
114
  if (ypos = uri['return_to_ypos'].to_i) > 0
108
115
  ypos += session[:edit_mode] == 2 ? 250 : -250
109
116
  end
@@ -116,8 +123,8 @@ end
116
123
  # Default user login action.
117
124
  ####################################################################
118
125
  def process_login
119
- # Somebody is probably playing
120
- return dc_render_404 unless ( params[:record] and params[:record][:username] and params[:record][:password] )
126
+ # Somebody is probably playing
127
+ return dc_render_404 unless ( params[:record] && params[:record][:username] && params[:record][:password] )
121
128
 
122
129
  unless params[:record][:password].blank? #password must not be empty
123
130
  user = DcUser.find_by(username: params[:record][:username], active: true)
@@ -154,7 +161,7 @@ def login
154
161
  clear_login_data # on the safe side
155
162
  end
156
163
  end
157
- # Display login
164
+ # Display login
158
165
  route = params[:route] || 'poll'
159
166
  redirect_to "/#{route}?poll_id=login&return_to=#{params[:return_to]}"
160
167
  end
@@ -163,23 +170,23 @@ end
163
170
  # Action for restoring document data from journal document.
164
171
  ####################################################################
165
172
  def restore_from_journal
166
- # Only administrators can perform this operation
173
+ # Only administrators can perform this operation
167
174
  unless dc_user_has_role('admin')
168
175
  return render plain: { 'msg_info' => (t ('drgcms.not_authorized')) }.to_json
169
176
  end
170
- # selected fields to hash
177
+ # selected fields to hash
171
178
  restore = {}
172
- params[:select].each {|key,value| restore[key] = value if value == '1' }
179
+ params[:select].each { |key,value| restore[key] = value if value == '1' }
173
180
  result = if restore.size == 0
174
181
  { 'msg_error' => (t ('drgcms.dc_journal.zero_selected')) }
175
182
  else
176
183
  journal_doc = DcJournal.find(params[:id])
177
- # update hash with data to be restored
184
+ # update hash with data to be restored
178
185
  JSON.parse(journal_doc.diff).each {|k,v| restore[k] = v.first if restore[k] }
179
- # determine tables and document ids
186
+ # determine tables and document ids
180
187
  tables = journal_doc.tables.split(';')
181
188
  ids = (journal_doc.ids.blank? ? [] : journal_doc.ids.split(';') ) << journal_doc.doc_id
182
- # find document
189
+ # find document
183
190
  doc = nil
184
191
  tables.each_index do |i|
185
192
  doc = if doc.nil?
@@ -188,10 +195,10 @@ def restore_from_journal
188
195
  doc.send(tables[i].pluralize).find(ids[i])
189
196
  end
190
197
  end
191
- # restore and save values
198
+ # restore and save values
192
199
  restore.each { |field,value| doc.send("#{field}=",value) }
193
200
  doc.save
194
- # TODO Error checking
201
+ # TODO Error checking
195
202
  { 'msg_info' => (t ('drgcms.dc_journal.restored')) }
196
203
  end
197
204
  render plain: result.to_json
@@ -202,10 +209,11 @@ end
202
209
  # window with data formatted as json.
203
210
  ########################################################################
204
211
  def copy_clipboard
205
- # Only administrators can perform this operation
212
+ # Only administrators can perform this operation
206
213
  return render(plain: t('drgcms.not_authorized') ) unless dc_user_can(DcPermission::CAN_ADMIN,'dc_site')
214
+
207
215
  respond_to do |format|
208
- # just open new window to same url and come back with html request
216
+ # just open new window to same url and come back with html request
209
217
  format.json { dc_render_ajax(operation: 'window', url: request.url ) }
210
218
 
211
219
  format.html do
@@ -213,7 +221,6 @@ def copy_clipboard
213
221
  text = "<br><br>[#{params[:table]},#{params[:id]},#{params[:ids]}]<br>"
214
222
  render plain: text + doc.as_document.to_json
215
223
  end
216
-
217
224
  end
218
225
  end
219
226
 
@@ -223,17 +230,19 @@ end
223
230
  # ajax call for processing data.
224
231
  ########################################################################
225
232
  def paste_clipboard
226
- # Only administrators can perform this operation
233
+ # Only administrators can perform this operation
227
234
  return render(plain: t('drgcms.not_authorized') ) unless dc_user_can(DcPermission::CAN_ADMIN,'dc_site')
235
+
228
236
  result = ''
229
237
  respond_to do |format|
230
- # just open new window to same url and come back with html request
238
+ # just open new window to same url and come back with html request
231
239
  format.html { return render('paste_clipboard', layout: 'cms') }
232
240
  format.json {
233
241
  table, id, ids = nil
234
242
  params[:data].split("\n").each do |line|
235
243
  line.chomp!
236
244
  next if line.size < 5 # empty line. Skip
245
+
237
246
  begin
238
247
  if line[0] == '[' # id(s)
239
248
  result << "<br>#{line}"
@@ -260,7 +269,7 @@ def add_json_ld_schema
260
269
  edited_document = DcJsonLd.find_document_by_ids(params[:table], params[:ids])
261
270
  yaml = YAML.load_file( dc_find_form_file('json_ld_schema') )
262
271
  schema_data = yaml[params[:schema]]
263
- # Existing document
272
+ # Existing document
264
273
  if edited_document.dc_json_lds.find_by(type: "@#{params[:schema]}")
265
274
  return render json: {'msg_error' => t('helpers.help.dc_json_ld.add_error', schema: params[:schema] ) }
266
275
  else
@@ -337,7 +346,7 @@ def update_json(json, is_update=false) #:nodoc:
337
346
  json.each do |k,v|
338
347
  if v.class == Hash
339
348
  result[k] = v['$oid'] unless is_update
340
- #TODO Double check if unless works as expected
349
+ # TODO Double check if unless works as expected
341
350
  elsif v.class == Array
342
351
  result[k] = []
343
352
  v.each {|e| result[k] << update_json(e, is_update)}
@@ -354,22 +363,22 @@ end
354
363
  def process_document(line, table, id, ids)
355
364
  if params[:do_update] == '1'
356
365
  doc = dc_find_document(table, id, ids)
357
- # document found. Update it and return
366
+ # document found. Update it and return
358
367
  if doc
359
368
  doc.update( update_json(ActiveSupport::JSON.decode(line), true) )
360
369
  msg = dc_check_model(doc)
361
370
  return (msg ? " ERROR! #{msg}" : " UPDATE. OK.")
362
371
  end
363
372
  end
364
- # document will be added to collection
373
+ # document will be added to collection
365
374
  if ids.to_s.size > 5
366
- #TODO Add embedded document
375
+ #TODO Add embedded document
367
376
  " NOT SUPPORTED YET!"
368
377
  else
369
378
  doc = table.classify.constantize.new( update_json(ActiveSupport::JSON.decode(line)) )
370
379
  doc.save
371
380
  end
372
- msg = dc_check_model(doc)
381
+ msg = DrgCms.model_check(doc)
373
382
  msg ? " ERROR! #{msg}" : " NEW. OK."
374
383
  end
375
384
 
@@ -116,6 +116,18 @@ def self.choices_for_form_name(session)
116
116
  Dir["#{session[:help_project]}/*.yml"].map { |file_name| File.basename(file_name,'.*') }.sort
117
117
  end
118
118
 
119
+ ######################################################################
120
+ # Will return choices for language select on form. Choices can be either set by dc_locales document in dc_big_table
121
+ # or can be acquired from Rails default locale
122
+ ######################################################################
123
+ def self.choices_for_locales
124
+ choices = DcBigTable.choices4('dc_locales')
125
+ return choices unless choices[0,0] == I18n.t('drgcms.error')
126
+
127
+ choices = [I18n.default_locale] + I18n.fallbacks.inject([]) { |r, e| r << e.first }
128
+ choices.map(&:to_s).uniq
129
+ end
130
+
119
131
  ######################################################################
120
132
  # Will return temp key for data saved in dc_temp file
121
133
  ######################################################################
@@ -153,8 +153,9 @@ def export_to_excel(report_id)
153
153
  excel[n, i] = value
154
154
  end
155
155
  end
156
- workbook.write Rails.root.join("public/tmp/#{report_id}.xls")
157
- dc_render_ajax(operation: :window, value: "/tmp/#{report_id}.xls")
156
+ file_name = "#{report_id}-#{Time.now.to_i}.xls"
157
+ workbook.write Rails.root.join('public', 'tmp', file_name)
158
+ dc_render_ajax(operation: :window, value: "/tmp/#{file_name}")
158
159
  end
159
160
 
160
161
  ############################################################################
@@ -200,15 +201,12 @@ end
200
201
  # @param [Object] txt : Text or object. Result of to_s method of the object is
201
202
  # @param [Hash] opts
202
203
  ###############################################################################
203
- def pdf_text(txt, opts={})
204
- box_opts = {}
204
+ def pdf_text(txt, opts = {})
205
+ box_opts = opts.dup
205
206
  ypos = @pdf.cursor
206
207
  xpos = opts.delete(:atx) || 0
207
- box_opts.merge!(single_line: (opts.delete(:single_line) || true))
208
- box_opts.merge!(at: (opts.delete(:at) || [xpos, ypos]))
209
- box_opts.merge!(width: opts[:width]) if opts[:width]
210
- box_opts.merge!(align: opts[:align]) if opts[:align]
211
- box_opts.merge!(inline_format: opts[:inline_format]) if opts[:inline_format]
208
+ box_opts[:single_line] ||= true
209
+ box_opts[:at] ||= [xpos, ypos]
212
210
 
213
211
  @pdf.text_box(txt.to_s, box_opts)
214
212
  end
@@ -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
@@ -140,7 +148,15 @@ form:
140
148
  method: (get),put,post
141
149
  caption: ajax_call
142
150
  control: control_name.method_to_call
143
- when_new: false
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
+
144
160
  5:
145
161
  type: window
146
162
  controller: cmsedit
@@ -149,15 +165,17 @@ form:
149
165
  action: edit
150
166
  method: (get),put,post
151
167
  caption: Edit linked document
152
- when_new: false
153
168
  params:
154
169
  id:
155
170
  object: record (can be omitted)
156
171
  method: page_id
157
172
  user:
158
173
  object: session
159
- method: user_id
160
-
174
+ method: user_id
175
+ html:
176
+ data-x: 800
177
+ data-y: 400
178
+ data-fields: field1,field2,...
161
179
  6:
162
180
  type: script
163
181
  caption: Cancle
@@ -165,7 +183,6 @@ form:
165
183
  7:
166
184
  type: submit
167
185
  caption: Send
168
- when_new: false
169
186
  params:
170
187
  before-save: send_mail
171
188
  after-save: return_to parent.reload
@@ -251,6 +268,7 @@ form:
251
268
  type: embedded
252
269
  load: default,delay,always
253
270
  form_name: dc_poll_item
271
+ readonly: no
254
272
  html:
255
273
  height: 800
256
274
  20:
@@ -264,7 +282,8 @@ form:
264
282
  40:
265
283
  name: customer_id
266
284
  type: text_autocomplete
267
- search:
285
+ search: model_name.method.additional_parameter
286
+ search:
268
287
  table: customer
269
288
  field: custumer_name
270
289
  method: search
@@ -59,5 +59,3 @@ form:
59
59
  name: dc_big_table_values
60
60
  type: embedded
61
61
  form_name: dc_big_table_value
62
- html:
63
- height: 600
@@ -48,5 +48,3 @@ form:
48
48
  name: dc_big_table_locales
49
49
  type: embedded
50
50
  form_name: dc_big_table_locale
51
- html:
52
- height: 300
@@ -79,5 +79,4 @@ form:
79
79
  type: embedded
80
80
  caption: false
81
81
  form_name: dc_part
82
- html:
83
- height: 1000
82
+ load: delay
@@ -46,5 +46,3 @@ form:
46
46
  type: embedded
47
47
  table: dc_policy_rule
48
48
  form_name: dc_policy_rule_nocms
49
- html:
50
- height: 400
@@ -20,8 +20,9 @@ index:
20
20
  type: field
21
21
  name: lang_1
22
22
  caption: drgcms.dc_help.lang
23
- field_type: text_field
23
+ field_type: text_with_select
24
24
  size: 5
25
+ eval: DcHelpControl.choices_for_locales
25
26
  default:
26
27
  eval: '@parent.session[:help_lang]'
27
28
  html:
@@ -54,6 +54,3 @@ form:
54
54
  name: dc_json_lds
55
55
  type: embedded
56
56
  table: dc_json_ld
57
- html:
58
- height: 400
59
-
@@ -32,25 +32,21 @@ form:
32
32
  10:
33
33
  name: name
34
34
  type: text_field
35
- html:
36
- size: 20
35
+ size: 20
37
36
 
38
37
  20:
39
38
  name: description
40
39
  type: text_field
41
- html:
42
- size: 20
40
+ size: 20
43
41
 
44
42
  30:
45
43
  name: div_name
46
44
  type: text_field
47
- html:
48
- size: 20
45
+ size: 20
49
46
  40:
50
47
  name: link_prepend
51
48
  type: text_field
52
- html:
53
- size: 20
49
+ size: 20
54
50
  50:
55
51
  name: dc_site_id
56
52
  type: select
@@ -64,13 +60,11 @@ form:
64
60
  type: embedded
65
61
  caption: false
66
62
  form_name: dc_menu_item
67
- html:
68
- height: 1000
63
+ load: delay
69
64
 
70
65
  tab3:
71
66
  20:
72
67
  name: css
73
68
  caption: false
74
69
  type: text_area
75
- html:
76
- size: 100x50
70
+ size: 100x50
@@ -75,7 +75,5 @@ form:
75
75
  type: embedded
76
76
  caption: false
77
77
  form_name: dc_menu_item
78
- html:
79
- height: 1000
80
-
78
+ load: delay
81
79
 
@@ -99,6 +99,10 @@ form:
99
99
  eval: DcDesign.choices4_design(@parent.dc_get_site)
100
100
  html:
101
101
  include_blank: true
102
+ 15:
103
+ name: div_class
104
+ type: text_field
105
+ size: 20
102
106
 
103
107
  20:
104
108
  name: menu_id
@@ -153,8 +157,7 @@ form:
153
157
  caption: false
154
158
  type: embedded
155
159
  form_name: dc_part
156
- html:
157
- height: 600
160
+ load: delay
158
161
 
159
162
  5iframe:
160
163
  10:
@@ -40,8 +40,7 @@ form:
40
40
  40:
41
41
  name: message
42
42
  type: text_area
43
- html:
44
- size: 100x5
43
+ size: 100x5
45
44
 
46
45
  50:
47
46
  name: active
@@ -51,6 +50,4 @@ form:
51
50
  name: dc_policy_rules
52
51
  type: embedded
53
52
  form_name: dc_policy_rule
54
- html:
55
- height: 400
56
-
53
+
@@ -37,14 +37,12 @@ form:
37
37
  10:
38
38
  name: name
39
39
  type: text_field
40
- html:
41
- size: 50
40
+ size: 50
42
41
 
43
42
  20:
44
43
  name: title
45
44
  type: text_field
46
- html:
47
- size: 50
45
+ size: 50
48
46
 
49
47
  30:
50
48
  name: sub_text
@@ -54,8 +52,7 @@ form:
54
52
  35:
55
53
  name: pre_display
56
54
  type: text_field
57
- html:
58
- size: 50
55
+ size: 50
59
56
  40:
60
57
  name: operation
61
58
  type: select
@@ -63,8 +60,7 @@ form:
63
60
  50:
64
61
  name: parameters
65
62
  type: text_field
66
- html:
67
- size: 50
63
+ size: 50
68
64
 
69
65
  60:
70
66
  name: display
@@ -73,8 +69,7 @@ form:
73
69
  70:
74
70
  name: captcha_type
75
71
  type: text_field
76
- html:
77
- size: 10
72
+ size: 10
78
73
 
79
74
  80:
80
75
  name: valid_from
@@ -92,8 +87,7 @@ form:
92
87
  100:
93
88
  name: css
94
89
  type: text_area
95
- html:
96
- size: 100x20
90
+ size: 100x20
97
91
 
98
92
  110:
99
93
  name: active
@@ -103,8 +97,8 @@ form:
103
97
  name: js
104
98
  type: text_area
105
99
  caption: false
100
+ size: 100x50
106
101
  html:
107
- size: 100x50
108
102
  style: 'font-family:courier;'
109
103
  tab3:
110
104
  20:
@@ -112,13 +106,13 @@ form:
112
106
  caption: false
113
107
  type: embedded
114
108
  form_name: dc_poll_item
115
- html:
116
- height: 800
109
+ load: delay
110
+
117
111
  tab4:
118
112
  10:
119
113
  name: form
120
114
  caption: false
121
115
  type: text_area
116
+ size: 100x50
122
117
  html:
123
- size: 100x50
124
118
  style: 'font-family:courier;'
data/app/forms/dc_seo.yml CHANGED
@@ -29,5 +29,4 @@ form:
29
29
  help: helpers.help.dc_seo.dc_json_lds
30
30
  type: embedded
31
31
  table: dc_json_ld
32
- html:
33
- height: 600
32
+ load: delay
@@ -63,8 +63,7 @@ form:
63
63
  type: embedded
64
64
  caption: false
65
65
  form_name: dc_simple_menu_item
66
- html:
67
- height: 800
66
+ load: delay
68
67
 
69
68
  tab3:
70
69
  20:
@@ -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:
@@ -132,8 +128,7 @@ form:
132
128
  type: text_area
133
129
  size: 130x40
134
130
 
135
- 5permissions:
136
-
131
+ 5permissions:
137
132
  10:
138
133
  name: inherit_policy
139
134
  type: select
@@ -145,9 +140,12 @@ form:
145
140
  type: embedded
146
141
  caption: false
147
142
  form_name: dc_policy
143
+ load: delay
144
+
148
145
  6parts:
149
146
  10:
150
147
  name: dc_parts
151
148
  caption: false
152
149
  type: embedded
153
150
  form_name: dc_part
151
+ load: delay
@@ -345,7 +345,7 @@ def dc_help_for_tab(tab)
345
345
  label, help = dc_label_help(field.last)
346
346
  next if help.blank?
347
347
 
348
- html << %(<div class="help-field"><div class="help-label">#{label}</div><div class="help-text">#{help}</div></div>)
348
+ html << %(<div class="help-field"><div class="help-label">#{label}</div><div class="help-text">#{help.gsub("\n",'<br>')}</div></div>)
349
349
  end
350
350
  html
351
351
  end
@@ -356,13 +356,12 @@ end
356
356
  def dc_help_fields
357
357
  return '' if @form['form'].nil?
358
358
 
359
- html = '<div class="dc-handle" data-div="#the1"></div><div id="the1">'
359
+ html = '<a id="fields"></a>'
360
360
  if @form['form']['tabs']
361
361
  @form['form']['tabs'].each { |tab| html << dc_help_for_tab(tab) }
362
362
  else
363
363
  html << dc_help_for_tab(@form['form']['fields'])
364
364
  end
365
- html << '</div>'
366
365
  html.html_safe
367
366
  end
368
367