locomotive_cms 0.0.1.4 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/Gemfile +4 -2
  2. data/app/controllers/admin/api_contents_controller.rb +30 -0
  3. data/app/controllers/admin/base_controller.rb +2 -2
  4. data/app/controllers/admin/content_types_controller.rb +1 -1
  5. data/app/controllers/admin/custom_fields_controller.rb +33 -0
  6. data/app/controllers/admin/my_accounts_controller.rb +2 -2
  7. data/app/controllers/admin/sites_controller.rb +2 -2
  8. data/app/helpers/admin/accounts_helper.rb +1 -1
  9. data/app/helpers/admin/custom_fields_helper.rb +1 -1
  10. data/app/models/asset.rb +2 -1
  11. data/app/models/asset_collection.rb +2 -2
  12. data/app/models/content_instance.rb +7 -0
  13. data/app/models/content_type.rb +1 -0
  14. data/app/models/page_part.rb +4 -4
  15. data/app/models/site.rb +1 -1
  16. data/app/models/theme_asset.rb +2 -0
  17. data/app/uploaders/asset_uploader.rb +2 -2
  18. data/app/views/admin/asset_collections/edit.html.haml +6 -3
  19. data/app/views/admin/content_types/_form.html.haml +10 -5
  20. data/app/views/admin/content_types/edit.html.haml +3 -1
  21. data/app/views/admin/content_types/new.html.haml +2 -0
  22. data/app/views/admin/contents/_form.html.haml +12 -2
  23. data/app/views/admin/current_sites/_form.html.haml +1 -1
  24. data/app/views/admin/custom_fields/_edit_field.html.haml +9 -0
  25. data/app/views/admin/{shared/_custom_fields.html.haml → custom_fields/_index.html.haml} +14 -4
  26. data/app/views/admin/custom_fields/edit_category.html.haml +43 -0
  27. data/app/views/admin/pages/_form.html.haml +1 -1
  28. data/app/views/admin/passwords/edit.html.haml +2 -2
  29. data/app/views/admin/passwords/new.html.haml +2 -2
  30. data/app/views/admin/sessions/new.html.haml +1 -1
  31. data/app/views/admin/shared/_head.html.haml +1 -1
  32. data/app/views/admin/shared/_header.html.haml +2 -2
  33. data/app/views/admin/sites/_form.html.haml +1 -1
  34. data/app/views/admin/theme_assets/images.html.haml +7 -7
  35. data/app/views/devise/mailer/reset_password_instructions.html.haml +1 -1
  36. data/config/application.rb +4 -3
  37. data/config/boot.rb +3 -14
  38. data/config/initializers/locomotive.rb +1 -0
  39. data/config/initializers/mongoid.rb +11 -12
  40. data/config/initializers/secret_token.rb +7 -0
  41. data/config/locales/admin_ui_en.yml +113 -4
  42. data/config/routes.rb +6 -8
  43. data/lib/locomotive/configuration.rb +2 -1
  44. data/lib/locomotive/liquid/drops/contents.rb +11 -13
  45. data/lib/locomotive/liquid/drops/javascripts.rb +1 -1
  46. data/lib/locomotive/liquid/tags/paginate.rb +1 -1
  47. data/lib/locomotive/render.rb +1 -1
  48. data/lib/locomotive/routing/site_dispatcher.rb +2 -1
  49. data/lib/locomotive.rb +3 -1
  50. data/lib/misc_form_builder.rb +10 -0
  51. data/public/images/admin/form/big_item-popup.png +0 -0
  52. data/public/images/admin/form/footer-popup.png +0 -0
  53. data/public/images/admin/form/header-popup.png +0 -0
  54. data/public/images/admin/form/icons/edit.png +0 -0
  55. data/public/images/admin/form/item-popup.png +0 -0
  56. data/public/images/admin/list/none-small.png +0 -0
  57. data/public/javascripts/admin/application.js +3 -2
  58. data/public/javascripts/admin/content_types.js +1 -1
  59. data/public/javascripts/admin/contents.js +11 -1
  60. data/public/javascripts/admin/custom_fields/category.js +91 -0
  61. data/public/javascripts/admin/custom_fields.js +27 -0
  62. data/public/javascripts/admin/page_parts.js +10 -5
  63. data/public/javascripts/admin/pages.js +1 -1
  64. data/public/javascripts/admin/snippets.js +1 -1
  65. data/public/javascripts/admin/theme_assets.js +2 -0
  66. data/public/javascripts/admin/utils.js +9 -0
  67. data/public/javascripts/all.js +14 -2
  68. data/public/stylesheets/admin/application.css +2 -2
  69. data/public/stylesheets/admin/box.css +80 -4
  70. data/public/stylesheets/admin/formtastic_changes.css +7 -2
  71. data/public/stylesheets/all.css +6 -1
  72. data/spec/lib/locomotive/render_spec.rb +2 -2
  73. data/spec/models/asset_collections_spec.rb +4 -4
  74. data/spec/spec_helper.rb +1 -1
  75. data/spec/support/locomotive.rb +1 -1
  76. data/vendor/plugins/custom_fields/Gemfile +11 -0
  77. data/vendor/plugins/custom_fields/README +2 -2
  78. data/vendor/plugins/custom_fields/Rakefile +23 -17
  79. data/vendor/plugins/custom_fields/lib/custom_fields/custom_fields_for.rb +2 -1
  80. data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/embeds_many.rb +20 -13
  81. data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/has_many_related.rb +33 -0
  82. data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/associations/proxy.rb +20 -0
  83. data/vendor/plugins/custom_fields/lib/custom_fields/extensions/mongoid/document.rb +14 -21
  84. data/vendor/plugins/custom_fields/lib/custom_fields/{custom_field.rb → field.rb} +25 -23
  85. data/vendor/plugins/custom_fields/lib/custom_fields/proxy_class_enabler.rb +37 -0
  86. data/vendor/plugins/custom_fields/lib/custom_fields/types/category.rb +73 -0
  87. data/vendor/plugins/custom_fields/lib/custom_fields/types/default.rb +18 -0
  88. data/vendor/plugins/custom_fields/lib/custom_fields.rb +9 -1
  89. data/vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb +28 -0
  90. data/vendor/plugins/custom_fields/spec/integration/types/category_spec.rb +26 -0
  91. data/vendor/plugins/custom_fields/spec/models/person.rb +10 -0
  92. data/vendor/plugins/custom_fields/spec/models/project.rb +16 -0
  93. data/vendor/plugins/custom_fields/spec/models/task.rb +10 -0
  94. data/vendor/plugins/custom_fields/spec/spec_helper.rb +31 -0
  95. data/vendor/plugins/custom_fields/spec/unit/custom_field_spec.rb +42 -0
  96. data/vendor/plugins/custom_fields/spec/unit/custom_fields_for_spec.rb +106 -0
  97. data/vendor/plugins/custom_fields/spec/unit/proxy_class_enabler_spec.rb +25 -0
  98. data/vendor/plugins/custom_fields/spec/unit/types/category_spec.rb +97 -0
  99. metadata +83 -35
  100. data/app/views/devise/confirmations/new.html.haml +0 -12
  101. data/app/views/devise/registrations/edit.html.haml +0 -35
  102. data/app/views/devise/registrations/new.html.haml +0 -20
  103. data/app/views/devise/sessions/new.html.haml +0 -22
  104. data/app/views/devise/shared/_links.haml +0 -20
  105. data/app/views/devise/unlocks/new.html.haml +0 -12
  106. data/vendor/plugins/custom_fields/install.rb +0 -1
data/Gemfile CHANGED
@@ -9,15 +9,17 @@ gem "bson_ext", ">= 1.0.1"
9
9
  gem "mongo_ext"
10
10
  gem "mongoid", ">= 2.0.0.beta6"
11
11
  gem "mongoid_acts_as_tree", ">= 0.1.2"
12
+ gem "mongo_session_store", "2.0.0.pre"
12
13
  gem "warden"
13
- gem "devise", ">= 1.1.rc0"
14
- gem "haml", ">= 3.0.1"
14
+ gem "devise", ">= 1.1.rc1"
15
+ gem "haml", "3.0.1"
15
16
  gem "rmagick", "2.12.2"
16
17
  gem "aws"
17
18
  gem "jeweler"
18
19
  gem "mimetype-fu", :require => "mimetype_fu"
19
20
  gem "formtastic-rails3", :require => "formtastic"
20
21
  gem "carrierwave-rails3", :require => "carrierwave"
22
+ gem "actionmailer-with-request", :require => 'actionmailer_with_request'
21
23
 
22
24
  # Development environment
23
25
  group :development do
@@ -0,0 +1,30 @@
1
+ module Admin
2
+ class ApiContentsController < ActionController::Base
3
+
4
+ include Locomotive::Routing::SiteDispatcher
5
+
6
+ before_filter :require_site
7
+
8
+ before_filter :set_content_type
9
+
10
+ def create
11
+ @content = @content_type.contents.build(params[:content])
12
+
13
+ respond_to do |format|
14
+ if @content.save
15
+ format.json { render :json => { :content => @content } }
16
+ else
17
+ format.json { render :json => { :content => @content, :errors => @content.errors } }
18
+ end
19
+ end
20
+ end
21
+
22
+ protected
23
+
24
+ def set_content_type
25
+ @content_type = current_site.content_types.where(:slug => params[:slug]).first
26
+ render :json => { :error => 'Api not enabled'} and return false unless @content_type.api_enabled
27
+ end
28
+
29
+ end
30
+ end
@@ -5,7 +5,7 @@ module Admin
5
5
 
6
6
  layout 'admin/application'
7
7
 
8
- before_filter :authenticate_account!
8
+ before_filter :authenticate_admin!
9
9
 
10
10
  before_filter :require_site
11
11
 
@@ -48,7 +48,7 @@ module Admin
48
48
  end
49
49
 
50
50
  def set_locale
51
- I18n.locale = current_account.locale
51
+ I18n.locale = current_admin.locale
52
52
  end
53
53
 
54
54
  end
@@ -45,7 +45,7 @@ module Admin
45
45
  flash[:error] = e.to_s
46
46
  end
47
47
 
48
- redirect_to admin_content_types_url
48
+ redirect_to admin_pages_url
49
49
  end
50
50
 
51
51
  end
@@ -0,0 +1,33 @@
1
+ module Admin
2
+ class CustomFieldsController < BaseController
3
+
4
+ layout false
5
+
6
+ before_filter :set_content_type
7
+
8
+ def edit
9
+ @field = @content_type.content_custom_fields.find(params[:id])
10
+ render :action => "edit_#{@field.kind.downcase}"
11
+ end
12
+
13
+ def update
14
+ @field = @content_type.content_custom_fields.find(params[:id])
15
+ @field.updated_at = Time.now # forces mongoid to save the object
16
+
17
+ params[:custom_field][:category_items_attributes].delete('-1')
18
+
19
+ if @field.update_attributes(params[:custom_field])
20
+ render :json => @field.attributes
21
+ else
22
+ render :json => { :error => translate_flash_msg(:successful) }
23
+ end
24
+ end
25
+
26
+ protected
27
+
28
+ def set_content_type
29
+ @content_type = current_site.content_types.where(:slug => params[:slug]).first
30
+ end
31
+
32
+ end
33
+ end
@@ -4,11 +4,11 @@ module Admin
4
4
  sections 'settings', 'account'
5
5
 
6
6
  def edit
7
- @account = current_account
7
+ @account = current_admin
8
8
  end
9
9
 
10
10
  def update
11
- @account = current_account
11
+ @account = current_admin
12
12
  if @account.update_attributes(params[:account])
13
13
  flash_success!
14
14
  redirect_to edit_admin_my_account_url
@@ -11,7 +11,7 @@ module Admin
11
11
  @site = Site.new(params[:site])
12
12
 
13
13
  if @site.save
14
- @site.memberships.create :account => @current_account, :admin => true
14
+ @site.memberships.create :account => @current_admin, :admin => true
15
15
  flash_success!
16
16
  redirect_to edit_admin_my_account_url
17
17
  else
@@ -21,7 +21,7 @@ module Admin
21
21
  end
22
22
 
23
23
  def destroy
24
- @site = current_account.sites.detect { |s| s._id == params[:id] }
24
+ @site = current_admin.sites.detect { |s| s._id == params[:id] }
25
25
 
26
26
  if @site != current_site
27
27
  @site.destroy
@@ -1,7 +1,7 @@
1
1
  module Admin::AccountsHelper
2
2
 
3
3
  def admin_on?(site = current_site)
4
- site.memberships.detect { |a| a.admin? && a.account == current_account }
4
+ site.memberships.detect { |a| a.admin? && a.account == current_admin }
5
5
  end
6
6
 
7
7
  end
@@ -2,7 +2,7 @@ module Admin::CustomFieldsHelper
2
2
 
3
3
  def options_for_field_kind(selected = nil)
4
4
  # %w{String Text Boolean Email File Date}
5
- options = %w{String Text}.map do |kind|
5
+ options = %w{String Text Category}.map do |kind|
6
6
  [t("admin.custom_fields.kind.#{kind.downcase}"), kind]
7
7
  end
8
8
  end
data/app/models/asset.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  class Asset
2
2
 
3
3
  include Mongoid::Document
4
- include Mongoid::Timestamps
4
+ include Mongoid::Timestamps
5
5
 
6
6
  ## Extensions ##
7
7
  include Models::Extensions::Asset::Vignette
8
+ include CustomFields::ProxyClassEnabler
8
9
 
9
10
  ## fields ##
10
11
  field :name, :type => String
@@ -3,8 +3,8 @@ class AssetCollection
3
3
  include Locomotive::Mongoid::Document
4
4
 
5
5
  ## fields ##
6
- field :name, :type => String
7
- field :slug, :type => String
6
+ field :name
7
+ field :slug
8
8
 
9
9
  ## associations ##
10
10
  belongs_to_related :site
@@ -3,6 +3,9 @@ class ContentInstance
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
5
5
 
6
+ ## extensions ##
7
+ include CustomFields::ProxyClassEnabler
8
+
6
9
  ## fields (dynamic fields) ##
7
10
  field :_position_in_list, :type => Integer, :default => 0
8
11
 
@@ -17,6 +20,10 @@ class ContentInstance
17
20
 
18
21
  ## methods ##
19
22
 
23
+ def to_liquid
24
+ Locomotive::Liquid::Drops::Content.new(self)
25
+ end
26
+
20
27
  protected
21
28
 
22
29
  def require_highlighted_field
@@ -8,6 +8,7 @@ class ContentType
8
8
  field :slug
9
9
  field :order_by
10
10
  field :highlighted_field_name
11
+ field :api_enabled, :type => Boolean, :default => false
11
12
 
12
13
  ## associations ##
13
14
  belongs_to_related :site
@@ -3,11 +3,11 @@ class PagePart
3
3
  include Mongoid::Document
4
4
 
5
5
  ## fields ##
6
- field :name, :type => String
7
- field :slug, :type => String
8
- field :value, :type => String
6
+ field :name
7
+ field :slug
8
+ field :value
9
9
  field :disabled, :type => Boolean, :default => false
10
- field :value, :type => String
10
+ field :value
11
11
 
12
12
  ## associations ##
13
13
  embedded_in :page, :inverse_of => :parts
data/app/models/site.rb CHANGED
@@ -4,7 +4,7 @@ class Site
4
4
 
5
5
  ## fields ##
6
6
  field :name
7
- field :subdomain, :type => String
7
+ field :subdomain
8
8
  field :domains, :type => Array, :default => []
9
9
 
10
10
  ## associations ##
@@ -53,6 +53,8 @@ class ThemeAsset
53
53
  end
54
54
 
55
55
  def performing_plain_text?
56
+ return true if !self.new_record? && !self.image? && self.errors.empty?
57
+
56
58
  !(self.performing_plain_text.blank? || self.performing_plain_text == 'false' || self.performing_plain_text == false)
57
59
  end
58
60
 
@@ -35,8 +35,8 @@ class AssetUploader < CarrierWave::Uploader::Base
35
35
  self.class.content_types.each_pair do |type, rules|
36
36
  rules.each do |rule|
37
37
  case rule
38
- when String then value = type if file.content_type == rule
39
- when Regexp then value = type if (file.content_type =~ rule) == 0
38
+ when String then value = type if content_type == rule
39
+ when Regexp then value = type if (content_type =~ rule) == 0
40
40
  end
41
41
  end
42
42
  end
@@ -1,7 +1,8 @@
1
1
  - title link_to(@collection.name.blank? ? @collection.name_was : @collection.name, '#', :rel => 'asset_collection_name', :title => t('.ask_for_name'), :class => 'editable')
2
2
 
3
3
  - content_for :head do
4
- = javascript_include_tag 'admin/asset_collections', 'admin/custom_fields'
4
+ = javascript_include_tag 'admin/plugins/fancybox', 'admin/asset_collections', 'admin/custom_fields'
5
+ = stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
5
6
 
6
7
  - content_for :submenu do
7
8
  = render 'admin/shared/menu/assets'
@@ -25,6 +26,8 @@
25
26
  = f.input :name
26
27
  = f.input :slug, :required => false
27
28
 
28
- = render 'admin/shared/custom_fields', :f => f, :collection_name => 'assets'
29
+ = render 'admin/custom_fields/index', :f => f, :collection_name => 'assets'
29
30
 
30
- = render 'admin/shared/form_actions', :delete_button => link_to(content_tag(:span, t('.destroy')), admin_asset_collection_url(@collection), :confirm => t('admin.messages.confirm'), :method => :delete, :class => 'button small remove'), :button_label => :update
31
+ = render 'admin/shared/form_actions', :delete_button => link_to(content_tag(:span, t('.destroy')), admin_asset_collection_url(@collection), :confirm => t('admin.messages.confirm'), :method => :delete, :class => 'button small remove'), :button_label => :update
32
+
33
+ = render 'admin/custom_fields/edit_field'
@@ -1,13 +1,18 @@
1
1
  - content_for :head do
2
- = javascript_include_tag 'admin/custom_fields'
2
+ = javascript_include_tag 'admin/plugins/fancybox', 'admin/custom_fields'
3
+ = stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
3
4
 
4
5
  = f.inputs :name => :information do
5
6
  = f.input :name
6
7
  = f.input :slug
7
8
  = f.input :description
8
9
 
9
- = render 'admin/shared/custom_fields', :f => f, :collection_name => 'contents'
10
+ = render 'admin/custom_fields/index', :f => f, :collection_name => 'contents'
10
11
 
11
- = f.foldable_inputs :name => :options, :class => 'switchable' do
12
- = f.input :highlighted_field_name, :as => :select, :collection => options_for_highlighted_field(f.object, 'contents'), :include_blank => false
13
- = f.input :order_by, :as => :select, :collection => options_for_order_by(f.object, 'contents'), :include_blank => false
12
+ - unless f.object.new_record?
13
+ = f.foldable_inputs :name => :options, :class => 'switchable' do
14
+ = f.input :highlighted_field_name, :as => :select, :collection => options_for_highlighted_field(f.object, 'contents'), :include_blank => false
15
+ = f.input :order_by, :as => :select, :collection => options_for_order_by(f.object, 'contents'), :include_blank => false
16
+ = f.custom_input :api_enabled, :css => 'toggle' do
17
+ = f.check_box :api_enabled
18
+
@@ -13,4 +13,6 @@
13
13
 
14
14
  = render 'form', :f => form
15
15
 
16
- = render 'admin/shared/form_actions', :back_url => admin_contents_url(@content_type.slug), :button_label => :update
16
+ = render 'admin/shared/form_actions', :back_url => admin_contents_url(@content_type.slug), :button_label => :update
17
+
18
+ = render 'admin/custom_fields/edit_field'
@@ -13,3 +13,5 @@
13
13
  = render 'form', :f => f
14
14
 
15
15
  = render 'admin/shared/form_actions', :back_url => admin_pages_url, :button_label => :create
16
+
17
+ = render 'admin/custom_fields/edit_field'
@@ -1,3 +1,7 @@
1
+ - content_for :head do
2
+ = javascript_include_tag 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/contents'
3
+ = stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
4
+
1
5
  - highlighted_field_name = @content.content_type.highlighted_field_name
2
6
 
3
7
  = f.inputs :name => :other_fields do
@@ -5,6 +9,12 @@
5
9
  - required = highlighted_field_name == field._name
6
10
 
7
11
  - if field.string?
8
- = f.input field._alias.to_sym, :label => field.label, :required => required
12
+ = f.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
9
13
  - elsif field.text?
10
- = f.input field._alias.to_sym, :label => field.label, :as => :text, :required => required
14
+ = f.input field._alias.to_sym, :label => field.label, :hint => field.hint, :as => :text, :required => required
15
+ - elsif field.category?
16
+ = f.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
17
+ = f.select field._name.to_sym, field.ordered_category_items.collect { |item| [item.name, item.id] }
18
+ %button.button.light.edit-categories-link{ :type => 'button', :'data-url' => edit_admin_custom_field_path(@content_type.slug, field) }
19
+ %span= t('.edit_categories')
20
+
@@ -40,6 +40,6 @@
40
40
  %li{ :class => "item #{'last' if index == @site.memberships.size - 1}" }
41
41
  %strong= account.name
42
42
  %em= account.email
43
- - if account != current_account
43
+ - if account != current_admin
44
44
  %span.actions
45
45
  = link_to image_tag('admin/form/icons/trash.png'), admin_membership_url(membership), :class => 'remove first', :confirm => t('admin.messages.confirm'), :method => :delete
@@ -0,0 +1,9 @@
1
+ .box-wrapper
2
+ #edit-custom-field
3
+ %h2= t('.title')
4
+
5
+ = form_tag '#', :class => 'formtastic' do
6
+ = fields_for CustomFields::Field.new, :builder => Formtastic::SemanticFormHelper.builder do |g|
7
+ = g.inputs :name => :information do
8
+ = g.input :_alias
9
+ = g.input :hint
@@ -10,6 +10,10 @@
10
10
  = image_tag 'admin/form/icons/drag.png'
11
11
 
12
12
  = g.hidden_field :position, :class => 'position'
13
+
14
+ = g.hidden_field :_alias, :class => 'alias'
15
+
16
+ = g.hidden_field :hint, :class => 'hint'
13
17
 
14
18
  = g.text_field :label
15
19
 
@@ -22,14 +26,19 @@
22
26
  &nbsp;
23
27
 
24
28
  %span.actions
25
- = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
29
+ = link_to image_tag('admin/form/pen.png'), '#edit-custom-field', :class => 'edit first'
30
+ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
26
31
 
27
- = f.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name'), :child_index => '-1' do |g|
32
+ = f.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name', :_alias => ''), :child_index => '-1' do |g|
28
33
  %li{ :class => 'item template' }
29
34
  %span.handle
30
35
  = image_tag 'admin/form/icons/drag.png'
31
36
 
32
37
  = g.hidden_field :position, :class => 'position'
38
+
39
+ = g.hidden_field :_alias, :class => 'alias'
40
+
41
+ = g.hidden_field :hint, :class => 'hint'
33
42
 
34
43
  = g.text_field :label, :class => 'string label void'
35
44
 
@@ -42,6 +51,7 @@
42
51
  &nbsp;
43
52
 
44
53
  %span.actions
45
- = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
54
+ = link_to image_tag('admin/form/pen.png'), '#edit-custom-field', :class => 'edit first'
55
+ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
46
56
  %button{ :class => 'button light add', :type => 'button' }
47
- %span= t('admin.buttons.new_item')
57
+ %span= t('admin.buttons.new_item')
@@ -0,0 +1,43 @@
1
+ #edit-custom-field-category
2
+ .inner
3
+ %h2= t('.title')
4
+
5
+ %p= t('.help')
6
+
7
+ = semantic_form_for @field, :as => :custom_field, :url => admin_custom_field_url(@content_type.slug, @field) do |f|
8
+ = f.foldable_inputs :name => t('.collection_label'), :class => 'editable-list off' do
9
+ - @field.ordered_category_items.each do |item|
10
+ = f.fields_for :category_items, item, :child_index => item._index do |g|
11
+ %li{ :class => "item added #{'error' unless item.errors.empty?}"}
12
+ %span.handle
13
+ = image_tag 'admin/form/icons/drag.png'
14
+
15
+ = g.hidden_field :position, :class => 'position'
16
+
17
+ = g.text_field :name
18
+
19
+ &nbsp;
20
+
21
+ %span.actions
22
+ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
23
+
24
+ = f.fields_for :category_items, @field.category_items.build, :child_index => '-1' do |g|
25
+ %li{ :class => 'item template' }
26
+ %span.handle
27
+ = image_tag 'admin/form/icons/drag.png'
28
+
29
+ = g.hidden_field :position, :class => 'position'
30
+
31
+ = g.text_field :name, :class => 'string name'
32
+
33
+ &nbsp;
34
+
35
+ %span.actions
36
+ = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
37
+ %button{ :class => 'button light add', :type => 'button' }
38
+ %span= t('admin.buttons.new_item')
39
+
40
+ .popup-actions
41
+ %p
42
+ %button.button.light{ :type => 'button' }
43
+ %span= t('admin.shared.form_actions.update')
@@ -6,7 +6,7 @@
6
6
 
7
7
  = f.input :title
8
8
 
9
- = f.input :layout_id, :as => :select, :collection => current_site.layouts.all, :input_html => { :data_url => admin_layout_page_parts_url('_id_to_replace_') }
9
+ = f.input :layout_id, :as => :select, :collection => current_site.layouts.all.to_a, :input_html => { :data_url => admin_layout_page_parts_url('_id_to_replace_') }
10
10
 
11
11
  - if not @page.index? and not @page.not_found?
12
12
  = f.input :parent_id, :as => :select, :collection => parent_pages_options, :include_blank => false
@@ -1,6 +1,6 @@
1
1
  - title t('.title')
2
2
 
3
- = semantic_form_for(resource, :as => resource_name, :url => password_path, :html => { :method => :put }) do |f|
3
+ = semantic_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
4
4
 
5
5
  = f.hidden_field :reset_password_token
6
6
 
@@ -12,7 +12,7 @@
12
12
  = f.input :password_confirmation, :label => t('.password_confirmation'), :required => false
13
13
 
14
14
  %p.link
15
- = link_to t('.link'), new_account_session_path
15
+ = link_to t('.link'), new_admin_session_path
16
16
 
17
17
  .footer
18
18
  = login_button_tag t('admin.buttons.change_password')
@@ -1,6 +1,6 @@
1
1
  - title t('.title')
2
2
 
3
- = semantic_form_for(resource, :as => resource_name, :url => password_path) do |f|
3
+ = semantic_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f|
4
4
 
5
5
  = f.hidden_field :reset_password_token
6
6
 
@@ -11,7 +11,7 @@
11
11
  = f.input :email, :label => t('.email'), :required => false
12
12
 
13
13
  %p.link
14
- = link_to t('.link'), new_account_session_path
14
+ = link_to t('.link'), new_admin_session_path
15
15
 
16
16
  .footer
17
17
  = login_button_tag t('admin.buttons.send_password')
@@ -9,7 +9,7 @@
9
9
  = f.input :password, :label => t('.password'), :required => false
10
10
 
11
11
  %p.link
12
- = link_to t('.link'), new_password_path
12
+ = link_to t('.link'), new_admin_password_path
13
13
 
14
14
  .footer
15
15
  = login_button_tag t('admin.buttons.login')
@@ -10,7 +10,7 @@
10
10
 
11
11
  = stylesheet_link_tag 'admin/layout', 'admin/plugins/toggle', 'admin/menu', 'admin/buttons', 'admin/formtastic', 'admin/formtastic_changes', 'admin/application', :media => 'screen', :cache => Rails.env.production?
12
12
 
13
- = javascript_include_tag 'admin/jquery', 'admin/jquery.ui', 'admin/rails', 'admin/plugins/toggle', 'admin/plugins/growl', 'admin/plugins/cookie', 'admin/application', :cache => Rails.env.production?
13
+ = javascript_include_tag 'admin/jquery', 'admin/jquery.ui', 'admin/rails', 'admin/utils', 'admin/plugins/toggle', 'admin/plugins/growl', 'admin/plugins/cookie', 'admin/application', :cache => Rails.env.production?
14
14
 
15
15
  %script{ :type => 'text/javascript' }
16
16
  = find_and_preserve(growl_message)
@@ -1,8 +1,8 @@
1
1
  %h1= link_to current_site.name, '#'
2
2
 
3
3
  #global-actions-bar
4
- = t('.welcome', :name => link_to(current_account.name, edit_admin_my_account_url))
4
+ = t('.welcome', :name => link_to(current_admin.name, edit_admin_my_account_url))
5
5
  %span= '|'
6
6
  = link_to t('.see'), main_site_url
7
7
  %span= '|'
8
- = link_to t('.logout'), destroy_account_session_url, :confirm => t('admin.messages.confirm')
8
+ = link_to t('.logout'), destroy_admin_session_url, :confirm => t('admin.messages.confirm')
@@ -24,7 +24,7 @@
24
24
  %span.actions
25
25
  = link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
26
26
 
27
- %li.item.new
27
+ %li.item.template
28
28
  %em
29
29
  http://
30
30
  = text_field_tag 'label', t('formtastic.hints.site.domain_name'), :class => 'string label void'
@@ -6,10 +6,10 @@
6
6
 
7
7
  - if @image_assets.empty?
8
8
  %p.no-items= t('.no_items')
9
- - else
10
- %ul.assets
11
- = render 'asset', :asset => current_site.theme_assets.build, :edit => false
12
-
13
- = render :partial => 'asset', :collection => @image_assets, :locals => { :per_row => 3, :edit => false }
14
-
15
- %li.clear
9
+
10
+ %ul.assets
11
+ = render 'asset', :asset => current_site.theme_assets.build, :edit => false
12
+
13
+ = render :partial => 'asset', :collection => @image_assets, :locals => { :per_row => 3, :edit => false }
14
+
15
+ %li.clear
@@ -5,7 +5,7 @@
5
5
  %p
6
6
  Someone has requested a link to change your password, and you can do this through the link below.
7
7
  %p
8
- = link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
8
+ = link_to 'Change my password', edit_admin_password_url(@resource, :reset_password_token => @resource.reset_password_token)
9
9
  %p
10
10
  If you didn't request this, please ignore this email.
11
11
  %p
@@ -40,10 +40,11 @@ module Locomotive
40
40
  # g.template_engine :erb
41
41
  # g.test_framework :test_unit, :fixture => true
42
42
  # end
43
+
44
+ # Configure the default encoding used in templates for Ruby 1.9.
45
+ config.encoding = "utf-8"
43
46
 
44
47
  # Configure sensitive parameters which will be filtered from the log file.
45
- config.filter_parameters << :password
46
-
47
- config.secret_token = '968a457262807c64e3ed5609882e17a774b917f5bcf2d308bd37eac4ba4d416d5692e6b13d77523fddb94c1dd603f160db8492b86b5e0203240bf339fe2aeae4'
48
+ config.filter_parameters << :password
48
49
  end
49
50
  end
data/config/boot.rb CHANGED
@@ -1,17 +1,6 @@
1
- # Use Bundler (preferred)
2
- begin
3
- require File.expand_path('../../.bundle/environment', __FILE__)
4
- rescue LoadError
5
- require 'rubygems'
1
+ require 'rubygems'
2
+ # Set up gems listed in the Gemfile.
3
+ if File.exist?(File.expand_path('../../Gemfile', __FILE__))
6
4
  require 'bundler'
7
5
  Bundler.setup
8
-
9
- # To use 2.x style vendor/rails and RubyGems
10
- #
11
- # vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
12
- # if File.exist?(vendor_rails)
13
- # Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
14
- # end
15
- #
16
- # require 'rubygems'
17
6
  end
@@ -4,4 +4,5 @@ require File.dirname(__FILE__) + '/../../lib/core_ext.rb'
4
4
  Locomotive.configure do |config|
5
5
  config.default_domain = 'example.com'
6
6
  config.lastest_items_nb = 5
7
+ config.enable_logs = true
7
8
  end