camaleon_cms 0.2.1 → 1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

Files changed (266) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +266 -0
  3. data/app/apps/plugins/attack/config/config.json +1 -1
  4. data/app/apps/plugins/contact_form/config/config.json +1 -1
  5. data/app/apps/plugins/contact_form/contact_form_html_helper.rb +15 -10
  6. data/app/apps/plugins/contact_form/front_controller.rb +1 -0
  7. data/app/apps/plugins/contact_form/views/admin_forms/edit.html.erb +1 -2
  8. data/app/apps/plugins/contact_form/views/admin_forms/index.html.erb +1 -1
  9. data/app/apps/plugins/contact_form/views/admin_forms/responses.html.erb +1 -1
  10. data/app/apps/plugins/contact_form/views/forms_shorcode.html.erb +6 -6
  11. data/app/apps/plugins/front_cache/config/config.json +1 -1
  12. data/app/apps/plugins/front_cache/views/admin/settings.html.erb +1 -1
  13. data/app/apps/plugins/visibility_post/config/config.json +1 -1
  14. data/app/apps/themes/camaleon_first/assets/css/style-ver.css.scss +59 -32
  15. data/app/apps/themes/camaleon_first/views/layouts/index.html.erb +2 -2
  16. data/app/apps/themes/default/assets/css/style.css.scss +3 -0
  17. data/app/apps/themes/default/views/category.html.erb +1 -1
  18. data/app/apps/themes/default/views/post_tag.html.erb +1 -1
  19. data/app/apps/themes/default/views/post_type.html.erb +1 -1
  20. data/app/apps/themes/default/views/search.html.erb +1 -1
  21. data/app/apps/themes/new/views/category.html.erb +1 -1
  22. data/app/apps/themes/new/views/layouts/index.html.erb +2 -2
  23. data/app/apps/themes/new/views/post_tag.html.erb +1 -1
  24. data/app/apps/themes/new/views/post_type.html.erb +1 -1
  25. data/app/apps/themes/new/views/search.html.erb +1 -1
  26. data/app/assets/{stylesheets/admin/bootstrap/images → images/admin}/glyphicons-halflings.png +0 -0
  27. data/app/assets/javascripts/admin/actions.js +12 -205
  28. data/app/assets/javascripts/admin/admin-basic-manifest.js +3 -0
  29. data/app/assets/javascripts/admin/admin-manifest.js +14 -4
  30. data/app/assets/javascripts/admin/custom_fields.js +4 -2
  31. data/app/assets/javascripts/admin/data.js +49 -20
  32. data/app/assets/javascripts/admin/elfinder/upload_elfinder.js +4 -4
  33. data/app/assets/javascripts/admin/grid-editor.js +390 -113
  34. data/app/assets/javascripts/admin/i18n.js +22 -0
  35. data/app/assets/javascripts/admin/jquery.validate.js +2 -54
  36. data/app/assets/javascripts/admin/{core.js → libraries.js} +92 -76
  37. data/app/assets/javascripts/admin/login_manifest.js +0 -3
  38. data/app/assets/javascripts/admin/lte/app.js +758 -0
  39. data/app/assets/javascripts/admin/modal.js +76 -22
  40. data/app/assets/javascripts/admin/nav-menu.js +98 -39
  41. data/app/assets/javascripts/admin/post.js +28 -29
  42. data/app/assets/javascripts/admin/tinymce/skins/lightgray/content.min.css.scss +1 -1
  43. data/app/assets/javascripts/admin/tinymce/tinymce.min.js +11 -11
  44. data/app/assets/javascripts/admin/translator.js +9 -7
  45. data/app/assets/javascripts/admin/widgets.js +1 -0
  46. data/app/assets/stylesheets/admin/admin-basic-manifest.css +15 -0
  47. data/app/assets/stylesheets/admin/admin-manifest.css +7 -11
  48. data/app/assets/stylesheets/admin/bootstrap-datepicker.css.scss +472 -0
  49. data/app/assets/stylesheets/admin/bootstrap-datetimepicker.css.scss +339 -0
  50. data/app/assets/stylesheets/admin/colorpicker.css.scss +95 -0
  51. data/app/assets/stylesheets/admin/custom_admin.css.scss +160 -0
  52. data/app/assets/stylesheets/admin/elfinder-manifest.css +1 -1
  53. data/app/assets/stylesheets/admin/grid-editor.css.scss +14 -299
  54. data/app/assets/stylesheets/admin/lte/admin.css.scss +4747 -0
  55. data/app/assets/stylesheets/admin/lte/skins/skin-black-light.css +176 -0
  56. data/app/assets/stylesheets/admin/lte/skins/skin-black.css +154 -0
  57. data/app/assets/stylesheets/admin/lte/skins/skin-blue-light.css +167 -0
  58. data/app/assets/stylesheets/admin/lte/skins/skin-blue.css +142 -0
  59. data/app/assets/stylesheets/admin/lte/skins/skin-green-light.css +156 -0
  60. data/app/assets/stylesheets/admin/lte/skins/skin-green.css +134 -0
  61. data/app/assets/stylesheets/admin/lte/skins/skin-purple-light.css +156 -0
  62. data/app/assets/stylesheets/admin/lte/skins/skin-purple.css +134 -0
  63. data/app/assets/stylesheets/admin/lte/skins/skin-red-light.css +156 -0
  64. data/app/assets/stylesheets/admin/lte/skins/skin-red.css +134 -0
  65. data/app/assets/stylesheets/admin/lte/skins/skin-yellow-light.css +156 -0
  66. data/app/assets/stylesheets/admin/lte/skins/skin-yellow.css +134 -0
  67. data/app/assets/stylesheets/admin/nav-menu.css.scss +33 -0
  68. data/app/controllers/admin/appearances/nav_menus_controller.rb +13 -10
  69. data/app/controllers/admin/appearances/themes_controller.rb +1 -2
  70. data/app/controllers/admin/appearances_controller.rb +0 -4
  71. data/app/controllers/admin/categories_controller.rb +9 -15
  72. data/app/controllers/admin/comments_controller.rb +8 -14
  73. data/app/controllers/admin/grid_editor_controller.rb +55 -0
  74. data/app/controllers/admin/installers_controller.rb +1 -1
  75. data/app/controllers/admin/media_controller.rb +1 -3
  76. data/app/controllers/admin/plugins_controller.rb +2 -2
  77. data/app/controllers/admin/post_tags_controller.rb +9 -18
  78. data/app/controllers/admin/posts/drafts_controller.rb +1 -9
  79. data/app/controllers/admin/posts_controller.rb +12 -15
  80. data/app/controllers/admin/sessions_controller.rb +6 -7
  81. data/app/controllers/admin/settings/custom_fields_controller.rb +4 -9
  82. data/app/controllers/admin/settings/post_types_controller.rb +6 -16
  83. data/app/controllers/admin/settings/sites_controller.rb +5 -7
  84. data/app/controllers/admin/settings_controller.rb +0 -4
  85. data/app/controllers/admin/user_roles_controller.rb +8 -8
  86. data/app/controllers/admin/users_controller.rb +8 -9
  87. data/app/controllers/admin_controller.rb +4 -5
  88. data/app/controllers/apps/plugins_admin_controller.rb +3 -3
  89. data/app/controllers/apps/plugins_front_controller.rb +2 -2
  90. data/app/controllers/apps/themes_admin_controller.rb +2 -2
  91. data/app/controllers/apps/themes_front_controller.rb +2 -2
  92. data/app/controllers/camaleon_controller.rb +0 -1
  93. data/app/controllers/concerns/frontend_concern.rb +1 -2
  94. data/app/controllers/frontend_controller.rb +25 -9
  95. data/app/decorators/category_decorator.rb +0 -1
  96. data/app/decorators/custom_field_decorator.rb +0 -1
  97. data/app/decorators/custom_fields_concern.rb +9 -3
  98. data/app/decorators/post_comment_decorator.rb +0 -1
  99. data/app/decorators/post_decorator.rb +10 -4
  100. data/app/decorators/post_tag_decorator.rb +0 -1
  101. data/app/decorators/post_type_decorator.rb +0 -1
  102. data/app/decorators/site_decorator.rb +35 -11
  103. data/app/decorators/term_taxonomy_decorator.rb +1 -3
  104. data/app/decorators/theme_decorator.rb +0 -1
  105. data/app/decorators/user_decorator.rb +7 -5
  106. data/app/decorators/widget_decorator.rb +0 -1
  107. data/app/helpers/admin/application_helper.rb +14 -0
  108. data/app/helpers/admin/menus_helper.rb +8 -8
  109. data/app/helpers/camaleon_helper.rb +10 -3
  110. data/app/helpers/captcha_helper.rb +2 -2
  111. data/app/helpers/frontend/application_helper.rb +0 -1
  112. data/app/helpers/frontend/nav_menu_helper.rb +2 -1
  113. data/app/helpers/frontend/seo_helper.rb +1 -2
  114. data/app/helpers/frontend/site_helper.rb +4 -4
  115. data/app/helpers/hooks_helper.rb +2 -5
  116. data/app/helpers/html_helper.rb +9 -7
  117. data/app/helpers/plugins_helper.rb +34 -8
  118. data/app/helpers/session_helper.rb +1 -2
  119. data/app/helpers/short_code_helper.rb +91 -10
  120. data/app/helpers/site_helper.rb +17 -8
  121. data/app/helpers/theme_helper.rb +34 -7
  122. data/app/helpers/uploader_helper.rb +6 -2
  123. data/app/mailers/html_mailer.rb +15 -6
  124. data/app/models/category.rb +2 -1
  125. data/app/models/concerns/custom_fields_read.rb +14 -3
  126. data/app/models/concerns/metas.rb +7 -4
  127. data/app/models/custom_field_group.rb +3 -0
  128. data/app/models/{concerns/metas_saved.rb → grid_template.rb} +7 -2
  129. data/app/models/meta.rb +0 -1
  130. data/app/models/nav_menu.rb +15 -1
  131. data/app/models/nav_menu_item.rb +10 -0
  132. data/app/models/post.rb +100 -6
  133. data/app/models/post_comment.rb +6 -0
  134. data/app/models/post_default.rb +9 -8
  135. data/app/models/post_relationship.rb +2 -0
  136. data/app/models/post_type.rb +36 -24
  137. data/app/models/site.rb +7 -16
  138. data/app/models/term_taxonomy.rb +3 -2
  139. data/app/models/theme.rb +5 -0
  140. data/app/models/widget/assigned.rb +3 -2
  141. data/app/views/admin/appearances/nav_menus/_custom_fields.html.erb +6 -0
  142. data/app/views/admin/appearances/{_external_menu.html.erb → nav_menus/_external_menu.html.erb} +8 -10
  143. data/app/views/admin/appearances/nav_menus/_menu_form.html.erb +35 -0
  144. data/app/views/admin/appearances/nav_menus/_menu_list.html.erb +22 -0
  145. data/app/views/admin/appearances/nav_menus/index.html.erb +110 -0
  146. data/app/views/admin/appearances/themes/index.html.erb +4 -3
  147. data/app/views/admin/appearances/widgets/main/_sidebar.html.erb +29 -0
  148. data/app/views/admin/appearances/widgets/main/form.html.erb +1 -1
  149. data/app/views/admin/appearances/widgets/main/index.html.erb +19 -41
  150. data/app/views/admin/categories/edit.html.erb +2 -6
  151. data/app/views/admin/categories/index.html.erb +7 -11
  152. data/app/views/admin/comments/form.html.erb +4 -7
  153. data/app/views/admin/comments/index.html.erb +24 -41
  154. data/app/views/admin/comments/reply.html.erb +9 -10
  155. data/app/views/admin/grid_editor/form.html.erb +31 -0
  156. data/app/views/admin/grid_editor/index.html.erb +29 -0
  157. data/app/views/admin/media/index.html.erb +3 -15
  158. data/app/views/admin/plugins/_plugins_list.html.erb +1 -2
  159. data/app/views/admin/post_tags/edit.html.erb +2 -6
  160. data/app/views/admin/post_tags/index.html.erb +3 -8
  161. data/app/views/admin/posts/_sidebar.html.erb +136 -0
  162. data/app/views/admin/posts/form.html.erb +87 -281
  163. data/app/views/admin/posts/index.html.erb +89 -104
  164. data/app/views/admin/sessions/forgot.html.erb +7 -13
  165. data/app/views/admin/sessions/login.html.erb +21 -11
  166. data/app/views/admin/sessions/register.html.erb +3 -6
  167. data/app/views/admin/settings/custom_fields/_meta_data.html.erb +1 -1
  168. data/app/views/admin/settings/custom_fields/_render.html.erb +6 -14
  169. data/app/views/admin/settings/custom_fields/fields/audio.html.erb +1 -1
  170. data/app/views/admin/settings/custom_fields/fields/field_attrs.html.erb +3 -5
  171. data/app/views/admin/settings/custom_fields/fields/file.html.erb +1 -1
  172. data/app/views/admin/settings/custom_fields/fields/image.html.erb +1 -1
  173. data/app/views/admin/settings/custom_fields/fields/posts.html.erb +1 -1
  174. data/app/views/admin/settings/custom_fields/fields/select.html.erb +1 -1
  175. data/app/views/admin/settings/custom_fields/fields/users.html.erb +1 -1
  176. data/app/views/admin/settings/custom_fields/fields/video.html.erb +1 -1
  177. data/app/views/admin/settings/custom_fields/form.html.erb +11 -9
  178. data/app/views/admin/settings/custom_fields/get_items.html.erb +3 -6
  179. data/app/views/admin/settings/custom_fields/index.html.erb +3 -10
  180. data/app/views/admin/settings/languages.html.erb +2 -10
  181. data/app/views/admin/settings/post_types/_form.html.erb +1 -1
  182. data/app/views/admin/settings/post_types/edit.html.erb +2 -6
  183. data/app/views/admin/settings/post_types/index.html.erb +4 -12
  184. data/app/views/admin/settings/site.html.erb +143 -149
  185. data/app/views/admin/settings/sites/form.html.erb +4 -19
  186. data/app/views/admin/settings/sites/index.html.erb +8 -9
  187. data/app/views/admin/taxonomy/index.html.erb +1 -1
  188. data/app/views/admin/user_roles/form.html.erb +2 -3
  189. data/app/views/admin/user_roles/index.html.erb +2 -8
  190. data/app/views/admin/users/form.html.erb +14 -9
  191. data/app/views/admin/users/index.html.erb +3 -8
  192. data/app/views/admin/users/profile_edit.html.erb +21 -14
  193. data/app/views/default_theme/custom_fields/audio.html.erb +3 -0
  194. data/app/views/default_theme/custom_fields/checkbox.html.erb +3 -0
  195. data/app/views/default_theme/custom_fields/checkboxes.html.erb +3 -0
  196. data/app/views/default_theme/custom_fields/colorpicker.html.erb +3 -0
  197. data/app/views/default_theme/custom_fields/date.html.erb +3 -0
  198. data/app/views/default_theme/custom_fields/editor.html.erb +3 -0
  199. data/app/views/default_theme/custom_fields/email.html.erb +3 -0
  200. data/app/views/default_theme/custom_fields/field_attrs.html.erb +3 -0
  201. data/app/views/default_theme/custom_fields/file.html.erb +3 -0
  202. data/app/views/default_theme/custom_fields/image.html.erb +3 -0
  203. data/app/views/default_theme/custom_fields/numeric.html.erb +3 -0
  204. data/app/views/default_theme/custom_fields/phone.html.erb +3 -0
  205. data/app/views/default_theme/custom_fields/posts.html.erb +3 -0
  206. data/app/views/default_theme/custom_fields/radio.html.erb +3 -0
  207. data/app/views/default_theme/custom_fields/select.html.erb +3 -0
  208. data/app/views/default_theme/custom_fields/select_eval.html.erb +3 -0
  209. data/app/views/default_theme/custom_fields/text_area.html.erb +3 -0
  210. data/app/views/default_theme/custom_fields/text_box.html.erb +3 -0
  211. data/app/views/default_theme/custom_fields/url.html.erb +3 -0
  212. data/app/views/default_theme/custom_fields/users.html.erb +3 -0
  213. data/app/views/default_theme/custom_fields/video.html.erb +3 -0
  214. data/app/views/default_theme/layouts/index.html.erb +2 -2
  215. data/app/views/default_theme/{post.html.erb → single.html.erb} +1 -1
  216. data/app/views/default_theme/{post.rss.builder → single.rss.builder} +0 -0
  217. data/app/views/layouts/admin.html.erb +35 -133
  218. data/app/views/layouts/admin/_flash_messages.html.erb +1 -15
  219. data/app/views/layouts/admin/_footer.html.erb +6 -0
  220. data/app/views/layouts/admin/_header.html.erb +51 -0
  221. data/app/views/layouts/admin/_sidebar.html.erb +21 -30
  222. data/app/views/layouts/admin/installer.html.erb +2 -2
  223. data/app/views/layouts/login.html.erb +15 -33
  224. data/config/initializers/active_record_extension.rb +14 -2
  225. data/config/initializers/assets.rb +21 -7
  226. data/config/initializers/page_caching.rb +1 -2
  227. data/config/locales/admin/en.yml +17 -9
  228. data/config/locales/admin/es.yml +8 -3
  229. data/config/locales/admin/it.yml +4 -2
  230. data/config/locales/admin/js.yml +147 -0
  231. data/config/routes/admin.rb +4 -4
  232. data/config/routes/frontend.rb +2 -2
  233. data/config/system.json +1 -0
  234. data/db/migrate/20150926095310_rename_column_posts.rb +18 -0
  235. data/lib/camaleon_cms.rb +1 -1
  236. data/lib/camaleon_cms/engine.rb +17 -2
  237. data/lib/camaleon_cms/version.rb +1 -1
  238. data/lib/generators/camaleon_cms/gem_plugin_generator.rb +122 -0
  239. data/lib/generators/camaleon_cms/gem_plugin_template/app/controllers/plugins/my_plugin/admin_controller.rb +8 -0
  240. data/lib/generators/camaleon_cms/gem_plugin_template/app/controllers/plugins/my_plugin/front_controller.rb +8 -0
  241. data/lib/generators/camaleon_cms/gem_plugin_template/app/helpers/plugins/my_plugin/main_helper.rb +22 -0
  242. data/lib/generators/camaleon_cms/gem_plugin_template/app/models/plugins/my_plugin/my_plugin.rb +12 -0
  243. data/lib/generators/camaleon_cms/gem_plugin_template/app/views/plugins/my_plugin/admin/index.html.erb +2 -0
  244. data/lib/generators/camaleon_cms/gem_plugin_template/app/views/plugins/my_plugin/front/index.html.erb +2 -0
  245. data/lib/generators/camaleon_cms/gem_plugin_template/app/views/plugins/my_plugin/layouts/readme.txt +2 -0
  246. data/lib/generators/camaleon_cms/gem_plugin_template/config/camaleon_plugin.json +21 -0
  247. data/lib/generators/camaleon_cms/install_generator.rb +1 -2
  248. data/lib/generators/camaleon_cms/install_template/plugin_routes.rb +1 -10
  249. data/lib/generators/ctheme_template/app/apps/themes/my_theme/config/config.json +5 -5
  250. data/lib/generators/ctheme_template/app/apps/themes/my_theme/main_helper.rb +6 -5
  251. data/lib/generators/ctheme_template/app/apps/themes/my_theme/views/layouts/index.html.erb +2 -2
  252. data/lib/plugin_routes.rb +40 -2
  253. metadata +257 -22
  254. data/app/assets/stylesheets/admin/animate/animate.min.css +0 -6
  255. data/app/assets/stylesheets/admin/bootstrap/bootstrap-datetimepicker.css.scss +0 -339
  256. data/app/assets/stylesheets/admin/bootstrap/bootstrap.min.css +0 -5
  257. data/app/assets/stylesheets/admin/core.scss +0 -349
  258. data/app/assets/stylesheets/admin/fonts/OpenSans-Regular-webfont.eot +0 -0
  259. data/app/assets/stylesheets/admin/fonts/OpenSans-Regular-webfont.svg +0 -1831
  260. data/app/assets/stylesheets/admin/fonts/OpenSans-Regular-webfont.ttf +0 -0
  261. data/app/assets/stylesheets/admin/fonts/OpenSans-Regular-webfont.woff +0 -0
  262. data/app/assets/stylesheets/admin/nav-menu.css +0 -54
  263. data/app/assets/stylesheets/admin/theme-default.scss +0 -8462
  264. data/app/models/concerns/site_public.rb +0 -23
  265. data/app/views/admin/appearances/menu.html.erb +0 -199
  266. data/lib/Gemfile +0 -25
@@ -23,21 +23,22 @@
23
23
  <div class="panel panel-default">
24
24
  <div class="panel-body panel-body-image">
25
25
  <div class="theme-image text-center">
26
- <img class="img-responsive" src="<%= asset_path(theme_asset_path(theme[:thumb].to_s, theme[:key])) %>" alt="<%= theme[:name] %>">
26
+ <img class="img-responsive" style="width: 100%; height: 180px;" src="<%= asset_path(theme_asset_path(theme[:thumb].to_s, theme[:key])) %>" alt="<%= theme[:name] %>">
27
27
  </div>
28
28
  <a href="#" class="panel-body-inform">
29
29
  <span class="fa fa-desktop"></span>
30
30
  </a>
31
31
  </div>
32
- <div class="panel-body">
32
+ <div class="panel-body" style="min-height: 120px;">
33
33
  <h3><%= theme[:name] %></h3>
34
-
35
34
  <p><%= theme[:description] %></p>
36
35
  </div>
37
36
  <div class="panel-footer text-muted text-right">
38
37
  <% if current_theme.slug == theme[:key] && params[:set].nil? %>
39
38
  <% r = {links: []}; hook_run(theme, "theme_options", r) %>
40
39
  <% r[:links] << link_to(raw('&nbsp;&nbsp;Import Data (data.json)&nbsp;'), admin_plugins_export_content_settings_path(file: ["app", "apps", 'themes', theme[:key], 'data.json'].join("/"))) if current_site.plugin_installed?('export_content') && File.exist?(File.join(theme["path"], "data.json")) %>
40
+ <% r[:links] << link_to('Settings', admin_settings_site_path(tab: "theme"), class: "btn btn-primary") if File.exist?(current_theme.settings_file) %>
41
+
41
42
  <% r[:links] << link_to(raw('&nbsp;&nbsp;Import Data (data.json)&nbsp;'), "#", {'onclick' => "alert('You need to install import/export plugin to import sample data.'); return false;"}) if !current_site.plugin_installed?('export_content') && File.exist?(File.join(theme["path"], "data.json")) %>
42
43
  <%= raw r[:links].join(" | ") %>
43
44
  <span class="btn btn-success"><%= t('admin.button.actived').upcase %></span>
@@ -0,0 +1,29 @@
1
+ <div id="content-sidebar" class="col-md-4">
2
+ <a href="<%= new_admin_appearances_widgets_sidebar_path %>" title="<%= t('admin.widgets.create_sidebar') %>" class="ajax_link btn btn-default" ><%= t('admin.widgets.create_sidebar') %></a>
3
+ <div class="panel panel-default">
4
+ <div class="panel-body">
5
+ <div class="row">
6
+ <% current_site.sidebars.each do |sidebar| %>
7
+ <div class="item-sidebar panel panel-default panel-toggled" data-id="<%= sidebar.id %>">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title">
10
+ <%= sidebar.name %><br>
11
+ <small class="text-muted"><%= sidebar.description %></small>
12
+ </h3>
13
+ <ul class="panel-controls">
14
+ <li><a href="<%= edit_admin_appearances_widgets_sidebar_path(sidebar) %>" class="panel-edit ajax_link" title="<%= t('admin.button.edit')%>"><span class="fa fa fa-edit"></span></a></li>
15
+ <li><%= link_to raw('<span class="fa fa-times text-danger"></span>'), admin_appearances_widgets_sidebar_path(sidebar), method: :delete, data: { confirm: t('admin.message.delete_item') }, class: "panel-delete", title: "#{t('admin.button.delete')}" %></li>
16
+ <li><a class="panel-collapse" href="#"><span class="fa fa-angle-down"></span></a></li>
17
+ </ul>
18
+ </div>
19
+ <div class="sidebar-body panel-body" data-id="<%= sidebar.id %>">
20
+ <% sidebar.assigned.each do |assign| %>
21
+ <%= render partial: "admin/appearances/widgets/assign/form", locals: {sidebar: sidebar, assigned: assign, widget: assign.widget} %>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -18,7 +18,7 @@
18
18
  <%#= f.text_area :excerpt, :class => "form-control", :rows => 2 %>
19
19
  </div>-->
20
20
  <div class="form-group text-right">
21
- <button class="btn btn-primary pull-right" type="submit"><%= t('admin.button.submit')%></button>
21
+ <button class="btn btn-primary" type="submit"><%= t('admin.button.submit')%></button>
22
22
  </div>
23
23
  <script>
24
24
  jQuery(function(){ init_form_validations($("#widget_form")); });
@@ -3,7 +3,7 @@
3
3
  var sidebar_reorder_url = '<%= admin_appearances_widgets_sidebar_reorder_path(sidebar_id: -1) %>';
4
4
  </script>
5
5
  <%= javascript_include_tag "admin/widgets" %>
6
- <%= stylesheet_link_tag "admin/widgets" %>
6
+ <%#= stylesheet_link_tag "admin/widgets" %>
7
7
  <% add_asset_library('tinymce') %>
8
8
  <div class="page-title">
9
9
  <h2><span class="fa fa-archive"></span> <%= t('admin.sidebar.widgets') %>
@@ -12,8 +12,10 @@
12
12
  <div class="page-content-wrap">
13
13
 
14
14
  <div class="row">
15
- <div id="content-widget" class="col-md-8">
16
- <a href="<%= new_admin_appearances_widgets_main_path %>" title="<%= t('admin.widgets.create_widget') %>" class="ajax_link btn btn-default"><%= t('admin.widgets.create_widget') %></a>
15
+ <div id="content-widget" class="col-md-12">
16
+ <div class="text-right">
17
+ <a href="<%= new_admin_appearances_widgets_main_path %>" title="<%= t('admin.widgets.create_widget') %>" class="ajax_link btn btn-primary"><%= t('admin.widgets.create_widget') %></a>
18
+ </div>
17
19
  <div class="panel panel-colorful">
18
20
  <div class="panel-body">
19
21
  <h2 class="panel-title"><%= t('admin.widgets.simple_widgets')%> </h2><br><br>
@@ -22,12 +24,14 @@
22
24
  <% @widgets.each do |item| %>
23
25
  <% if item.is_simple? %>
24
26
  <div class="panel-widget col-md-3" data-id=<%= item.id %> >
25
- <div class="tile tile-info" data-id="<%= item.id %>">
26
- <h4><%= item.name %></h4>
27
- <p><%= item.excerpt %></p>
28
- <%= link_to raw('<span class="fa fa-edit"></span>'), { action: :edit, id: item.id }, class: "ajax_link informer informer-default", title: "#{t('admin.button.edit')}" %>
29
- <%= link_to raw('<span class="fa fa-times"></span>'), { action: :destroy, id: item.id },method: :delete, data: { confirm: t('admin.message.delete_item') }, class: "informer informer-default dir-tr", title: "#{t('admin.button.delete')}" %>
30
- <div class="informer informer-default dir-bl shortcode" style="font-size:11px;"><%= item.short_code %></div>
27
+ <div class="small-box <%= ["bg-green", "bg-aqua", "bg-yellow", "bg-red"].sample %>" data-id="<%= item.id %>">
28
+ <div class="inner">
29
+ <h4><%= item.name %></h4>
30
+ <p><%= item.excerpt %></p>
31
+ </div>
32
+ <%= link_to raw('<span class="fa fa-edit"></span>'), { action: :edit, id: item.id }, class: "ajax_link edit_link", title: "#{t('admin.button.edit')}" %>
33
+ <%= link_to raw('<span class="fa fa-times"></span>'), { action: :destroy, id: item.id },method: :delete, data: { confirm: t('admin.message.delete_item') }, class: "del_link", title: "#{t('admin.button.delete')}" %>
34
+ <div class="small-box-footer" style="font-size:11px;"><%= item.short_code %></div>
31
35
  </div>
32
36
  </div>
33
37
  <% end %>
@@ -43,9 +47,11 @@
43
47
  <% @widgets.each do |item| %>
44
48
  <% unless item.is_simple? %>
45
49
  <div class="panel-widget col-md-3" data-id=<%= item.id %> >
46
- <div class="tile tile-primary" data-id="<%= item.id %>">
47
- <h4><%= item.name %></h4>
48
- <p><%= item.excerpt %></p>
50
+ <div class="small-box <%= ["bg-green", "bg-aqua", "bg-yellow", "bg-red"].sample %>" data-id="<%= item.id %>">
51
+ <div class="inner">
52
+ <h4><%= item.name %></h4>
53
+ <p><%= item.excerpt %></p>
54
+ </div>
49
55
  <div class="informer informer-default dir-bl shortcode" style="font-size:11px;"><%= item.short_code %></div>
50
56
  </div>
51
57
  </div>
@@ -58,34 +64,6 @@
58
64
  </div>
59
65
  </div>
60
66
  </div>
61
- <div id="content-sidebar" class="col-md-4">
62
- <a href="<%= new_admin_appearances_widgets_sidebar_path %>" title="<%= t('admin.widgets.create_sidebar') %>" class="ajax_link btn btn-default" ><%= t('admin.widgets.create_sidebar') %></a>
63
- <div class="panel panel-default">
64
- <div class="panel-body">
65
- <div class="row">
66
- <% current_site.sidebars.each do |sidebar| %>
67
- <div class="item-sidebar panel panel-default panel-toggled" data-id="<%= sidebar.id %>">
68
- <div class="panel-heading">
69
- <h3 class="panel-title">
70
- <%= sidebar.name %><br>
71
- <small class="text-muted"><%= sidebar.description %></small>
72
- </h3>
73
- <ul class="panel-controls">
74
- <li><a href="<%= edit_admin_appearances_widgets_sidebar_path(sidebar) %>" class="panel-edit ajax_link" title="<%= t('admin.button.edit')%>"><span class="fa fa fa-edit"></span></a></li>
75
- <li><%= link_to raw('<span class="fa fa-times text-danger"></span>'), admin_appearances_widgets_sidebar_path(sidebar), method: :delete, data: { confirm: t('admin.message.delete_item') }, class: "panel-delete", title: "#{t('admin.button.delete')}" %></li>
76
- <li><a class="panel-collapse" href="#"><span class="fa fa-angle-down"></span></a></li>
77
- </ul>
78
- </div>
79
- <div class="sidebar-body panel-body" data-id="<%= sidebar.id %>">
80
- <% sidebar.assigned.each do |assign| %>
81
- <%= render partial: "admin/appearances/widgets/assign/form", locals: {sidebar: sidebar, assigned: assign, widget: assign.widget} %>
82
- <% end %>
83
- </div>
84
- </div>
85
- <% end %>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
67
+ <%#= render "sidebar" %>
90
68
  </div>
91
69
  </div>
@@ -1,13 +1,9 @@
1
- <div class="page-title">
2
- <h2><span class="fa fa-folder"></span> <%= "#{@post_type.decorate.the_title.pluralize} / " if @post_type.present? %> <%= t('admin.post_type.category').to_s.titleize.pluralize %></h2>
3
- </div>
4
1
  <div class="page-content-wrap">
5
-
6
2
  <div class="row">
7
- <div class="col-md-6 col-md-offset-3">
3
+ <div class="col-md-8 col-md-offset-2">
8
4
  <div class="panel panel-default">
9
5
  <div class="panel-heading ui-draggable-handle">
10
- <h3 class="panel-title"><%= @category.id.present? ? t('admin.post_type.edit_category') : t('admin.post_type.add_category') %></h3>
6
+ <h4><%= @category.id.present? ? t('admin.post_type.edit_category') : t('admin.post_type.add_category') %></h4>
11
7
  </div>
12
8
  <%= render partial: 'admin/categories/form' %>
13
9
  </div>
@@ -1,14 +1,8 @@
1
- <div class="page-title">
2
- <h2>
3
- <span class="fa fa-folder"></span> <%= "#{@post_type.decorate.the_title.pluralize} / " if @post_type.present? %> <%= t('admin.post_type.category').to_s.titleize.pluralize %>
4
- </h2>
5
- </div>
6
- <div class="page-content-wrap">
7
-
1
+ <div class="page-content-wrap row">
8
2
  <div class="col-md-4">
9
3
  <div class="panel panel-default">
10
4
  <div class="panel-heading ui-draggable-handle">
11
- <h3 class="panel-title"><%= t('admin.post_type.add_category')%> </h3>
5
+ <h4><%= t('admin.post_type.add_category')%> </h4>
12
6
  </div>
13
7
 
14
8
  <%= render partial: 'admin/categories/form' %>
@@ -19,10 +13,12 @@
19
13
 
20
14
  <div class="col-md-8">
21
15
 
22
- <!-- START BASIC TABLE SAMPLE -->
16
+ <!-- START BASIC TABLE SAMPLE -->
23
17
  <div class="panel panel-default">
24
18
  <div class="panel-heading ui-draggable-handle">
25
- <h3 class="panel-title"><%= t('admin.page_title.list')%></h3>
19
+ <h4>
20
+ <span class="fa fa-folder"></span> <%= "#{@post_type.decorate.the_title.pluralize} / " if @post_type.present? %> <%= t('admin.post_type.category').to_s.titleize.pluralize %>
21
+ </h4>
26
22
  </div>
27
23
  <div class="panel-body">
28
24
 
@@ -68,7 +64,7 @@
68
64
  </tbody>
69
65
  </table>
70
66
  <%= content_tag("div", raw(t('admin.message.data_found_list')), class: "alert alert-warning") if @categories.empty? %>
71
- <%= will_paginate @categories, renderer: BootstrapPagination::Rails %>
67
+ <%= raw do_pagination(@categories) %>
72
68
  </div>
73
69
  </div>
74
70
  <!-- END BASIC TABLE SAMPLE -->
@@ -1,15 +1,12 @@
1
- <div class="page-title">
2
- <h2>
3
- <span class="fa fa-users"></span>
4
- <%= "Edit "%>
5
- </h2>
6
- </div>
7
1
  <div class="page-content-wrap">
8
2
  <div class="row">
9
3
  <div class="col-md-6 col-md-offset-3">
10
4
  <div class="panel panel-default">
11
5
  <div class="panel-heading ui-draggable-handle">
12
- <h3 class="panel-title"><%= @comment.id.present? ? "Edit" : "Add" %> </h3>
6
+ <h4>
7
+ <span class="fa fa-users"></span>
8
+ Comment <%= @comment.id.present? ? "Edit" : "Add" %>
9
+ </h4>
13
10
  </div>
14
11
  <%= form_for @comment, url:{action: @comment.new_record? ? :create : :update} do |f| %>
15
12
 
@@ -1,28 +1,17 @@
1
- <div class="page-title">
2
- <h2><span class="fa fa-comments"></span> <%= t('admin.comments.comments_list_post')%></h2>
3
- </div>
4
-
5
- <!-- PAGE CONTENT WRAPPER -->
6
- <div class="page-content-wrap">
7
-
8
- <div class="row">
9
- <div class="col-md-12">
10
-
11
- <!-- START BASIC TABLE SAMPLE -->
12
- <div class="panel panel-default">
13
- <div class="panel-heading">
14
- <h3 class="panel-title"><%= t('admin.page_title.list')%></h3>
15
- </div>
16
- <div class="panel-body">
1
+ <div class="panel panel-default">
2
+ <div class="panel-heading">
3
+ <h4><span class="fa fa-comments"></span> <%= t('admin.comments.comments_list_post')%></h4>
4
+ </div>
5
+ <div class="panel-body">
17
6
 
18
- <table class="table">
7
+ <table class="table">
19
8
  <thead>
20
9
  <tr>
21
- <th><%= t('admin.table.id')%></th>
22
- <th><%= t('admin.table.post')%></th>
23
- <th><%= t('admin.table.post_type')%></th>
24
- <th><%= t('admin.table.comments')%></th>
25
- <th><%= t('admin.table.actions')%></th>
10
+ <th><%= t('admin.table.id')%></th>
11
+ <th><%= t('admin.table.post')%></th>
12
+ <th><%= t('admin.table.post_type')%></th>
13
+ <th><%= t('admin.table.comments')%></th>
14
+ <th><%= t('admin.table.actions')%></th>
26
15
  </tr>
27
16
  </thead>
28
17
  <tbody>
@@ -32,27 +21,21 @@
32
21
  post_type = f.post_type.decorate
33
22
  %>
34
23
  <tr>
35
- <td><%= f.id %></td>
36
- <td><a href="<%= post.the_url %>" target="_blank"><%= post.the_title %></a></td>
37
- <td><a href="<%= post_type.the_url %>" target="_blank"><%= post_type.the_title %></a></td>
38
- <td><%= f.comments.main.size %></td>
39
- <td>
40
- <%= link_to raw('<i class="fa fa-comments"></i>'), {action: :responses, post_id: f.id }, class: "btn btn-default btn-xs", title: "#{t('admin.table.comments')}" %>
41
- <%= link_to raw('<i class="fa fa-times"></i>'), { action: :destroy_comments, post_id: f.id },
42
- method: :delete, data: { confirm: t('admin.message.delete') }, class: "btn btn-danger btn-xs", title: "Delete" %>
43
- </td>
24
+ <td><%= f.id %></td>
25
+ <td><a href="<%= post.the_url %>" target="_blank"><%= post.the_title %></a></td>
26
+ <td><a href="<%= post_type.the_url %>" target="_blank"><%= post_type.the_title %></a></td>
27
+ <td><%= f.comments.main.size %></td>
28
+ <td>
29
+ <%= link_to raw('<i class="fa fa-comments"></i>'), {action: :responses, post_id: f.id }, class: "btn btn-default btn-xs", title: "#{t('admin.table.comments')}" %>
30
+ <%= link_to raw('<i class="fa fa-times"></i>'), { action: :destroy_comments, post_id: f.id },
31
+ method: :delete, data: { confirm: t('admin.message.delete') }, class: "btn btn-danger btn-xs", title: "Delete" %>
32
+ </td>
44
33
  </tr>
45
34
  <% end %>
46
35
 
47
36
  </tbody>
48
- </table>
49
- <%= content_tag("div", raw(t('admin.message.data_found_list')), class: "alert alert-warning") if @posts.empty? %>
50
- <%= will_paginate @posts, renderer: BootstrapPagination::Rails %>
51
- </div>
52
-
53
- </div>
54
- <!-- END BASIC TABLE SAMPLE -->
37
+ </table>
38
+ <%= content_tag("div", raw(t('admin.message.data_found_list')), class: "alert alert-warning") if @posts.empty? %>
39
+ <%= raw do_pagination(@posts) %>
55
40
  </div>
56
- </div>
57
-
58
- </div>
41
+ </div>
@@ -29,7 +29,7 @@
29
29
  <div class="btn-group btn-group-sm">
30
30
  <button title="<%= t('admin.comments.tooltip.approved_comment') %>" onclick="do_change_status(this, '<%= comment.id%>', 'approved', 'success'); return false;" class="btn btn-default <%= 'btn-primary' if comment[:approved] == "approved" %>"><span class="fa fa-thumbs-o-up"></span></button>
31
31
  <button title="<%= t('admin.comments.tooltip.comment_pending') %>" onclick="do_change_status(this, '<%= comment.id%>', 'pending', 'warning'); return false;" class="btn btn-default <%= 'btn-primary' if comment[:approved] == "pending" %>"><span class="fa fa-warning"></span></button>
32
- <button title="<%= t('admin.comments.tooltip.comment_spam') %>" onclick="do_change_status(this, '<%= comment.id%>', 'spam', 'danger'); return false;" class="btn btn-default <%= 'btn-primary' if comment[:approved] == "danger" %>"><span class="fa fa-bug"></span></button>
32
+ <button title="<%= t('admin.comments.tooltip.comment_spam') %>" onclick="do_change_status(this, '<%= comment.id%>', 'spam', 'danger'); return false;" class="btn btn-default <%= 'btn-primary' if comment[:approved] == "spam" %>"><span class="fa fa-bug"></span></button>
33
33
  </div>
34
34
  <div class="btn-group btn-group-sm">
35
35
  <button title="<%= t('admin.comments.tooltip.reply_comment') %>" onclick="do_responses_comment(this, <%= comment.id %>, true); return false;" class="btn btn-default"><span class="fa fa-mail-reply"></span></button>
@@ -87,7 +87,7 @@
87
87
  <div class="btn-group btn-group-sm">
88
88
  <button title="<%= t('admin.comments.tooltip.approved_comment') %>" onclick="do_change_status(this, '<%= children.id%>', 'approved', 'success'); return false;" class="btn btn-default <%= 'btn-primary' if children[:approved] == "approved" %>"><span class="fa fa-thumbs-o-up"></span></button>
89
89
  <button title="<%= t('admin.comments.tooltip.comment_pending') %>" onclick="do_change_status(this, '<%= children.id%>', 'pending', 'warning'); return false;" class="btn btn-default <%= 'btn-primary' if children[:approved] == "pending" %>"><span class="fa fa-warning"></span></button>
90
- <button title="<%= t('admin.comments.tooltip.comment_spam') %>" onclick="do_change_status(this, '<%= children.id%>', 'spam', 'danger'); return false;" class="btn btn-default <%= 'btn-primary' if children[:approved] == "danger" %>"><span class="fa fa-bug"></span></button>
90
+ <button title="<%= t('admin.comments.tooltip.comment_spam') %>" onclick="do_change_status(this, '<%= children.id%>', 'spam', 'danger'); return false;" class="btn btn-default <%= 'btn-primary' if children[:approved] == "spam" %>"><span class="fa fa-bug"></span></button>
91
91
  </div>
92
92
  <div class="btn-group btn-group-sm">
93
93
  <button title="<%= t('admin.comments.tooltip.delete_comment') %>" onclick="do_delete_comment(this, <%= children.id %>, 'children'); return false;" class="btn btn-default"><span class="fa fa-trash-o"></span></button>
@@ -111,8 +111,7 @@
111
111
  </div>
112
112
  <script>
113
113
  var form;
114
- run.push(function()
115
- {
114
+ jQuery(function($){
116
115
  form = $("#menu_form");
117
116
 
118
117
  $('.select').change(function(){
@@ -151,13 +150,13 @@
151
150
 
152
151
  switch (value){
153
152
  case "approved":
154
- type = lang.approved;
153
+ type = I18n("msg.approved");
155
154
  break;
156
155
  case "pending":
157
- type = lang.pending;
156
+ type = I18n("msg.pending");
158
157
  break;
159
158
  case "spam":
160
- type = lang.spam;
159
+ type = I18n("msg.spam");
161
160
  break;
162
161
  default:
163
162
  type = ""
@@ -168,7 +167,7 @@
168
167
  msn = res.notice+type+".";
169
168
  $(dom).parent().find('.btn-primary').removeClass('btn-primary')
170
169
  $(dom).addClass('btn-primary')
171
- $.fn.alert({title: msn, type: color, close: lang.close});
170
+ $.fn.alert({title: msn, type: color, close: I18n("button.close")});
172
171
  }
173
172
  });
174
173
 
@@ -176,14 +175,14 @@
176
175
 
177
176
  function do_delete_comment(comment, id, type_comment){
178
177
 
179
- var msg = lang.message_delete_item;
178
+ var msg = I18n("msg.delete_item");
180
179
 
181
180
  if (confirm(msg)) {
182
181
  var path = '<%= delete_admin_comments_path()%>';
183
182
  var data = {answers_id: id};
184
183
 
185
184
  $.post( path, data, function(res){
186
- $.fn.alert({title: res.notice, close: lang.close});
185
+ $.fn.alert({title: res.notice, close: I18n("button.close")});
187
186
  });
188
187
 
189
188
  if (type_comment == "parent"){
@@ -0,0 +1,31 @@
1
+ <%= form_for @grid_template, url:{action: @grid_template.new_record? ? :create : :update}, html: { id: "grid_template_form" } do |f| %>
2
+ <div class="panel-body">
3
+ <%= render partial: 'layouts/admin/form_error', locals: {data: @grid_template} %>
4
+ <div class="form-group">
5
+ <%= f.label t('admin.table.name') %><br>
6
+ <%= f.text_field :name, :class => "form-control required" %>
7
+ </div>
8
+ <div class="form-group hidden">
9
+ <%= f.text_area :description, :class => "form-control", :rows => 4 %>
10
+ </div>
11
+ </div>
12
+ <div class="text-right">
13
+ <button class="btn btn-primary" type="submit"><%= t('admin.button.submit') %></button>
14
+ </div>
15
+ <script>
16
+ jQuery(function(){
17
+ var form = $("#grid_template_form");
18
+ form.validate({
19
+ submitHandler: function(form){
20
+ form = $(form);
21
+ showLoading();
22
+ $.post(form.attr("action"), form.serialize(), function(res){
23
+ form.replaceWith(res);
24
+ hideLoading();
25
+ });
26
+ return false;
27
+ }
28
+ });
29
+ });
30
+ </script>
31
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <table class="table table-striped" id="grid_table_list">
2
+ <% @grid_templates.each do |item| %>
3
+ <tr>
4
+ <td><%= item.name %></td>
5
+ <td class="text-right">
6
+ <%= link_to("<i class='fa fa-trash'></i>".html_safe, admin_grid_editor_path(item), class: "destroy_item", "data-message" => t("admin.message.delete_item")) %>
7
+ <%= link_to("<i class='fa fa-pencil'></i>".html_safe, edit_admin_grid_editor_path(item), class: "edit_item") %>
8
+ <%= link_to("<i class='fa fa-exchange'></i>".html_safe, admin_grid_editor_path(item), class: "import_item", title: t("admin.table.import"), "data-message" => t("admin.message.are_you_sure_to_import")) %>
9
+ </td>
10
+ </tr>
11
+ <% end %>
12
+ <%= content_tag("div", raw(t('admin.message.data_found_list')), class: "alert alert-warning") if @grid_templates.empty? %>
13
+ </table>
14
+ <script>
15
+ jQuery(function(){
16
+ var table = $("#grid_table_list");
17
+ table.on("click", ".destroy_item", function(){
18
+ if(!confirm($(this).attr("data-message"))) return false;
19
+ showLoading();
20
+ $.ajax({type: "delete", url: $(this).attr("href"), success: function(res){ table.parent().html(res); hideLoading(); }});
21
+ return false;
22
+ });
23
+ table.on("click", ".edit_item", function(){
24
+ showLoading();
25
+ $.get($(this).attr("href"), function(res){ table.parent().html(res); hideLoading(); });
26
+ return false;
27
+ });
28
+ })
29
+ </script>