camaleon_cms 1.0.4 → 1.0.5

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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/admin/actions.js +14 -3
  3. data/app/assets/javascripts/admin/admin-manifest.js +1 -4
  4. data/app/assets/javascripts/admin/custom_fields.js +2 -2
  5. data/app/assets/javascripts/admin/data.js +68 -102
  6. data/app/assets/javascripts/admin/libraries.js +46 -87
  7. data/app/assets/javascripts/admin/modal.js +15 -3
  8. data/app/assets/javascripts/admin/post.js +2 -2
  9. data/app/assets/stylesheets/admin/admin-manifest.css +1 -2
  10. data/app/assets/stylesheets/admin/custom_admin.css.scss +3 -1
  11. data/app/controllers/admin/sessions_controller.rb +21 -14
  12. data/app/controllers/admin/users_controller.rb +7 -4
  13. data/app/controllers/api/api_controller.rb +28 -0
  14. data/app/controllers/api/v1/category_controller.rb +7 -0
  15. data/app/controllers/api/v1/page_controller.rb +8 -0
  16. data/app/controllers/api/v1/post_controller.rb +8 -0
  17. data/app/controllers/concerns/frontend_concern.rb +1 -17
  18. data/app/decorators/category_decorator.rb +1 -1
  19. data/app/helpers/camaleon_helper.rb +15 -0
  20. data/app/helpers/html_helper.rb +1 -0
  21. data/app/helpers/session_helper.rb +18 -3
  22. data/app/models/site.rb +17 -11
  23. data/app/views/admin/posts/_sidebar.html.erb +9 -7
  24. data/app/views/admin/posts/form.html.erb +4 -1
  25. data/app/views/admin/sessions/register.html.erb +8 -6
  26. data/app/views/admin/settings/custom_fields/_render.html.erb +3 -2
  27. data/app/views/admin/settings/custom_fields/fields/audio.html.erb +1 -1
  28. data/app/views/admin/settings/custom_fields/fields/checkbox.html.erb +1 -1
  29. data/app/views/admin/settings/custom_fields/fields/checkboxes.html.erb +1 -1
  30. data/app/views/admin/settings/custom_fields/fields/colorpicker.html.erb +1 -1
  31. data/app/views/admin/settings/custom_fields/fields/date.html.erb +1 -1
  32. data/app/views/admin/settings/custom_fields/fields/editor.html.erb +1 -1
  33. data/app/views/admin/settings/custom_fields/fields/email.html.erb +1 -1
  34. data/app/views/admin/settings/custom_fields/fields/field_attrs.html.erb +2 -2
  35. data/app/views/admin/settings/custom_fields/fields/file.html.erb +1 -1
  36. data/app/views/admin/settings/custom_fields/fields/image.html.erb +1 -1
  37. data/app/views/admin/settings/custom_fields/fields/numeric.html.erb +1 -1
  38. data/app/views/admin/settings/custom_fields/fields/phone.html.erb +1 -1
  39. data/app/views/admin/settings/custom_fields/fields/posts.html.erb +1 -1
  40. data/app/views/admin/settings/custom_fields/fields/radio.html.erb +1 -1
  41. data/app/views/admin/settings/custom_fields/fields/select.html.erb +1 -1
  42. data/app/views/admin/settings/custom_fields/fields/text_area.html.erb +1 -1
  43. data/app/views/admin/settings/custom_fields/fields/text_box.html.erb +1 -1
  44. data/app/views/admin/settings/custom_fields/fields/url.html.erb +1 -1
  45. data/app/views/admin/settings/custom_fields/fields/users.html.erb +1 -1
  46. data/app/views/admin/settings/custom_fields/fields/video.html.erb +1 -1
  47. data/app/views/admin/settings/custom_fields/index.html.erb +54 -8
  48. data/app/views/admin/settings/site.html.erb +170 -151
  49. data/app/views/admin/users/form.html.erb +19 -23
  50. data/app/views/default_theme/sitemap.html.erb +19 -0
  51. data/app/views/default_theme/sitemap.xml.builder +48 -0
  52. data/app/views/layouts/admin.html.erb +3 -13
  53. data/app/views/layouts/admin/_footer.html.erb +10 -3
  54. data/app/views/layouts/admin/_header.html.erb +1 -1
  55. data/config/initializers/doorkeeper.rb +128 -0
  56. data/config/initializers/rufus_cron.rb +3 -3
  57. data/config/initializers/sass.rb +0 -62
  58. data/config/locales/admin/en.yml +3 -2
  59. data/config/locales/admin/es.yml +2 -0
  60. data/config/locales/admin/js.yml +9 -38
  61. data/config/locales/doorkeeper.en.yml +123 -0
  62. data/config/routes.rb +12 -0
  63. data/config/routes/admin.rb +0 -3
  64. data/db/migrate/20150930115030_doorkeeper_configuration.rb +45 -0
  65. data/lib/camaleon_cms/engine.rb +2 -0
  66. data/lib/camaleon_cms/version.rb +1 -1
  67. data/lib/generators/camaleon_cms/gem_plugin_template/app/models/plugins/my_plugin/my_plugin.rb +1 -6
  68. data/lib/generators/cplugin_template/app/apps/plugins/my_plugin/models/my_plugin.rb +0 -5
  69. data/lib/generators/ctheme_template/app/apps/themes/my_theme/assets/js/main.js +1 -1
  70. data/lib/plugin_routes.rb +12 -8
  71. metadata +38 -46
  72. data/app/assets/javascripts/admin/grid-editor.js +0 -532
  73. data/app/assets/javascripts/audio/alert.mp3 +0 -0
  74. data/app/assets/javascripts/audio/fail.mp3 +0 -0
  75. data/app/assets/javascripts/jquery-1.11.3.min.js +0 -5
  76. data/app/assets/stylesheets/admin/grid-editor.css.scss +0 -15
  77. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/css/style.css +0 -84
  78. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/editor_plugin.js +0 -1
  79. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/editor_plugin_src.js +0 -90
  80. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/img/youtube.png +0 -0
  81. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/index.html +0 -86
  82. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/js/scripts.js +0 -1
  83. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/js/scripts_src.js +0 -81
  84. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/langs/en.js +0 -3
  85. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/langs/en_dlg.js +0 -12
  86. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/langs/es.js +0 -3
  87. data/app/assets/stylesheets/tinymce/plugins/youtubeIframe/langs/es_dlg.js +0 -12
  88. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/bootstrap.css +0 -2228
  89. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/content.css +0 -189
  90. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/dialog.css +0 -295
  91. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/butt2.png +0 -0
  92. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/button-bg.png +0 -0
  93. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/buttons.png +0 -0
  94. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/down_arrow.gif +0 -0
  95. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/fade-butt.png +0 -0
  96. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/icons.png +0 -0
  97. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/items.gif +0 -0
  98. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/menu-arrow.png +0 -0
  99. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/menu-check.png +0 -0
  100. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/progress.gif +0 -0
  101. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/tabs.gif +0 -0
  102. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/img/toolbarbg.png +0 -0
  103. data/app/assets/stylesheets/tinymce/themes/advanced/skins/bootstrap/ui.css +0 -1163
  104. data/app/controllers/admin/grid_editor_controller.rb +0 -55
  105. data/app/views/admin/grid_editor/form.html.erb +0 -31
  106. data/app/views/admin/grid_editor/index.html.erb +0 -29
  107. data/config/sitemap.rb +0 -56
  108. data/lib/generators/camaleon_cms/gem_theme_template/app/controllers/plugins/my_plugin/admin_controller.rb +0 -8
  109. data/lib/generators/camaleon_cms/gem_theme_template/app/controllers/plugins/my_plugin/front_controller.rb +0 -8
  110. data/lib/generators/camaleon_cms/gem_theme_template/app/helpers/plugins/my_plugin/main_helper.rb +0 -22
  111. data/lib/generators/camaleon_cms/gem_theme_template/app/models/plugins/my_plugin/my_plugin.rb +0 -12
  112. data/lib/generators/camaleon_cms/gem_theme_template/app/views/plugins/my_plugin/admin/index.html.erb +0 -2
  113. data/lib/generators/camaleon_cms/gem_theme_template/app/views/plugins/my_plugin/front/index.html.erb +0 -2
  114. data/lib/generators/camaleon_cms/gem_theme_template/app/views/plugins/my_plugin/layouts/readme.txt +0 -2
  115. data/lib/generators/camaleon_cms/gem_theme_template/config/camaleon_plugin.json +0 -21
@@ -1,55 +0,0 @@
1
- =begin
2
- Camaleon CMS is a content management system
3
- Copyright (C) 2015 by Owen Peredo Diaz
4
- Email: owenperedo@gmail.com
5
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7
- See the GNU Affero General Public License (GPLv3) for more details.
8
- =end
9
- # Manage all templates for grid editor
10
- class Admin::GridEditorController < AdminController
11
- # return all grid templates
12
- def index
13
- @grid_templates = current_site.grid_templates
14
- render "index", layout: false
15
- end
16
-
17
- # return new grid editor template form
18
- def new
19
- @grid_template ||= current_site.grid_templates.new
20
- render "form", layout: false
21
- end
22
-
23
- # return edit grid editor template form
24
- def edit
25
- @grid_template = current_site.grid_templates.find(params[:id])
26
- new
27
- end
28
-
29
- # update a grid editor template
30
- def update
31
- current_site.grid_templates.find(params[:id]).update(params.require(:grid_template).permit(:name, :description))
32
- index
33
- end
34
-
35
- # return grid template value
36
- def show
37
- render inline: current_site.grid_templates.find(params[:id]).description
38
- end
39
-
40
- # destroy a grid editor template
41
- def destroy
42
- current_site.grid_templates.find(params[:id]).destroy
43
- index
44
- end
45
-
46
- # create a new grid editor template
47
- def create
48
- params[:grid_template][:slug] = Time.now.to_i
49
- if current_site.grid_templates.create(params.require(:grid_template).permit(:name, :slug, :description))
50
- index
51
- else
52
- render inline: "<div class='alert alert-danger'>#{t("admin.message.form_error")}</div>"
53
- end
54
- end
55
- end
@@ -1,31 +0,0 @@
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 %>
@@ -1,29 +0,0 @@
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>
data/config/sitemap.rb DELETED
@@ -1,56 +0,0 @@
1
- require 'uri'
2
- h = PluginRoutes.system_info["base_domain"]
3
-
4
- # create sitemap directory
5
- sitemaps_dir = Rails.root.join("public", "sitemaps").to_s
6
- FileUtils.mkdir(sitemaps_dir) unless Dir.exist?(sitemaps_dir)
7
-
8
- Site.all.each do |site|
9
- site = site.decorate
10
- folder "sitemaps/#{site.slug}"
11
- # host site.slug.include?(".") ? site.slug : "#{site.slug}.#{h}"
12
- host site.the_url.to_s.parse_domain
13
-
14
- langs = site.get_languages
15
-
16
- sitemap :site do
17
- url root_url, priority: 1.0, change_freq: "daily"
18
-
19
- langs.each_with_index{|l, index| url site.the_url(locale: index==0?nil:l), last_mod: site.updated_at, priority: 0.9 }
20
- url sitemap_url
21
- end
22
-
23
-
24
- sitemap_for site.posts.public_posts, name: :published_posts do |post|
25
- post = post.decorate
26
- langs.each_with_index{|l, index| url post.the_url(locale: index==0?nil:l), last_mod: post.updated_at, priority: 0.7 }
27
- end
28
-
29
- sitemap_for site.full_categories.no_empty, name: :categories do |cat|
30
- cat = cat.decorate
31
- langs.each_with_index{|l, index| url cat.the_url(locale: index==0?nil:l), last_mod: cat.updated_at, priority: 0.5 }
32
- end
33
-
34
- sitemap_for site.post_types, name: :groups do |ptype|
35
- ptype = ptype.decorate
36
- langs.each_with_index{|l, index| url ptype.the_url(locale: index==0?nil:l), last_mod: ptype.updated_at, priority: 0.3 }
37
- end
38
-
39
- sitemap_for site.post_tags, name: :tags do |ptag|
40
- ptag = ptag.decorate
41
- langs.each_with_index{|l, index| url ptag.the_url(locale: index==0?nil:l), last_mod: ptag.updated_at, priority: 0.2 }
42
- end
43
-
44
- # hooks
45
- c = CamaleonController.new
46
- c.instance_eval do
47
- @current_site = site
48
- @_hooks_skip = []
49
- end
50
-
51
- # sample: sitemap :site2 do \n url root_url \n end
52
- r = {site: site, eval: ""}; c.hooks_run("sitemap", r)
53
- instance_eval(r[:eval]) if r[:eval].present?
54
-
55
- ping_with "http://#{host}/sitemap.xml"
56
- end
@@ -1,8 +0,0 @@
1
- class Plugins::PluginClass::AdminController < Apps::PluginsAdminController
2
- include Plugins::PluginClass::MainHelper
3
- def index
4
- # actions for admin panel
5
- end
6
-
7
- # add custom methods below
8
- end
@@ -1,8 +0,0 @@
1
- class Plugins::PluginClass::FrontController < Apps::PluginsFrontController
2
- include Plugins::PluginClass::MainHelper
3
- def index
4
- # actions for frontend module
5
- end
6
-
7
- # add custom methods below
8
- end
@@ -1,22 +0,0 @@
1
- module Plugins::PluginClass::MainHelper
2
- def self.included(klass)
3
- # klass.helper_method [:my_helper_method] rescue "" # here your methods accessible from views
4
- end
5
-
6
- # here all actions on going to active
7
- # you can run sql commands like this:
8
- # results = ActiveRecord::Base.connection.execute(query);
9
- # plugin: plugin model
10
- def pluginKey_on_active(plugin)
11
- end
12
-
13
- # here all actions on going to inactive
14
- # plugin: plugin model
15
- def pluginKey_on_inactive(plugin)
16
- end
17
-
18
- # here all actions to upgrade for a new version
19
- # plugin: plugin model
20
- def pluginKey_on_upgrade(plugin)
21
- end
22
- end
@@ -1,12 +0,0 @@
1
- # class Plugins::PluginClass::Models::PluginClass < ActiveRecord::Base
2
- # attr_accessible :path, :browser_key
3
- # belongs_to :site
4
-
5
- # here create your models normally
6
- # notice: your tables in database will be plugins_pluginKey in plural (check rails documentation)
7
- # end
8
-
9
- # here your default models customization
10
- # Site.class_eval do
11
- # has_many :pluginKey, class_name: "Plugins::PluginClass::Models::PluginClass"
12
- # end
@@ -1,2 +0,0 @@
1
- <%#= javascript_include_tag plugin_gem_asset("js/my_file.js") %>
2
- Plugin ready to use in admin panel!.
@@ -1,2 +0,0 @@
1
- <%#= javascript_include_tag plugin_gem_asset("js/my_file.js") %>
2
- Plugin ready to use! in frontend.
@@ -1,2 +0,0 @@
1
- You can create your layouts here.
2
- To load your custom layout you can use: layout: plugin_layout(<layout_name>) in your controller
@@ -1,21 +0,0 @@
1
- {
2
- "title": "pluginTitle",
3
- "descr": "",
4
- "version": "0.1",
5
- "key": "pluginKey",
6
- "helpers": [
7
- "Plugins::PluginClass::MainHelper"
8
- ],
9
- "hooks": {
10
- "on_active": [
11
- "pluginKey_on_active"
12
- ],
13
- "on_inactive": [
14
- "pluginKey_on_inactive"
15
- ],
16
- "on_upgrade": [
17
- "pluginKey_on_upgrade"
18
- ]
19
- //here you can add all your hooks (read documentation)
20
- }
21
- }