adva 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/adva.gemspec +3 -0
- data/app/assets/config/manifest.js +6 -0
- data/app/assets/javascripts/adva_cms/ckeditor.js.erb +12 -0
- data/app/assets/javascripts/adva_cms/concat_main_menus.js +13 -0
- data/app/assets/javascripts/adva_cms/jquery.table_tree.js +704 -0
- data/app/assets/javascripts/adva_cms.js +7 -0
- data/app/assets/javascripts/ckeditor/config.js.erb +94 -0
- data/app/assets/stylesheets/adva_cms/admin/common.scss +15 -1
- data/app/assets/stylesheets/adva_cms/admin/projection.scss +2 -5
- data/app/assets/stylesheets/adva_cms/admin/sidebar.scss +30 -9
- data/app/assets/stylesheets/adva_cms/admin.scss +1 -1
- data/app/controllers/admin/base_controller.rb +10 -24
- data/app/controllers/admin/page/articles_controller.rb +8 -27
- data/app/controllers/admin/page/categories_controller.rb +6 -9
- data/app/controllers/admin/page/links_controller.rb +6 -9
- data/app/controllers/admin/sections_controller.rb +7 -9
- data/app/controllers/admin/sites_controller.rb +9 -12
- data/app/controllers/admin/users_controller.rb +6 -9
- data/app/controllers/articles_controller.rb +30 -57
- data/app/controllers/base_controller.rb +8 -8
- data/app/controllers/password_controller.rb +3 -5
- data/app/controllers/session_controller.rb +3 -5
- data/app/helpers/activities_helper.rb +9 -20
- data/app/helpers/admin/base_helper.rb +4 -22
- data/app/helpers/base_helper.rb +1 -1
- data/app/helpers/content_helper.rb +7 -5
- data/app/helpers/resource_helper.rb +4 -5
- data/app/helpers/users_helper.rb +1 -1
- data/app/models/activity.rb +3 -0
- data/app/models/article.rb +0 -11
- data/app/models/category.rb +3 -3
- data/app/models/content.rb +10 -39
- data/app/models/link.rb +0 -1
- data/app/models/password_mailer.rb +6 -9
- data/app/models/section.rb +6 -7
- data/app/models/site.rb +0 -2
- data/app/models/user.rb +1 -2
- data/app/views/activity_notifier/new_content_notification.html.erb +5 -5
- data/app/views/admin/activities/_activities.html.erb +4 -4
- data/app/views/admin/activities/_comment.html.erb +21 -21
- data/app/views/admin/activities/_content.html.erb +4 -3
- data/app/views/admin/activities/_topic.html.erb +5 -5
- data/app/views/admin/install/confirmation.html.erb +3 -3
- data/app/views/admin/install/index.html.erb +14 -14
- data/app/views/admin/page/articles/_form.html.erb +28 -25
- data/app/views/admin/page/articles/_options.html.erb +3 -4
- data/app/views/admin/page/articles/edit.html.erb +3 -3
- data/app/views/admin/page/articles/new.html.erb +4 -4
- data/app/views/admin/page/categories/edit.html.erb +9 -9
- data/app/views/admin/page/categories/index.html.erb +16 -16
- data/app/views/admin/page/categories/new.html.erb +5 -3
- data/app/views/admin/page/contents/index.html.erb +3 -18
- data/app/views/admin/page/links/_form.html.erb +17 -17
- data/app/views/admin/page/links/_options.html.erb +16 -19
- data/app/views/admin/page/links/edit.html.erb +3 -3
- data/app/views/admin/page/links/new.html.erb +3 -3
- data/app/views/admin/sections/_form.html.haml +5 -5
- data/app/views/admin/sections/edit.html.haml +2 -2
- data/app/views/admin/sections/index.html.erb +18 -18
- data/app/views/admin/sections/new.html.erb +15 -13
- data/app/views/admin/sections/settings/_page.html.haml +4 -6
- data/app/views/admin/shared/_header.html.erb +5 -4
- data/app/views/admin/shared/_section_tree.html.erb +2 -2
- data/app/views/admin/sites/_email_notifications.html.erb +6 -7
- data/app/views/admin/sites/_form.html.erb +7 -7
- data/app/views/admin/sites/_recent_users.html.erb +4 -2
- data/app/views/admin/sites/_unapproved_comments.html.erb +1 -1
- data/app/views/admin/sites/index.html.erb +1 -1
- data/app/views/admin/sites/new.html.erb +2 -2
- data/app/views/admin/sites/show.html.erb +7 -8
- data/app/views/admin/users/edit.html.erb +1 -1
- data/app/views/admin/users/index.html.erb +10 -10
- data/app/views/admin/users/new.html.erb +1 -1
- data/app/views/admin/users/show.html.erb +7 -7
- data/app/views/layouts/admin.html.haml +3 -5
- data/app/views/layouts/login.html.erb +1 -1
- data/app/views/password/edit.html.erb +12 -5
- data/app/views/password/new.html.erb +7 -7
- data/app/views/password_mailer/reset_password_email.html.erb +21 -1
- data/app/views/password_mailer/updated_password_email.html.erb +3 -1
- data/app/views/session/new.html.erb +9 -9
- data/app/views/shared/_flash.html.erb +2 -2
- data/app/views/shared/_sidebar.html.erb +2 -2
- data/config/initializers/ckeditor.rb +61 -0
- data/config/initializers/time_format.rb +2 -0
- data/lib/adva/authenticate_user.rb +193 -0
- data/lib/{active_record → adva}/belongs_to_author.rb +4 -4
- data/lib/adva/event.rb +34 -0
- data/lib/adva/extensible_forms.rb +285 -0
- data/lib/{has_options.rb → adva/has_options.rb} +5 -7
- data/lib/adva/has_permalink.rb +36 -0
- data/lib/adva/version.rb +1 -1
- data/lib/adva.rb +10 -36
- data/lib/rails_ext/action_controller/event_helper.rb +1 -1
- data/lib/rails_ext.rb +0 -9
- data/vendor/gems/cacheable_flash/.gitignore +8 -0
- data/vendor/gems/cacheable_flash/Gemfile +8 -0
- data/vendor/gems/cacheable_flash/README.md +35 -0
- data/vendor/gems/cacheable_flash/Rakefile +4 -0
- data/vendor/gems/cacheable_flash/bin/console +15 -0
- data/vendor/gems/cacheable_flash/bin/setup +8 -0
- data/vendor/gems/cacheable_flash/cacheable_flash.gemspec +38 -0
- data/vendor/gems/cacheable_flash/lib/cacheable_flash/controller.rb +29 -0
- data/vendor/gems/cacheable_flash/lib/cacheable_flash/javascript.js +19 -0
- data/vendor/gems/cacheable_flash/lib/cacheable_flash/middleware.rb +30 -0
- data/vendor/gems/cacheable_flash/lib/cacheable_flash/version.rb +5 -0
- data/vendor/gems/cacheable_flash/lib/cacheable_flash.rb +12 -0
- data/vendor/gems/simple_taggable/lib/tag_list.rb +1 -1
- data/vendor/gems/tags/lib/menu.rb +1 -1
- data/vendor/gems/tags/lib/tags/tag.rb +1 -1
- metadata +71 -144
- data/app/assets/javascripts/adva_cms/admin/jquery.admin.js +0 -23
- data/app/assets/javascripts/adva_cms/admin/jquery.article.js +0 -22
- data/app/assets/javascripts/adva_cms/admin/jquery.cached_pages.js +0 -14
- data/app/assets/javascripts/adva_cms/admin/jquery.table_tree.js +0 -7
- data/app/assets/javascripts/adva_cms/application.js +0 -13
- data/app/assets/javascripts/adva_cms/base.js +0 -4
- data/app/assets/javascripts/adva_cms/cookie.js +0 -49
- data/app/assets/javascripts/adva_cms/jquery/jquery-lowpro.js +0 -224
- data/app/assets/javascripts/adva_cms/jquery/jquery.qtip.js +0 -2085
- data/app/assets/javascripts/adva_cms/jquery/jquery.table_tree.js +0 -307
- data/app/assets/javascripts/adva_cms/jquery/jquery.tablednd_0_5.js +0 -386
- data/app/assets/javascripts/adva_cms/jquery.common.js +0 -41
- data/app/assets/javascripts/adva_cms/jquery.dates.js +0 -51
- data/app/assets/javascripts/adva_cms/jquery.flash.js +0 -59
- data/app/assets/javascripts/adva_cms/jquery.roles.js +0 -25
- data/app/assets/javascripts/adva_cms/json.js +0 -139
- data/app/controllers/admin/base_account_controller.rb +0 -13
- data/app/controllers/admin/install_controller.rb +0 -61
- data/app/controllers/admin/plugins_controller.rb +0 -38
- data/app/helpers/meta_tags_helper.rb +0 -30
- data/app/models/account.rb +0 -7
- data/app/models/event.rb +0 -34
- data/app/views/admin/articles/_meta_tags.html.erb +0 -7
- data/app/views/admin/cached_pages/_filter.html.erb +0 -8
- data/app/views/admin/cached_pages/destroy.js.erb +0 -18
- data/app/views/admin/cached_pages/index.html.erb +0 -26
- data/app/views/admin/plugins/_form.html.erb +0 -11
- data/app/views/admin/plugins/index.html.erb +0 -16
- data/app/views/admin/plugins/show.html.erb +0 -43
- data/app/views/admin/shared/_language_select.html.erb +0 -6
- data/app/views/admin/shared/_section_summary.html.erb +0 -23
- data/app/views/admin/sites/_meta_tags.html.erb +0 -15
- data/app/views/layouts/default.html.erb +0 -38
- data/app/views/layouts/simple.html.erb +0 -22
- data/app/views/shared/_footer.html.erb +0 -4
- data/app/views/shared/messages/insufficient_permissions.html.erb +0 -4
- data/config/initializers/article.rb +0 -8
- data/config/initializers/has_options.rb +0 -2
- data/config/initializers/has_permalink.rb +0 -2
- data/config/initializers/site.rb +0 -8
- data/config/locales/en.yml +0 -1319
- data/lib/action_controller/authenticate_anonymous.rb +0 -69
- data/lib/action_controller/authenticate_user.rb +0 -203
- data/lib/core_ext.rb +0 -7
- data/lib/extensible_forms.rb +0 -284
- data/lib/has_permalink.rb +0 -33
- data/lib/login/helper_integration.rb +0 -11
- data/lib/login/mail_config.rb +0 -39
- data/lib/rails_ext/action_controller/cacheable_flash.rb +0 -30
- data/lib/rails_ext/action_controller/content_for_assignments.rb +0 -106
- data/lib/rails_ext/action_controller/page_caching.rb +0 -23
- data/lib/rails_ext/action_controller/responds_to_parent.rb +0 -46
- data/lib/rails_ext/active_record/exists.rb +0 -5
- data/lib/rails_ext/active_record/sti_instantiation.rb +0 -35
- data/lib/rails_ext/active_record/sticky_changes.rb +0 -30
- data/lib/rails_ext/railties/plugin.rb +0 -58
- data/lib/rails_ext/railties/plugin_configuration.rb +0 -72
- data/lib/registry.rb +0 -49
- data/lib/tasks/translation.rake +0 -69
- data/lib/time_hacks.rb +0 -57
- data/lib/webrat_patch.rb +0 -11
- data/test/meta_tags_test.rb +0 -42
- data/vendor/gems/has_counter/.gitignore +0 -17
- data/vendor/gems/has_counter/Gemfile +0 -4
- data/vendor/gems/has_counter/LICENSE +0 -22
- data/vendor/gems/has_counter/MIT-LICENSE +0 -20
- data/vendor/gems/has_counter/README.markdown +0 -64
- data/vendor/gems/has_counter/README.md +0 -29
- data/vendor/gems/has_counter/Rakefile +0 -2
- data/vendor/gems/has_counter/db/migrate/20080601194338_create_counters_table.rb.rb +0 -13
- data/vendor/gems/has_counter/has_counter.gemspec +0 -17
- data/vendor/gems/has_counter/lib/active_record/has_counter.rb +0 -67
- data/vendor/gems/has_counter/lib/counter.rb +0 -23
- data/vendor/gems/has_counter/lib/has_counter/version.rb +0 -3
- data/vendor/gems/has_counter/lib/has_counter.rb +0 -4
- data/vendor/gems/has_counter/spec/has_counter.sqlite3.db +0 -0
- data/vendor/gems/has_counter/spec/has_counter_spec.rb +0 -55
- data/vendor/gems/has_counter/spec/spec_helper.rb +0 -117
- data/vendor/gems/has_filter/.gitignore +0 -17
- data/vendor/gems/has_filter/Gemfile +0 -4
- data/vendor/gems/has_filter/LICENSE +0 -22
- data/vendor/gems/has_filter/README.md +0 -29
- data/vendor/gems/has_filter/Rakefile +0 -2
- data/vendor/gems/has_filter/app/assets/images/has_filter/filter_add.png +0 -0
- data/vendor/gems/has_filter/app/assets/images/has_filter/filter_button_left.png +0 -0
- data/vendor/gems/has_filter/app/assets/images/has_filter/filter_button_right.png +0 -0
- data/vendor/gems/has_filter/app/assets/images/has_filter/filter_remove.png +0 -0
- data/vendor/gems/has_filter/app/assets/javascripts/has_filter/filter.js +0 -35
- data/vendor/gems/has_filter/app/assets/javascripts/has_filter/jquery.filter.js +0 -23
- data/vendor/gems/has_filter/app/assets/stylesheets/has_filter/alternate/filter.scss +0 -102
- data/vendor/gems/has_filter/app/assets/stylesheets/has_filter/filter.scss +0 -100
- data/vendor/gems/has_filter/app/helpers/filter_helper.rb +0 -3
- data/vendor/gems/has_filter/has_filter.gemspec +0 -17
- data/vendor/gems/has_filter/init.rb +0 -3
- data/vendor/gems/has_filter/lib/has_filter/active_record/act_macro.rb +0 -102
- data/vendor/gems/has_filter/lib/has_filter/filter/base.rb +0 -67
- data/vendor/gems/has_filter/lib/has_filter/filter/categorized.rb +0 -24
- data/vendor/gems/has_filter/lib/has_filter/filter/chain.rb +0 -45
- data/vendor/gems/has_filter/lib/has_filter/filter/set.rb +0 -80
- data/vendor/gems/has_filter/lib/has_filter/filter/state.rb +0 -25
- data/vendor/gems/has_filter/lib/has_filter/filter/tagged.rb +0 -22
- data/vendor/gems/has_filter/lib/has_filter/filter/text.rb +0 -55
- data/vendor/gems/has_filter/lib/has_filter/filter.rb +0 -17
- data/vendor/gems/has_filter/lib/has_filter/version.rb +0 -3
- data/vendor/gems/has_filter/lib/has_filter.rb +0 -22
- data/vendor/gems/has_filter/test/db/setup.rb +0 -45
- data/vendor/gems/has_filter/test/db/test.sqlite3.db +0 -0
- data/vendor/gems/has_filter/test/fixtures.rb +0 -15
- data/vendor/gems/has_filter/test/has_filter/filter_chain_test.rb +0 -41
- data/vendor/gems/has_filter/test/has_filter/filter_scopes_test.rb +0 -102
- data/vendor/gems/has_filter/test/has_filter/filter_tags_test.rb +0 -113
- data/vendor/gems/has_filter/test/has_filter/integration.rb +0 -15
- data/vendor/gems/has_filter/test/has_filter/scopes_test.rb +0 -48
- data/vendor/gems/has_filter/test/log/test.log +0 -34346
- data/vendor/gems/has_filter/test/models.rb +0 -23
- data/vendor/gems/has_filter/test/templates/has_filter/test/index.html.erb +0 -5
- data/vendor/gems/has_filter/test/test_helper.rb +0 -66
- data/vendor/gems/xss_terminate/.gitignore +0 -17
- data/vendor/gems/xss_terminate/Gemfile +0 -4
- data/vendor/gems/xss_terminate/LICENSE +0 -22
- data/vendor/gems/xss_terminate/MIT-LICENSE +0 -20
- data/vendor/gems/xss_terminate/README +0 -94
- data/vendor/gems/xss_terminate/README.md +0 -29
- data/vendor/gems/xss_terminate/Rakefile +0 -23
- data/vendor/gems/xss_terminate/lib/html5lib_sanitize.rb +0 -2453
- data/vendor/gems/xss_terminate/lib/rails_sanitize.rb +0 -8
- data/vendor/gems/xss_terminate/lib/xss_terminate/version.rb +0 -3
- data/vendor/gems/xss_terminate/lib/xss_terminate.rb +0 -141
- data/vendor/gems/xss_terminate/tasks/xss_terminate_tasks.rake +0 -7
- data/vendor/gems/xss_terminate/test/models/comment.rb +0 -5
- data/vendor/gems/xss_terminate/test/models/entry.rb +0 -7
- data/vendor/gems/xss_terminate/test/models/message.rb +0 -3
- data/vendor/gems/xss_terminate/test/models/person.rb +0 -5
- data/vendor/gems/xss_terminate/test/models/review.rb +0 -5
- data/vendor/gems/xss_terminate/test/schema.rb +0 -34
- data/vendor/gems/xss_terminate/test/setup_test.rb +0 -16
- data/vendor/gems/xss_terminate/test/xss_terminate_test.rb +0 -50
- data/vendor/gems/xss_terminate/xss_terminate.gemspec +0 -17
- /data/lib/tasks/{adva_cms.rake → adva.rake} +0 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
//= require nacelle/ckeditor
|
2
|
+
|
3
|
+
/*
|
4
|
+
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
5
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
6
|
+
*/
|
7
|
+
|
8
|
+
CKEDITOR.editorConfig = function( config )
|
9
|
+
{
|
10
|
+
config.versionCheck = false
|
11
|
+
|
12
|
+
// Define changes to default configuration here. For example:
|
13
|
+
// config.language = 'fr';
|
14
|
+
// config.uiColor = '#AADC6E';
|
15
|
+
|
16
|
+
/* Filebrowser routes */
|
17
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed.
|
18
|
+
config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
|
19
|
+
|
20
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Flash dialog.
|
21
|
+
config.filebrowserFlashBrowseUrl = "/ckeditor/attachment_files";
|
22
|
+
|
23
|
+
// The location of a script that handles file uploads in the Flash dialog.
|
24
|
+
config.filebrowserFlashUploadUrl = "/ckeditor/attachment_files";
|
25
|
+
|
26
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Link tab of Image dialog.
|
27
|
+
config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
|
28
|
+
|
29
|
+
// The location of an external file browser, that should be launched when "Browse Server" button is pressed in the Image dialog.
|
30
|
+
config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
|
31
|
+
|
32
|
+
// The location of a script that handles file uploads in the Image dialog.
|
33
|
+
config.filebrowserImageUploadUrl = "/ckeditor/pictures?";
|
34
|
+
|
35
|
+
// The location of a script that handles file uploads.
|
36
|
+
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
|
37
|
+
|
38
|
+
// For inline style definition.
|
39
|
+
config.stylesSet = 'my_styles';
|
40
|
+
|
41
|
+
config.allowedContent = true;
|
42
|
+
config.filebrowserUploadMethod = 'form';
|
43
|
+
|
44
|
+
config.extraAllowedContent = 'span cell form input select option[*]';
|
45
|
+
config.contentsCss = '<%= asset_path("ckeditor.css") %>';
|
46
|
+
config.extraPlugins = 'cells';
|
47
|
+
config.removePlugins = 'resize';
|
48
|
+
config.colorButton_colors = '4e89c0,bf370d,4b5774,4DAB36,4f4f4f';
|
49
|
+
|
50
|
+
// Toolbar groups configuration.
|
51
|
+
config.toolbar = [
|
52
|
+
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Maximize', 'Source'] },
|
53
|
+
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
|
54
|
+
// { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
|
55
|
+
// { name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
|
56
|
+
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
|
57
|
+
//{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar' ] },
|
58
|
+
{ name: 'insert', items: [ 'Image', 'Media', 'Table', 'HorizontalRule', 'SpecialChar', 'Iframe', 'Youtube', 'InsertCell' ] },
|
59
|
+
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
|
60
|
+
'/',
|
61
|
+
{ name: 'styles', items: [ 'Styles' ] },
|
62
|
+
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'TextColor', '-', 'RemoveFormat' ] }
|
63
|
+
];
|
64
|
+
};
|
65
|
+
|
66
|
+
CKEDITOR.stylesSet.add( 'my_styles', [
|
67
|
+
// Block-level styles.
|
68
|
+
{ name: ':Paragraph', element: 'p' },
|
69
|
+
|
70
|
+
{ name: 'Heading 2', element: 'h2' },
|
71
|
+
{ name: 'Heading 3', element: 'h3', attributes: { 'class': 'h3-header' } },
|
72
|
+
{ name: 'Heading 4', element: 'h4' },
|
73
|
+
{ name: 'Heading 5', element: 'h5' },
|
74
|
+
|
75
|
+
// Inline styles.
|
76
|
+
{ name: 'Clear', element: 'div', attributes: { 'class': 'clear' } },
|
77
|
+
{ name: 'Stat list', element: 'ul', attributes: { 'class': 'stats-list' } },
|
78
|
+
{ name: 'Subtitle', element: 'p', attributes: { 'class': 'subtitle_two' } },
|
79
|
+
{ name: 'Caption img left', element: 'p', attributes: { 'class': 'p-image--left' } },
|
80
|
+
{ name: 'Caption img right', element: 'p', attributes: { 'class': 'p-image--right' } },
|
81
|
+
{ name: 'Testimonial Image', element: 'blockquote', attributes: { 'class': '-img-col' } },
|
82
|
+
{ name: 'Testimonial 2-col', element: 'blockquote', attributes: { 'class': '-two-col' } },
|
83
|
+
{ name: 'Testimonial 3-col', element: 'blockquote', attributes: { 'class': '-three-col' } },
|
84
|
+
{ name: 'Blockquote left', element: 'blockquote', attributes: { 'class': 'blockquote-left' } },
|
85
|
+
{ name: 'Blockquote right', element: 'blockquote', attributes: { 'class': 'blockquote-right' } },
|
86
|
+
{ name: 'Line chart up', element: 'span', attributes: { 'class': 'line-chart-up' } },
|
87
|
+
{ name: 'Line chart down', element: 'span', attributes: { 'class': 'line-chart-down' } },
|
88
|
+
{ name: 'Reverse button', element: 'a', attributes: { 'class': 'reverse-button' } },
|
89
|
+
{ name: 'No shadow', element: 'img', attributes: { 'class': 'no-shadow' } },
|
90
|
+
{ name: 'Hidden image', element: 'img', attributes: { 'class': '-hidden-img' } }
|
91
|
+
]);
|
92
|
+
|
93
|
+
CKEDITOR.dtd.$removeEmpty.span = 0;
|
94
|
+
|
@@ -73,4 +73,18 @@ div.pagination a {
|
|
73
73
|
}
|
74
74
|
div.pagination a:hover, div.pagination a:focus {
|
75
75
|
text-decoration: underline;
|
76
|
-
}
|
76
|
+
}
|
77
|
+
|
78
|
+
/* Checkbox toggle visibility */
|
79
|
+
.show-if-previous-checked {
|
80
|
+
display: none;
|
81
|
+
}
|
82
|
+
:checked ~ .show-if-previous-checked {
|
83
|
+
display: initial;
|
84
|
+
}
|
85
|
+
.show-if-previous-unchecked {
|
86
|
+
display: initial;
|
87
|
+
}
|
88
|
+
:checked ~ .show-if-previous-unchecked {
|
89
|
+
display: none;
|
90
|
+
}
|
@@ -45,12 +45,9 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
|
45
45
|
#sidebar textarea {
|
46
46
|
font-size: 14px;
|
47
47
|
}
|
48
|
-
#sidebar .tabs > ul li
|
48
|
+
#sidebar .tabs > ul li label {
|
49
49
|
font-size: 15px;
|
50
50
|
}
|
51
|
-
#sidebar .tabs > ul li.active a {
|
52
|
-
background: #f6f6f6;
|
53
|
-
}
|
54
51
|
|
55
52
|
/* top.css */
|
56
53
|
#top > ul > li > a {
|
@@ -115,4 +112,4 @@ select {
|
|
115
112
|
}
|
116
113
|
#content form h2 {
|
117
114
|
font-size: 14pt;
|
118
|
-
}
|
115
|
+
}
|
@@ -31,9 +31,13 @@
|
|
31
31
|
#sidebar .tabs > ul li {
|
32
32
|
float: left;
|
33
33
|
}
|
34
|
-
#sidebar .tabs > ul li
|
34
|
+
#sidebar .tabs > ul li label {
|
35
|
+
text-decoration: underline;
|
36
|
+
cursor: pointer;
|
35
37
|
display: block;
|
38
|
+
color: #76a3a3;
|
36
39
|
font-size: 12px;
|
40
|
+
margin-top: 0;
|
37
41
|
padding: 3px 15px;
|
38
42
|
outline: none;
|
39
43
|
-webkit-border-top-left-radius: 4px;
|
@@ -41,22 +45,39 @@
|
|
41
45
|
-moz-border-top-left-radius: 4px;
|
42
46
|
-moz-border-top-right-radius: 4px;
|
43
47
|
}
|
44
|
-
#sidebar .tabs >
|
45
|
-
|
48
|
+
#sidebar .tabs > input {
|
49
|
+
opacity: 0.001;
|
50
|
+
position: absolute;
|
51
|
+
z-index: 1;
|
52
|
+
top: -15px;
|
46
53
|
}
|
47
|
-
#
|
48
|
-
|
49
|
-
|
54
|
+
#adva_current_tab_0 { left: calc(15px * 0); }
|
55
|
+
#adva_current_tab_1 { left: calc(15px * 1); }
|
56
|
+
#adva_current_tab_2 { left: calc(15px * 2); }
|
57
|
+
#adva_current_tab_3 { left: calc(15px * 3); }
|
58
|
+
#adva_current_tab_4 { left: calc(15px * 4); }
|
59
|
+
#adva_current_tab_0:checked ~ ul li label[for=adva_current_tab_0],
|
60
|
+
#adva_current_tab_1:checked ~ ul li label[for=adva_current_tab_1],
|
61
|
+
#adva_current_tab_2:checked ~ ul li label[for=adva_current_tab_2],
|
62
|
+
#adva_current_tab_3:checked ~ ul li label[for=adva_current_tab_3],
|
63
|
+
#adva_current_tab_4:checked ~ ul li label[for=adva_current_tab_4] {
|
64
|
+
background-color: #544535;
|
65
|
+
color: white;
|
50
66
|
}
|
51
|
-
#sidebar .tabs > ul li
|
52
|
-
|
67
|
+
#sidebar .tabs > ul li label:hover {
|
68
|
+
background-color: #544535;
|
69
|
+
text-decoration: none;
|
53
70
|
}
|
54
71
|
#sidebar .tabs .tab {
|
55
72
|
display: none;
|
56
73
|
clear: both;
|
57
74
|
padding: 5px 20px 20px 20px;
|
58
75
|
}
|
59
|
-
#
|
76
|
+
#adva_current_tab_0:checked ~ .tab[for=adva_current_tab_0],
|
77
|
+
#adva_current_tab_1:checked ~ .tab[for=adva_current_tab_1],
|
78
|
+
#adva_current_tab_2:checked ~ .tab[for=adva_current_tab_2],
|
79
|
+
#adva_current_tab_3:checked ~ .tab[for=adva_current_tab_3],
|
80
|
+
#adva_current_tab_4:checked ~ .tab[for=adva_current_tab_4] {
|
60
81
|
display: block;
|
61
82
|
}
|
62
83
|
.filters .submit {
|
@@ -10,6 +10,6 @@
|
|
10
10
|
//= require "adva_cms/admin/themes.css"
|
11
11
|
//= require "adva_cms/admin/helptip.css"
|
12
12
|
//= require "adva_cms/admin/users.css"
|
13
|
+
//= require "adva_cms/admin/activities.css"
|
13
14
|
//= require "adva_cms/jquery/jquery.tooltip.css"
|
14
15
|
//= require "adva_cms/admin/projection.css"
|
15
|
-
//= require "has_filter/filter.css"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "adva/authenticate_user"
|
2
|
+
|
1
3
|
class Admin::BaseController < ApplicationController
|
2
4
|
layout "admin"
|
3
5
|
|
@@ -7,8 +9,9 @@ class Admin::BaseController < ApplicationController
|
|
7
9
|
include ResourceHelper
|
8
10
|
helper TableBuilder
|
9
11
|
|
10
|
-
helper :base, :resource, :content
|
11
|
-
|
12
|
+
helper :base, :resource, :content
|
13
|
+
|
14
|
+
include Adva::AuthenticateUser
|
12
15
|
|
13
16
|
helper_method :menu, :content_locale, :has_permission?
|
14
17
|
|
@@ -25,31 +28,15 @@ class Admin::BaseController < ApplicationController
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def require_authentication
|
28
|
-
if
|
29
|
-
return redirect_to_login(
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
else
|
34
|
-
return redirect_to_login(t(:'adva.flash.login_to_access_admin_area_of_account')) if current_user.anonymous?
|
35
|
-
unless current_user.admin?
|
36
|
-
return redirect_to_login(t(:'adva.flash.no_permission_for_admin_area_of_account'))
|
37
|
-
end
|
31
|
+
if current_user.anonymous?
|
32
|
+
return redirect_to_login("Please login to access the admin area of this site.")
|
33
|
+
elsif !current_user.admin?
|
34
|
+
return redirect_to_login("You do not have permission to access the admin area of this site. Please, contact your system administrator or login with another user account.")
|
38
35
|
end
|
39
36
|
end
|
40
37
|
|
41
38
|
def redirect_to_login(notice = nil)
|
42
|
-
|
43
|
-
redirect_to login_url(:return_to => request.url)
|
44
|
-
end
|
45
|
-
|
46
|
-
def rescue_action(exception)
|
47
|
-
if exception.is_a? ActionController::RoleRequired
|
48
|
-
@error = exception
|
49
|
-
render :template => 'shared/messages/insufficient_permissions'
|
50
|
-
else
|
51
|
-
super
|
52
|
-
end
|
39
|
+
redirect_to login_url(return_to: request.url), notice: notice
|
53
40
|
end
|
54
41
|
|
55
42
|
def return_from(action, options = {})
|
@@ -73,7 +60,6 @@ class Admin::BaseController < ApplicationController
|
|
73
60
|
def set_locale
|
74
61
|
params[:locale] =~ /^[\w]{2}$/ or raise 'invalid locale' if params[:locale]
|
75
62
|
I18n.locale = params[:locale] || I18n.default_locale
|
76
|
-
I18n.locale.untaint
|
77
63
|
end
|
78
64
|
|
79
65
|
def set_timezone
|
@@ -30,53 +30,34 @@ class Admin::Page::ArticlesController < Admin::BaseController
|
|
30
30
|
@article = @section.articles.build(params[:article])
|
31
31
|
if @article.save
|
32
32
|
trigger_events(@article)
|
33
|
-
|
34
|
-
redirect_to [:edit, :admin, @section, @article]
|
33
|
+
redirect_to [:edit, :admin, @section, @article], notice: "The article has been created."
|
35
34
|
else
|
36
35
|
set_categories
|
37
|
-
flash.now
|
36
|
+
flash.now.alert = "The article could not be created." + current_resource_errors
|
38
37
|
render :action => 'new'
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
42
41
|
def update
|
43
|
-
params[:article][:version].present? ? rollback : update_attributes
|
44
|
-
end
|
45
|
-
|
46
|
-
def update_attributes
|
47
42
|
@article.attributes = params[:article]
|
48
43
|
|
49
44
|
if @article.save
|
50
45
|
trigger_events(@article)
|
51
|
-
|
52
|
-
redirect_to [:edit, :admin, @section, @article]
|
46
|
+
redirect_to [:edit, :admin, @section, @article], notice: "The article has been updated."
|
53
47
|
else
|
54
48
|
set_categories
|
55
|
-
flash.now
|
49
|
+
flash.now.alert = "The article could not be updated." + current_resource_errors
|
56
50
|
render :action => 'edit'
|
57
51
|
end
|
58
52
|
end
|
59
53
|
|
60
|
-
def rollback
|
61
|
-
version = params[:article][:version].to_i
|
62
|
-
|
63
|
-
if @article.version != version and @article.revert_to(version)
|
64
|
-
trigger_event(@article, :rolledback)
|
65
|
-
flash[:notice] = t(:'adva.articles.flash.rollback.success', :version => version)
|
66
|
-
else
|
67
|
-
flash[:error] = t(:'adva.articles.flash.rollback.failure', :version => version)
|
68
|
-
end
|
69
|
-
redirect_to [:edit, :admin, @section, @article]
|
70
|
-
end
|
71
|
-
|
72
54
|
def destroy
|
73
55
|
if @article.destroy
|
74
56
|
trigger_events(@article)
|
75
|
-
|
76
|
-
redirect_to [:admin, @section, :contents]
|
57
|
+
redirect_to [:admin, @section, :contents], notice: "The article has been deleted."
|
77
58
|
else
|
78
59
|
set_categories
|
79
|
-
flash.now
|
60
|
+
flash.now.alert = "The article could not be deleted." + current_resource_errors
|
80
61
|
render :action => 'edit'
|
81
62
|
end
|
82
63
|
end
|
@@ -130,12 +111,12 @@ class Admin::Page::ArticlesController < Admin::BaseController
|
|
130
111
|
|
131
112
|
unless updated_at = params[:article].delete(:updated_at)
|
132
113
|
# TODO raise something more explicit here
|
133
|
-
raise
|
114
|
+
raise "Can not update article: timestamp missing. Please make sure that your form has a hidden field: updated_at."
|
134
115
|
end
|
135
116
|
|
136
117
|
# We parse the timestamp of article too so we can get rid of those microseconds postgresql adds
|
137
118
|
if @article.updated_at && (Time.zone.parse(updated_at) != Time.zone.parse(@article.updated_at.to_s))
|
138
|
-
flash
|
119
|
+
flash.now.alert = "In the meantime this article has been updated by someone else. Please resolve any conflicts."
|
139
120
|
render :action => :edit
|
140
121
|
end
|
141
122
|
end
|
@@ -11,20 +11,18 @@ class Admin::Page::CategoriesController < Admin::BaseController
|
|
11
11
|
def create
|
12
12
|
@category = @section.categories.build params[:category]
|
13
13
|
if @category.save
|
14
|
-
|
15
|
-
redirect_to [:admin, @section, :categories]
|
14
|
+
redirect_to [:admin, @section, :categories], notice: "The category has been created."
|
16
15
|
else
|
17
|
-
flash.now
|
16
|
+
flash.now.alert = "The category could not be created." + current_resource_errors
|
18
17
|
render :action => "new"
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
22
21
|
def update
|
23
22
|
if @category.update params[:category]
|
24
|
-
|
25
|
-
redirect_to [:admin, @section, :categories]
|
23
|
+
redirect_to [:admin, @section, :categories], notice: "The category has been updated."
|
26
24
|
else
|
27
|
-
flash.now
|
25
|
+
flash.now.alert = "The category could not be updated." + current_resource_errors
|
28
26
|
render :action => 'edit'
|
29
27
|
end
|
30
28
|
end
|
@@ -40,10 +38,9 @@ class Admin::Page::CategoriesController < Admin::BaseController
|
|
40
38
|
|
41
39
|
def destroy
|
42
40
|
if @category.destroy
|
43
|
-
|
44
|
-
redirect_to [:admin, @section, :categories]
|
41
|
+
redirect_to [:admin, @section, :categories], notice: "The category has been deleted."
|
45
42
|
else
|
46
|
-
flash.now
|
43
|
+
flash.now.alert = "The category could not be deleted." + current_resource_errors
|
47
44
|
render :action => 'edit'
|
48
45
|
end
|
49
46
|
end
|
@@ -16,10 +16,9 @@ class Admin::Page::LinksController < Admin::BaseController
|
|
16
16
|
@link = @section.links.build params[:link]
|
17
17
|
if @link.save
|
18
18
|
trigger_events(@link)
|
19
|
-
|
20
|
-
redirect_to [:edit, :admin, @section, @link]
|
19
|
+
redirect_to [:edit, :admin, @section, @link], notice: "The link has been created."
|
21
20
|
else
|
22
|
-
flash.now
|
21
|
+
flash.now.alert = "The link could not be created." + current_resource_errors
|
23
22
|
render :action => 'new'
|
24
23
|
end
|
25
24
|
end
|
@@ -29,10 +28,9 @@ class Admin::Page::LinksController < Admin::BaseController
|
|
29
28
|
|
30
29
|
if @link.save
|
31
30
|
trigger_events(@link)
|
32
|
-
|
33
|
-
redirect_to [:edit, :admin, @section, @link]
|
31
|
+
redirect_to [:edit, :admin, @section, @link], notice: "The link has been updated."
|
34
32
|
else
|
35
|
-
flash.now
|
33
|
+
flash.now.alert = "The link could not be updated." + current_resource_errors
|
36
34
|
render :action => 'edit', :cl => content_locale
|
37
35
|
end
|
38
36
|
end
|
@@ -40,10 +38,9 @@ class Admin::Page::LinksController < Admin::BaseController
|
|
40
38
|
def destroy
|
41
39
|
if @link.destroy
|
42
40
|
trigger_events(@link)
|
43
|
-
|
44
|
-
redirect_to [:admin, @section, :contents]
|
41
|
+
redirect_to [:admin, @section, :contents], notice: "The link has been deleted."
|
45
42
|
else
|
46
|
-
flash.now
|
43
|
+
flash.now.alert = "The link could not be deleted." + current_resource_errors
|
47
44
|
render :action => 'edit'
|
48
45
|
end
|
49
46
|
end
|
@@ -15,12 +15,12 @@ class Admin::SectionsController < Admin::BaseController
|
|
15
15
|
def create
|
16
16
|
@section = @site.sections.build params[:section]
|
17
17
|
if @section.save
|
18
|
-
flash
|
19
|
-
redirect_to (params[:commit] ==
|
18
|
+
flash.notice = "The section has been created."
|
19
|
+
redirect_to (params[:commit] == "Save and create another section" ?
|
20
20
|
[:new, :admin, :section] :
|
21
21
|
[:admin, @section, :articles])
|
22
22
|
else
|
23
|
-
flash.now
|
23
|
+
flash.now.alert = "The section could not be created."
|
24
24
|
render :action => "new"
|
25
25
|
end
|
26
26
|
end
|
@@ -30,20 +30,18 @@ class Admin::SectionsController < Admin::BaseController
|
|
30
30
|
|
31
31
|
def update
|
32
32
|
if @section.update params[:section]
|
33
|
-
|
34
|
-
redirect_to [:edit, :admin, @section]
|
33
|
+
redirect_to [:edit, :admin, @section], notice: "The section has been updated."
|
35
34
|
else
|
36
|
-
flash.now
|
35
|
+
flash.now.alert = "The section could not be updated."
|
37
36
|
render :action => 'edit'
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
41
40
|
def destroy
|
42
41
|
if @section.destroy
|
43
|
-
|
44
|
-
redirect_to [:new, :admin, :section]
|
42
|
+
redirect_to [:new, :admin, :section], notice: "The section has been deleted."
|
45
43
|
else
|
46
|
-
flash.now
|
44
|
+
flash.now.alert = "The section could not be deleted."
|
47
45
|
render :action => 'edit'
|
48
46
|
end
|
49
47
|
end
|
@@ -22,11 +22,10 @@ class Admin::SitesController < Admin::BaseController
|
|
22
22
|
site.sections << section
|
23
23
|
|
24
24
|
if site.save
|
25
|
-
|
26
|
-
redirect_to admin_site_url(site)
|
25
|
+
redirect_to admin_site_url(site), notice: "The site has been created."
|
27
26
|
else
|
28
|
-
flash.now
|
29
|
-
render :
|
27
|
+
flash.now.alert = "The site could not be created"
|
28
|
+
render action: :new
|
30
29
|
end
|
31
30
|
end
|
32
31
|
|
@@ -35,21 +34,19 @@ class Admin::SitesController < Admin::BaseController
|
|
35
34
|
|
36
35
|
def update
|
37
36
|
if @site.update params[:site]
|
38
|
-
|
39
|
-
redirect_to edit_admin_site_url
|
37
|
+
redirect_to edit_admin_site_url, notice: "The site has been updated."
|
40
38
|
else
|
41
|
-
flash.now
|
42
|
-
render :
|
39
|
+
flash.now.alert = "The site could not be updated"
|
40
|
+
render action: :edit
|
43
41
|
end
|
44
42
|
end
|
45
43
|
|
46
44
|
def destroy
|
47
45
|
if @site.destroy
|
48
|
-
|
49
|
-
redirect_to return_from(:site_deleted)
|
46
|
+
redirect_to return_from(:site_deleted), notice: "The site has been deleted."
|
50
47
|
else
|
51
|
-
flash.now
|
52
|
-
render :
|
48
|
+
flash.now.alert = "The site could not be deleted"
|
49
|
+
render action: :show
|
53
50
|
end
|
54
51
|
end
|
55
52
|
|
@@ -20,10 +20,9 @@ class Admin::UsersController < Admin::BaseController
|
|
20
20
|
if @user.save
|
21
21
|
@user.verify! # TODO hu??
|
22
22
|
trigger_events(@user)
|
23
|
-
|
24
|
-
redirect_to admin_user_url(@user)
|
23
|
+
redirect_to [:admin, @user], notice: "The user has been created."
|
25
24
|
else
|
26
|
-
flash.now
|
25
|
+
flash.now.alert = "The user could not be created."
|
27
26
|
render :action => :new
|
28
27
|
end
|
29
28
|
end
|
@@ -34,10 +33,9 @@ class Admin::UsersController < Admin::BaseController
|
|
34
33
|
def update
|
35
34
|
if @user.update(params[:user])
|
36
35
|
trigger_events(@user)
|
37
|
-
|
38
|
-
redirect_to admin_user_url(@user)
|
36
|
+
redirect_to [:admin, @user], notice: "The user has been updated."
|
39
37
|
else
|
40
|
-
flash.now
|
38
|
+
flash.now.alert = "The user could not be updated."
|
41
39
|
render :action => :edit
|
42
40
|
end
|
43
41
|
end
|
@@ -45,10 +43,9 @@ class Admin::UsersController < Admin::BaseController
|
|
45
43
|
def destroy
|
46
44
|
if @user.destroy
|
47
45
|
trigger_events(@user)
|
48
|
-
|
49
|
-
redirect_to admin_users_url
|
46
|
+
redirect_to [:admin, :users], notice: "The user has been deleted."
|
50
47
|
else
|
51
|
-
flash.now
|
48
|
+
flash.now.alert = "The user could not be deleted."
|
52
49
|
render :action => :edit
|
53
50
|
end
|
54
51
|
end
|