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.
- checksums.yaml +4 -4
- data/README.md +203 -24
- data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
- data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
- data/app/assets/javascripts/drg_cms/drg_cms.js +229 -95
- data/app/assets/stylesheets/drg_cms/drg_cms.css +608 -542
- data/app/assets/stylesheets/drg_cms_application.css +1 -1
- data/app/assets/stylesheets/drg_cms_cms.css +1 -4
- data/app/controllers/cmsedit_controller.rb +54 -127
- data/app/controllers/dc_application_controller.rb +17 -2
- data/app/controllers/dc_common_controller.rb +13 -7
- data/app/controls/browse_models_control.rb +15 -26
- data/app/controls/cmsedit_control.rb +125 -0
- data/app/controls/dc_help_control.rb +13 -1
- data/app/controls/dc_page_control.rb +0 -1
- data/app/controls/dc_poll_result_control.rb +1 -1
- data/app/controls/dc_report.rb +1 -1
- data/app/controls/design_element_settings_control.rb +1 -1
- data/app/forms/all_options.yml +23 -7
- data/app/forms/cms_menu.yml +24 -24
- data/app/forms/dc_big_table.yml +0 -2
- data/app/forms/dc_big_table_value.yml +0 -2
- data/app/forms/dc_browse_fields.yml +13 -9
- data/app/forms/dc_design.yml +1 -2
- data/app/forms/dc_folder_permission.yml +0 -2
- data/app/forms/dc_help_1.yml +2 -1
- data/app/forms/dc_json_ld.yml +0 -3
- data/app/forms/dc_menu.yml +6 -12
- data/app/forms/dc_menu_item.yml +1 -3
- data/app/forms/dc_page.yml +1 -2
- data/app/forms/dc_policy.yml +2 -5
- data/app/forms/dc_poll.yml +10 -16
- data/app/forms/dc_poll_result_export.yml +1 -1
- data/app/forms/dc_seo.yml +1 -2
- data/app/forms/dc_simple_menu.yml +1 -2
- data/app/forms/dc_site.yml +5 -7
- data/app/helpers/cms_common_helper.rb +8 -6
- data/app/helpers/cms_edit_helper.rb +61 -53
- data/app/helpers/cms_helper.rb +78 -42
- data/app/helpers/cms_index_helper.rb +198 -137
- data/app/helpers/dc_application_helper.rb +65 -43
- data/app/models/concerns/dc_page_concern.rb +1 -1
- data/app/models/concerns/dc_site_concern.rb +9 -3
- data/app/models/dc_big_table.rb +2 -2
- data/app/models/dc_filter.rb +45 -37
- data/app/models/dc_json_ld.rb +1 -1
- data/app/models/dc_part.rb +19 -9
- data/app/models/dc_site.rb +0 -1
- data/app/models/dc_temp.rb +7 -0
- data/app/models/drgcms_form_fields/comment.rb +11 -2
- data/app/models/drgcms_form_fields/drgcms_field.rb +10 -4
- data/app/models/drgcms_form_fields/link_to.rb +1 -1
- data/app/models/drgcms_form_fields/multitext_autocomplete.rb +5 -5
- data/app/models/drgcms_form_fields/readonly.rb +3 -0
- data/app/models/drgcms_form_fields/select.rb +14 -14
- data/app/models/drgcms_form_fields/text_autocomplete.rb +19 -11
- data/app/renderers/dc_part_renderer.rb +1 -1
- data/app/renderers/dc_poll_renderer.rb +1 -1
- data/app/views/cmsedit/_edit_stuff.html.erb +12 -12
- data/app/views/cmsedit/_form.html.erb +3 -2
- data/app/views/cmsedit/_result.html.erb +21 -18
- data/app/views/cmsedit/login.html.erb +1 -1
- data/app/views/dc_common/paste_clipboard.html.erb +1 -1
- data/app/views/layouts/cms.html.erb +3 -5
- data/config/locales/drgcms_en.yml +5 -3
- data/config/locales/drgcms_sl.yml +5 -3
- data/config/locales/kaminari.yml +1 -1
- data/config/locales/models_sl.yml +1 -0
- data/drg_cms.gemspec +1 -1
- data/lib/drg_cms/version.rb +1 -1
- data/lib/drg_cms.rb +6 -12
- metadata +10 -5
- data/app/views/cmsedit/__remove_edit_stuff.js.erb +0 -6
- 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
|
-
|
148
|
-
table, form_name
|
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
|
-
|
174
|
+
(html = choice.first; break) if choice.last.to_s == value.to_s
|
177
175
|
else
|
178
|
-
|
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
|
-
|
192
|
+
options_part = {}
|
194
193
|
@yaml['html'].symbolize_keys!
|
195
|
-
%i(
|
196
|
-
|
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
|
200
|
-
@html << @parent.select(record, @yaml['name'], get_choices, @yaml['html']
|
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']
|
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
|
-
#
|
47
|
-
#
|
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(
|
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
|
-
|
112
|
-
|
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)
|
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:
|
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}
|
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-
|
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('
|
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('
|
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('
|
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
|
-
<
|
22
|
+
<span>|</span>
|
23
23
|
|
24
|
-
<%= link_to( fa_icon('compress
|
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
|
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
|
30
|
+
<%= link_to( fa_icon('refresh', title: t('drgcms.reload')), '#',
|
31
31
|
onclick: "document.location.reload(true); return false;") %>
|
32
|
-
<
|
32
|
+
<span>|</span>
|
33
33
|
|
34
|
-
<%= link_to( fa_icon('
|
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,24 +1,27 @@
|
|
1
1
|
|
2
2
|
<div class="dc-table-frame">
|
3
3
|
|
4
|
-
<%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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-
|
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
|
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
|
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:
|
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
|
63
|
+
form_error: Napaka pri branju forme %{form_name}
|
64
64
|
img_large: Klik za večjo sliko
|
65
|
-
no_class:
|
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:
|
118
|
+
this_site_only: Samo dokumenti trenutne spletne strani
|
117
119
|
|
118
120
|
dc_help:
|
119
121
|
help: POMOČ
|
data/config/locales/kaminari.yml
CHANGED
data/drg_cms.gemspec
CHANGED
data/lib/drg_cms/version.rb
CHANGED
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
|
-
|
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'
|
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
|
+
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:
|
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:
|
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,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 %>
|