adva 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/adva.gemspec +3 -0
  3. data/app/assets/config/manifest.js +6 -0
  4. data/app/assets/javascripts/adva_cms/ckeditor.js.erb +12 -0
  5. data/app/assets/javascripts/adva_cms/concat_main_menus.js +13 -0
  6. data/app/assets/javascripts/adva_cms/jquery.table_tree.js +704 -0
  7. data/app/assets/javascripts/adva_cms.js +7 -0
  8. data/app/assets/javascripts/ckeditor/config.js.erb +94 -0
  9. data/app/assets/stylesheets/adva_cms/admin/common.scss +15 -1
  10. data/app/assets/stylesheets/adva_cms/admin/projection.scss +2 -5
  11. data/app/assets/stylesheets/adva_cms/admin/sidebar.scss +30 -9
  12. data/app/assets/stylesheets/adva_cms/admin.scss +1 -1
  13. data/app/controllers/admin/base_controller.rb +10 -24
  14. data/app/controllers/admin/page/articles_controller.rb +8 -27
  15. data/app/controllers/admin/page/categories_controller.rb +6 -9
  16. data/app/controllers/admin/page/links_controller.rb +6 -9
  17. data/app/controllers/admin/sections_controller.rb +7 -9
  18. data/app/controllers/admin/sites_controller.rb +9 -12
  19. data/app/controllers/admin/users_controller.rb +6 -9
  20. data/app/controllers/articles_controller.rb +30 -52
  21. data/app/controllers/base_controller.rb +8 -8
  22. data/app/controllers/password_controller.rb +3 -5
  23. data/app/controllers/session_controller.rb +3 -5
  24. data/app/helpers/activities_helper.rb +9 -20
  25. data/app/helpers/admin/base_helper.rb +4 -22
  26. data/app/helpers/base_helper.rb +1 -1
  27. data/app/helpers/content_helper.rb +7 -5
  28. data/app/helpers/resource_helper.rb +4 -5
  29. data/app/helpers/users_helper.rb +1 -1
  30. data/app/models/activity.rb +3 -0
  31. data/app/models/article.rb +0 -11
  32. data/app/models/category.rb +3 -3
  33. data/app/models/content.rb +10 -39
  34. data/app/models/link.rb +0 -1
  35. data/app/models/password_mailer.rb +6 -9
  36. data/app/models/section.rb +6 -7
  37. data/app/models/site.rb +0 -2
  38. data/app/models/user.rb +1 -2
  39. data/app/views/activity_notifier/new_content_notification.html.erb +5 -5
  40. data/app/views/admin/activities/_activities.html.erb +4 -4
  41. data/app/views/admin/activities/_comment.html.erb +21 -21
  42. data/app/views/admin/activities/_content.html.erb +4 -3
  43. data/app/views/admin/activities/_topic.html.erb +5 -5
  44. data/app/views/admin/install/confirmation.html.erb +3 -3
  45. data/app/views/admin/install/index.html.erb +14 -14
  46. data/app/views/admin/page/articles/_form.html.erb +28 -25
  47. data/app/views/admin/page/articles/_options.html.erb +3 -4
  48. data/app/views/admin/page/articles/edit.html.erb +3 -3
  49. data/app/views/admin/page/articles/new.html.erb +4 -4
  50. data/app/views/admin/page/categories/edit.html.erb +9 -9
  51. data/app/views/admin/page/categories/index.html.erb +16 -16
  52. data/app/views/admin/page/categories/new.html.erb +5 -3
  53. data/app/views/admin/page/contents/index.html.erb +3 -18
  54. data/app/views/admin/page/links/_form.html.erb +17 -17
  55. data/app/views/admin/page/links/_options.html.erb +16 -19
  56. data/app/views/admin/page/links/edit.html.erb +3 -3
  57. data/app/views/admin/page/links/new.html.erb +3 -3
  58. data/app/views/admin/sections/_form.html.haml +5 -5
  59. data/app/views/admin/sections/edit.html.haml +2 -2
  60. data/app/views/admin/sections/index.html.erb +18 -18
  61. data/app/views/admin/sections/new.html.erb +15 -13
  62. data/app/views/admin/sections/settings/_page.html.haml +4 -6
  63. data/app/views/admin/shared/_header.html.erb +5 -4
  64. data/app/views/admin/shared/_section_tree.html.erb +2 -2
  65. data/app/views/admin/sites/_email_notifications.html.erb +6 -7
  66. data/app/views/admin/sites/_form.html.erb +7 -7
  67. data/app/views/admin/sites/_recent_users.html.erb +4 -2
  68. data/app/views/admin/sites/_unapproved_comments.html.erb +1 -1
  69. data/app/views/admin/sites/index.html.erb +1 -1
  70. data/app/views/admin/sites/new.html.erb +2 -2
  71. data/app/views/admin/sites/show.html.erb +7 -8
  72. data/app/views/admin/users/edit.html.erb +1 -1
  73. data/app/views/admin/users/index.html.erb +10 -10
  74. data/app/views/admin/users/new.html.erb +1 -1
  75. data/app/views/admin/users/show.html.erb +7 -7
  76. data/app/views/layouts/admin.html.haml +3 -5
  77. data/app/views/layouts/login.html.erb +1 -1
  78. data/app/views/password/edit.html.erb +12 -5
  79. data/app/views/password/new.html.erb +7 -7
  80. data/app/views/password_mailer/reset_password_email.html.erb +21 -1
  81. data/app/views/password_mailer/updated_password_email.html.erb +3 -1
  82. data/app/views/session/new.html.erb +9 -9
  83. data/app/views/shared/_flash.html.erb +2 -2
  84. data/app/views/shared/_sidebar.html.erb +2 -2
  85. data/config/initializers/ckeditor.rb +61 -0
  86. data/config/initializers/time_format.rb +2 -0
  87. data/lib/adva/authenticate_user.rb +193 -0
  88. data/lib/{active_record → adva}/belongs_to_author.rb +4 -4
  89. data/lib/adva/event.rb +34 -0
  90. data/lib/adva/extensible_forms.rb +285 -0
  91. data/lib/{has_options.rb → adva/has_options.rb} +5 -7
  92. data/lib/adva/has_permalink.rb +36 -0
  93. data/lib/adva/version.rb +1 -1
  94. data/lib/adva.rb +10 -36
  95. data/lib/rails_ext/action_controller/event_helper.rb +1 -1
  96. data/lib/rails_ext.rb +0 -9
  97. data/vendor/gems/cacheable_flash/.gitignore +8 -0
  98. data/vendor/gems/cacheable_flash/Gemfile +8 -0
  99. data/vendor/gems/cacheable_flash/README.md +35 -0
  100. data/vendor/gems/cacheable_flash/Rakefile +4 -0
  101. data/vendor/gems/cacheable_flash/bin/console +15 -0
  102. data/vendor/gems/cacheable_flash/bin/setup +8 -0
  103. data/vendor/gems/cacheable_flash/cacheable_flash.gemspec +38 -0
  104. data/vendor/gems/cacheable_flash/lib/cacheable_flash/controller.rb +29 -0
  105. data/vendor/gems/cacheable_flash/lib/cacheable_flash/javascript.js +19 -0
  106. data/vendor/gems/cacheable_flash/lib/cacheable_flash/middleware.rb +30 -0
  107. data/vendor/gems/cacheable_flash/lib/cacheable_flash/version.rb +5 -0
  108. data/vendor/gems/cacheable_flash/lib/cacheable_flash.rb +12 -0
  109. data/vendor/gems/simple_taggable/lib/tag_list.rb +1 -1
  110. data/vendor/gems/tags/lib/menu.rb +1 -1
  111. data/vendor/gems/tags/lib/tags/tag.rb +1 -1
  112. metadata +71 -144
  113. data/app/assets/javascripts/adva_cms/admin/jquery.admin.js +0 -23
  114. data/app/assets/javascripts/adva_cms/admin/jquery.article.js +0 -22
  115. data/app/assets/javascripts/adva_cms/admin/jquery.cached_pages.js +0 -14
  116. data/app/assets/javascripts/adva_cms/admin/jquery.table_tree.js +0 -7
  117. data/app/assets/javascripts/adva_cms/application.js +0 -13
  118. data/app/assets/javascripts/adva_cms/base.js +0 -4
  119. data/app/assets/javascripts/adva_cms/cookie.js +0 -49
  120. data/app/assets/javascripts/adva_cms/jquery/jquery-lowpro.js +0 -224
  121. data/app/assets/javascripts/adva_cms/jquery/jquery.qtip.js +0 -2085
  122. data/app/assets/javascripts/adva_cms/jquery/jquery.table_tree.js +0 -307
  123. data/app/assets/javascripts/adva_cms/jquery/jquery.tablednd_0_5.js +0 -386
  124. data/app/assets/javascripts/adva_cms/jquery.common.js +0 -41
  125. data/app/assets/javascripts/adva_cms/jquery.dates.js +0 -51
  126. data/app/assets/javascripts/adva_cms/jquery.flash.js +0 -59
  127. data/app/assets/javascripts/adva_cms/jquery.roles.js +0 -25
  128. data/app/assets/javascripts/adva_cms/json.js +0 -139
  129. data/app/controllers/admin/base_account_controller.rb +0 -13
  130. data/app/controllers/admin/install_controller.rb +0 -61
  131. data/app/controllers/admin/plugins_controller.rb +0 -38
  132. data/app/helpers/meta_tags_helper.rb +0 -30
  133. data/app/models/account.rb +0 -7
  134. data/app/models/event.rb +0 -34
  135. data/app/views/admin/articles/_meta_tags.html.erb +0 -7
  136. data/app/views/admin/cached_pages/_filter.html.erb +0 -8
  137. data/app/views/admin/cached_pages/destroy.js.erb +0 -18
  138. data/app/views/admin/cached_pages/index.html.erb +0 -26
  139. data/app/views/admin/plugins/_form.html.erb +0 -11
  140. data/app/views/admin/plugins/index.html.erb +0 -16
  141. data/app/views/admin/plugins/show.html.erb +0 -43
  142. data/app/views/admin/shared/_language_select.html.erb +0 -6
  143. data/app/views/admin/shared/_section_summary.html.erb +0 -23
  144. data/app/views/admin/sites/_meta_tags.html.erb +0 -15
  145. data/app/views/layouts/default.html.erb +0 -38
  146. data/app/views/layouts/simple.html.erb +0 -22
  147. data/app/views/shared/_footer.html.erb +0 -4
  148. data/app/views/shared/messages/insufficient_permissions.html.erb +0 -4
  149. data/config/initializers/article.rb +0 -8
  150. data/config/initializers/has_options.rb +0 -2
  151. data/config/initializers/has_permalink.rb +0 -2
  152. data/config/initializers/site.rb +0 -8
  153. data/config/locales/en.yml +0 -1319
  154. data/lib/action_controller/authenticate_anonymous.rb +0 -69
  155. data/lib/action_controller/authenticate_user.rb +0 -203
  156. data/lib/core_ext.rb +0 -7
  157. data/lib/extensible_forms.rb +0 -284
  158. data/lib/has_permalink.rb +0 -33
  159. data/lib/login/helper_integration.rb +0 -11
  160. data/lib/login/mail_config.rb +0 -39
  161. data/lib/rails_ext/action_controller/cacheable_flash.rb +0 -30
  162. data/lib/rails_ext/action_controller/content_for_assignments.rb +0 -106
  163. data/lib/rails_ext/action_controller/page_caching.rb +0 -23
  164. data/lib/rails_ext/action_controller/responds_to_parent.rb +0 -46
  165. data/lib/rails_ext/active_record/exists.rb +0 -5
  166. data/lib/rails_ext/active_record/sti_instantiation.rb +0 -35
  167. data/lib/rails_ext/active_record/sticky_changes.rb +0 -30
  168. data/lib/rails_ext/railties/plugin.rb +0 -58
  169. data/lib/rails_ext/railties/plugin_configuration.rb +0 -72
  170. data/lib/registry.rb +0 -49
  171. data/lib/tasks/translation.rake +0 -69
  172. data/lib/time_hacks.rb +0 -57
  173. data/lib/webrat_patch.rb +0 -11
  174. data/test/meta_tags_test.rb +0 -42
  175. data/vendor/gems/has_counter/.gitignore +0 -17
  176. data/vendor/gems/has_counter/Gemfile +0 -4
  177. data/vendor/gems/has_counter/LICENSE +0 -22
  178. data/vendor/gems/has_counter/MIT-LICENSE +0 -20
  179. data/vendor/gems/has_counter/README.markdown +0 -64
  180. data/vendor/gems/has_counter/README.md +0 -29
  181. data/vendor/gems/has_counter/Rakefile +0 -2
  182. data/vendor/gems/has_counter/db/migrate/20080601194338_create_counters_table.rb.rb +0 -13
  183. data/vendor/gems/has_counter/has_counter.gemspec +0 -17
  184. data/vendor/gems/has_counter/lib/active_record/has_counter.rb +0 -67
  185. data/vendor/gems/has_counter/lib/counter.rb +0 -23
  186. data/vendor/gems/has_counter/lib/has_counter/version.rb +0 -3
  187. data/vendor/gems/has_counter/lib/has_counter.rb +0 -4
  188. data/vendor/gems/has_counter/spec/has_counter.sqlite3.db +0 -0
  189. data/vendor/gems/has_counter/spec/has_counter_spec.rb +0 -55
  190. data/vendor/gems/has_counter/spec/spec_helper.rb +0 -117
  191. data/vendor/gems/has_filter/.gitignore +0 -17
  192. data/vendor/gems/has_filter/Gemfile +0 -4
  193. data/vendor/gems/has_filter/LICENSE +0 -22
  194. data/vendor/gems/has_filter/README.md +0 -29
  195. data/vendor/gems/has_filter/Rakefile +0 -2
  196. data/vendor/gems/has_filter/app/assets/images/has_filter/filter_add.png +0 -0
  197. data/vendor/gems/has_filter/app/assets/images/has_filter/filter_button_left.png +0 -0
  198. data/vendor/gems/has_filter/app/assets/images/has_filter/filter_button_right.png +0 -0
  199. data/vendor/gems/has_filter/app/assets/images/has_filter/filter_remove.png +0 -0
  200. data/vendor/gems/has_filter/app/assets/javascripts/has_filter/filter.js +0 -35
  201. data/vendor/gems/has_filter/app/assets/javascripts/has_filter/jquery.filter.js +0 -23
  202. data/vendor/gems/has_filter/app/assets/stylesheets/has_filter/alternate/filter.scss +0 -102
  203. data/vendor/gems/has_filter/app/assets/stylesheets/has_filter/filter.scss +0 -100
  204. data/vendor/gems/has_filter/app/helpers/filter_helper.rb +0 -3
  205. data/vendor/gems/has_filter/has_filter.gemspec +0 -17
  206. data/vendor/gems/has_filter/init.rb +0 -3
  207. data/vendor/gems/has_filter/lib/has_filter/active_record/act_macro.rb +0 -102
  208. data/vendor/gems/has_filter/lib/has_filter/filter/base.rb +0 -67
  209. data/vendor/gems/has_filter/lib/has_filter/filter/categorized.rb +0 -24
  210. data/vendor/gems/has_filter/lib/has_filter/filter/chain.rb +0 -45
  211. data/vendor/gems/has_filter/lib/has_filter/filter/set.rb +0 -80
  212. data/vendor/gems/has_filter/lib/has_filter/filter/state.rb +0 -25
  213. data/vendor/gems/has_filter/lib/has_filter/filter/tagged.rb +0 -22
  214. data/vendor/gems/has_filter/lib/has_filter/filter/text.rb +0 -55
  215. data/vendor/gems/has_filter/lib/has_filter/filter.rb +0 -17
  216. data/vendor/gems/has_filter/lib/has_filter/version.rb +0 -3
  217. data/vendor/gems/has_filter/lib/has_filter.rb +0 -22
  218. data/vendor/gems/has_filter/test/db/setup.rb +0 -45
  219. data/vendor/gems/has_filter/test/db/test.sqlite3.db +0 -0
  220. data/vendor/gems/has_filter/test/fixtures.rb +0 -15
  221. data/vendor/gems/has_filter/test/has_filter/filter_chain_test.rb +0 -41
  222. data/vendor/gems/has_filter/test/has_filter/filter_scopes_test.rb +0 -102
  223. data/vendor/gems/has_filter/test/has_filter/filter_tags_test.rb +0 -113
  224. data/vendor/gems/has_filter/test/has_filter/integration.rb +0 -15
  225. data/vendor/gems/has_filter/test/has_filter/scopes_test.rb +0 -48
  226. data/vendor/gems/has_filter/test/log/test.log +0 -34346
  227. data/vendor/gems/has_filter/test/models.rb +0 -23
  228. data/vendor/gems/has_filter/test/templates/has_filter/test/index.html.erb +0 -5
  229. data/vendor/gems/has_filter/test/test_helper.rb +0 -66
  230. data/vendor/gems/xss_terminate/.gitignore +0 -17
  231. data/vendor/gems/xss_terminate/Gemfile +0 -4
  232. data/vendor/gems/xss_terminate/LICENSE +0 -22
  233. data/vendor/gems/xss_terminate/MIT-LICENSE +0 -20
  234. data/vendor/gems/xss_terminate/README +0 -94
  235. data/vendor/gems/xss_terminate/README.md +0 -29
  236. data/vendor/gems/xss_terminate/Rakefile +0 -23
  237. data/vendor/gems/xss_terminate/lib/html5lib_sanitize.rb +0 -2453
  238. data/vendor/gems/xss_terminate/lib/rails_sanitize.rb +0 -8
  239. data/vendor/gems/xss_terminate/lib/xss_terminate/version.rb +0 -3
  240. data/vendor/gems/xss_terminate/lib/xss_terminate.rb +0 -141
  241. data/vendor/gems/xss_terminate/tasks/xss_terminate_tasks.rake +0 -7
  242. data/vendor/gems/xss_terminate/test/models/comment.rb +0 -5
  243. data/vendor/gems/xss_terminate/test/models/entry.rb +0 -7
  244. data/vendor/gems/xss_terminate/test/models/message.rb +0 -3
  245. data/vendor/gems/xss_terminate/test/models/person.rb +0 -5
  246. data/vendor/gems/xss_terminate/test/models/review.rb +0 -5
  247. data/vendor/gems/xss_terminate/test/schema.rb +0 -34
  248. data/vendor/gems/xss_terminate/test/setup_test.rb +0 -16
  249. data/vendor/gems/xss_terminate/test/xss_terminate_test.rb +0 -50
  250. data/vendor/gems/xss_terminate/xss_terminate.gemspec +0 -17
  251. /data/lib/tasks/{adva_cms.rake → adva.rake} +0 -0
@@ -0,0 +1,7 @@
1
+ //= require rails-ujs
2
+
3
+ //= require adva_cms/concat_main_menus
4
+ //= require adva_cms/ckeditor
5
+ //= require adva_cms/jquery.table_tree
6
+
7
+
@@ -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 a {
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 a {
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 > ul li.active a {
45
- background: #f6f6f6 image_url("adva_cms/admin/tab_sidebar_active.png") repeat-x;
48
+ #sidebar .tabs > input {
49
+ opacity: 0.001;
50
+ position: absolute;
51
+ z-index: 1;
52
+ top: -15px;
46
53
  }
47
- #sidebar .tabs > ul li a:hover {
48
- background-color: #fff;
49
- text-decoration: none;
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.active a:hover {
52
- cursor: default;
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
- #sidebar .tabs .tab.active {
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, :meta_tags
11
- helper HasFilter::Helper
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 @site
29
- return redirect_to_login(t(:'adva.flash.login_to_access_admin_area_of_site')) if current_user.anonymous?
30
- unless current_user.admin?
31
- return redirect_to_login(t(:'adva.flash.no_permission_for_admin_area_of_site'))
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
- flash[:notice] = notice
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
- flash[:notice] = t(:'adva.articles.flash.create.success')
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[:error] = t(:'adva.articles.flash.create.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.articles.flash.update.success')
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[:error] = t(:'adva.articles.flash.update.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.articles.flash.destroy.success')
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[:error] = t(:'adva.articles.flash.destroy.failure') + current_resource_errors
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 t(:'adva.articles.exception.missing_timestamp')
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[:error] = t(:'adva.articles.flash.optimistic_lock.failure')
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
- flash[:notice] = t(:'adva.categories.flash.create.success')
15
- redirect_to [:admin, @section, :categories]
14
+ redirect_to [:admin, @section, :categories], notice: "The category has been created."
16
15
  else
17
- flash.now[:error] = t(:'adva.categories.flash.create.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.categories.flash.update.success')
25
- redirect_to [:admin, @section, :categories]
23
+ redirect_to [:admin, @section, :categories], notice: "The category has been updated."
26
24
  else
27
- flash.now[:error] = t(:'adva.categories.flash.update.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.categories.flash.destroy.success')
44
- redirect_to [:admin, @section, :categories]
41
+ redirect_to [:admin, @section, :categories], notice: "The category has been deleted."
45
42
  else
46
- flash.now[:error] = t(:'adva.categories.flash.destroy.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.links.flash.create.success')
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[:error] = t(:'adva.links.flash.create.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.links.flash.update.success')
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[:error] = t(:'adva.links.flash.update.failure') + current_resource_errors
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
- flash[:notice] = t(:'adva.links.flash.destroy.success')
44
- redirect_to [:admin, @section, :contents]
41
+ redirect_to [:admin, @section, :contents], notice: "The link has been deleted."
45
42
  else
46
- flash.now[:error] = t(:'adva.links.flash.destroy.failure') + current_resource_errors
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[:notice] = t(:'adva.sections.flash.create.success')
19
- redirect_to (params[:commit] == t(:'adva.sections.links.save_and_create_new') ?
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[:error] = t(:'adva.sections.flash.update.failure')
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
- flash[:notice] = t(:'adva.sections.flash.update.success')
34
- redirect_to [:edit, :admin, @section]
33
+ redirect_to [:edit, :admin, @section], notice: "The section has been updated."
35
34
  else
36
- flash.now[:error] = t(:'adva.sections.flash.update.failure')
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
- flash[:notice] = t(:'adva.sections.flash.destroy.success')
44
- redirect_to [:new, :admin, :section]
42
+ redirect_to [:new, :admin, :section], notice: "The section has been deleted."
45
43
  else
46
- flash.now[:error] = t(:'adva.sections.flash.destroy.failure')
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
- flash[:notice] = t(:'adva.sites.flash.create.success')
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[:error] = t(:'adva.sites.flash.create.failure')
29
- render :action => :new
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
- flash[:notice] = t(:'adva.sites.flash.update.success')
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[:error] = t(:'adva.sites.flash.update.failure')
42
- render :action => 'edit'
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
- flash[:notice] = t(:'adva.sites.flash.destroy.success')
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[:error] = t(:'adva.sites.flash.destroy.failure')
52
- render :action => 'show'
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
- flash[:notice] = t(:'adva.users.flash.create.success')
24
- redirect_to admin_user_url(@user)
23
+ redirect_to [:admin, @user], notice: "The user has been created."
25
24
  else
26
- flash.now[:error] = t(:'adva.users.flash.create.failure')
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
- flash[:notice] = t(:'adva.users.flash.update.success')
38
- redirect_to admin_user_url(@user)
36
+ redirect_to [:admin, @user], notice: "The user has been updated."
39
37
  else
40
- flash.now[:error] = t(:'adva.users.flash.update.failure')
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
- flash[:notice] = t(:'adva.users.flash.destroy.success')
49
- redirect_to admin_users_url
46
+ redirect_to [:admin, :users], notice: "The user has been deleted."
50
47
  else
51
- flash.now[:error] = t(:'adva.users.flash.destroy.failure')
48
+ flash.now.alert = "The user could not be deleted."
52
49
  render :action => :edit
53
50
  end
54
51
  end