cms-fortress 1.3.0.rc2 → 1.3.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +27 -2
- data/app/assets/javascripts/cms/fortress/site_selector.js.coffee +15 -0
- data/app/assets/javascripts/cms/fortress/themes/wide.js.coffee.erb +1 -0
- data/app/assets/stylesheets/cms/fortress/admin_overrides.css +5 -0
- data/app/assets/stylesheets/cms/fortress/themes/wide.css.scss +9 -0
- data/app/helpers/cms/fortress/application_helper.rb +8 -0
- data/app/helpers/cms/fortress/sprocket_helper.rb +13 -10
- data/app/helpers/comfy/admin/cms/pages_helper.rb +20 -0
- data/app/views/cms/fortress/themes/wide/_body.html.haml +20 -2
- data/app/views/cms/fortress/themes/wide/_menu.html.haml +1 -1
- data/app/views/comfy/admin/cms/pages/_form.html.haml +1 -1
- data/cms-fortress.gemspec +2 -2
- data/config/locales/de.yml +3 -1
- metadata +3 -3
- data/app/assets/javascripts/cms/fortress/cms_fortress.js +0 -0
data/README.rdoc
CHANGED
@@ -22,7 +22,7 @@ An extension for the awesome Comfortable Mexican Sofa (https://github.com/comfy/
|
|
22
22
|
|
23
23
|
Add gem defintion to your Gemfile:
|
24
24
|
|
25
|
-
gem 'cms-fortress'
|
25
|
+
gem 'cms-fortress', '~> 1.3.0.rc3'
|
26
26
|
|
27
27
|
Then from the Rails project's root run:
|
28
28
|
|
@@ -37,6 +37,16 @@ After that run your app and navigate to http://localhost:3000/cms-admin to start
|
|
37
37
|
username: admin@cmsfortress.com
|
38
38
|
password: 1234qwer
|
39
39
|
|
40
|
+
===== Installing on project with Comfortable Mexican Sofa was already installed:
|
41
|
+
|
42
|
+
rails generate cms:fortress --no-comfy
|
43
|
+
rake db:migrate
|
44
|
+
|
45
|
+
===== Upgrading older version of cms-fortress:
|
46
|
+
|
47
|
+
rails generate cms:fortress:upgrade
|
48
|
+
rake db:migrate
|
49
|
+
|
40
50
|
===Adding custom role details
|
41
51
|
|
42
52
|
You can create a custom role ability via a three-step process.
|
@@ -66,6 +76,21 @@ You can create a custom role ability via a three-step process.
|
|
66
76
|
:path => 'admin_my_role_details_path'
|
67
77
|
}
|
68
78
|
# the other two lists are "content_resources" and "design_resources"
|
79
|
+
|
80
|
+
#adding a super user only menu item
|
81
|
+
config.settings_resources << {
|
82
|
+
:name => 'my_role_detail',
|
83
|
+
:title => 'i18n.label.title', # this is passed to the t() function - can be plain text
|
84
|
+
:path => 'admin_my_role_details_path',
|
85
|
+
:super_user => true
|
86
|
+
}
|
87
|
+
|
88
|
+
# adding a divider menu item (Wide Theme only)
|
89
|
+
config.content_resources << {name: 'divider'}
|
90
|
+
|
91
|
+
#adding a menu header item (Wide Theme only)
|
92
|
+
config.content_resources << {name: 'dropdown-header', title: "i18n.my.header.label"}
|
93
|
+
|
69
94
|
end
|
70
95
|
|
71
96
|
The path is eval'd at runtime, so you can use Rails helper methods such as
|
@@ -127,6 +152,6 @@ Afterwards you can run the tests by calling
|
|
127
152
|
|
128
153
|
== Copyright
|
129
154
|
|
130
|
-
Copyright (c)
|
155
|
+
Copyright (c) 2014 Melvin Sembrano. See LICENSE.txt for
|
131
156
|
further details.
|
132
157
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class SiteSelector
|
2
|
+
constructor: ->
|
3
|
+
@initialize_event_handler()
|
4
|
+
|
5
|
+
initialize_event_handler: ->
|
6
|
+
@site_selector()
|
7
|
+
|
8
|
+
site_selector: ->
|
9
|
+
($ '#js_site_selector').on 'change', (event) =>
|
10
|
+
page_id = ($ event.target).val()
|
11
|
+
locale = location.search
|
12
|
+
location.href = "/cms-admin/sites/#{page_id}/pages#{locale}"
|
13
|
+
|
14
|
+
$ ->
|
15
|
+
site_selector = new SiteSelector
|
@@ -3,6 +3,14 @@ require 'cms/fortress/error'
|
|
3
3
|
|
4
4
|
module Cms::Fortress::ApplicationHelper
|
5
5
|
|
6
|
+
def current_site
|
7
|
+
@site.label
|
8
|
+
end
|
9
|
+
|
10
|
+
def super_user?
|
11
|
+
current_cms_fortress_user && current_cms_fortress_user.type.eql?(:super_user)
|
12
|
+
end
|
13
|
+
|
6
14
|
def dashboard_widget(title, collection)
|
7
15
|
render partial: "cms/fortress/shared/dashboard_widget", locals: {title: title, collection: collection}
|
8
16
|
end
|
@@ -10,22 +10,18 @@ module Cms::Fortress::SprocketHelper
|
|
10
10
|
end
|
11
11
|
|
12
12
|
options = {
|
13
|
-
menubar:
|
14
|
-
toolbar1:
|
15
|
-
toolbar2:
|
16
|
-
plugins: "
|
17
|
-
language:
|
13
|
+
menubar: "tools format view",
|
14
|
+
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table | fullscreen code | image fmedia link",
|
15
|
+
toolbar2: "",
|
16
|
+
plugins: ["code", "fullscreen", "media", "link", "table"],
|
17
|
+
language: "en"
|
18
18
|
}.stringify_keys.merge(config)
|
19
19
|
|
20
20
|
<<-EOF
|
21
21
|
tinymce.init({
|
22
|
+
#{configuration_from_options(options)},
|
22
23
|
selector: 'textarea[data-cms-rich-text]',
|
23
|
-
menubar: '#{ options['menubar'] }',
|
24
|
-
toolbar1: '#{ options['toolbar1'] } | image fmedia link',
|
25
|
-
toolbar2: '#{ options['toolbar2'] }',
|
26
|
-
plugins: #{ options['plugins'] },
|
27
24
|
link_list: CmsFortress.media.othersUrl(),
|
28
|
-
language: '#{ options['language'] }',
|
29
25
|
setup: function(ed) {
|
30
26
|
ed.addButton('image', {
|
31
27
|
title: 'Insert Image',
|
@@ -46,4 +42,11 @@ module Cms::Fortress::SprocketHelper
|
|
46
42
|
EOF
|
47
43
|
end
|
48
44
|
|
45
|
+
private
|
46
|
+
|
47
|
+
def configuration_from_options(options)
|
48
|
+
options.map do |k, v|
|
49
|
+
v.is_a?(Array) ? "#{k}: #{v}" : "#{k}: '#{v}'"
|
50
|
+
end.join(',')
|
51
|
+
end
|
49
52
|
end
|
@@ -19,4 +19,24 @@ module Comfy::Admin::Cms::PagesHelper
|
|
19
19
|
"30 days" => 30.days
|
20
20
|
}.map {|k,v| [k, v.to_i] }
|
21
21
|
end
|
22
|
+
|
23
|
+
def site_selector
|
24
|
+
select_tag(
|
25
|
+
:sites,
|
26
|
+
options_for_select(sites_for_select, params[:site_id]),
|
27
|
+
{class: 'form-control input-sm site_selector', id: 'js_site_selector'}
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def sites_for_select
|
32
|
+
all_sites.map { |site| [site.label, site.id] }
|
33
|
+
end
|
34
|
+
|
35
|
+
def all_sites
|
36
|
+
Comfy::Cms::Site.all
|
37
|
+
end
|
38
|
+
|
39
|
+
def multiple_sites?
|
40
|
+
all_sites.size > 1
|
41
|
+
end
|
22
42
|
end
|
@@ -1,7 +1,25 @@
|
|
1
1
|
- unless @site.nil? || @site.new_record?
|
2
2
|
.container-fluid.current-site-info
|
3
|
-
|
4
|
-
=
|
3
|
+
- if super_user? && multiple_sites?
|
4
|
+
.btn-group(style="margin-top: 8px;")
|
5
|
+
%button.btn.btn-default.btn-sm.dropdown-toggle(type='button' data-toggle="dropdown")
|
6
|
+
%small.site-button-label
|
7
|
+
%em
|
8
|
+
= t('.current_site')
|
9
|
+
%strong.site-button-label
|
10
|
+
= current_site
|
11
|
+
%b.caret
|
12
|
+
%ul.dropdown-menu
|
13
|
+
- all_sites.each do |site|
|
14
|
+
= topnav_item site.label, comfy_admin_cms_site_pages_path(site), @site.id.eql?(site.id)
|
15
|
+
- else
|
16
|
+
.btn.btn-default.btn-sm
|
17
|
+
%small.site-button-label
|
18
|
+
%em
|
19
|
+
= t('.current_site')
|
20
|
+
%strong.site-button-label
|
21
|
+
= current_site
|
22
|
+
|
5
23
|
|
6
24
|
.container-fluid.wide-body
|
7
25
|
- if controller_name.eql?('revisions')
|
@@ -55,9 +55,9 @@
|
|
55
55
|
= topnav_resource_item("settings", resource)
|
56
56
|
|
57
57
|
|
58
|
-
|
59
58
|
= render 'cms/fortress/admin/topnav'
|
60
59
|
|
60
|
+
|
61
61
|
- if current_cms_fortress_user
|
62
62
|
.btn-group.pull-right(style="margin-top: 8px;")
|
63
63
|
%button.btn.btn-default.dropdown-toggle(type="button" data-toggle="dropdown")
|
@@ -11,7 +11,7 @@
|
|
11
11
|
- if Cms::Fortress.configuration.enable_page_workflow && !@page.new_record?
|
12
12
|
.container-fluid
|
13
13
|
.btn-group
|
14
|
-
%span.btn.btn-success= @page.aasm_state
|
14
|
+
%span.btn.btn-success= t('.' + @page.aasm_state)
|
15
15
|
- page_actions(@page).each do |page_action|
|
16
16
|
= form.button t('.'+page_action.to_s), :class => 'btn btn-default', :value => page_action, :name => 'transition'
|
17
17
|
%hr
|
data/cms-fortress.gemspec
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "cms-fortress"
|
5
|
-
s.version = "1.3.0.
|
5
|
+
s.version = "1.3.0.rc3"
|
6
6
|
|
7
7
|
s.authors = ["Melvin Sembrano"]
|
8
|
-
s.date = "2014-06-
|
8
|
+
s.date = "2014-06-19"
|
9
9
|
s.description = "Comfortable Mexican Sofa (CMS) - User and role management extension"
|
10
10
|
s.email = "melvinsembrano@gmail.com"
|
11
11
|
s.extra_rdoc_files = [ "LICENSE.txt", "README.rdoc" ]
|
data/config/locales/de.yml
CHANGED
@@ -15,12 +15,14 @@ de:
|
|
15
15
|
are_you_sure: Sind Sie sicher?
|
16
16
|
cancel: Abbrechen
|
17
17
|
published: Publiziert
|
18
|
-
published_date:
|
18
|
+
published_date: Publiziert am
|
19
|
+
schedule_date: geplante Publizierung
|
19
20
|
cache_timeout: Cache Dauer
|
20
21
|
toggle_navigation: Navigation einklappen
|
21
22
|
image_selector: Bildauswahl
|
22
23
|
insert_item: Ein Bild anklicken um es in den ausgewählten Editor einzufügen.
|
23
24
|
settings: Einstellungen
|
25
|
+
site_selector: "Seite auswählen: "
|
24
26
|
|
25
27
|
admin:
|
26
28
|
dashboard:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cms-fortress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0.
|
4
|
+
version: 1.3.0.rc3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -283,8 +283,8 @@ files:
|
|
283
283
|
- README.rdoc
|
284
284
|
- Rakefile
|
285
285
|
- VERSION
|
286
|
-
- app/assets/javascripts/cms/fortress/cms_fortress.js
|
287
286
|
- app/assets/javascripts/cms/fortress/media.js.coffee
|
287
|
+
- app/assets/javascripts/cms/fortress/site_selector.js.coffee
|
288
288
|
- app/assets/javascripts/cms/fortress/themes/wide.js.coffee.erb
|
289
289
|
- app/assets/javascripts/html5shiv.js
|
290
290
|
- app/assets/stylesheets/cms/fortress/admin_overrides.css
|
File without changes
|