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
@@ -111,7 +111,7 @@ def render
111
111
  @yaml['html']['placeholder'] = t('drgcms.search_placeholder')
112
112
  _name = '_' + @yaml['name']
113
113
  @html << '<div class="ui-autocomplete-border">'
114
- @html << @parent.link_to(@parent.fa_icon('plus-square lg', class: 'dc-animate dc-green'), '#',onclick: 'return false;') # dummy add. But it is usefull.
114
+ @html << @parent.link_to(@parent.fa_icon('plus-square-o', class: 'dc-green'), '#',onclick: 'return false;') # dummy add. But it is usefull.
115
115
 
116
116
  record = record_text_for(@yaml['name'])
117
117
  # text field for autocomplete
@@ -119,7 +119,7 @@ def render
119
119
  # direct link for adding new documents to collection
120
120
  if @yaml['with_new'] and !@readonly
121
121
  @html << ' ' +
122
- @parent.fa_icon('plus-square lg', class: 'in-edit-add', title: t('drgcms.new'),
122
+ @parent.fa_icon('plus-square-o', class: 'in-edit-add', title: t('drgcms.new'),
123
123
  style: "vertical-align: top;", 'data-table' => @yaml['with_new'] )
124
124
  end
125
125
  # div to list active selections
@@ -137,9 +137,9 @@ def render
137
137
  end
138
138
  # Related data is missing. It happends.
139
139
  @html << if rec
140
- link = @parent.link_to(@parent.fa_icon('remove lg', class: 'dc-animate dc-red'), '#',
140
+ link = @parent.link_to(@parent.fa_icon('remove_circle', class: 'dc-red'), '#',
141
141
  onclick: "$('##{rec.id}').hide(); var v = $('##{record}_#{@yaml['name']}_#{rec.id}'); v.val(\"-\" + v.val());return false;")
142
- link = @parent.fa_icon('check lg', class: 'dc-green') if @readonly
142
+ link = @parent.fa_icon('check', class: 'dc-green') if @readonly
143
143
  field = @parent.hidden_field(record, "#{@yaml['name']}_#{rec.id}", value: element)
144
144
  "<div id=\"#{rec.id}\" style=\"padding:4px;\">#{link} #{rec.send(field_name)}<br>#{field}</div>"
145
145
  else
@@ -149,7 +149,7 @@ def render
149
149
  end
150
150
  @html << "</div></div>"
151
151
  # Create text for div to be added when new category is selected
152
- link = @parent.link_to(@parent.fa_icon('remove lg', class: 'dc-animate dc-red'), '#',
152
+ link = @parent.link_to(@parent.fa_icon('remove_circle', class: 'dc-red'), '#',
153
153
  onclick: "$('#rec_id').hide(); var v = $('##{record}_#{@yaml['name']}_rec_id'); v.val(\"-\" + v.val());return false;")
154
154
  field = @parent.hidden_field(record, "#{@yaml['name']}_rec_id", value: 'rec_id')
155
155
  one_div = "<div id=\"rec_id\" style=\"padding:4px;\">#{link} rec_search<br>#{field}</div>"
@@ -52,8 +52,11 @@ class Readonly < DrgcmsField
52
52
  # Render readonly field html code
53
53
  ###########################################################################
54
54
  def render
55
+ set_initial_value
56
+ @record[@yaml['name']] = @yaml['html']['value'] if @yaml['html']['value']
57
+
55
58
  @html << @parent.hidden_field('record', @yaml['name']) # retain field as hidden field
56
- @html << '<div class="dc-readonly">'
59
+ @html << %(<div class="dc-readonly" id="record_#{@yaml['name']}_">)
57
60
 
58
61
  @html << if @yaml['eval']
59
62
  if @yaml['eval'].match(/dc_name4_id|dc_name_for_id/)
@@ -145,9 +145,9 @@ def add_view_code
145
145
  return '' if (data = @record.send(@yaml['name'])).blank?
146
146
 
147
147
  table, form_name = @yaml['view'].split(/\ |\,/).delete_if { |e| e.blank? }
148
- url = @parent.url_for(controller: :cmsedit, id: data, action: :edit, table: table, form_name: form_name, readonly: true, window_close: 1 )
149
- icon = @parent.fa_icon('eye')
150
- %(<span class="dc-window-open" data-url="#{url}">#{icon}</span>)
148
+ url = @parent.url_for(controller: 'cmsedit', id: data, action: :edit, table: table, form_name: form_name, readonly: true, window_close: 1 )
149
+ icon = @parent.mi_icon('eye-o md-18')
150
+ %(<span class="dc-window-open" data-url="#{url}"> #{icon}</span>)
151
151
  end
152
152
 
153
153
  ###########################################################################
@@ -189,17 +189,17 @@ def render
189
189
 
190
190
  set_initial_value('html','selected')
191
191
  # separate options and html part
192
- html_part = {}
192
+ options_part = {}
193
193
  @yaml['html'].symbolize_keys!
194
- %i(class id style required).each { |sym| html_part[sym] = @yaml['html'].delete(sym) if html_part[sym]}
195
- html_part[:multiple] = true if @yaml['multiple']
194
+ %i(selected include_blank).each { |sym| options_part[sym] = @yaml['html'].delete(sym) if @yaml['html'][sym] }
195
+ @yaml['html'][:multiple] = true if @yaml['multiple']
196
196
 
197
197
  record = record_text_for(@yaml['name'])
198
- if html_part[:multiple]
199
- @html << @parent.select(record, @yaml['name'], get_choices, @yaml['html'], html_part)
198
+ if @yaml['html'][:multiple]
199
+ @html << @parent.select(record, @yaml['name'], get_choices, options_part, @yaml['html'])
200
200
  @js << "$('##{record}_#{@yaml['name']}').selectMultiple();"
201
201
  else
202
- @html << @parent.select(record, @yaml['name'], get_choices, @yaml['html'], html_part)
202
+ @html << @parent.select(record, @yaml['name'], get_choices, options_part, @yaml['html'])
203
203
  # add code for view more data
204
204
  @html << add_view_code() if @yaml['view']
205
205
  end
@@ -222,4 +222,5 @@ def self.get_data(params, name)
222
222
  end
223
223
 
224
224
  end
225
+
225
226
  end
@@ -29,7 +29,8 @@ module DrgcmsFormFields
29
29
  # * +name:+ field name (required)
30
30
  # * +type:+ text_autocomplete (required)
31
31
  # * +table+ Collection (table) name. When defined search must contain field name
32
- # * +with_new+ Will add an icon for shortcut to add new document to collection
32
+ # * +with_new+ Will add an icon for shortcut to add new document to related collection
33
+ # * +with_edit+ Will add an icon for shortcut to edit (view) related document
33
34
  # * +is_id+ Field value represent value as id. If false, field will use entered value and not value selected with autocomplete. Default is true.
34
35
  # * +search:+ Search may consist of three parameters from which are separated either by dot (.)
35
36
  # * search_field_name; when table option is defined search must define field name which will be used for search query
@@ -43,8 +44,9 @@ module DrgcmsFormFields
43
44
  # type: text_autocomplete
44
45
  # search: dc_user.name
45
46
  # is_id: false
46
- # html:
47
- # size: 30
47
+ # size: 30
48
+ # with_new: user
49
+ # with_edit: user
48
50
  ###########################################################################
49
51
  class TextAutocomplete < DrgcmsField
50
52
 
@@ -58,8 +60,8 @@ def render
58
60
  table = @yaml['search']['table']
59
61
  ret_name = @yaml['search']['field']
60
62
  method = @yaml['search']['method']
61
- elsif @yaml['search'].match(/\./)
62
- table, ret_name, method = @yaml['search'].split(/\.|\,/).map(&:strip)
63
+ elsif @yaml['search'].match(/\.|\,| /)
64
+ table, ret_name, method = @yaml['search'].split(/\.|\,| /).map(&:strip)
63
65
  else
64
66
  ret_name = @yaml['search']
65
67
  end
@@ -102,16 +104,22 @@ def render
102
104
  @yaml['html'] ||= {}
103
105
  @yaml['html']['value'] = value_displayed
104
106
  @yaml['html']['placeholder'] ||= t('drgcms.search_placeholder') || nil
105
- #
107
+
106
108
  _name = '_' + @yaml['name']
107
109
  record = record_text_for(@yaml['name'])
108
110
  @html << '<span class="dc-text-autocomplete">' + @parent.text_field(record, _name, @yaml['html']) + '<span></span>'
111
+ # with new icon
109
112
  if @yaml['with_new']
110
- @html << ' ' +
111
- @parent.fa_icon('plus-square lg', class: 'in-edit-add', title: t('drgcms.new'),
112
- style: "vertical-align: top;", 'data-table' => @yaml['with_new'] )
113
+ @html << ' ' + @parent.fa_icon('plus-square-o', class: 'in-edit-add', title: t('drgcms.new'),
114
+ style: "vertical-align: top;", 'data-table' => @yaml['with_new'] )
115
+ end
116
+ # with edit icon
117
+ if @yaml['with_edit'] && @record && @record[@yaml['name']].present?
118
+ @html << ' ' + @parent.fa_icon('edit-o', class: 'in-edit-add', title: t('drgcms.edit'),
119
+ style: "vertical-align: top;", 'data-table' => @yaml['with_edit'], 'data-id' => @record[@yaml['name']] )
113
120
  end
114
- @html << '</span>' + @parent.hidden_field(record, @yaml['name'], value: value) # actual value will be in hidden field
121
+ @html << '</span>' + @parent.hidden_field(record, @yaml['name'], value: value) # actual value will be in hidden field
122
+
115
123
  # JS stuff
116
124
  # allow unselected values on is_id: false option
117
125
  not_id_code = %(
@@ -119,7 +127,7 @@ if (ui.item == null) {
119
127
  $("##{record}_#{@yaml['name']}").val($("##{record}__#{@yaml['name']}").val() );
120
128
  return;
121
129
  } ) if not_id
122
- #
130
+
123
131
  @js << <<EOJS
124
132
  $(document).ready(function() {
125
133
  $("##{record}_#{_name}").autocomplete( {
@@ -140,7 +148,7 @@ $(document).ready(function() {
140
148
  change: function (event, ui) {
141
149
  #{not_id_code}
142
150
  if (ui.item == null) return;
143
- $("##{record}_#{@yaml['name']}").val(ui.item.id);
151
+ $("##{record}_#{@yaml['name']}").val(ui.item.id).trigger('change');
144
152
  },
145
153
 
146
154
  minLength: 2
@@ -83,6 +83,7 @@ $(document).ready(function() {
83
83
  $('##{@yaml['name']}_').change( function() {
84
84
  if ($(this).val().toString().length > 0) {
85
85
  $('##{record}_#{@yaml['name']}').val( $(this).val() );
86
+ $('##{record}_#{@yaml['name']}').trigger("change");
86
87
  }
87
88
  $('##{record}_#{@yaml['name']}').focus();
88
89
  });
@@ -68,9 +68,10 @@ end
68
68
  # dc_render(:dc_common_renderer, method: 'google_analytics', code: 'UA-12345678-9')
69
69
  ########################################################################
70
70
  def google_analytics
71
+ html = ''
71
72
  ga_acc = @opts[:code] || @opts[:ga_acc]
72
- return '' if ga_acc.nil? or ga_acc == '/'
73
- html =<<EOT
73
+ if ga_acc && ga_acc != '/'
74
+ html << %(
74
75
  <!-- Google analytics. -->
75
76
  <script type="text/javascript">
76
77
  (function(i,s,o,g,r,a,m){
@@ -86,7 +87,23 @@ def google_analytics
86
87
  ga('send', 'pageview')
87
88
  }
88
89
  </script>
89
- EOT
90
+ )
91
+ end
92
+
93
+ ga4_acc = @opts[:code4] || @opts[:ga4_acc]
94
+ if ga4_acc && ga4_acc != '/'
95
+ html << %(
96
+ <!-- Global site tag (gtag.js) - Google Analytics -->
97
+ <script async src="https://www.googletagmanager.com/gtag/js?id=#{ga4_acc}"></script>
98
+ <script>
99
+ window.dataLayer = window.dataLayer || [];
100
+ function gtag(){dataLayer.push(arguments);}
101
+ gtag('js', new Date());
102
+
103
+ gtag('config', '#{ga4_acc}');
104
+ </script>)
105
+ end
106
+
90
107
  html.html_safe
91
108
  end
92
109
 
@@ -64,7 +64,7 @@ def render_particle(particle, opts)
64
64
  return msg unless can_view
65
65
  html = ''
66
66
  if @opts[:edit_mode] > 1
67
- opts[:editparams].merge!(title: "#{t('drgcms.edit')}: #{particle.name}", controller: :cmsedit)
67
+ opts[:editparams].merge!(title: "#{t('drgcms.edit')}: #{particle.name}", controller: 'cmsedit')
68
68
  html << dc_link_for_edit( opts[:editparams] )
69
69
  end
70
70
  #
@@ -120,7 +120,7 @@ def do_one_item(poll, yaml)
120
120
  end
121
121
  # submit and link tag
122
122
  clas = yaml['type'].match(/submit_tag/) ? '' : 'dc-link-submit'
123
- html << "<span class='#{clas} dc-animate'>#{field_html}#{yaml['separator']}</span>"
123
+ html << "<span class='#{clas}'>#{field_html}#{yaml['separator']}</span>"
124
124
  # other fields
125
125
  else
126
126
  html << case
@@ -2,36 +2,36 @@
2
2
  <button class="cms-toggle mode-<%= session[:edit_mode] %>" title="<%= t('drgcms.toggle_cms')%>">CMS</button>
3
3
  <% # = link_to('CMS', controller: 'dc_common', action: 'toggle_edit_mode', return_to: request.url) %>
4
4
  <% if session[:edit_mode] > 1 %>
5
- <div class="cmsedit-table cmsedit-top">
6
- <div id="menu">
5
+ <div class="cmsedit-top">
6
+ <div id="cms-top-menu">
7
7
 
8
8
  <% if @page %>
9
- <%= link_to( fa_icon('file-text-o lg', class: "dc-animate", title: "#{t('drgcms.edit_page')}"),
9
+ <%= link_to( fa_icon('description-o', title: "#{t('drgcms.edit_page')}"),
10
10
  {controller: 'cmsedit', action: 'edit', table: @site.page_class, id: @page._id}, target: 'iframe_cms') %>
11
11
  <% end %>
12
12
 
13
13
  <% if @design %>
14
- <%= link_to( fa_icon('credit-card lg', class: "dc-animate", title: "#{t('drgcms.edit_design')}"),
14
+ <%= link_to( fa_icon('web', title: "#{t('drgcms.edit_design')}"),
15
15
  {controller: 'cmsedit', action: 'edit', table: 'dc_design', id: @design._id}, target: 'iframe_cms') %>
16
16
  <% end %>
17
17
 
18
18
  <% if @site %>
19
- <%= link_to( fa_icon('globe lg', class: "dc-animate", title: "#{t('drgcms.edit_site')}"),
19
+ <%= link_to( fa_icon('public', title: "#{t('drgcms.edit_site')}"),
20
20
  {controller: 'cmsedit', action: 'edit', table: 'dc_site', id: @site._id}, target: 'iframe_cms') %>
21
21
  <% end %>
22
- <b>&nbsp; | &nbsp; </b>
22
+ <span>|</span>
23
23
 
24
- <%= link_to( fa_icon('compress lg', class: "dc-animate", title: t('drgcms.minimize')), '#',
24
+ <%= link_to( fa_icon('compress', title: t('drgcms.minimize')), '#',
25
25
  onclick: "$('#iframe_cms').height(1); return false;" ) %>
26
26
 
27
- <%= link_to( fa_icon('expand lg', class: "dc-animate", title: t('drgcms.maximize')), '#',
27
+ <%= link_to( fa_icon('expand', title: t('drgcms.maximize')), '#',
28
28
  onclick: "$('#iframe_cms').height( $('#iframe_cms').height() + 500);; return false;") %>
29
29
 
30
- <%= link_to( fa_icon('refresh lg', class: "dc-animate", title: t('drgcms.reload')), '#',
30
+ <%= link_to( fa_icon('refresh', title: t('drgcms.reload')), '#',
31
31
  onclick: "document.location.reload(true); return false;") %>
32
- <b>&nbsp; | &nbsp; </b>
32
+ <span>|</span>
33
33
 
34
- <%= link_to( fa_icon('copy lg', class: "dc-animate", title: "#{t('drgcms.doc_paste_title')}"),
34
+ <%= link_to( fa_icon('content_paste-o', title: t('drgcms.doc_paste_title')),
35
35
  {controller: 'dc_common', action: 'paste_clipboard'}, target: 'iframe_cms') %>
36
36
 
37
37
  <%= DrgcmsFormFields::Elfinder.file_manager_url(self) %>
@@ -42,7 +42,7 @@
42
42
  <div id="menu-hamburger"><%= fa_icon('bars') %></div>
43
43
 
44
44
  <div class="cmsedit-container">
45
- <div id="menu">
45
+ <div id="cms-menu">
46
46
  <%= dc_choices4_cmsmenu.html_safe %>
47
47
  </div>
48
48
 
@@ -1,17 +1,24 @@
1
+ <div id="dc-form-container">
2
+ <div id="dc-form-left">
3
+ <%= dc_form_left %>
4
+ </div>
1
5
 
2
- <%= dc_flash_messages %>
3
- <%= dc_error_messages_for @record %>
4
- <%= dc_warning_messages_for @record %>
6
+ <div id="dc-form-right">
7
+ <%= dc_flash_messages %>
8
+ <%= dc_error_messages_for @record %>
9
+ <%= dc_warning_messages_for @record %>
5
10
 
6
- <div class="dc-form-frame">
11
+ <div class="dc-form-frame">
12
+ <% fields = dc_fields_for_form %>
13
+ <%= dc_actions_for_form 'top' %>
7
14
 
8
- <%= dc_actions_for_form 'top' %>
9
-
10
- <%= dc_fields_for_form %>
11
- <%= dc_document_statistics %>
15
+ <%= fields %>
16
+ <%= dc_document_statistics %>
12
17
 
13
- <%= dc_actions_for_form 'bottom' %>
14
- </div>
18
+ <%= dc_actions_for_form 'bottom' %>
19
+ </div>
15
20
 
16
- <%= javascript_tag(@js) unless @js.blank? %>
17
- <% unless @css.blank? %><style type="text/css"><%= @css %></style><% end %>
21
+ <%= javascript_tag(@js) unless @js.blank? %>
22
+ <% unless @css.blank? %><style><%= @css %></style><% end %>
23
+ </div>
24
+ </div>
@@ -1,9 +1,13 @@
1
- <%= dc_head_for_form %>
2
- <%= dc_table_title dc_edit_title() %>
1
+ <% dc_form_update %>
3
2
 
4
- <%= form_tag( @parms, method: :put, id: params['form_name'] || params['table'],
5
- class: 'cmsform', multipart: @form['form']['multipart'] ) do %>
6
- <%= render partial: 'form' %>
7
- <% end %>
3
+ <div <%= dc_form_id %>>
4
+ <%= dc_head_for_form %>
5
+ <%= dc_table_title dc_edit_title() %>
6
+
7
+ <%= form_tag( @form_params, method: :put, id: CmsHelper.form_param(params) || CmsHelper.table_param(params),
8
+ class: 'cmsform', multipart: @form['form']['multipart'], window_close: params[:window_close] ) do %>
9
+ <%= render partial: 'form' %>
10
+ <% end %>
11
+ </div>
8
12
 
9
13
  <div id="popup" style="display: none;"></div>
@@ -1,12 +1,14 @@
1
- <div id="<%= params['form_name'] || params['table'] %>" class="dc-form-frame">
1
+ <% dc_form_update %>
2
+
3
+ <div <%= dc_form_id %> class="dc-form-frame">
2
4
  <%= dc_title_for_index @records %>
3
5
 
4
6
  <%= dc_actions_for_index %>
5
7
  <%= dc_div_filter %>
6
8
  <%= dc_flash_messages %>
7
- <div id='result'> <%= render partial: 'result' %></div>
9
+ <div id="result"> <%= render partial: 'result' %></div>
8
10
  </div>
9
11
 
10
12
  <%= javascript_tag(@js) unless @js.blank? %>
11
- <% unless @css.blank? %><style type="text/css"><%= @css %></style><% end %>
13
+ <% unless @css.blank? %><style><%= @css %></style><% end %>
12
14
  <div id="popup" style="display: none;"></div>
@@ -12,7 +12,7 @@
12
12
  <div class="input"><%= password_field('record', 'password') %></div>
13
13
 
14
14
  <div class="label"></div>
15
- <div class="input"><%= submit_tag t('drgcms.login'), class: 'dc-animate-button' %></div>
15
+ <div class="input"><%= submit_tag t('drgcms.login'), class: 'dc-submit' %></div>
16
16
  <%= hidden_field_tag('return_to_error', request.url ) %>
17
17
  <% end %>
18
18
  </div>
@@ -1,8 +1,12 @@
1
- <%= dc_table_title dc_new_title %>
1
+ <% dc_form_update %>
2
2
 
3
- <%= form_tag(@parms, method: :post, id: params['form_name'] || params['table'],
4
- class: 'cmsform', multipart: @form['form']['multipart']) do %>
5
- <%= render partial: 'form' %>
6
- <% end %>
3
+ <div <%= dc_form_id %>>
4
+ <%= dc_table_title dc_new_title %>
5
+
6
+ <%= form_tag(@form_params, method: :post, id: CmsHelper.form_param(params) || CmsHelper.table_param(params),
7
+ class: 'cmsform', multipart: @form['form']['multipart']) do %>
8
+ <%= render partial: 'form' %>
9
+ <% end %>
10
+ </div>
7
11
 
8
12
  <div id="popup" style="display: none;"></div>
@@ -8,6 +8,7 @@
8
8
  <% if @commnets %>
9
9
  <button onclick="location.href='#comments'; return false;"><%= t('drgcms.dc_help.comments_button') %></button>
10
10
  <% end %>
11
+ <div style="float: right"><%= fa_icon('close', class: 'dc-link') %></div>
11
12
  </div>
12
13
 
13
14
  <div class="help-body"><%= dc_help_body if @help %></div>
@@ -2,7 +2,7 @@
2
2
  <%= dc_table_title t('drgcms.doc_paste_title') %>
3
3
 
4
4
  <div class="dc-form-frame"><br>
5
- <span class="dc-link dc-link-ajax dc-animate" data-request="post" title="<%= t('drgcms.doc_paste_clipboard') %>"
5
+ <span class="dc-link-ajax" data-request="post" title="<%= t('drgcms.doc_paste_clipboard') %>"
6
6
  data-url="<%= url_for(controller: 'dc_common', action: 'paste_clipboard') %>"><%= t('drgcms.doc_paste_clipboard') %>
7
7
  </span>
8
8
 
@@ -3,15 +3,13 @@
3
3
  <head>
4
4
  <title><%= @page_title %></title>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
6
8
  <%= stylesheet_link_tag "cms", media: 'all' %>
7
- <% if false %> not require in cms mode
8
- <style type="text/css" media="all"><%= "#{@site.css if @site}#{@design.css if @design}\n#{@page.css if @page}".html_safe %></style>
9
- <%= @site.header.html_safe if @site %>
10
- <% end %>
11
9
  <%= javascript_include_tag "cms" %>
12
10
  <%= csrf_meta_tags %>
13
11
  </head>
14
- <body>
12
+ <body id="body-cms">
15
13
 
16
14
  <%= yield %>
17
15
 
@@ -69,12 +69,17 @@ en:
69
69
  toggle_cms: Toggle CMS edit/view mode
70
70
  edit: Edit
71
71
  show: Show
72
+ duplicate: Duplicate
72
73
  new: New
73
74
  sort: Sort
74
75
  filter: Filter
75
76
  refresh: Refresh
76
77
  back: Back
78
+ next: Next
79
+ finish: Finish
80
+ steps: Steps
77
81
  close: Close
82
+ cancel: Cancel
78
83
  delete: Delete
79
84
  enable: Enable
80
85
  disable: Disable
@@ -97,6 +102,7 @@ en:
97
102
  updated_by: Updated by
98
103
  created_at: Created at
99
104
  updated_at: Updated at
105
+ active: Active
100
106
  new_record: New record
101
107
 
102
108
  filter_poll: Filter
@@ -117,7 +123,7 @@ en:
117
123
  simple_message: Please write in the name of month no %{number} in a year.
118
124
 
119
125
  filters:
120
- this_site_only: Documents for currently selected site only
126
+ this_site_only: Only documents of currently selected web site
121
127
 
122
128
  dc_help:
123
129
  help: HELP
@@ -70,11 +70,16 @@ sl:
70
70
  edit: Urejanje
71
71
  show: Prikaz
72
72
  new: Dodaj
73
+ duplicate: Podvoji
73
74
  sort: Razvrsti
74
75
  filter: Filter
75
76
  refresh: Osveži
76
77
  back: Nazaj
78
+ next: Naprej
79
+ steps: Koraki
80
+ finish: Zaključek
77
81
  close: Zapri
82
+ cancel: Preklic
78
83
  delete: Izbris
79
84
  enable: Omogoči
80
85
  disable: Onemogoči
@@ -97,6 +102,7 @@ sl:
97
102
  updated_by: Spremenil
98
103
  created_at: Ustvarjeno
99
104
  updated_at: Spremenjeno
105
+ active: Aktiven
100
106
  new_record: Nov zapis
101
107
 
102
108
  filter_poll: Filter
@@ -114,7 +120,7 @@ sl:
114
120
  restore: Restavriraj
115
121
 
116
122
  filters:
117
- this_site_only: Dokumenti samo trenutno izbrane strani
123
+ this_site_only: Samo dokumenti trenutne spletne strani
118
124
 
119
125
  dc_help:
120
126
  help: POMOČ
@@ -23,4 +23,4 @@ sx:
23
23
  last: "Zadnja &raquo;"
24
24
  previous: "&lsaquo; Nazaj"
25
25
  next: "Naprej &rsaquo;"
26
- truncate: "..."
26
+ truncate: "..."
data/drg_cms.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.required_ruby_version = '>= 2.7'
22
22
 
23
- s.add_dependency 'rails', '~> 6.1'
23
+ s.add_dependency 'rails'#, '~> 6.1'
24
24
  s.add_dependency 'jquery-rails'
25
25
  s.add_dependency 'jquery-ui-rails'
26
26
  s.add_dependency 'non-stupid-digest-assets'
@@ -30,6 +30,6 @@ Gem::Specification.new do |s|
30
30
 
31
31
  s.add_dependency 'kaminari-mongoid'
32
32
  s.add_dependency 'kaminari-actionview'
33
- s.add_dependency 'font-awesome-rails'
33
+ s.add_dependency 'drg_material_icons'
34
34
  s.add_dependency 'sort_alphabetical'
35
35
  end
@@ -23,5 +23,5 @@
23
23
 
24
24
  # drg_cms gem version
25
25
  module DrgCms #:nodoc:
26
- VERSION = '0.6.1.5'.freeze
26
+ VERSION = '0.6.1.11'.freeze
27
27
  end
data/lib/drg_cms.rb CHANGED
@@ -219,24 +219,24 @@ end
219
219
  ###############################################################################
220
220
  def self.routes
221
221
  Rails.application.routes.draw do
222
- # match '/dc_common/:action' => 'dc_common#:action', via: [:get, :put, :post]
223
222
  controller :dc_common do
224
223
  post 'dc_common/autocomplete' => :autocomplete
225
224
  post 'dc_common/ad_click' => :ad_click
226
225
  get 'dc_common/toggle_edit_mode' => :toggle_edit_mode
227
226
  match 'dc_common/process_login' => :process_login, via: [:put, :post]
228
- get 'dc_common/logout' => :logout
229
227
  get 'dc_common/login' => :login
228
+ get 'dc_common/logout' => :logout
230
229
  get 'dc_common/copy_clipboard' => :copy_clipboard
231
230
  match 'dc_common/paste_clipboard' => :paste_clipboard, via: [:get, :post]
232
231
  put 'dc_common/restore_from_journal' => :restore_from_journal
233
232
  get 'dc_common/add_json_ld_schema' => :add_json_ld_schema
234
233
  get 'dc_common/help' => :help
235
234
  end
236
- match 'elfinder' => 'dc_elfinder#connector', via: [:get, :post]
235
+ match 'elfinder' => 'dc_elfinder#connector', via: [:get, :post]
236
+ get 'cms/login' => 'cmsedit#login'
237
+ get 'cms/logout' => 'cmsedit#logout'
237
238
  match 'cmsedit/run' => 'cmsedit#run', via: [:get, :put, :post]
238
239
  resources :cmsedit
239
- resources :cms, controller: :cmsedit
240
240
  end
241
241
  end
242
242