imagine_cms 4.2.4 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +4 -0
- data/.ruby-version +1 -1
- data/Dockerfile +61 -0
- data/README.md +50 -0
- data/app/assets/javascripts/imagine_cms/core.js +4 -2
- data/app/assets/javascripts/imagine_cms/legacy/misc.js +29 -31
- data/app/controllers/cms/content_controller.rb +29 -25
- data/app/controllers/manage/application_controller.rb +4 -0
- data/app/controllers/manage/cms_controller.rb +13 -0
- data/app/controllers/{management/cms_controller.rb → manage/cms_pages_controller.rb} +625 -711
- data/app/controllers/manage/cms_snippets_controller.rb +67 -0
- data/app/controllers/manage/cms_templates_controller.rb +71 -0
- data/app/controllers/management/application_controller.rb +1 -1
- data/app/controllers/management/user_controller.rb +7 -6
- data/app/controllers/management/users_controller.rb +56 -56
- data/app/controllers/util_controller.rb +0 -1
- data/app/helpers/cms_application_helper.rb +17 -19
- data/app/mailers/imagine_cms_mailer.rb +16 -0
- data/app/models/cms_page.rb +8 -23
- data/app/models/user.rb +1 -1
- data/app/sweepers/cms_content_sweeper.rb +3 -3
- data/app/views/cms/content/_photo_gallery.html.erb +4 -4
- data/app/views/cms/content/_search_result.html.erb +1 -1
- data/app/views/imagine_cms/_header.html.erb +1 -1
- data/app/views/imagine_cms/_toolbar.html.erb +12 -12
- data/app/views/imagine_cms_mailer/request_review.text.erb +10 -0
- data/app/views/layouts/management.html.erb +29 -5
- data/app/views/manage/cms/index.html.erb +7 -0
- data/app/views/{management/cms → manage/cms_pages}/_complete_gallery.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_create_file_link.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_crop_feature_image.html.erb +20 -5
- data/app/views/{management/cms → manage/cms_pages}/_crop_image.html.erb +20 -5
- data/app/views/{management/cms → manage/cms_pages}/_crop_results.html.erb +0 -0
- data/app/views/manage/cms_pages/_crop_results_feature_image.html.erb +1 -0
- data/app/views/manage/cms_pages/_crop_results_thumb.html.erb +1 -0
- data/app/views/{management/cms → manage/cms_pages}/_crop_thumb.html.erb +20 -5
- data/app/views/{management/cms → manage/cms_pages}/_edit_page.html.erb +37 -49
- data/app/views/{management/cms → manage/cms_pages}/_gallery_index.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_gallery_setup.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_image.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_image_details.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_image_draggable.html.erb +0 -0
- data/app/views/manage/cms_pages/_list_page.html.erb +8 -0
- data/app/views/{management/cms → manage/cms_pages}/_list_page_select.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_list_pages.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_list_pages_select.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_page_attribute.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_page_list.html.erb +2 -2
- data/app/views/{management/cms → manage/cms_pages}/_page_list_source_folder.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_page_list_source_tag.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_select_gallery.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_sort_images.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_template_options.html.erb +3 -3
- data/app/views/{management/cms → manage/cms_pages}/_upload_feature_image.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_upload_file.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/_upload_image.html.erb +1 -1
- data/app/views/{management/cms → manage/cms_pages}/_upload_thumb.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/edit_page_content.html.erb +7 -0
- data/app/views/{management/cms → manage/cms_pages}/gallery_management.html.erb +1 -1
- data/app/views/{management/cms/pages.html.erb → manage/cms_pages/index.html.erb} +1 -1
- data/app/views/{management/cms/page_tags_for_lookup.html.erb → manage/cms_pages/page_tags_for_lookup.js.erb} +0 -0
- data/app/views/{management/cms → manage/cms_pages}/select_page.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/toolbar_edit.html.erb +0 -0
- data/app/views/{management/cms → manage/cms_pages}/toolbar_preview.html.erb +6 -6
- data/app/views/manage/cms_snippets/_cms_snippet.html.erb +3 -0
- data/app/views/manage/cms_snippets/edit.html.erb +25 -0
- data/app/views/{management/cms/snippets.html.erb → manage/cms_snippets/index.html.erb} +2 -2
- data/app/views/manage/cms_templates/_cms_template.html.erb +3 -0
- data/app/views/{management/cms → manage/cms_templates}/_template_reference.html.erb +2 -2
- data/app/views/manage/cms_templates/edit.html.erb +26 -0
- data/app/views/{management/cms/templates.html.erb → manage/cms_templates/index.html.erb} +2 -2
- data/app/views/management/default/index.html.erb +3 -1
- data/app/views/management/users/edit.html.erb +2 -2
- data/app/views/management/users/index.html.erb +2 -2
- data/app/views/management/users/new.html.erb +1 -1
- data/config/initializers/constants.rb +3 -0
- data/config/routes.rb +57 -10
- data/db/migrate/20121108004747_add_settings_table.rb +8 -12
- data/db/migrate/20121108005110_add_tasks_table.rb +7 -11
- data/db/migrate/20121115083748_add_logs_table.rb +13 -18
- data/db/migrate/20121115083811_add_users_tables.rb +26 -26
- data/db/migrate/20121115084028_add_cms_tables.rb +91 -90
- data/db/migrate/20140423085357_add_redirect_fields_to_cms_pages.rb +2 -2
- data/db/migrate/20140423085358_add_redirect_fields_to_cms_page_versions.rb +2 -2
- data/docker-compose.override.yml.example +43 -0
- data/docker-compose.yml +21 -0
- data/docker/conf/.my.cnf +3 -0
- data/docker/conf/my.local.cnf +14 -0
- data/docker/conf/my.prod.cnf +9 -0
- data/docker/conf/nginx-vhost.conf +14 -0
- data/docker/services/memcached.sh +3 -0
- data/docker/services/sidekiq.sh +3 -0
- data/docker/services/webpack.sh +3 -0
- data/docker/startup/101_mkdir.sh +15 -0
- data/docker/startup/201_bundler.sh +4 -0
- data/docker/startup/211_yarn.sh +4 -0
- data/imagine_cms.gemspec +12 -11
- data/lib/extensions/action_controller_extensions.rb +4 -2
- data/lib/imagine_cms/engine.rb +6 -7
- data/lib/imagine_cms/version.rb +1 -1
- data/lib/upload_progress/lib/upload_progress.rb +3 -3
- data/test/dummy/app/assets/javascripts/application.js +0 -1
- metadata +94 -74
- data/.ruby-gemset +0 -1
- data/README.rdoc +0 -98
- data/app/views/management/cms/_crop_results_feature_image.html.erb +0 -1
- data/app/views/management/cms/_crop_results_thumb.html.erb +0 -1
- data/app/views/management/cms/_list_page.html.erb +0 -8
- data/app/views/management/cms/_snippet.html.erb +0 -3
- data/app/views/management/cms/_temp.html.erb +0 -3
- data/app/views/management/cms/edit_master.html.erb +0 -48
- data/app/views/management/cms/edit_snippet.html.erb +0 -25
- data/app/views/management/cms/edit_template.html.erb +0 -25
- data/app/views/management/cms/index.html.erb +0 -7
- data/app/views/management/cms/permission_denied.html.erb +0 -1
- data/lib/hash_object.rb +0 -39
- data/lib/hash_wrapper.rb +0 -17
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div id="<%= "cb_item_#{list_page.id}" %>" class="cb_item" style="width: 148px; overflow: hidden; margin: 2px; float: left; cursor: pointer" onclick="$('view_link').href = '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>'; $('new_link').onclick = function () { editProperties('<%=raw url_for action: 'new', mode: 'ajax_new', parent_id: list_page %>', 'Create New Page under /<%= list_page.path %>'); return false; }; $('edit_link').onclick = function () { editProperties('<%=raw url_for action: 'edit_page', id: list_page, mode: 'ajax_edit' %>', 'Page Properties: <%= list_page.name %>'); return false; }; $('edit_content_link').href = '<%=raw url_for action: 'edit_page_content', id: list_page %>'; $('delete_link').href = '<%=raw url_for action: 'delete_page', id: list_page.id %>'; setTimeout('cbSelectItem(\'' + this.id + '\', <%= @page_level %>, \'<%=raw url_for action: 'list_pages', level: @page_level + 1, parent_id: list_page.id %>\');', 200);" ondblclick="$('edit_content_link').click();">
|
2
|
+
<table cellpadding="0" cellspacing="0" border="0">
|
3
|
+
<tr>
|
4
|
+
<td valign="top"><%= image_tag 'management/icon_page.gif', style: 'margin: 2px 5px 0 0;' %></td>
|
5
|
+
<td<%= list_page.published_version >= 0 ? '' : ' style="color: gray"'.html_safe %>><%= list_page.name %></td>
|
6
|
+
</tr>
|
7
|
+
</table>
|
8
|
+
</div>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -29,8 +29,8 @@
|
|
29
29
|
|
30
30
|
<table>
|
31
31
|
<tr>
|
32
|
-
<td><%= button_to_function('Add Page/Folder', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/
|
33
|
-
<td><%= button_to_function('Add Tag', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/
|
32
|
+
<td><%= button_to_function('Add Page/Folder', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/cms_pages/page_list_add_folder?key=#{key}&i=' + $('page_objects_#{key}-sources-folder-count').value, {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom}); $('page_objects_#{key}-sources-folder-count').value++;", class: 'form_button') %></td>
|
33
|
+
<td><%= button_to_function('Add Tag', "new Ajax.Updater('page_list_#{key}-source-list', '/manage/cms_pages/page_list_add_tag?key=#{key}&i=' + $('page_objects_#{key}-sources-tag-count').value, {asynchronous:true, evalScripts:true, insertion:Insertion.Bottom}); $('page_objects_#{key}-sources-tag-count').value++;", class: 'form_button') %></td>
|
34
34
|
<td>
|
35
35
|
<%= check_box :page_objects, "#{key}-include-expired", { class: 'form', style: '' }, 'true', 'false' %>
|
36
36
|
<label for="page_objects_<%= key %>-include-expired">Include expired items</label>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<%- unless @template_options.empty? -%>
|
1
|
+
<%- unless @template_options.to_h.empty? -%>
|
2
2
|
<div style="background-color: white; width: 100%; border: 1px solid #aaaaaa;">
|
3
|
-
<%- @template_options.each do |name, type| -%>
|
4
|
-
<%- key = name.gsub(/[^\w\d]/, '_') -%>
|
3
|
+
<%- @template_options.to_h.each do |name, type| -%>
|
4
|
+
<%- key = name.to_s.gsub(/[^\w\d]/, '_') -%>
|
5
5
|
<table width="100%">
|
6
6
|
<col width="55%" /><col width="45%" />
|
7
7
|
<tr>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,3 +1,10 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
taglist = new Array(<%= @taglist.size %>)
|
3
|
+
<%- @taglist.each_with_index do |tag, i| -%>
|
4
|
+
taglist[<%= i %>]="<%=j tag %>";
|
5
|
+
<%- end -%>
|
6
|
+
</script>
|
7
|
+
|
1
8
|
<%= form_tag({}, id: 'page_content_form') do %>
|
2
9
|
<%= submit_tag 'Save', id: 'btn_save', style: 'display: none' %>
|
3
10
|
<%= render inline: @template_content %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= form_remote_tag :url => { :action => 'select_gallery', :id => @pg },
|
12
12
|
:update => 'select_gallery' do -%>
|
13
13
|
Current Gallery:
|
14
|
-
<select name="gallery_id" onchange="new Ajax.Updater('gallery_container', '/manage/
|
14
|
+
<select name="gallery_id" onchange="new Ajax.Updater('gallery_container', '/manage/cms_pages/<%= @pg.id %>/select_gallery', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); return false;">
|
15
15
|
<%-
|
16
16
|
@galleries.each do |gallery|
|
17
17
|
unless session[:broken_galleries].include?(File.basename(gallery))
|
@@ -68,7 +68,7 @@ EOF
|
|
68
68
|
cbNumColumns = <%= @page_levels.size - 1 %>;
|
69
69
|
$('columnBrowserLevel' + cbNumColumns).scrollIntoView();
|
70
70
|
$('view_link').href = '<%= list_page.path.blank? ? '' : '/' + list_page.path %>/version/<%= list_page.published_version > 0 ? list_page.published_version : list_page.version %>';
|
71
|
-
$('new_link').onclick = function () { editProperties('<%=raw url_for(action: '
|
71
|
+
$('new_link').onclick = function () { editProperties('<%=raw url_for(action: 'new', mode: 'ajax_new', parent_id: list_page, authenticity_token: form_authenticity_token.to_s) %>', 'Create New Page under /<%= list_page.path %>'); return false; };
|
72
72
|
$('edit_link').onclick = function () { editProperties('<%=raw url_for action: 'edit_page', id: list_page, mode: 'ajax_edit', authenticity_token: form_authenticity_token.to_s %>', 'Page Properties: <%= list_page.name %>'); return false; };
|
73
73
|
$('edit_content_link').href = '<%=raw url_for action: 'edit_page_content', id: list_page, authenticity_token: form_authenticity_token.to_s %>';
|
74
74
|
$('delete_link').href = '<%=raw url_for action: 'delete_page', id: list_page.id %>';
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,13 +3,13 @@
|
|
3
3
|
<tbody>
|
4
4
|
<tr valign="top" align="left">
|
5
5
|
<% if @pg -%>
|
6
|
-
<td onclick="location.href = '<%= url_for :
|
6
|
+
<td onclick="location.href = '<%= url_for controller: '/manage/cms_pages', action: 'edit_page_content', id: @pg, version: params[:version] %>';">
|
7
7
|
<!-- save -->
|
8
8
|
<span class="iconContainer">
|
9
9
|
<span title="Edit" class="dojoE2TBIcon dojoE2TBIcon_Save"> </span>
|
10
10
|
</span>
|
11
11
|
</td>
|
12
|
-
<td onclick="location.href = '<%= url_for :
|
12
|
+
<td onclick="location.href = '<%= url_for controller: '/manage/cms_pages', action: 'edit_page_content', id: @pg, version: params[:version] %>';" style="vertical-align: middle; cursor: pointer">
|
13
13
|
<span title="Edit" style="font-family: Arial">Edit</span>
|
14
14
|
</td>
|
15
15
|
|
@@ -30,8 +30,8 @@
|
|
30
30
|
</span>
|
31
31
|
</td>
|
32
32
|
|
33
|
-
<td onclick="location.href = '<%= url_for :
|
34
|
-
<a href="<%= url_for :
|
33
|
+
<td onclick="location.href = '<%= url_for controller: '/manage/cms_pages', action: 'index', path: (@pg ? @pg.path : nil) %>';" style="vertical-align: middle; cursor: pointer">
|
34
|
+
<a href="<%= url_for controller: '/manage/cms_pages', action: 'index', path: (@pg ? @pg.path : nil) %>" style="text-decoration: none"><span title="Manage Pages" style="font-family: Arial; color: #3c3c3c;">Pages</span></a>
|
35
35
|
</td>
|
36
36
|
|
37
37
|
<td isSpacer="true">
|
@@ -65,7 +65,7 @@
|
|
65
65
|
|
66
66
|
<td style="vertical-align: middle;">
|
67
67
|
<%- if !UseCmsAccessLevels || user_has_permission?(:manage_cms_publishing) -%>
|
68
|
-
<%= form_remote_tag(:url => { :controller => '/
|
68
|
+
<%= form_remote_tag(:url => { :controller => '/manage/cms_pages', :action => 'set_page_version', :id => @pg },
|
69
69
|
:loading => "$('set_page_version_loading').show();",
|
70
70
|
:complete => "$('set_page_version_loading').hide();" + (@pg ? "$('pg_published_version_container').style.borderColor = ($('pg_published_version').value == '0' || $('pg_published_version').value == '#{@pg.versions.last.version}') ? '#EBEBEB' : 'red';" : '')) do -%>
|
71
71
|
<div id="pg_published_version_container" style="border-color: <%= @pg && (@pg.published_version == 0 || @pg.published_version == @pg.versions.last.version) ? '#EBEBEB' : 'red' %>; border-style: solid; border-width: 2px;">
|
@@ -78,7 +78,7 @@
|
|
78
78
|
<% end %>
|
79
79
|
<%- else -%>
|
80
80
|
<%- if params[:version] && params[:version].to_i != @pg.published_version && !(@pg.published_version == 0 && params[:version].to_i == @pg.versions.count) -%>
|
81
|
-
<%= form_remote_tag(:url => { :controller => '/
|
81
|
+
<%= form_remote_tag(:url => { :controller => '/manage/cms_pages', :action => 'request_review', :id => @pg, :version => (params[:version] || @pg.published_version) },
|
82
82
|
:loading => "$('set_page_version_loading').show();",
|
83
83
|
:complete => "$('set_page_version_loading').hide();") do -%>
|
84
84
|
<%= submit_tag "Submit Version #{(params[:version])} for Review" %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= flash_message %>
|
2
|
+
|
3
|
+
<h2><%= params[:action].titlecase %> Snippet</h2>
|
4
|
+
|
5
|
+
<%= form_with(model: ['manage', @cms_snippet], local: true) do |f| %>
|
6
|
+
<%= f.text_field :name, placeholder: 'Snippet Name', :size => '50' %>
|
7
|
+
<div class="codemirror-html-container">
|
8
|
+
<%= f.text_area :content, class: 'codemirror-html autocomplete-off' %>
|
9
|
+
</div>
|
10
|
+
<%= f.submit 'Save Snippet', class: 'form_button' %>
|
11
|
+
<button onclick="jQuery('#preview_frame').show(); jQuery('#preview_frame')[0].scrollIntoView(); jQuery('#preview_content').val(jQuery('textarea[name=\'cms_snippet[content]\']').val()); jQuery('#preview_form').submit(); return false;" class="form_button">Preview</button>
|
12
|
+
<%= link_to 'Cancel', action: 'index' %>
|
13
|
+
<br>
|
14
|
+
|
15
|
+
<br>
|
16
|
+
<%= render partial: '/manage/cms_templates/template_reference' %>
|
17
|
+
<br>
|
18
|
+
|
19
|
+
<iframe id="preview_frame" name="preview_frame"></iframe>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<%= form_tag(url_for(controller: '/cms/content', action: 'preview_template'), id: 'preview_form', target: 'preview_frame') do %>
|
23
|
+
<%= text_area_tag 'content', '', id: 'preview_content', style: 'display: none;' %>
|
24
|
+
<%= hidden_field_tag 'mode', 'preview' %>
|
25
|
+
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h2>CMS » Snippets</h2>
|
2
2
|
|
3
|
-
<p><%= button_to 'Create New Snippet',
|
3
|
+
<p><%= button_to 'Create New Snippet', new_manage_cms_snippet_path, method: :get %></p>
|
4
4
|
|
5
5
|
<%= flash_message %>
|
6
6
|
|
@@ -8,5 +8,5 @@
|
|
8
8
|
<tr>
|
9
9
|
<th>Name</th>
|
10
10
|
</tr>
|
11
|
-
<%= render
|
11
|
+
<%= render @cms_snippets %>
|
12
12
|
</table>
|
@@ -14,8 +14,8 @@
|
|
14
14
|
<%= snippet('Top Nav') %>
|
15
15
|
<%= page_list('My Page List',
|
16
16
|
template: 'html', header: 'html', footer: 'html',
|
17
|
-
folders: 'f1,f2',
|
18
|
-
exclude_tags: 't3,t4', require_tags: 't5,t6',
|
17
|
+
folders: 'f1,f2', pages: 'p1,p2',
|
18
|
+
include_tags: 't1,t2', exclude_tags: 't3,t4', require_tags: 't5,t6',
|
19
19
|
primary_sort_key: 'article_date', primary_sort_direction: 'asc',
|
20
20
|
item_count: 5, item_offset: 1, use_pagination: 1,
|
21
21
|
empty_message: 'Coming soon!') %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= flash_message %>
|
2
|
+
|
3
|
+
<h2><%= params[:action].titlecase %> Template</h2>
|
4
|
+
|
5
|
+
<%= form_with(model: [:manage, @cms_template], local: true) do |f| %>
|
6
|
+
<%= f.text_field :name, placeholder: 'Template Name', size: '50' %>
|
7
|
+
<div class="codemirror-html-container">
|
8
|
+
<%= f.text_area :content, class: 'codemirror-html autocomplete-off' %>
|
9
|
+
</div>
|
10
|
+
<%= f.submit 'Save Template', class: 'form_button' %>
|
11
|
+
<button onclick="window.CodemirrorInstances.forEach((cm) => { cm.save(); }); jQuery('#preview_frame').show(); jQuery('#preview_frame')[0].scrollIntoView(); jQuery('#preview_content').val(jQuery('textarea[name=\'cms_template[content]\']').val()); jQuery('#preview_form').submit(); return false;" class="form_button">Preview</button>
|
12
|
+
<%= link_to 'Cancel', action: 'index' %>
|
13
|
+
<br>
|
14
|
+
|
15
|
+
<br>
|
16
|
+
<%= render partial: 'template_reference' %>
|
17
|
+
<br>
|
18
|
+
|
19
|
+
<iframe id="preview_frame" name="preview_frame"></iframe>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<%= form_tag(url_for(controller: '/cms/content', action: 'preview_template'), id: 'preview_form', target: 'preview_frame') do %>
|
23
|
+
<%= text_area_tag 'content', '', id: 'preview_content', style: 'display: none;' %>
|
24
|
+
<%= hidden_field_tag 'mode', 'preview' %>
|
25
|
+
<%= hidden_field_tag 'id', params[:id] %>
|
26
|
+
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h2>CMS » Templates</h2>
|
2
2
|
|
3
|
-
<p><%= button_to 'Create New Template',
|
3
|
+
<p><%= button_to 'Create New Template', new_manage_cms_template_path, method: :get %></p>
|
4
4
|
|
5
5
|
<%= flash_message %>
|
6
6
|
|
@@ -8,5 +8,5 @@
|
|
8
8
|
<tr>
|
9
9
|
<th>Name</th>
|
10
10
|
</tr>
|
11
|
-
<%= render
|
11
|
+
<%= render @cms_templates %>
|
12
12
|
</table>
|
@@ -3,10 +3,12 @@
|
|
3
3
|
Manage Your Site
|
4
4
|
</h2>
|
5
5
|
|
6
|
+
<%= flash_message %>
|
7
|
+
|
6
8
|
<p>
|
7
9
|
<ul>
|
8
10
|
<%- if user_has_permission? :manage_cms -%>
|
9
|
-
<li><%= link_to 'CMS',
|
11
|
+
<li><%= link_to 'CMS', manage_cms_path %>
|
10
12
|
- Manage content management system</li>
|
11
13
|
<%- end -%>
|
12
14
|
<%- if user_has_permission? :manage_users -%>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= flash_message %>
|
2
2
|
|
3
|
-
<%= form_for(@
|
3
|
+
<%= form_for(@usr) do |f| %>
|
4
4
|
<table>
|
5
5
|
<tr>
|
6
6
|
<td>First name:</td>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<td><%= f.password_field :password_confirmation %></td>
|
29
29
|
</tr>
|
30
30
|
|
31
|
-
<%- if @
|
31
|
+
<%- if @usr.username != session[:user_username] -%>
|
32
32
|
<tr>
|
33
33
|
<td>This user is allowed to:</td>
|
34
34
|
<td>
|
@@ -13,14 +13,14 @@
|
|
13
13
|
<td bgcolor="#dedede" width="10%"> </td>
|
14
14
|
<td bgcolor="#dedede" width="10%"> </td>
|
15
15
|
</tr>
|
16
|
-
<%- @
|
16
|
+
<%- @usrs.each do |u| %>
|
17
17
|
<tr>
|
18
18
|
<td><%= link_to u.username, :action => 'edit', :id => u %></td>
|
19
19
|
<td><%= u.first_name %></td>
|
20
20
|
<td><%= u.last_name %></td>
|
21
21
|
<td><%= u.active? ? 'Y' : 'N' %>
|
22
22
|
<td><%= button_to(u.active? ? 'Disable' : 'Enable', { :action => (u.active? ? 'disable' : 'enable'), :id => u}, :class => 'form_button') if u.username != session[:user_username] %></td>
|
23
|
-
<td><%= button_to('Delete', { :action => 'destroy', :id => u }, :method => :delete, :class => 'form_button', :
|
23
|
+
<td><%= button_to('Delete', { :action => 'destroy', :id => u }, :method => :delete, :class => 'form_button', :onclick => "return confirm('Are you sure you want to delete #{u.username}?');") if u.username != session[:user_username] %></td>
|
24
24
|
</tr>
|
25
25
|
<% end %>
|
26
26
|
</table>
|
@@ -14,6 +14,9 @@ UseCmsPageCaching = false unless defined? UseCmsPageCaching
|
|
14
14
|
UseCmsAccessLevels = false unless defined? UseCmsAccessLevels
|
15
15
|
EnableAssetTimestamping = true unless defined? EnableAssetTimestamping
|
16
16
|
|
17
|
+
CmsImageMaxWidth = 2500 unless defined? CmsImageMaxWidth
|
18
|
+
CmsImageMaxHeight = 2500 unless defined? CmsImageMaxHeight
|
19
|
+
|
17
20
|
# CMS gallery setup
|
18
21
|
GalleryMaxWidth = 586 unless defined? GalleryMaxWidth
|
19
22
|
GalleryMaxHeight = 400 unless defined? GalleryMaxHeight
|
data/config/routes.rb
CHANGED
@@ -3,21 +3,68 @@ Rails.application.routes.draw do
|
|
3
3
|
match 'manage' => 'management/default#index', :via => [ :get ]
|
4
4
|
match 'manage/login' => 'management/user#login', :via => [ :get, :post ]
|
5
5
|
match 'manage/logout' => 'management/user#logout', :via => [ :get, :post ]
|
6
|
-
match 'manage/user(/:action(/:id))' => 'management/user', :via => [ :get, :post ]
|
7
|
-
|
8
6
|
match 'manage/cms/preview_template' => 'cms/content#preview_template', :via => [ :post ]
|
9
|
-
match 'manage/cms(/:action(/:id))' => 'management/cms', :via => [ :get, :post ]
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
namespace :manage do
|
9
|
+
get 'cms' => 'cms#index'
|
10
|
+
|
11
|
+
resources :cms_pages do
|
12
|
+
collection do
|
13
|
+
get :list_pages, :select_page, :list_pages_select
|
14
|
+
post :list_pages, :select_page, :list_pages_select
|
15
|
+
get :toolbar_preview
|
16
|
+
get :page_attribute
|
17
|
+
|
18
|
+
# for new pages (no id yet)
|
19
|
+
get :show_template_options
|
20
|
+
post :edit_page
|
21
|
+
|
22
|
+
# page list dialog functions
|
23
|
+
post :page_list_add_folder, :page_list_add_tag
|
24
|
+
end
|
14
25
|
member do
|
15
|
-
|
16
|
-
post :
|
17
|
-
|
26
|
+
get :toolbar_preview, :toolbar_edit
|
27
|
+
post :set_page_version, :request_review
|
28
|
+
|
29
|
+
get :edit_page, :show_template_options
|
30
|
+
post :edit_page
|
31
|
+
post :delete_page
|
32
|
+
|
33
|
+
get :edit_page_content, :insert_page_object_config
|
34
|
+
post :edit_page_content
|
35
|
+
|
36
|
+
get :create_file_link, :upload_file, :receive_file
|
37
|
+
post :create_file_link, :upload_file, :receive_file
|
38
|
+
|
39
|
+
get :upload_image, :receive_image, :crop_image, :save_crop, :upload_status
|
40
|
+
post :upload_image, :receive_image, :crop_image, :save_crop, :upload_status
|
41
|
+
get :upload_thumb, :crop_thumb, :save_crop_thumb
|
42
|
+
post :upload_thumb, :crop_thumb, :save_crop_thumb
|
43
|
+
get :upload_feature_image, :crop_feature_image, :save_crop_feature_image
|
44
|
+
post :upload_feature_image, :crop_feature_image, :save_crop_feature_image
|
45
|
+
|
46
|
+
|
47
|
+
get :receive_gallery, :complete_gallery, :gallery_setup, :add_to_gallery
|
48
|
+
post :receive_gallery, :complete_gallery, :gallery_setup, :add_to_gallery
|
49
|
+
get :gallery_management, :select_gallery, :set_gallery_order, :save_gallery_settings
|
50
|
+
post :gallery_management, :select_gallery, :set_gallery_order, :save_gallery_settings
|
51
|
+
get :sort_images, :sort_images_save
|
52
|
+
post :sort_images, :sort_images_save
|
53
|
+
get :image_details, :update_caption
|
54
|
+
post :image_details, :update_caption
|
55
|
+
# get :delete_photo, :delete_gallery
|
56
|
+
post :delete_photo, :delete_gallery
|
18
57
|
end
|
19
58
|
end
|
20
|
-
|
59
|
+
resources :cms_templates
|
60
|
+
resources :cms_snippets
|
61
|
+
end
|
62
|
+
|
63
|
+
resources :users, path: 'manage/users', controller: 'management/users' do
|
64
|
+
member do
|
65
|
+
post :enable, :disable
|
66
|
+
end
|
67
|
+
end
|
21
68
|
|
22
69
|
match 'util/date_picker' => 'util#date_picker', :as => :date_picker, :via => [ :get, :post ]
|
23
70
|
|
@@ -1,18 +1,14 @@
|
|
1
|
-
class AddSettingsTable < ActiveRecord::Migration
|
1
|
+
class AddSettingsTable < ActiveRecord::Migration[4.2]
|
2
2
|
|
3
|
-
def
|
4
|
-
create_table
|
5
|
-
t.
|
6
|
-
t.
|
3
|
+
def change
|
4
|
+
create_table :settings do |t|
|
5
|
+
t.string :name, null: false
|
6
|
+
t.text :value
|
7
7
|
|
8
|
-
t.
|
9
|
-
t.
|
8
|
+
t.datetime :created_on
|
9
|
+
t.datetime :updated_on
|
10
10
|
end
|
11
|
-
add_index "settings", ["name"], :
|
12
|
-
end
|
13
|
-
|
14
|
-
def down
|
15
|
-
drop_table "settings"
|
11
|
+
add_index "settings", ["name"], name: "UN_settings_name", unique: true
|
16
12
|
end
|
17
13
|
|
18
14
|
end
|
@@ -1,17 +1,13 @@
|
|
1
|
-
class AddTasksTable < ActiveRecord::Migration
|
1
|
+
class AddTasksTable < ActiveRecord::Migration[4.2]
|
2
2
|
|
3
|
-
def
|
4
|
-
create_table
|
5
|
-
t.
|
3
|
+
def change
|
4
|
+
create_table :tasks do |t|
|
5
|
+
t.string :name, null: false
|
6
6
|
|
7
|
-
t.
|
8
|
-
t.
|
7
|
+
t.datetime :created_on
|
8
|
+
t.datetime :updated_on
|
9
9
|
end
|
10
|
-
add_index "tasks", ["name"], :
|
11
|
-
end
|
12
|
-
|
13
|
-
def down
|
14
|
-
drop_table "tasks"
|
10
|
+
add_index "tasks", ["name"], name: "UN_tasks_name", unique: true
|
15
11
|
end
|
16
12
|
|
17
13
|
end
|