fullstack-cms 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -0
- data/VERSION +1 -1
- data/app/controllers/{links_controller.rb → admin/links_controller.rb} +0 -0
- data/app/controllers/{menus_controller.rb → admin/menus_controller.rb} +0 -0
- data/app/controllers/{page_parts_controller.rb → admin/page_parts_controller.rb} +0 -0
- data/app/controllers/{pages_controller.rb → admin/pages_controller.rb} +1 -1
- data/app/controllers/{posts_controller.rb → admin/posts_controller.rb} +0 -0
- data/app/controllers/{settings_controller.rb → admin/settings_controller.rb} +0 -0
- data/app/controllers/{tags_controller.rb → admin/tags_controller.rb} +0 -0
- data/app/controllers/{users_controller.rb → admin/users_controller.rb} +0 -0
- data/app/helpers/menus_helper.rb +2 -1
- data/app/helpers/mobile_helper.rb +7 -0
- data/app/helpers/pages_helper.rb +25 -1
- data/app/models/nestable.rb +14 -0
- data/app/models/page.rb +16 -3
- data/{lib/generators/fullstack/cms/templates/rails/lib/support → app/models}/pageable.rb +2 -1
- data/app/views/admin/links/_form.html.erb +3 -3
- data/app/views/admin/links/_index.html.erb +1 -1
- data/app/views/admin/links/_links.html.erb +15 -48
- data/app/views/admin/menus/_form.html.erb +5 -5
- data/app/views/admin/menus/_index.html.erb +11 -2
- data/app/views/admin/page_parts/_tabs.html.erb +3 -3
- data/app/views/admin/pages/_form.html.erb +4 -19
- data/app/views/admin/settings/_form.html.erb +17 -15
- data/app/views/admin/settings/_index.html.erb +7 -1
- data/config/routes.rb +27 -0
- data/fullstack-cms.gemspec +29 -62
- data/lib/fullstack/cms.rb +1 -0
- data/lib/generators/fullstack/cms/install_generator.rb +40 -4
- data/lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/admin/links.js.coffee +20 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/jquery.fitvids.js +77 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/lib/plugins.js +5 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/javascripts/site/site.js.coffee +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/stylesheets/site/bootstrap.overrides.css +3 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/stylesheets/site/lib/bootstrap.min.css +722 -0
- data/lib/generators/fullstack/cms/templates/rails/app/assets/stylesheets/site/site.css +30 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/layouts/email.html.erb +1 -1
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_head.html.erb +7 -7
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_header.html.erb +1 -1
- data/lib/generators/fullstack/cms/templates/rails/config/initializers/devise_mailer.rb +1 -0
- data/lib/generators/fullstack/cms/templates/rails/public/admin/drag-handle.png +0 -0
- data/locales/en.yml +9 -0
- data/locales/it.yml +30 -0
- metadata +42 -62
- data/app/views/admin/menus/_filter.html.erb +0 -12
- data/app/views/admin/settings/_filter.html.erb +0 -10
- data/lib/generators/fullstack/cms/templates/rails/README.md +0 -40
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/attachments/_attachments.html.erb +0 -49
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/attachments/create.js.coffee +0 -14
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/destroy.js.coffee +0 -7
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/edit.html.erb +0 -8
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/index.html.erb +0 -54
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/new.html.erb +0 -8
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/update.js.coffee +0 -5
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/dashboard/show.html.erb +0 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_filter.html.erb +0 -14
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_form.html.erb +0 -24
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_index.html.erb +0 -9
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_links.html.erb +0 -128
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_table_row.html.erb +0 -9
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/create.js.erb +0 -12
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/sort.js.coffee +0 -6
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/update.js.coffee +0 -6
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_filter.html.erb +0 -12
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_form.html.erb +0 -34
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_index.html.erb +0 -9
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/page_parts/_tabs.html.erb +0 -21
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/page_parts/destroy.js.coffee +0 -12
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_filter.html.erb +0 -12
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_form.html.erb +0 -50
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_index.html.erb +0 -14
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_filter.html.erb +0 -14
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_form.html.erb +0 -26
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_index.html.erb +0 -9
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_filter.html.erb +0 -10
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_form.html.erb +0 -25
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_index.html.erb +0 -8
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/shared/_nav.html.erb +0 -38
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_filter.html.erb +0 -12
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_form.html.erb +0 -53
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_index.html.erb +0 -18
- data/lib/generators/fullstack/cms/templates/rails/app/views/layouts/admin.html.erb +0 -80
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120416071459_acts_as_taggable_on_migration.rb +0 -31
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120730184641_create_friendly_id_slugs.rb +0 -18
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120730204729_create_ckeditor_assets.rb +0 -26
- data/lib/generators/fullstack/cms/templates/rails/db/seeds.rb.tt +0 -11
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/asset.rb +0 -4
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/attachment_file.rb +0 -12
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/picture.rb +0 -13
- data/lib/generators/fullstack/cms/templates/rails/lib/support/user_subject.rb +0 -40
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/.gitkeep +0 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/assets.rake +0 -53
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/cms.rake +0 -23
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/remote.rake +0 -255
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<% if thead -%>
|
|
2
|
-
<th><%= sort_link title_method_for(collection.klass) %></th>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<th><%= _("Actions") %></th>
|
|
6
|
-
<% end -%>
|
|
7
|
-
|
|
8
|
-
<% if tbody -%>
|
|
9
|
-
<td><%= link_to title_for(content), [:edit, :admin, content] %></td>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<td><%= default_collection_actions_for(content) %></td>
|
|
14
|
-
<% end -%>
|
data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_form.html.erb
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<%= tabs do |t| %>
|
|
2
|
-
<%= t.pane _("Info") do %>
|
|
3
|
-
|
|
4
|
-
<%= semantic_form_for [:"admin", resource], :html => {:multipart => true} do |f| -%>
|
|
5
|
-
<%= form_errors(f) %>
|
|
6
|
-
|
|
7
|
-
<%= f.inputs do %>
|
|
8
|
-
<%= f.input :title %>
|
|
9
|
-
<%= f.input :excerpt %>
|
|
10
|
-
|
|
11
|
-
<% end -%>
|
|
12
|
-
|
|
13
|
-
<%= form_actions do %>
|
|
14
|
-
<%= button (resource.persisted? ? _("Update") : _("Create")), :type => :primary, :size => :large %>
|
|
15
|
-
<% end %>
|
|
16
|
-
<% end -%>
|
|
17
|
-
|
|
18
|
-
<% end %>
|
|
19
|
-
<%= t.pane _("Photos") do %>
|
|
20
|
-
|
|
21
|
-
<div>
|
|
22
|
-
<%= photo_uploader_for(@photogallery) %>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<% end %>
|
|
26
|
-
<% end %>
|
data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_index.html.erb
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<% if thead -%>
|
|
2
|
-
<th><%= sort_link title_method_for(collection.klass) %></th><th><%= sort_link :created_at %></th><th><%= _("Actions") %></th>
|
|
3
|
-
<% end -%>
|
|
4
|
-
|
|
5
|
-
<% if tbody -%>
|
|
6
|
-
<td><%= link_to title_for(content), [:edit, :admin, content] %></td>
|
|
7
|
-
<td><%= l content.created_at, :format => :pubdate %></td>
|
|
8
|
-
<td><%= default_collection_actions_for(content) %></td>
|
|
9
|
-
<% end -%>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<%= semantic_form_for [:"admin", resource], :html => {:multipart => true} do |f| -%>
|
|
2
|
-
|
|
3
|
-
<%= form_errors(f) %>
|
|
4
|
-
<% if resource.new_record? %>
|
|
5
|
-
|
|
6
|
-
<%= f.inputs do %>
|
|
7
|
-
<%= f.input :key %>
|
|
8
|
-
<%= f.input :kind, :as => "select", :collection => Setting.kinds %>
|
|
9
|
-
<% end -%>
|
|
10
|
-
|
|
11
|
-
<% else %>
|
|
12
|
-
|
|
13
|
-
<%= f.inputs do %>
|
|
14
|
-
<%= f.input :key, :input_html => {:readonly => true} %>
|
|
15
|
-
<%= f.input :"#{resource.kind}_value" %>
|
|
16
|
-
<% end -%>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<% end %>
|
|
20
|
-
<%= form_actions do %>
|
|
21
|
-
<%= button (resource.persisted? ? _("Update") : _("Create")), :type => :primary, :size => :large %>
|
|
22
|
-
<% end %>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<% end -%>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<% if thead -%>
|
|
2
|
-
<th><%= sort_link title_method_for(collection.klass) %></th><th><%= _("Actions") %></th>
|
|
3
|
-
<% end -%>
|
|
4
|
-
|
|
5
|
-
<% if tbody -%>
|
|
6
|
-
<td><%= link_to title_for(content), [:edit, :admin, content] %></td>
|
|
7
|
-
<td><%= default_collection_actions_for(content) %></td>
|
|
8
|
-
<% end -%>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<% content_for :menu do -%>
|
|
2
|
-
|
|
3
|
-
<%= nav do %>
|
|
4
|
-
<%= nav_item _("Dashboard"), admin_root_path, :icon => "cog" , :icon_color => :white %>
|
|
5
|
-
<%= nav_item _("Settings"), admin_settings_path, :icon => "wrench" , :icon_color => :white %>
|
|
6
|
-
<% end %>
|
|
7
|
-
|
|
8
|
-
<%= nav(:class => 'float right') do %>
|
|
9
|
-
<%= nav_item _("Homepage"), "/", :icon => "home" , :icon_color => :white %>
|
|
10
|
-
<%= dropdown_nav_item _("Account"), :icon => "user" , :icon_color => :white do %>
|
|
11
|
-
<%= nav_item _('Logout'), destroy_user_session_path, :method => :delete %>
|
|
12
|
-
<% end %>
|
|
13
|
-
<% end %>
|
|
14
|
-
|
|
15
|
-
<% end -%>
|
|
16
|
-
|
|
17
|
-
<% content_for :nav do -%>
|
|
18
|
-
|
|
19
|
-
<div class="well">
|
|
20
|
-
<%= nav_list do %>
|
|
21
|
-
<%= nav_header _("Website") %>
|
|
22
|
-
<%= nav_item _("Pages"), admin_pages_path %>
|
|
23
|
-
<%= nav_item _("Menus"), admin_menus_path %>
|
|
24
|
-
|
|
25
|
-
<%= nav_header _("Contents") %>
|
|
26
|
-
<%= nav_item _("Photogalleries"), admin_photogalleries_path %>
|
|
27
|
-
|
|
28
|
-
<!-- items placeholder -->
|
|
29
|
-
|
|
30
|
-
<%= nav_header _("Users") %>
|
|
31
|
-
<%= nav_item _("Users"), admin_users_path %>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<% end -%>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<% end -%>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<%= tabs do |t| %>
|
|
2
|
-
<%= t.pane _("Info") do %>
|
|
3
|
-
|
|
4
|
-
<%= semantic_form_for [:"admin", resource], :html => {:multipart => true} do |f| -%>
|
|
5
|
-
|
|
6
|
-
<%= form_errors(f) %>
|
|
7
|
-
|
|
8
|
-
<%= f.inputs do %>
|
|
9
|
-
<%= f.input :email %>
|
|
10
|
-
<% end -%>
|
|
11
|
-
|
|
12
|
-
<%= link_to _("Edit password"),
|
|
13
|
-
"javascript:void(0);",
|
|
14
|
-
:id => "edit_your_password",
|
|
15
|
-
:class => "btn btn-small" %>
|
|
16
|
-
|
|
17
|
-
<div id="password_fields" style="display:none;">
|
|
18
|
-
<%= f.inputs do %>
|
|
19
|
-
<%= f.input :password %>
|
|
20
|
-
<%= f.input :password_confirmation %>
|
|
21
|
-
<% end %>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<%= form_actions do %>
|
|
25
|
-
<%= button (resource.persisted? ? _("Update") : _("Create")),
|
|
26
|
-
:type => :primary, :size => :large %>
|
|
27
|
-
<% end %>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<% end -%>
|
|
31
|
-
|
|
32
|
-
<% end %>
|
|
33
|
-
<% end %>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<% content_for :javascripts do -%>
|
|
38
|
-
<%= coffee_script_tag do %>
|
|
39
|
-
html = $("#password_fields").find("fieldset")
|
|
40
|
-
html.remove()
|
|
41
|
-
$("#password_fields").show()
|
|
42
|
-
|
|
43
|
-
$(document).ready ->
|
|
44
|
-
|
|
45
|
-
$("#edit_your_password").click ->
|
|
46
|
-
elems = $(html)
|
|
47
|
-
elems.hide()
|
|
48
|
-
$("#password_fields").empty().append(elems)
|
|
49
|
-
elems.show('slow')
|
|
50
|
-
$(@).remove()
|
|
51
|
-
|
|
52
|
-
<% end %>
|
|
53
|
-
<% end %>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<% if thead -%>
|
|
2
|
-
<th><%= sort_link title_method_for(collection.klass) %></th>
|
|
3
|
-
|
|
4
|
-
<th><%= sort_link :created_at %></th>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<th><%= _("Actions") %></th>
|
|
8
|
-
<% end -%>
|
|
9
|
-
|
|
10
|
-
<% if tbody -%>
|
|
11
|
-
<td><%= link_to title_for(content), [:edit, :admin, content] %></td>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<td><%= l content.created_at, :format => :pubdate %></td>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<td><%= default_collection_actions_for(content) %></td>
|
|
18
|
-
<% end -%>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="it">
|
|
3
|
-
<head>
|
|
4
|
-
<%= csrf_meta_tags %>
|
|
5
|
-
<%= meta :title => "#{@title}" + ( @title ? " - " : "" ) + Settings.site.title + ' Admin',
|
|
6
|
-
:description => Settings.site.slogan
|
|
7
|
-
%>
|
|
8
|
-
<%= stylesheet_link_tag 'admin/admin' %>
|
|
9
|
-
<%= yield :stylesheets %>
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body>
|
|
13
|
-
<%= render :partial => 'admin/shared/nav' %>
|
|
14
|
-
|
|
15
|
-
<% if devise_controller? %>
|
|
16
|
-
<%= navbar :fixed => :top do %>
|
|
17
|
-
<%= brand Settings.site.title + ' Admin', admin_root_path %>
|
|
18
|
-
<% end %>
|
|
19
|
-
<div class="container main">
|
|
20
|
-
<div class="row">
|
|
21
|
-
<%= yield %>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<% else %>
|
|
25
|
-
|
|
26
|
-
<% bootstrap_fluid! %>
|
|
27
|
-
|
|
28
|
-
<%= navbar :fixed => :top do %>
|
|
29
|
-
<%= brand Settings.site.title + ' Admin', admin_root_path %>
|
|
30
|
-
<%= yield :menu %>
|
|
31
|
-
<% end %>
|
|
32
|
-
|
|
33
|
-
<%= yield :crumbs %>
|
|
34
|
-
<div class="container-fluid main">
|
|
35
|
-
<div class="row-fluid">
|
|
36
|
-
<div id="left-aside" class="span2">
|
|
37
|
-
<%= yield :nav %>
|
|
38
|
-
</div>
|
|
39
|
-
<% if content_for?(:aside) -%>
|
|
40
|
-
<div class="span6" id="center">
|
|
41
|
-
<%= yield %>
|
|
42
|
-
</div>
|
|
43
|
-
<div id="right-aside" class="span4">
|
|
44
|
-
<%= yield :aside %>
|
|
45
|
-
</div>
|
|
46
|
-
<% else -%>
|
|
47
|
-
<div class="span10" id="center">
|
|
48
|
-
<%= yield %>
|
|
49
|
-
</div>
|
|
50
|
-
<% end -%>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<footer>
|
|
55
|
-
|
|
56
|
-
</footer>
|
|
57
|
-
<% end %>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<%= javascript_include_tag 'admin/admin' %>
|
|
61
|
-
<%= yield :javascripts %>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<% if flash[:notice].present? %>
|
|
65
|
-
<script type="text/javascript" charset="utf-8">$.notify.notice('<%= j "#{flash[:notice]}" %>');</script>
|
|
66
|
-
<% flash.discard(:notice) %>
|
|
67
|
-
|
|
68
|
-
<% elsif flash[:error].present? %>
|
|
69
|
-
<script type="text/javascript" charset="utf-8">$.notify.error('<%= j "#{flash[:error]}" %>');</script>
|
|
70
|
-
<% flash.discard(:error) %>
|
|
71
|
-
|
|
72
|
-
<% elsif flash[:alert].present? %>
|
|
73
|
-
<script type="text/javascript" charset="utf-8">$.notify.alert('<%= j "#{flash[:alert]}" %>');</script>
|
|
74
|
-
<% flash.discard(:alert) %>
|
|
75
|
-
|
|
76
|
-
<% end %>
|
|
77
|
-
|
|
78
|
-
</body>
|
|
79
|
-
</html>
|
|
80
|
-
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
class ActsAsTaggableOnMigration < ActiveRecord::Migration
|
|
2
|
-
def self.up
|
|
3
|
-
create_table :tags do |t|
|
|
4
|
-
t.string :name
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
create_table :taggings do |t|
|
|
8
|
-
t.references :tag
|
|
9
|
-
|
|
10
|
-
# You should make sure that the column created is
|
|
11
|
-
# long enough to store the required class names.
|
|
12
|
-
t.references :taggable, :polymorphic => true
|
|
13
|
-
t.references :tagger, :polymorphic => true
|
|
14
|
-
|
|
15
|
-
# limit is created to prevent mysql error o add_index lenght for myisam table type.
|
|
16
|
-
# http://bit.ly/vgW2Ql
|
|
17
|
-
t.string :context, :limit => 128
|
|
18
|
-
|
|
19
|
-
t.datetime :created_at
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
add_index :taggings, :tag_id
|
|
23
|
-
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def self.down
|
|
27
|
-
drop_table :taggings
|
|
28
|
-
drop_table :tags
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
class CreateFriendlyIdSlugs < ActiveRecord::Migration
|
|
2
|
-
|
|
3
|
-
def self.up
|
|
4
|
-
create_table :friendly_id_slugs do |t|
|
|
5
|
-
t.string :slug, :null => false
|
|
6
|
-
t.integer :sluggable_id, :null => false
|
|
7
|
-
t.string :sluggable_type, :limit => 40
|
|
8
|
-
t.datetime :created_at
|
|
9
|
-
end
|
|
10
|
-
add_index :friendly_id_slugs, :sluggable_id
|
|
11
|
-
add_index :friendly_id_slugs, [:slug, :sluggable_type], :unique => true
|
|
12
|
-
add_index :friendly_id_slugs, :sluggable_type
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def self.down
|
|
16
|
-
drop_table :friendly_id_slugs
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
class CreateCkeditorAssets < ActiveRecord::Migration
|
|
2
|
-
def self.up
|
|
3
|
-
create_table :ckeditor_assets do |t|
|
|
4
|
-
t.string :data_file_name, :null => false
|
|
5
|
-
t.string :data_content_type
|
|
6
|
-
t.integer :data_file_size
|
|
7
|
-
|
|
8
|
-
t.integer :assetable_id
|
|
9
|
-
t.string :assetable_type, :limit => 30
|
|
10
|
-
t.string :type, :limit => 30
|
|
11
|
-
|
|
12
|
-
# Uncomment it to save images dimensions, if your need it
|
|
13
|
-
t.integer :width
|
|
14
|
-
t.integer :height
|
|
15
|
-
|
|
16
|
-
t.timestamps
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type"
|
|
20
|
-
add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def self.down
|
|
24
|
-
drop_table :ckeditor_assets
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
puts "Seeding database ..."
|
|
2
|
-
|
|
3
|
-
if Rails.env.development?
|
|
4
|
-
user = User.new( :email => "admin@example.com",
|
|
5
|
-
:password => "password" )
|
|
6
|
-
|
|
7
|
-
user.skip_confirmation! if user.respond_to?(:skip_confirmation!)
|
|
8
|
-
user.save!
|
|
9
|
-
user.confirm! if user.respond_to?(:confirm)
|
|
10
|
-
user.has_role!(:administrator) if user.respond_to?(:has_role!)
|
|
11
|
-
end
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
class Ckeditor::AttachmentFile < Ckeditor::Asset
|
|
2
|
-
has_attached_file :data,
|
|
3
|
-
:url => "/ckeditor_assets/attachments/:id/:filename",
|
|
4
|
-
:path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename"
|
|
5
|
-
|
|
6
|
-
validates_attachment_size :data, :less_than => 100.megabytes
|
|
7
|
-
validates_attachment_presence :data
|
|
8
|
-
|
|
9
|
-
def url_thumb
|
|
10
|
-
@url_thumb ||= Ckeditor::Utils.filethumb(filename)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
class Ckeditor::Picture < Ckeditor::Asset
|
|
2
|
-
has_attached_file :data,
|
|
3
|
-
:url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
|
|
4
|
-
:path => ":rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension",
|
|
5
|
-
:styles => { :content => '800>', :thumb => '118x100#' }
|
|
6
|
-
|
|
7
|
-
validates_attachment_size :data, :less_than => 2.megabytes
|
|
8
|
-
validates_attachment_presence :data
|
|
9
|
-
|
|
10
|
-
def url_content
|
|
11
|
-
url(:content)
|
|
12
|
-
end
|
|
13
|
-
end
|