fullstack-cms 0.1.5 → 0.1.6
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/TODO.md +1 -19
- data/VERSION +1 -1
- data/app/helpers/menus_helper.rb +11 -4
- data/app/helpers/pages_helper.rb +20 -7
- data/app/helpers/settings_helper.rb +16 -3
- data/app/models/attachment.rb +18 -0
- data/app/models/page.rb +2 -2
- data/app/models/pageable.rb +16 -1
- data/app/models/photo.rb +23 -0
- data/app/models/setting.rb +10 -5
- data/app/models/text.rb +6 -0
- data/app/models/text_page_part.rb +3 -0
- data/app/models/text_with_title_page_part.rb +4 -0
- data/app/views/admin/pages/_collection.html.erb +1 -1
- data/app/views/admin/pages/_form.html.erb +29 -21
- data/app/views/admin/settings/_collection.html.erb +27 -0
- data/app/views/admin/users/_form.html.erb +9 -1
- data/config/locales/formats.en.yml +9 -0
- data/config/locales/formats.it.yml +9 -0
- data/config/locales/it.yml +8 -6
- data/fullstack-cms.gemspec +10 -3
- data/lib/generators/fullstack/cms/install_generator.rb +8 -13
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/site/home.html.erb +1 -12
- data/lib/generators/fullstack/cms/templates/rails/config/initializers/fullstack.rb +20 -0
- metadata +11 -4
- data/app/views/admin/page_parts/_tabs.html.erb +0 -21
- data/app/views/admin/page_parts/destroy.js.coffee +0 -12
data/TODO.md
CHANGED
@@ -2,24 +2,6 @@
|
|
2
2
|
|
3
3
|
## Page parts with schema
|
4
4
|
|
5
|
-
|
6
|
-
<%= part "marketing-1", :schema => "text-with-title" %>
|
7
|
-
<%= part "marketing-2", :schema => "text-with-title" %>
|
8
|
-
<%= part "announcement", :schema => "announcement" %>
|
9
|
-
|
10
|
-
class AnnouncementPagePart < PagePart
|
11
|
-
field :claim, :string
|
12
|
-
field :link, :link
|
13
|
-
end
|
5
|
+
# ordinamento degli input in base all'ordine dei field
|
14
6
|
|
15
|
-
class TextPagePart < PagePart
|
16
|
-
field :text, :text, :markup => true
|
17
|
-
end
|
18
|
-
|
19
|
-
class TextWithTitlePagePart < PagePart
|
20
|
-
field :title, :string
|
21
|
-
field :text, :text, :markup => true
|
22
|
-
end
|
23
|
-
|
24
|
-
# Update e Creatore di ogni cosa
|
25
7
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/app/helpers/menus_helper.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
module MenusHelper
|
2
2
|
|
3
|
+
def find_or_create_menu(uid)
|
4
|
+
Menu.find_or_create_by_uid(uid, :name => "#{uid}".gsub("-", "_").humanize)
|
5
|
+
end
|
6
|
+
|
3
7
|
def nav_items_for(uid)
|
4
|
-
menu =
|
8
|
+
menu = find_or_create_menu(uid)
|
5
9
|
html = ""
|
6
10
|
|
7
11
|
menu.links.each do |link|
|
@@ -15,8 +19,7 @@ module MenusHelper
|
|
15
19
|
html.html_safe
|
16
20
|
end
|
17
21
|
|
18
|
-
def
|
19
|
-
content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block)
|
22
|
+
def render_menu(uid, options = nil, &block)
|
20
23
|
content_tag :ul, nav_items_for(uid, &block), options, false
|
21
24
|
end
|
22
25
|
|
@@ -30,7 +33,11 @@ module MenusHelper
|
|
30
33
|
klass_name, id = url.gsub("content://", "").split("#")
|
31
34
|
klass = klass_name.constantize
|
32
35
|
resource = klass.find(id)
|
33
|
-
|
36
|
+
if resource
|
37
|
+
page_path_for(resource)
|
38
|
+
else
|
39
|
+
"#"
|
40
|
+
end
|
34
41
|
|
35
42
|
else
|
36
43
|
url
|
data/app/helpers/pages_helper.rb
CHANGED
@@ -4,21 +4,34 @@ module PagesHelper
|
|
4
4
|
@current_page
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def part(name, opts = {}, &block)
|
8
8
|
if @current_page
|
9
|
-
|
10
|
-
|
9
|
+
schema = opts.delete(:schema) || PagePart
|
10
|
+
|
11
|
+
klass = schema.is_a?(Class) ? schema : "#{schema.to_s.camelize}PagePart".constantize
|
12
|
+
p = klass.find_or_create_by_name_and_page_id("#{name}", @current_page)
|
13
|
+
|
14
|
+
if block_given?
|
15
|
+
block.call(p)
|
16
|
+
else
|
17
|
+
p
|
18
|
+
end
|
19
|
+
|
11
20
|
end
|
12
21
|
end
|
13
22
|
|
14
23
|
def page_path_for(resource_or_page)
|
15
24
|
page = resource_or_page.is_a?(Page) ? resource_or_page : Page.find_by_resource_type(resource_or_page.class.name.underscore)
|
16
25
|
path = page.try(:path)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
26
|
+
if path.blank?
|
27
|
+
"#"
|
28
|
+
else
|
29
|
+
path.gsub(/:[A-z_]+/) do |seg|
|
30
|
+
meth = seg.gsub(/^:/, "")
|
31
|
+
resource_or_page.send(meth)
|
32
|
+
end
|
21
33
|
end
|
34
|
+
|
22
35
|
end
|
23
36
|
|
24
37
|
def page_url_for(resource_or_page)
|
@@ -1,7 +1,20 @@
|
|
1
1
|
module SettingsHelper
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
# eg.
|
4
|
+
# setting("blog/per_page", 20, :kind => :integer)
|
5
|
+
def get_setting(namespaced_key, *args)
|
6
|
+
namespace_separator = "/"
|
7
|
+
|
8
|
+
opts = args.extract_options!
|
9
|
+
value = args.first
|
10
|
+
namespaced_key = namespaced_key.to_s
|
11
|
+
group, key = namespaced_key.include?(namespace_separator) ? namespaced_key.split(namespace_separator) : [nil, namespaced_key]
|
12
|
+
|
13
|
+
Setting.global("#{key}", :autocreate => (opts[:autocreate].nil? ? true : opts[:autocreate]), :kind => opts[:kind], :default => value, :group => group)
|
5
14
|
end
|
15
|
+
|
16
|
+
alias :setting :get_setting
|
17
|
+
|
18
|
+
end
|
19
|
+
|
6
20
|
|
7
|
-
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Attachment < ActiveRecord::Base
|
2
|
+
field :name, :string
|
3
|
+
alias_attribute :title, :name
|
4
|
+
|
5
|
+
field :description, :text
|
6
|
+
has_attached :file
|
7
|
+
|
8
|
+
# validates_attachment :file, :presence => true,
|
9
|
+
# :size => { :in => 0..1000.megabytes }
|
10
|
+
|
11
|
+
belongs_to :attachable, :polymorphic => true
|
12
|
+
attr_accessible :name, :description, :file, :attachable, :attachable_id, :attachable_type, :title
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
data/app/models/page.rb
CHANGED
data/app/models/pageable.rb
CHANGED
@@ -10,12 +10,27 @@ module Pageable
|
|
10
10
|
|
11
11
|
this_controller_name = "#{self.name.underscore}".gsub("_controller", "")
|
12
12
|
uid = "#{this_controller_name}##{name}"
|
13
|
+
parent_uid = if parent_opt = options.delete(:parent)
|
14
|
+
parent_opt = parent_opt.to_s
|
15
|
+
if parent_opt.include?("#")
|
16
|
+
parent_opt
|
17
|
+
else
|
18
|
+
"#{this_controller_name}##{parent_opt}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
13
22
|
i18n_scope = "pages.#{self.name.underscore.split('/').last}##{name}"
|
14
|
-
parent =
|
15
23
|
title = options.delete(:title) || I18n.t("#{i18n_scope}.title", :default => "#{name}".humanize)
|
16
24
|
|
17
25
|
if Page.table_exists?
|
26
|
+
|
18
27
|
page = Page.find_or_create_by_uid(uid, :title => title, :name => name)
|
28
|
+
if parent_uid
|
29
|
+
parent = Page.find_by_uid(parent_uid.to_s)
|
30
|
+
#raise [parent_uid.to_s, parent].inspect
|
31
|
+
page.move_to_child_of(parent) unless page.parent == parent
|
32
|
+
end
|
33
|
+
|
19
34
|
end
|
20
35
|
|
21
36
|
map(name, path, options = {}, &block)
|
data/app/models/photo.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
class Photo < ActiveRecord::Base
|
2
|
+
|
3
|
+
validates_attachment :image, :presence => true,
|
4
|
+
:size => { :in => 0..2.megabytes }
|
5
|
+
|
6
|
+
has_attached :image, :styles => {
|
7
|
+
:large => ["800x600", :jpeg],
|
8
|
+
:thumb => ["100x100", :jpeg]
|
9
|
+
}
|
10
|
+
|
11
|
+
validates_presence_of :photographable
|
12
|
+
belongs_to :photographable, :polymorphic => :true
|
13
|
+
delegate :url, :file_name, :to => :image
|
14
|
+
|
15
|
+
field :caption, :text
|
16
|
+
|
17
|
+
def owner
|
18
|
+
photographable.owner if photographable && photographable.respond_to?(:owner)
|
19
|
+
end
|
20
|
+
|
21
|
+
timestamps
|
22
|
+
|
23
|
+
end
|
data/app/models/setting.rb
CHANGED
@@ -8,7 +8,8 @@ class Setting < ActiveRecord::Base
|
|
8
8
|
index :key
|
9
9
|
|
10
10
|
field :kind
|
11
|
-
|
11
|
+
field :group
|
12
|
+
|
12
13
|
field :integer_value, :integer
|
13
14
|
field :float_value, :float
|
14
15
|
field :text_value, :text
|
@@ -18,7 +19,6 @@ class Setting < ActiveRecord::Base
|
|
18
19
|
has_attached :file_value
|
19
20
|
|
20
21
|
|
21
|
-
|
22
22
|
def self.kinds
|
23
23
|
[ :string,
|
24
24
|
:integer,
|
@@ -44,10 +44,15 @@ class Setting < ActiveRecord::Base
|
|
44
44
|
|
45
45
|
# eg. Setting.global("site-name")
|
46
46
|
|
47
|
-
def self.global(key)
|
48
|
-
|
47
|
+
def self.global(key, opts = {})
|
48
|
+
autocreate = opts.delete(:autocreate)
|
49
|
+
kind = opts.delete(:kind) || :string
|
50
|
+
default = opts.delete(:default)
|
51
|
+
group = opts.delete(:group) || "global"
|
52
|
+
|
53
|
+
s = autocreate ? self.find_or_create_by_key_and_settable_id(key.to_s, nil, :kind => kind, :"#{kind}_value" => default, :group => group) : self.find_by_key_and_settable_id(key.to_s, nil)
|
49
54
|
if s
|
50
|
-
s.value
|
55
|
+
s.value || default
|
51
56
|
end
|
52
57
|
end
|
53
58
|
|
data/app/models/text.rb
ADDED
@@ -1,7 +1,7 @@
|
|
1
1
|
<ul class="nav">
|
2
2
|
<% Page.roots.each do |root| %>
|
3
3
|
<% Page.each_with_level(root.self_and_descendants) do |page, level| %>
|
4
|
-
<%= nav_item page.name, edit_admin_page_path(page), :icon => (page.
|
4
|
+
<%= nav_item page.name, edit_admin_page_path(page), :icon => (page.root? ? "home" : "file"), :style => "line-height: 36px; padding-left:#{20 * level}px" %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
7
7
|
</ul>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<%=
|
2
|
-
<%=
|
3
|
-
<%= admin_form_for [:"admin", current_resource], :html => {:multipart => true, :"data-type" => :script}, :remote => true do |f| -%>
|
4
|
-
|
5
|
-
<%= f.errors %>
|
1
|
+
<%= admin_form_for [:"admin", current_resource], :html => {:multipart => true} do |f| -%>
|
2
|
+
<%= f.errors %>
|
6
3
|
|
4
|
+
<%= tabs do |t| %>
|
5
|
+
<%= t.pane t('fullstack.admin.info', :default => "Info") do %>
|
6
|
+
|
7
7
|
<%= f.inputs do %>
|
8
8
|
<%= f.input :name %>
|
9
9
|
<% if !@page.resourceful? %>
|
@@ -11,29 +11,37 @@
|
|
11
11
|
<%= f.input :description, :as => :text %>
|
12
12
|
<% end %>
|
13
13
|
<% end -%>
|
14
|
-
|
15
|
-
<%= nav :class => "pills" do %>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
|
15
|
+
<%= nav :class => "pills" do %>
|
16
|
+
<%= nav_item t('fullstack.cms.advanced_settings', :default => "Advanced settings"),
|
17
|
+
"#advanced_settings",
|
18
|
+
:data => {:toggle => "collapse", :target => "#advanced_settings"},
|
19
|
+
:icon => "cog"
|
20
|
+
%>
|
21
21
|
<% end %>
|
22
|
+
|
22
23
|
<div class="collapse" id="advanced_settings">
|
23
24
|
<%= f.inputs do %>
|
24
25
|
<%= f.input :path, :input_html => {:readonly => true} %>
|
25
26
|
<%= f.input :uid, :input_html => {:readonly => true} %>
|
26
27
|
<% end %>
|
27
28
|
</div>
|
28
|
-
|
29
|
-
|
30
|
-
<%= form_actions do %>
|
31
|
-
<%= button (current_resource.persisted? ? t('fullstack.admin.update', :default => "Update") : t('fullstack.admin.create', :default => "Create")), :type => :primary, :size => :large %>
|
32
|
-
<% end %>
|
29
|
+
|
33
30
|
|
34
|
-
|
35
|
-
|
31
|
+
<% end %>
|
32
|
+
|
33
|
+
<% current_resource.page_parts.each do |p| %>
|
34
|
+
<%= t.pane t(p.name, :scope => 'fullstack.cms.parts', :default => p.name.try(:humanize)) do %>
|
35
|
+
<%= f.admin_fields_for :parts, p do |f| %>
|
36
|
+
<%= f.resource_inputs :except => [:page_id, :name] %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
36
40
|
|
37
41
|
<% end %>
|
38
|
-
|
39
|
-
|
42
|
+
|
43
|
+
<%= f.actions do %>
|
44
|
+
<%= f.resource_submit %>
|
45
|
+
<% end %>
|
46
|
+
|
47
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% if Setting.any? %>
|
2
|
+
|
3
|
+
<%
|
4
|
+
|
5
|
+
@groups = {}
|
6
|
+
|
7
|
+
@settings.each {|s|
|
8
|
+
@groups[s.group] ||= []
|
9
|
+
@groups[s.group] << s
|
10
|
+
}
|
11
|
+
|
12
|
+
nil
|
13
|
+
%>
|
14
|
+
|
15
|
+
<%= tabs do |t| %>
|
16
|
+
|
17
|
+
<% @groups.each do |g,settings| %>
|
18
|
+
<%= t.pane t(g, :scope => "fullstack.admin.groups", :default => g.to_s.humanize) do %>
|
19
|
+
<% settings.each do |stg| %>
|
20
|
+
<p><%= link_to t(stg.key, :scope => "helpers.label", :default => stg.key.to_s.humanize), [:edit, :admin, stg] %></p>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= f.inputs do %>
|
5
5
|
<%= f.input :email %>
|
6
6
|
<% end %>
|
7
|
-
|
7
|
+
|
8
8
|
<% if current_resource.persisted? %>
|
9
9
|
<%= link_to t('fullstack.admin.edit', :default => "Edit") + " " + t('helpers.label.password', :default => "password"),
|
10
10
|
"javascript:void(0);",
|
@@ -21,6 +21,14 @@
|
|
21
21
|
<% end %>
|
22
22
|
</div>
|
23
23
|
|
24
|
+
<div style="margin-bottom: 18px;">
|
25
|
+
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<% if current_resource.persisted? %>
|
29
|
+
<%= f.resource_inputs :except => %W(email password encrypted_password confirmation_token confirmed_at confirmation_sent_at unconfirmed_email remember_created_at sign_in_count current_sign_in_at last_sign_in_at current_sign_in_ip last_sign_in_ip reset_password_token reset_password_sent_at) %>
|
30
|
+
<% end %>
|
31
|
+
|
24
32
|
|
25
33
|
<%= f.actions do %>
|
26
34
|
<%= f.resource_submit %>
|
data/config/locales/it.yml
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
it:
|
2
2
|
fullstack:
|
3
3
|
cms:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
advanced_settings: "Impostazioni avanzate"
|
5
|
+
# links:
|
6
|
+
# links: "Link"
|
7
|
+
# choose_a_page_by_title: "Scegli una pagina"
|
8
|
+
# insert_by_hand: "Inserimento manuale"
|
9
|
+
# add_link: "Aggiungi link"
|
10
|
+
# link_a_page: "Collega una pagina"
|
11
|
+
#
|
data/fullstack-cms.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "fullstack-cms"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["mcasimir"]
|
@@ -33,21 +33,27 @@ Gem::Specification.new do |s|
|
|
33
33
|
"app/helpers/pages_helper.rb",
|
34
34
|
"app/helpers/settings_helper.rb",
|
35
35
|
"app/models/.gitkeep",
|
36
|
+
"app/models/attachment.rb",
|
36
37
|
"app/models/link.rb",
|
37
38
|
"app/models/menu.rb",
|
38
39
|
"app/models/nestable.rb",
|
39
40
|
"app/models/page.rb",
|
40
41
|
"app/models/page_part.rb",
|
41
42
|
"app/models/pageable.rb",
|
43
|
+
"app/models/photo.rb",
|
42
44
|
"app/models/redirect.rb",
|
43
45
|
"app/models/setting.rb",
|
44
|
-
"app/
|
45
|
-
"app/
|
46
|
+
"app/models/text.rb",
|
47
|
+
"app/models/text_page_part.rb",
|
48
|
+
"app/models/text_with_title_page_part.rb",
|
46
49
|
"app/views/admin/pages/_collection.html.erb",
|
47
50
|
"app/views/admin/pages/_form.html.erb",
|
51
|
+
"app/views/admin/settings/_collection.html.erb",
|
48
52
|
"app/views/admin/settings/_form.html.erb",
|
49
53
|
"app/views/admin/users/_form.html.erb",
|
50
54
|
"config/locales/en.yml",
|
55
|
+
"config/locales/formats.en.yml",
|
56
|
+
"config/locales/formats.it.yml",
|
51
57
|
"config/locales/it.yml",
|
52
58
|
"config/routes.rb",
|
53
59
|
"fullstack-cms.gemspec",
|
@@ -77,6 +83,7 @@ Gem::Specification.new do |s|
|
|
77
83
|
"lib/generators/fullstack/cms/templates/rails/app/views/site/site/home.html.erb",
|
78
84
|
"lib/generators/fullstack/cms/templates/rails/config/initializers/devise_controller.rb",
|
79
85
|
"lib/generators/fullstack/cms/templates/rails/config/initializers/devise_mailer.rb",
|
86
|
+
"lib/generators/fullstack/cms/templates/rails/config/initializers/fullstack.rb",
|
80
87
|
"lib/generators/fullstack/cms/templates/rails/config/schedule.rb",
|
81
88
|
"lib/generators/fullstack/cms/templates/rails/config/sitemap.rb.tt",
|
82
89
|
"lib/generators/fullstack/cms/templates/rails/config/styles.yml",
|
@@ -42,33 +42,28 @@ eos
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def english_localizations
|
46
|
-
generate "fullstack:cms:locale en"
|
47
|
-
end
|
48
|
-
|
49
45
|
def routes_rb
|
50
46
|
|
51
|
-
route "# mount_controller 'site/site'"
|
52
|
-
|
53
47
|
route '''
|
48
|
+
# namespace :site, :path => "/" do
|
49
|
+
# mount_controller "site"
|
50
|
+
# end
|
51
|
+
|
52
|
+
'''
|
54
53
|
|
54
|
+
route '''
|
55
55
|
constraints(:host => /#{Regexp.escape(Settings.app.domain)}/) do
|
56
56
|
root :to => redirect("http://www.#{Settings.app.domain}")
|
57
57
|
match \'/*path\', :to => redirect {|params| "http://www.#{Settings.app.domain}/#{params[:path]}"}
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
'''
|
61
61
|
end
|
62
62
|
|
63
63
|
def install_migrations
|
64
|
-
generate "migration:from link menu page_part page redirect setting"
|
64
|
+
generate "migration:from link menu page_part page redirect setting attachment photo text_page_part text_with_title_page_part"
|
65
65
|
end
|
66
66
|
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
67
|
protected
|
73
68
|
|
74
69
|
def migration_timestamp
|
@@ -1,12 +1 @@
|
|
1
|
-
<h1 class="page-header">Homepage</h1>
|
2
|
-
|
3
|
-
<div class="row">
|
4
|
-
<div class="span4">
|
5
|
-
<div class="well">
|
6
|
-
<%= page_part("Column") %>
|
7
|
-
</div>
|
8
|
-
</div>
|
9
|
-
<div class="span8">
|
10
|
-
<%= page_part("Body") %>
|
11
|
-
</div>
|
12
|
-
</div>
|
1
|
+
<h1 class="page-header">Homepage</h1>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Fullstack::Admin.resources do |admin|
|
2
|
+
|
3
|
+
admin.group :website do |g|
|
4
|
+
g.resource :pages
|
5
|
+
g.resource :menus
|
6
|
+
g.resource :settings
|
7
|
+
end
|
8
|
+
|
9
|
+
admin.group :contents do |g|
|
10
|
+
end
|
11
|
+
|
12
|
+
admin.group :users do |g|
|
13
|
+
g.resource :users
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
Fullstack::Cms.configure do |config|
|
19
|
+
config.linkables = %w(pages)
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fullstack-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -211,21 +211,27 @@ files:
|
|
211
211
|
- app/helpers/pages_helper.rb
|
212
212
|
- app/helpers/settings_helper.rb
|
213
213
|
- app/models/.gitkeep
|
214
|
+
- app/models/attachment.rb
|
214
215
|
- app/models/link.rb
|
215
216
|
- app/models/menu.rb
|
216
217
|
- app/models/nestable.rb
|
217
218
|
- app/models/page.rb
|
218
219
|
- app/models/page_part.rb
|
219
220
|
- app/models/pageable.rb
|
221
|
+
- app/models/photo.rb
|
220
222
|
- app/models/redirect.rb
|
221
223
|
- app/models/setting.rb
|
222
|
-
- app/
|
223
|
-
- app/
|
224
|
+
- app/models/text.rb
|
225
|
+
- app/models/text_page_part.rb
|
226
|
+
- app/models/text_with_title_page_part.rb
|
224
227
|
- app/views/admin/pages/_collection.html.erb
|
225
228
|
- app/views/admin/pages/_form.html.erb
|
229
|
+
- app/views/admin/settings/_collection.html.erb
|
226
230
|
- app/views/admin/settings/_form.html.erb
|
227
231
|
- app/views/admin/users/_form.html.erb
|
228
232
|
- config/locales/en.yml
|
233
|
+
- config/locales/formats.en.yml
|
234
|
+
- config/locales/formats.it.yml
|
229
235
|
- config/locales/it.yml
|
230
236
|
- config/routes.rb
|
231
237
|
- fullstack-cms.gemspec
|
@@ -255,6 +261,7 @@ files:
|
|
255
261
|
- lib/generators/fullstack/cms/templates/rails/app/views/site/site/home.html.erb
|
256
262
|
- lib/generators/fullstack/cms/templates/rails/config/initializers/devise_controller.rb
|
257
263
|
- lib/generators/fullstack/cms/templates/rails/config/initializers/devise_mailer.rb
|
264
|
+
- lib/generators/fullstack/cms/templates/rails/config/initializers/fullstack.rb
|
258
265
|
- lib/generators/fullstack/cms/templates/rails/config/schedule.rb
|
259
266
|
- lib/generators/fullstack/cms/templates/rails/config/sitemap.rb.tt
|
260
267
|
- lib/generators/fullstack/cms/templates/rails/config/styles.yml
|
@@ -286,7 +293,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
286
293
|
version: '0'
|
287
294
|
segments:
|
288
295
|
- 0
|
289
|
-
hash:
|
296
|
+
hash: -744864392680158351
|
290
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
298
|
none: false
|
292
299
|
requirements:
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<% page.page_parts.each do |part| %>
|
2
|
-
<%= tabs.pane(part.name) do %>
|
3
|
-
|
4
|
-
<%= admin_form_for [:"admin", page, part], :html => {:multipart => true}, :remote => true, :'data-type' => "js" do |f| -%>
|
5
|
-
|
6
|
-
<%= f.errors %>
|
7
|
-
|
8
|
-
<%= f.inputs do %>
|
9
|
-
<%= f.input :content, :label => false, :input_html => { :class => "markup-ckeditor", :id => "page_part_#{part.id}_content" } %>
|
10
|
-
<% end -%>
|
11
|
-
|
12
|
-
<%= f.actions do %>
|
13
|
-
<%= button (current_resource.persisted? ? _("Update") : _("Create")),
|
14
|
-
:type => :primary, :size => :large %>
|
15
|
-
<%= link_to _("Delete"), [:admin, page, part], :data => {:method => "delete", :remote => true, :confirm => _("Are you sure?") }, :class => "btn btn-large btn-danger" %>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<% end -%>
|
19
|
-
|
20
|
-
<% end %>
|
21
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<% if instance_variable_get("@#{controller_name.singularize}").destroyed? %>
|
2
|
-
$(".nav-tabs li.active, .tab-pane.active").fadeOut 'fast', ->
|
3
|
-
$(@).remove()
|
4
|
-
$(".tabs").show()
|
5
|
-
|
6
|
-
$("a[data-toggle='tab']").first().click()
|
7
|
-
|
8
|
-
notify_notice('<%=j t("flash.success.delete") %>')
|
9
|
-
<% else %>
|
10
|
-
notify_error('<%=j t("flash.error.delete") %>')
|
11
|
-
<% end %>
|
12
|
-
|