trusty-cms 2.0.2.pre.beta → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +2 -0
- data/CONTRIBUTORS.md +3 -1
- data/Gemfile +6 -1
- data/Gemfile.lock +100 -80
- data/INSTALL.md +7 -6
- data/README.md +3 -1
- data/Rakefile +24 -4
- data/app/assets/javascripts/admin/jquery-ui.js +3787 -2339
- data/app/assets/javascripts/admin/page-edit.js +3 -3
- data/app/assets/javascripts/admin/tabcontrol.js.erb +16 -16
- data/app/assets/javascripts/admin/treetable.js +4 -2
- data/app/assets/stylesheets/admin/_base.scss +4 -4
- data/app/assets/stylesheets/admin/modules/_links.scss +1 -1
- data/app/assets/stylesheets/admin/partials/_content.scss +9 -2
- data/app/assets/stylesheets/admin/partials/_forms.scss +97 -29
- data/app/assets/stylesheets/admin/partials/_header.scss +2 -3
- data/app/assets/stylesheets/admin/partials/_index.scss +9 -6
- data/app/assets/stylesheets/admin/partials/_layout.scss +1 -2
- data/app/assets/stylesheets/admin/partials/_popup.scss +0 -11
- data/app/assets/stylesheets/admin/partials/_tabcontrol.scss +4 -4
- data/app/assets/stylesheets/admin/partials/_typography.scss +4 -0
- data/app/controllers/admin/pages_controller.rb +9 -1
- data/app/controllers/admin/references_controller.rb +8 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/controllers/admin/welcome_controller.rb +3 -3
- data/app/controllers/site_controller.rb +1 -1
- data/app/helpers/admin/node_helper.rb +4 -4
- data/app/models/trusty_cms/config.rb +2 -1
- data/app/views/admin/configuration/edit.html.haml +2 -2
- data/app/views/admin/configuration/show.html.haml +1 -1
- data/app/views/admin/layouts/_form.html.haml +1 -1
- data/app/views/admin/layouts/remove.html.haml +1 -1
- data/app/views/admin/pages/_fields.html.haml +1 -1
- data/app/views/admin/pages/_node.html.haml +2 -2
- data/app/views/admin/pages/edit.html.haml +1 -1
- data/app/views/admin/pages/remove.html.haml +2 -2
- data/app/views/admin/preferences/edit.html.haml +36 -36
- data/app/views/admin/users/_form.html.haml +1 -1
- data/app/views/admin/users/_password_fields.html.haml +1 -1
- data/app/views/admin/users/remove.html.haml +1 -1
- data/app/views/admin/welcome/login.html.haml +1 -1
- data/app/views/layouts/application.html.haml +18 -16
- data/config/application.rb +2 -1
- data/config/boot.rb +0 -1
- data/config/database.mysql.yml +3 -3
- data/config/environments/development.rb +1 -0
- data/config/environments/test.rb +2 -4
- data/config/initializers/trusty_cms_config.rb +1 -0
- data/config/routes.rb +1 -0
- data/db/migrate/001_create_radiant_tables.rb +2 -1
- data/db/migrate/20100805155020_convert_page_metas.rb +0 -13
- data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +0 -4
- data/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb +0 -1
- data/lib/generators/instance/templates/databases/mysql.yml +3 -3
- data/lib/generators/instance/templates/instance_gemfile +2 -2
- data/lib/generators/trusty_cms/templates/database.yml.erb +4 -4
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -1
- data/lib/login_system.rb +1 -1
- data/lib/tasks/database.rake +1 -3
- data/lib/tasks/framework.rake +1 -1
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/admin_ui.rb +2 -0
- data/lib/trusty_cms/extension_migrator.rb +1 -2
- data/lib/trusty_cms/initializer.rb +1 -1
- data/lib/trusty_cms/setup.rb +1 -1
- data/spec/ci/database.mysql.yml +1 -1
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +5 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +152 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/database.yml +28 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +49 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/trusty_cms_config.rb +20 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +0 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +122 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/features/pages_spec.rb +2 -2
- data/spec/rails_helper.rb +3 -4
- data/spec/spec_helper.rb +13 -77
- data/spec/support/custom_actions.rb +1 -0
- data/trusty_cms.gemspec +4 -2
- metadata +171 -182
- data/db/migrate/003_rename_behavior_column.rb +0 -9
- data/db/migrate/010_merge_behaviors_and_pages.rb +0 -57
- data/db/migrate/011_rename_type_column_on_page_to_class_name.rb +0 -9
- data/db/migrate/019_add_salt_to_users.rb +0 -11
- data/spec/helpers/regions_helper_spec.rb +0 -16
@@ -54,22 +54,11 @@ div.popup {
|
|
54
54
|
}
|
55
55
|
.buttons {
|
56
56
|
border-top: 1px solid #e5e5e5;
|
57
|
-
background: whitesmoke;
|
58
|
-
font-size: 85%;
|
59
|
-
margin: 1.5em -20px -10px;
|
60
|
-
padding: 10px;
|
61
57
|
text-align: right;
|
62
58
|
input.button {
|
63
59
|
font-size: 120%;
|
64
60
|
}
|
65
61
|
button {
|
66
|
-
font-size: 110%;
|
67
|
-
padding: 4px 15px 5px;
|
68
|
-
background: whitesmoke;
|
69
|
-
border: 1px solid #959595;
|
70
|
-
@include border-radius(100px);
|
71
|
-
@include single-box-shadow(white, 0, 2px, 0, inset);
|
72
|
-
@include linear-gradient(color-stops(#dddddd 0%, #eeeeee 15%, white 100%));
|
73
62
|
&.default {
|
74
63
|
border: 1px solid #154ca6;
|
75
64
|
@include single-box-shadow(#c7e0f6, 0, 2px, 1px, inset);
|
@@ -6,8 +6,8 @@
|
|
6
6
|
width: 100%;
|
7
7
|
margin-right: -4px;
|
8
8
|
.tab {
|
9
|
-
background-color: #
|
10
|
-
color:
|
9
|
+
background-color: #e4e4e4;
|
10
|
+
color: black;
|
11
11
|
display: inline-block;
|
12
12
|
font-size: 90%;
|
13
13
|
text-align: left;
|
@@ -18,11 +18,11 @@
|
|
18
18
|
@include border-top-radius(6px);
|
19
19
|
&.here {
|
20
20
|
background-color: white;
|
21
|
-
color:
|
21
|
+
color: #737272;
|
22
22
|
font-weight: bold;
|
23
23
|
}
|
24
24
|
span:hover {
|
25
|
-
color:
|
25
|
+
color: #737272;
|
26
26
|
}
|
27
27
|
.close {
|
28
28
|
margin-top: -4px;
|
@@ -47,7 +47,7 @@ class Admin::PagesController < Admin::ResourceController
|
|
47
47
|
|
48
48
|
def model_class
|
49
49
|
if Page.descendants.any? { |d| d.to_s == params[:page_class] }
|
50
|
-
params[:page_class]
|
50
|
+
verify_page_class(params[:page_class])
|
51
51
|
elsif params[:page_id]
|
52
52
|
Page.find(params[:page_id]).children
|
53
53
|
else
|
@@ -89,4 +89,12 @@ class Admin::PagesController < Admin::ResourceController
|
|
89
89
|
@meta << {:field => "slug", :type => "text_field", :args => [{:class => 'textbox', :maxlength => 100}]}
|
90
90
|
@meta << {:field => "breadcrumb", :type => "text_field", :args => [{:class => 'textbox', :maxlength => 160}]}
|
91
91
|
end
|
92
|
+
|
93
|
+
def verify_page_class(page_class)
|
94
|
+
if page_class.constantize.ancestors.include?(Page)
|
95
|
+
page_class.constantize
|
96
|
+
else
|
97
|
+
raise "I'm not allowed to constantize #{page_class}!"
|
98
|
+
end
|
99
|
+
end
|
92
100
|
end
|
@@ -1,7 +1,14 @@
|
|
1
1
|
class Admin::ReferencesController < ApplicationController
|
2
2
|
def show
|
3
3
|
respond_to do |format|
|
4
|
-
|
4
|
+
render_allowed_type(params[:type])
|
5
|
+
format.any { render :action => @type, :content_type => "text/html", :layout => false }
|
5
6
|
end
|
6
7
|
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def render_allowed_type(type)
|
12
|
+
@type = type
|
13
|
+
end
|
7
14
|
end
|
@@ -4,7 +4,7 @@ class Admin::WelcomeController < ApplicationController
|
|
4
4
|
skip_before_filter :verify_authenticity_token
|
5
5
|
|
6
6
|
def index
|
7
|
-
redirect_to
|
7
|
+
redirect_to admin_pages_path
|
8
8
|
end
|
9
9
|
|
10
10
|
def login
|
@@ -18,7 +18,7 @@ class Admin::WelcomeController < ApplicationController
|
|
18
18
|
current_user.remember_me
|
19
19
|
set_session_cookie
|
20
20
|
end
|
21
|
-
redirect_to(session[:return_to] ||
|
21
|
+
redirect_to(session[:return_to] || welcome_path)
|
22
22
|
session[:return_to] = nil
|
23
23
|
end
|
24
24
|
end
|
@@ -28,7 +28,7 @@ class Admin::WelcomeController < ApplicationController
|
|
28
28
|
self.current_user.forget_me if self.current_user
|
29
29
|
self.current_user = nil
|
30
30
|
announce_logged_out
|
31
|
-
redirect_to
|
31
|
+
redirect_to login_path
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
@@ -1,18 +1,18 @@
|
|
1
1
|
module Admin::NodeHelper
|
2
2
|
|
3
|
-
def render_nodes(page, starting_index, parent_index = nil)
|
3
|
+
def render_nodes(page, starting_index, parent_index = nil, simple = false)
|
4
4
|
@rendered_html = ""
|
5
|
-
render_node page, starting_index, parent_index
|
5
|
+
render_node page, starting_index, parent_index, simple
|
6
6
|
@rendered_html
|
7
7
|
end
|
8
8
|
|
9
|
-
def render_node(page, index, parent_index = nil)
|
9
|
+
def render_node(page, index, parent_index = nil, simple = false)
|
10
10
|
|
11
11
|
@current_node = prepare_page(page)
|
12
12
|
|
13
13
|
@rendered_html += (render :partial => 'admin/pages/node',
|
14
14
|
:locals => {level: index, index: index, parent_index: parent_index,
|
15
|
-
page: page, simple:
|
15
|
+
page: page, simple: simple, branch: (page.children.count > 0) })
|
16
16
|
index
|
17
17
|
end
|
18
18
|
|
@@ -71,6 +71,7 @@ module TrustyCms
|
|
71
71
|
self.table_name = "config"
|
72
72
|
after_save :update_cache
|
73
73
|
attr_reader :definition
|
74
|
+
attr_accessible :key
|
74
75
|
|
75
76
|
class ConfigError < RuntimeError; end
|
76
77
|
|
@@ -88,7 +89,7 @@ module TrustyCms
|
|
88
89
|
|
89
90
|
def []=(key, value)
|
90
91
|
if table_exists?
|
91
|
-
setting =
|
92
|
+
setting = where(key: key).first_or_initialize
|
92
93
|
setting.value = value
|
93
94
|
end
|
94
95
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
%h1 Configuration
|
7
7
|
|
8
8
|
- main.edit_form do
|
9
|
-
= form_for :trusty_config, :url =>
|
9
|
+
= form_for :trusty_config, :url => admin_configuration_path, :html => {"data-onsubmit_status"=>"Saving changes…", :method => :put} do |f|
|
10
10
|
= render_region :form_top
|
11
11
|
- render_region :form do |form|
|
12
12
|
- form.edit_site do
|
@@ -35,4 +35,4 @@
|
|
35
35
|
.buttons
|
36
36
|
%input.button{:type=>"submit", :value=>"Save Changes"}/
|
37
37
|
or
|
38
|
-
= link_to "Cancel",
|
38
|
+
= link_to "Cancel", admin_configuration_path, class: 'alt'
|
@@ -39,7 +39,7 @@
|
|
39
39
|
%h3
|
40
40
|
- if admin?
|
41
41
|
.actions
|
42
|
-
= button_to t("edit_configuration"),
|
42
|
+
= button_to t("edit_configuration"), edit_admin_configuration_path, :method => :get
|
43
43
|
Configuration
|
44
44
|
- TrustyCms.config.site_settings.each do |site_setting|
|
45
45
|
%p.ruled
|
@@ -57,7 +57,7 @@
|
|
57
57
|
= save_model_and_continue_editing_button(@page)
|
58
58
|
= submit_tag(t('preview', :default => 'Preview'), :class => 'button', :id => 'show-preview')
|
59
59
|
= t('or')
|
60
|
-
= link_to t('cancel'), admin_pages_url
|
60
|
+
= link_to t('cancel'), admin_pages_url, class: 'alt'
|
61
61
|
#preview_panel.fullcover.grey_out{:style => 'display: none;'}
|
62
62
|
%iframe{:id => 'page-preview', :class => 'fullcover', :name => 'page-preview', :src => ActionController::Base.relative_url_root.to_s + '/loading-iframe.html', :frameborder => 0, :scrolling => "auto"}
|
63
63
|
.preview_tools
|
@@ -7,7 +7,7 @@
|
|
7
7
|
= icon
|
8
8
|
= node_title
|
9
9
|
- else
|
10
|
-
= (link_to("#{icon} #{node_title}".html_safe,
|
10
|
+
= (link_to("#{icon} #{node_title}".html_safe, edit_admin_page_path(page), :title => page.path)).html_safe
|
11
11
|
= page_type
|
12
12
|
= spinner
|
13
13
|
- node.status_column do
|
@@ -18,4 +18,4 @@
|
|
18
18
|
- unless simple
|
19
19
|
%td.actions
|
20
20
|
= page.add_child_option
|
21
|
-
= page.remove_option
|
21
|
+
= page.remove_option
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
- render_region :main do |main|
|
4
4
|
- main.edit_header do
|
5
|
-
%h1=
|
5
|
+
%h1= ''
|
6
6
|
- main.edit_form do
|
7
7
|
= form_for @page, :as => :page, :url => admin_page_path(@page), :html => {:method => :put, :multipart => true, :id => 'edit_page', 'data-onsubmit_status'=>t('saving_changes')} do |fields|
|
8
8
|
= render :partial => "fields", :object => fields
|
@@ -9,11 +9,11 @@
|
|
9
9
|
.inset
|
10
10
|
%table.index#site_map
|
11
11
|
%tbody
|
12
|
-
- render_nodes @page, @page.id
|
12
|
+
- render_nodes @page, @page.id, nil, true
|
13
13
|
= @rendered_html.html_safe
|
14
14
|
|
15
15
|
= form_for [:admin, @page.becomes(Page)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing pages…"} do
|
16
16
|
.buttons
|
17
17
|
%input.button{:type=>"submit", :value => t('delete_pages', :pages => pages) }/
|
18
18
|
= t('or')
|
19
|
-
= link_to t('cancel'),
|
19
|
+
= link_to t('cancel'), admin_pages_path, class: 'alt'
|
@@ -6,39 +6,39 @@
|
|
6
6
|
%h1= t('personal_preferences')
|
7
7
|
|
8
8
|
- main.edit_form do
|
9
|
-
= form_for @user, :url =>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
9
|
+
= form_for @user, :url => admin_preferences_path, :html => { :method => :put, 'data-onsubmit_status' => "#{t('saving_preferences')}…" } do |f|
|
10
|
+
%fieldset
|
11
|
+
= render :partial => 'admin/users/avatar'
|
12
|
+
|
13
|
+
= render_region :form_top, :locals => {:f => f}
|
14
|
+
|
15
|
+
- render_region :form, :locals => {:f => f} do |form|
|
16
|
+
- form.edit_name do
|
17
|
+
%p
|
18
|
+
= f.label :name, t("name")
|
19
|
+
= f.text_field :name, :class => "textbox", :size => 32, :maxlength => 100
|
20
|
+
|
21
|
+
- form.edit_email do
|
22
|
+
%p
|
23
|
+
= f.label :email, t("email_address"), :class => "optional"
|
24
|
+
= f.text_field "email", :class => 'textbox', :size => 32, :maxlength => 255
|
25
|
+
|
26
|
+
- form.edit_username do
|
27
|
+
%p
|
28
|
+
= f.label :login, t("username")
|
29
|
+
= f.text_field "login", :class => "textbox", :size => 32, :maxlength => 40, :required => true
|
30
|
+
|
31
|
+
- form.edit_password do
|
32
|
+
= render "admin/users/password_fields", :f => f
|
33
|
+
|
34
|
+
- form.edit_locale do
|
35
|
+
%p
|
36
|
+
= f.label :locale, t('language')
|
37
|
+
= f.select "locale", available_locales_select
|
38
|
+
|
39
|
+
- render_region :form_bottom, :locals => {:f => f} do |form_bottom|
|
40
|
+
- form_bottom.edit_buttons do
|
41
|
+
.buttons
|
42
|
+
= save_model_button @user
|
43
|
+
= t('or')
|
44
|
+
= link_to t('cancel'), admin_url, class: 'alt'
|
@@ -13,6 +13,6 @@
|
|
13
13
|
- unless @user.new_record?
|
14
14
|
%span
|
15
15
|
= t('or')
|
16
|
-
%a{:href=>"#", :onclick=>" $('#display_password').show(); $('#change_password').hide()"}= t('cancel')
|
16
|
+
%a{:href=>"#", :class=>"warning", :onclick=>" $('#display_password').show(); $('#change_password').hide()"}= t('cancel', class: 'alt')
|
17
17
|
|
18
18
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#single_form
|
4
4
|
%h1= t('please_login')
|
5
5
|
|
6
|
-
= form_tag
|
6
|
+
= form_tag login_path do
|
7
7
|
%p
|
8
8
|
%label{:for=>"username_or_email"}= t('username_or_email')
|
9
9
|
= text_field_tag "username_or_email", @username_or_email, :class => 'textbox', :maxlength => 40, :size => 40
|
@@ -31,22 +31,24 @@
|
|
31
31
|
#page
|
32
32
|
#header
|
33
33
|
- if logged_in?
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
34
|
+
= render_region :before_nav
|
35
|
+
- render_region :navigation do |navigation|
|
36
|
+
#site_links
|
37
|
+
= %{#{t('logged_in_as')} #{link_to h(current_user.name), edit_admin_preferences_path} (#{link_to t('log_out'), logout_path})}.html_safe
|
38
|
+
|
39
|
+
= link_to t('view_site'), root_path, :id=>"view_site"
|
40
|
+
%ul#navigation
|
41
|
+
- nav_tabs.each do |tab|
|
42
|
+
- if tab.visible?(current_user)
|
43
|
+
%li{:class=>('current ' if current_tab?(tab)).to_s}
|
44
|
+
= link_to translate_with_default(tab.name), (tab.first.relative_url if tab.first)
|
45
|
+
#toolbar
|
46
|
+
- if @current_tab and @current_tab.size > 1
|
47
|
+
%ul#secondary_navigation
|
48
|
+
- @current_tab.each do |sub_item|
|
49
|
+
- if sub_item.visible?(current_user)
|
50
|
+
%li= link_to translate_with_default(sub_item.name), sub_item.relative_url, :class=>('current' if current_item?(sub_item))
|
51
|
+
= yield :toolbar
|
50
52
|
#main
|
51
53
|
- if flash[:notice]
|
52
54
|
#notice
|
data/config/application.rb
CHANGED
@@ -8,6 +8,8 @@ require 'trusty_cms/extension_loader'
|
|
8
8
|
require 'trusty_cms/initializer'
|
9
9
|
require 'compass'
|
10
10
|
require 'rack/cache'
|
11
|
+
require 'trustygems'
|
12
|
+
|
11
13
|
|
12
14
|
if defined?(Bundler)
|
13
15
|
# If you precompile assets before deploying to production, use this line
|
@@ -117,7 +119,6 @@ module TrustyCms
|
|
117
119
|
html
|
118
120
|
end
|
119
121
|
end
|
120
|
-
|
121
122
|
config.after_initialize do
|
122
123
|
extension_loader.load_extensions
|
123
124
|
extension_loader.load_extension_initalizers
|