drg_cms 0.6.1.4 → 0.6.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) 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 +229 -95
  10. data/app/assets/stylesheets/drg_cms/drg_cms.css +608 -542
  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 +54 -127
  14. data/app/controllers/dc_application_controller.rb +17 -2
  15. data/app/controllers/dc_common_controller.rb +13 -7
  16. data/app/controls/browse_models_control.rb +15 -26
  17. data/app/controls/cmsedit_control.rb +125 -0
  18. data/app/controls/dc_help_control.rb +13 -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 +1 -1
  22. data/app/controls/design_element_settings_control.rb +1 -1
  23. data/app/forms/all_options.yml +23 -7
  24. data/app/forms/cms_menu.yml +24 -24
  25. data/app/forms/dc_big_table.yml +0 -2
  26. data/app/forms/dc_big_table_value.yml +0 -2
  27. data/app/forms/dc_browse_fields.yml +13 -9
  28. data/app/forms/dc_design.yml +1 -2
  29. data/app/forms/dc_folder_permission.yml +0 -2
  30. data/app/forms/dc_help_1.yml +2 -1
  31. data/app/forms/dc_json_ld.yml +0 -3
  32. data/app/forms/dc_menu.yml +6 -12
  33. data/app/forms/dc_menu_item.yml +1 -3
  34. data/app/forms/dc_page.yml +1 -2
  35. data/app/forms/dc_policy.yml +2 -5
  36. data/app/forms/dc_poll.yml +10 -16
  37. data/app/forms/dc_poll_result_export.yml +1 -1
  38. data/app/forms/dc_seo.yml +1 -2
  39. data/app/forms/dc_simple_menu.yml +1 -2
  40. data/app/forms/dc_site.yml +5 -7
  41. data/app/helpers/cms_common_helper.rb +8 -6
  42. data/app/helpers/cms_edit_helper.rb +61 -53
  43. data/app/helpers/cms_helper.rb +78 -42
  44. data/app/helpers/cms_index_helper.rb +198 -137
  45. data/app/helpers/dc_application_helper.rb +65 -43
  46. data/app/models/concerns/dc_page_concern.rb +1 -1
  47. data/app/models/concerns/dc_site_concern.rb +9 -3
  48. data/app/models/dc_big_table.rb +2 -2
  49. data/app/models/dc_filter.rb +45 -37
  50. data/app/models/dc_json_ld.rb +1 -1
  51. data/app/models/dc_part.rb +19 -9
  52. data/app/models/dc_site.rb +0 -1
  53. data/app/models/dc_temp.rb +7 -0
  54. data/app/models/drgcms_form_fields/comment.rb +11 -2
  55. data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
  56. data/app/models/drgcms_form_fields/link_to.rb +1 -1
  57. data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
  58. data/app/models/drgcms_form_fields/readonly.rb +3 -0
  59. data/app/models/drgcms_form_fields/select.rb +14 -14
  60. data/app/models/drgcms_form_fields/text_autocomplete.rb +19 -11
  61. data/app/renderers/dc_part_renderer.rb +1 -1
  62. data/app/renderers/dc_poll_renderer.rb +1 -1
  63. data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
  64. data/app/views/cmsedit/_form.html.erb +3 -2
  65. data/app/views/cmsedit/_result.html.erb +21 -18
  66. data/app/views/cmsedit/login.html.erb +1 -1
  67. data/app/views/dc_common/paste_clipboard.html.erb +1 -1
  68. data/app/views/layouts/cms.html.erb +3 -5
  69. data/config/locales/drgcms_en.yml +5 -3
  70. data/config/locales/drgcms_sl.yml +5 -3
  71. data/config/locales/kaminari.yml +1 -1
  72. data/config/locales/models_sl.yml +1 -0
  73. data/drg_cms.gemspec +1 -1
  74. data/lib/drg_cms/version.rb +1 -1
  75. data/lib/drg_cms.rb +6 -12
  76. metadata +10 -5
  77. data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
  78. data/app/views/cmsedit/__show.html.erb +0 -21
@@ -144,9 +144,8 @@ end
144
144
  def add_view_code
145
145
  return '' if (data = @record.send(@yaml['name'])).blank?
146
146
 
147
- ar = @yaml['view'].split(/\ |\,/).delete_if {|e| e.blank?}
148
- table, form_name = *ar
149
- url = @parent.url_for(controller: :cmsedit, id: data, action: :edit, table: table, form_name: form_name, readonly: true, window_close: 1 )
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 )
150
149
  icon = @parent.fa_icon('eye')
151
150
  %(<span class="dc-window-open" data-url="#{url}">#{icon}</span>)
152
151
  end
@@ -158,9 +157,9 @@ def ro_standard
158
157
  value = @record.respond_to?(@yaml['name']) ? @record.send(@yaml['name']) : nil
159
158
  return self if value.blank?
160
159
 
160
+ html = ''
161
161
  choices = get_choices()
162
162
  if value.class == Array # multiple choices
163
- html = ''
164
163
  value.each do |element|
165
164
  choices.each do |choice|
166
165
  if choice.to_s == element.to_s
@@ -169,17 +168,17 @@ def ro_standard
169
168
  end
170
169
  end
171
170
  end
172
- return super(html)
173
171
  else
174
172
  choices.each do |choice|
175
173
  if choice.class == Array
176
- return super(choice.first) if choice.last.to_s == value.to_s
174
+ (html = choice.first; break) if choice.last.to_s == value.to_s
177
175
  else
178
- return super(choice) if choice.to_s == value.to_s
176
+ (html = choice; break) if choice.to_s == value.to_s
179
177
  end
180
178
  end
179
+ html << add_view_code if @yaml['view']
181
180
  end
182
- super('')
181
+ super(html)
183
182
  end
184
183
 
185
184
  ###########################################################################
@@ -190,17 +189,17 @@ def render
190
189
 
191
190
  set_initial_value('html','selected')
192
191
  # separate options and html part
193
- html_part = {}
192
+ options_part = {}
194
193
  @yaml['html'].symbolize_keys!
195
- %i(class id style required).each { |sym| html_part[sym] = @yaml['html'].delete(sym) if html_part[sym]}
196
- 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']
197
196
 
198
197
  record = record_text_for(@yaml['name'])
199
- if html_part[:multiple]
200
- @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'])
201
200
  @js << "$('##{record}_#{@yaml['name']}').selectMultiple();"
202
201
  else
203
- @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'])
204
203
  # add code for view more data
205
204
  @html << add_view_code() if @yaml['view']
206
205
  end
@@ -223,4 +222,5 @@ def self.get_data(params, name)
223
222
  end
224
223
 
225
224
  end
225
+
226
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[@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( {
@@ -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,6 +1,7 @@
1
1
 
2
- <%= dc_flash_messages %>
3
- <%= dc_error_messages_for @record %>
2
+ <%= dc_flash_messages %>
3
+ <%= dc_error_messages_for @record %>
4
+ <%= dc_warning_messages_for @record %>
4
5
 
5
6
  <div class="dc-form-frame">
6
7
 
@@ -1,24 +1,27 @@
1
1
 
2
2
  <div class="dc-table-frame">
3
3
 
4
- <% unless @records.nil? %>
5
- <%= dc_background_for_result(:start) %>
6
-
7
- <%= dc_header_for_result %>
8
- <% for document in @records %>
9
- <%= dc_row_for_result(document) %>
10
- <%= dc_actions_for_result(document) %>
11
- <%= dc_columns_for_result(document) %>
12
- </div>
13
- <% end %>
14
- <% if @record_footer %>
15
- <div class="dc-result-data footer">
16
- <%= dc_actions_column_for_footer() %>
17
- <%= dc_columns_for_result(@record_footer) %>
18
- </div>
19
- <% end %>
20
-
21
- <%= dc_background_for_result(:end) %>
4
+ <% if @form['result_set']['type'] == 'method' %>
5
+ <%= dc_process_result_set_method %>
6
+ <% elsif @records %>
7
+ <%= dc_background_for_result(:start) %>
8
+ <%= dc_header_for_result %>
9
+
10
+ <% for document in @records %>
11
+ <%= dc_row_for_result(document) %>
12
+ <%= dc_actions_for_result(document) %>
13
+ <%= dc_columns_for_result(document) %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <% if @record_footer %>
18
+ <div class="dc-result-data footer">
19
+ <%= dc_actions_column_for_footer() %>
20
+ <%= dc_columns_for_result(@record_footer) %>
21
+ </div>
22
+ <% end %>
23
+
24
+ <%= dc_background_for_result(:end) %>
22
25
  <% end %>
23
26
  <%= dc_filter_popup() %>
24
27
 
@@ -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>
@@ -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
 
@@ -60,14 +60,16 @@ en:
60
60
  login: Login into CMS
61
61
  username: User name
62
62
  password: Password
63
- form_error: Error loading form #{form_name}
63
+ form_error: Error loading form %{form_name}
64
64
  img_large: Click for larger image
65
- no_class: Class %{class} not defined!
65
+ no_class: Class [%{class}] not defined!
66
+ no_method: Method (helper) [%{method}] not defined!
66
67
  img_alt_not_present: All images in body must have alternative text entered
67
68
 
68
69
  toggle_cms: Toggle CMS edit/view mode
69
70
  edit: Edit
70
71
  show: Show
72
+ duplicate: Duplicate
71
73
  new: New
72
74
  sort: Sort
73
75
  filter: Filter
@@ -116,7 +118,7 @@ en:
116
118
  simple_message: Please write in the name of month no %{number} in a year.
117
119
 
118
120
  filters:
119
- this_site_only: Documents for currently selected site only
121
+ this_site_only: Only documents of currently selected web site
120
122
 
121
123
  dc_help:
122
124
  help: HELP
@@ -60,15 +60,17 @@ sl:
60
60
  login: Prijava v CMS
61
61
  username: Uporabnik
62
62
  password: Geslo
63
- form_error: Napaka pri branju forme #{form_name}
63
+ form_error: Napaka pri branju forme %{form_name}
64
64
  img_large: Klik za večjo sliko
65
- no_class: Class %{class} ni definiran!
65
+ no_class: Razred (class) [%{class}] ni definiran!
66
+ no_method: Metoda (helper) [%{method}] ne obstaja!
66
67
  img_alt_not_present: Vse slike v vsebini morajo imeti vpisano nadomestno besedilo
67
68
 
68
69
  toggle_cms: Preklopi med CMS urejanjem in prikazom
69
70
  edit: Urejanje
70
71
  show: Prikaz
71
72
  new: Dodaj
73
+ duplicate: Podvoji
72
74
  sort: Razvrsti
73
75
  filter: Filter
74
76
  refresh: Osveži
@@ -113,7 +115,7 @@ sl:
113
115
  restore: Restavriraj
114
116
 
115
117
  filters:
116
- this_site_only: Dokumenti samo trenutno izbrane strani
118
+ this_site_only: Samo dokumenti trenutne spletne strani
117
119
 
118
120
  dc_help:
119
121
  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: "..."
@@ -984,3 +984,4 @@ sl:
984
984
  active: Podatki so aktivni
985
985
  add_schema: Dodaj strukturo
986
986
  add_error: Element %{schema} že obstaja!
987
+
data/drg_cms.gemspec CHANGED
@@ -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.4'.freeze
26
+ VERSION = '0.6.1.9'.freeze
27
27
  end
data/lib/drg_cms.rb CHANGED
@@ -140,12 +140,8 @@ end
140
140
  def self.model_check(document, crash = false)
141
141
  return nil unless document.errors.any?
142
142
 
143
- msg = ""
144
- document.errors.each do |attribute, errors_array|
145
- msg << "#{attribute}: #{errors_array}\n"
146
- end
147
- #
148
- if crash and msg.size > 0
143
+ msg = document.errors.inject('') { |r, error| r << "#{error.attribute}: #{error.message}\n" }
144
+ if crash && msg.size > 0
149
145
  msg = "Validation errors in #{document.class}:\n" + msg
150
146
  pp msg
151
147
  Rails.logger.error(msg)
@@ -223,27 +219,25 @@ end
223
219
  ###############################################################################
224
220
  def self.routes
225
221
  Rails.application.routes.draw do
226
- # match '/dc_common/:action' => 'dc_common#:action', via: [:get, :put, :post]
227
222
  controller :dc_common do
228
223
  post 'dc_common/autocomplete' => :autocomplete
229
224
  post 'dc_common/ad_click' => :ad_click
230
225
  get 'dc_common/toggle_edit_mode' => :toggle_edit_mode
231
226
  match 'dc_common/process_login' => :process_login, via: [:put, :post]
232
- get 'dc_common/logout' => :logout
233
227
  get 'dc_common/login' => :login
228
+ get 'dc_common/logout' => :logout
234
229
  get 'dc_common/copy_clipboard' => :copy_clipboard
235
230
  match 'dc_common/paste_clipboard' => :paste_clipboard, via: [:get, :post]
236
231
  put 'dc_common/restore_from_journal' => :restore_from_journal
237
232
  get 'dc_common/add_json_ld_schema' => :add_json_ld_schema
238
233
  get 'dc_common/help' => :help
239
234
  end
240
- 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'
241
238
  match 'cmsedit/run' => 'cmsedit#run', via: [:get, :put, :post]
242
239
  resources :cmsedit
243
- resources :cms, controller: :cmsedit
244
240
  end
245
241
  end
246
242
 
247
243
  end
248
-
249
- DrgCms.add_patches_path(File.dirname(__FILE__) + '../app/models/drgcms_form_fields/patches')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drg_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.4
4
+ version: 0.6.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damjan Rems
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: font-awesome-rails
126
+ name: drg_material_icons
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -163,6 +163,12 @@ files:
163
163
  - MIT-LICENSE
164
164
  - README.md
165
165
  - Rakefile
166
+ - app/assets/fonts/ibm-plex-sans-300.woff2
167
+ - app/assets/fonts/ibm-plex-sans-400.woff2
168
+ - app/assets/fonts/ibm-plex-sans-500.woff2
169
+ - app/assets/fonts/ibm-plex-sans-600.woff2
170
+ - app/assets/fonts/ibm-plex-sans-700.woff2
171
+ - app/assets/fonts/ibm-plex-sans-italic.woff2
166
172
  - app/assets/images/32px.png
167
173
  - app/assets/images/drg_cms/32px.png
168
174
  - app/assets/images/drg_cms/40px.png
@@ -210,6 +216,7 @@ files:
210
216
  - app/controllers/dc_common_controller.rb
211
217
  - app/controllers/dc_main_controller.rb
212
218
  - app/controls/browse_models_control.rb
219
+ - app/controls/cmsedit_control.rb
213
220
  - app/controls/dc_help_control.rb
214
221
  - app/controls/dc_page_control.rb
215
222
  - app/controls/dc_poll_result_control.rb
@@ -352,8 +359,6 @@ files:
352
359
  - app/renderers/dc_poll_renderer.rb
353
360
  - app/renderers/dc_renderer.rb
354
361
  - app/renderers/dc_simple_menu_renderer.rb
355
- - app/views/cmsedit/__remove_edit_stuff.js.erb
356
- - app/views/cmsedit/__show.html.erb
357
362
  - app/views/cmsedit/_edit_stuff.html.erb
358
363
  - app/views/cmsedit/_form.html.erb
359
364
  - app/views/cmsedit/_result.html.erb
@@ -1,6 +0,0 @@
1
-
2
- <% if session[:edit_mode] == 2 %>
3
- <%= javascript_tag do %>
4
- /* $('div[id^="drgcms-"]').css('border', '1px dotted blue') */
5
- <% end %>
6
- <% end %>
@@ -1,21 +0,0 @@
1
- <% if session[:edit_mode] and session[:edit_mode] > 0 %>
2
- <%= render partial: 'edit_stuff' %>
3
- <%= render partial: 'edit_stuff', formats: ['js'] %>
4
- <% else %>
5
- <h2>CMS login</h2>
6
- <%= dc_flash_messages %>
7
- <%= form_tag controller: 'dc_common', action: 'process_login', return_to: '/cmsedit/show', method: :put do %>
8
- <table>
9
- <tr>
10
- <td>Username:</td>
11
- <td><%= text_field('record', 'username') %>
12
- </tr><tr>
13
- <td>Password:</td>
14
- <td><%= password_field('record', 'password') %>
15
- </tr><tr>
16
- <td><%= submit_tag 'Login' %></td>
17
- </tr>
18
- </table>
19
- <%= hidden_field_tag('return_to_error', request.url ) %>
20
- <% end %>
21
- <% end %>