merge
2
.gitignore
vendored
@ -27,6 +27,6 @@ tmp/*
|
||||
.rvmrc
|
||||
Capfile
|
||||
config/deploy.rb
|
||||
perf/test.rb
|
||||
perf/*.rb
|
||||
gem_graph.png
|
||||
sites/
|
||||
|
8
Gemfile
@ -2,7 +2,7 @@ source :rubygems
|
||||
|
||||
# add in all the runtime dependencies
|
||||
|
||||
gem 'rails', '>= 3.0.4'
|
||||
gem 'rails', '>= 3.0.5'
|
||||
|
||||
gem 'warden'
|
||||
gem 'devise', '= 1.1.3'
|
||||
@ -18,10 +18,10 @@ gem 'formtastic', '~> 1.2.3'
|
||||
gem 'inherited_resources', '~> 1.1.2'
|
||||
|
||||
gem 'rmagick', '2.12.2'
|
||||
gem 'locomotive_carrierwave', '0.5.0.1.beta2', :require => 'carrierwave'
|
||||
# gem 'carrierwave', :path => '/Users/didier/Desktop/carrierwave'
|
||||
gem 'locomotive_carrierwave', '0.5.0.1.beta3', :require => 'carrierwave'
|
||||
|
||||
gem 'custom_fields', '1.0.0.beta.4'
|
||||
gem 'custom_fields', '1.0.0.beta.5'
|
||||
# gem 'custom_fields', :path => '../gems/custom_fields'
|
||||
gem 'fog', '0.3.7'
|
||||
gem 'mimetype-fu'
|
||||
gem 'actionmailer-with-request'
|
||||
|
14
Gemfile.lock
@ -77,10 +77,10 @@ GEM
|
||||
cucumber-rails (0.3.2)
|
||||
cucumber (>= 0.8.0)
|
||||
culerity (0.2.15)
|
||||
custom_fields (1.0.0.beta.4)
|
||||
activesupport (>= 3.0.0)
|
||||
custom_fields (1.0.0.beta.5)
|
||||
activesupport (>= 3.0.4)
|
||||
locomotive_carrierwave
|
||||
mongoid (~> 2.0.0.rc.6)
|
||||
mongoid (~> 2.0.0.rc.7)
|
||||
daemons (1.1.0)
|
||||
database_cleaner (0.6.4)
|
||||
delayed_job (2.1.2)
|
||||
@ -143,7 +143,7 @@ GEM
|
||||
linecache (0.43)
|
||||
linecache19 (0.5.11)
|
||||
ruby_core_source (>= 0.1.4)
|
||||
locomotive_carrierwave (0.5.0.1.beta2)
|
||||
locomotive_carrierwave (0.5.0.1.beta3)
|
||||
activesupport (~> 3.0)
|
||||
locomotive_jammit-s3 (0.5.4.4)
|
||||
jammit (>= 0.5.4)
|
||||
@ -264,7 +264,7 @@ DEPENDENCIES
|
||||
capybara
|
||||
cucumber (= 0.8.5)
|
||||
cucumber-rails
|
||||
custom_fields (= 1.0.0.beta.4)
|
||||
custom_fields (= 1.0.0.beta.5)
|
||||
database_cleaner
|
||||
delayed_job (= 2.1.2)
|
||||
delayed_job_mongoid (= 1.0.2)
|
||||
@ -278,7 +278,7 @@ DEPENDENCIES
|
||||
httparty (>= 0.6.1)
|
||||
inherited_resources (~> 1.1.2)
|
||||
launchy
|
||||
locomotive_carrierwave (= 0.5.0.1.beta2)
|
||||
locomotive_carrierwave (= 0.5.0.1.beta3)
|
||||
locomotive_jammit-s3
|
||||
locomotive_liquid (= 2.2.2)
|
||||
locomotive_mongoid_acts_as_tree (= 0.1.5.5)
|
||||
@ -286,7 +286,7 @@ DEPENDENCIES
|
||||
mocha!
|
||||
mongoid (~> 2.0.0.rc.7)
|
||||
pickle
|
||||
rails (>= 3.0.4)
|
||||
rails (>= 3.0.5)
|
||||
rmagick (= 2.12.2)
|
||||
rspec-rails (= 2.3.1)
|
||||
ruby-debug
|
||||
|
@ -12,13 +12,11 @@ module Admin
|
||||
end
|
||||
|
||||
def create
|
||||
@content = @content_type.contents.create(params[:content])
|
||||
|
||||
respond_with(@content, :location => edit_admin_content_url(@content_type.slug, @content))
|
||||
create! { edit_admin_content_url(@content_type.slug, @content.id) }
|
||||
end
|
||||
|
||||
def update
|
||||
update! { edit_admin_content_url(@content_type.slug, @content) }
|
||||
update! { edit_admin_content_url(@content_type.slug, @content.id) }
|
||||
end
|
||||
|
||||
def sort
|
||||
|
@ -1,7 +1,15 @@
|
||||
module Admin::AssetsHelper
|
||||
|
||||
def vignette_tag(asset)
|
||||
image_tag(asset.vignette_url)
|
||||
if asset.image?
|
||||
html, css = image_tag(asset.vignette_url), 'image'
|
||||
else
|
||||
css = "icon #{asset.content_type}"
|
||||
html = asset.content_type.to_s == 'other' ? truncate(asset.extname, :length => 3) : asset.content_type
|
||||
html = '?' if html.blank?
|
||||
end
|
||||
|
||||
content_tag(:div, content_tag(:div, html, :class => 'inside'), :class => css)
|
||||
end
|
||||
|
||||
def image_dimensions_and_size(asset)
|
||||
|
@ -10,8 +10,10 @@ module Admin::BaseHelper
|
||||
end
|
||||
|
||||
def admin_menu_item(name, url)
|
||||
label = content_tag(:em) + escape_once(' ') + t("admin.shared.menu.#{name}")
|
||||
content_tag(:li, link_to(label, url), :class => name.dasherize)
|
||||
index = controller.instance_variable_get(:@menu_index) || 1
|
||||
controller.instance_variable_set(:@menu_index, index + 1)
|
||||
label = content_tag(:em, escape_once(' ')) + content_tag(:span, t("admin.shared.menu.#{name}"))
|
||||
content_tag(:li, content_tag(:span) + link_to(label, url), :class => "item #{'first' if index == 1} item-#{index} #{name.dasherize}")
|
||||
end
|
||||
|
||||
def admin_button_tag(text, url, options = {})
|
||||
@ -25,18 +27,26 @@ module Admin::BaseHelper
|
||||
default_options = { :i18n => true, :css => name.dasherize.downcase }
|
||||
default_options.merge!(options)
|
||||
|
||||
css = "#{'on' if name == sections(:sub)} #{'links' if block_given?} #{options[:css]}"
|
||||
css = "#{'on' if name == sections(:sub)} #{options[:css]}"
|
||||
|
||||
label_link = default_options[:i18n] ? t("admin.shared.menu.#{name}") : name
|
||||
if block_given?
|
||||
popup = content_tag(:div, capture(&block), :class => 'popup', :style => 'display: none')
|
||||
link = link_to(content_tag(:span, preserve(label_link + content_tag(:em))), url)
|
||||
content_tag(:li, link + popup, :class => css)
|
||||
link = link_to(content_tag(:span, preserve(label_link) + content_tag(:em)) + content_tag(:em), url, :class => css)
|
||||
content_tag(:li, link + popup, :class => 'hoverable')
|
||||
else
|
||||
content_tag(:li, link_to(content_tag(:span, label_link), url), :class => css)
|
||||
content_tag(:li, link_to(content_tag(:span, label_link), url, :class => css))
|
||||
end
|
||||
end
|
||||
|
||||
def collection_to_js(collection, options = {})
|
||||
js = collection.collect { |object| object.to_json }
|
||||
|
||||
options_to_js = options.to_json.gsub(/^\{/, '').gsub(/\}$/, '')
|
||||
|
||||
"new Object({ \"collection\": [#{js.join(', ')}], #{options_to_js} })"
|
||||
end
|
||||
|
||||
def growl_message
|
||||
if not flash.empty?
|
||||
%{
|
||||
|
@ -2,7 +2,7 @@ module Admin::CustomFieldsHelper
|
||||
|
||||
def options_for_field_kind
|
||||
options = %w{string text category boolean date file}.map do |kind|
|
||||
[t("admin.custom_fields.kind.#{kind}"), kind]
|
||||
[t("custom_fields.kind.#{kind}"), kind]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -32,6 +32,11 @@ class Asset
|
||||
end
|
||||
end
|
||||
|
||||
def extname
|
||||
return nil unless self.source?
|
||||
File.extname(self.source_filename).gsub(/^\./, '')
|
||||
end
|
||||
|
||||
def site_id # needed by the uploader of custom fields
|
||||
self.collection.site_id
|
||||
end
|
||||
|
@ -9,7 +9,7 @@ class AssetCollection
|
||||
|
||||
## associations ##
|
||||
referenced_in :site
|
||||
embeds_many :assets
|
||||
embeds_many :assets, :validate => false
|
||||
|
||||
## behaviours ##
|
||||
custom_fields_for :assets
|
||||
|
@ -43,20 +43,6 @@ class ContentInstance
|
||||
self._visible || self._visible.nil?
|
||||
end
|
||||
|
||||
def aliased_attributes # TODO: move it to the custom_fields gem
|
||||
hash = { :created_at => self.created_at, :updated_at => self.updated_at }
|
||||
|
||||
self.custom_fields.each do |field|
|
||||
case field.kind
|
||||
when 'file' then hash[field._alias] = self.send(field._name.to_sym).url
|
||||
else
|
||||
hash[field._alias] = self.send(field._name.to_sym)
|
||||
end
|
||||
end
|
||||
|
||||
hash
|
||||
end
|
||||
|
||||
def errors_to_hash
|
||||
Hash.new.replace(self.errors)
|
||||
end
|
||||
|
@ -14,12 +14,15 @@ class ContentType
|
||||
|
||||
## associations ##
|
||||
referenced_in :site
|
||||
embeds_many :contents, :class_name => 'ContentInstance' do
|
||||
embeds_many :contents, :class_name => 'ContentInstance', :validate => false do
|
||||
def visible
|
||||
@target.find_all { |c| c.visible? }
|
||||
end
|
||||
end
|
||||
|
||||
## named scopes ##
|
||||
scope :first_by_slug, lambda { |slug| where(:slug => slug) }
|
||||
|
||||
## indexes ##
|
||||
index [[:site_id, Mongo::ASCENDING], [:slug, Mongo::ASCENDING]]
|
||||
|
||||
|
@ -10,32 +10,9 @@ module Models
|
||||
else
|
||||
self.source.url(:medium)
|
||||
end
|
||||
# elsif asset.pdf?
|
||||
# image_tag(asset.source.url(:medium))
|
||||
else
|
||||
mime_type_to_url(:medium)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def mime_type_to_url(size)
|
||||
mime_type = File.mime_type?(self.source_filename)
|
||||
filename = "unknown"
|
||||
|
||||
if !(mime_type =~ /pdf/).nil?
|
||||
filename = "PDF"
|
||||
elsif !(mime_type =~ /css/).nil?
|
||||
filename = "CSS"
|
||||
elsif !(mime_type =~ /javascript/).nil?
|
||||
filename = "JAVA"
|
||||
elsif !(mime_type =~ /font/).nil?
|
||||
filename = "FON"
|
||||
end
|
||||
|
||||
File.join("admin", "icons", "filetype", size.to_s, filename + ".png")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -28,6 +28,7 @@ class Page
|
||||
index [[:fullpath, Mongo::ASCENDING], [:site_id, Mongo::ASCENDING]]
|
||||
|
||||
## callbacks ##
|
||||
after_initialize :set_default_raw_template
|
||||
before_validation :normalize_slug
|
||||
before_save { |p| p.fullpath = p.fullpath(true) }
|
||||
before_destroy :do_not_remove_index_and_404_pages
|
||||
@ -102,4 +103,8 @@ class Page
|
||||
self.slug.slugify!(:without_extension => true) if self.slug.present?
|
||||
end
|
||||
|
||||
def set_default_raw_template
|
||||
self.raw_template ||= I18n.t('attributes.defaults.pages.other.body')
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -12,17 +12,17 @@ class AssetUploader < CarrierWave::Uploader::Base
|
||||
"#{Rails.root}/tmp/uploads"
|
||||
end
|
||||
|
||||
version :thumb do
|
||||
version :thumb, :if => :image? do
|
||||
process :resize_to_fill => [50, 50]
|
||||
process :convert => 'png'
|
||||
end
|
||||
|
||||
version :medium do
|
||||
version :medium, :if => :image? do
|
||||
process :resize_to_fill => [80, 80]
|
||||
process :convert => 'png'
|
||||
end
|
||||
|
||||
version :preview do
|
||||
version :preview, :if => :image? do
|
||||
process :resize_to_fit => [880, 1100]
|
||||
process :convert => 'png'
|
||||
end
|
||||
@ -58,6 +58,10 @@ class AssetUploader < CarrierWave::Uploader::Base
|
||||
end
|
||||
end
|
||||
|
||||
def image?
|
||||
model.image?
|
||||
end
|
||||
|
||||
def self.content_types
|
||||
{
|
||||
:image => ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg', 'image/x-icon'],
|
||||
|
@ -8,15 +8,11 @@
|
||||
= semantic_form_for @account, :url => admin_accounts_url do |f|
|
||||
|
||||
= f.foldable_inputs :name => :information do
|
||||
= f.input :name, :required => false
|
||||
= f.input :name
|
||||
|
||||
= f.foldable_inputs :name => :credentials do
|
||||
= f.input :email, :required => false
|
||||
|
||||
= f.custom_input :password, :label => :new_password do
|
||||
= f.password_field :password
|
||||
|
||||
= f.custom_input :password_confirmation, :label => :new_password_confirmation do
|
||||
= f.password_field :password_confirmation
|
||||
= f.input :email
|
||||
= f.input :password, :input_html => { :autocomplete => "off" }
|
||||
= f.input :password_confirmation, :input_html => { :autocomplete => "off" }
|
||||
|
||||
= render 'admin/shared/form_actions', :back_url => edit_admin_current_site_url, :button_label => :create
|
@ -1,7 +1,5 @@
|
||||
%li{ :id => "asset-#{asset.id}", :class => "asset #{'last' if (asset_counter + 1) % 6 == 0}"}
|
||||
%h4= link_to truncate(asset.name, :length => 22), edit_admin_asset_path(@asset_collection, asset)
|
||||
.image
|
||||
.inside
|
||||
= vignette_tag(asset)
|
||||
%h4= link_to truncate(asset.name, :length => 17), edit_admin_asset_path(@asset_collection, asset)
|
||||
= vignette_tag(asset)
|
||||
.actions
|
||||
= link_to image_tag('admin/list/icons/cross.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
|
@ -4,7 +4,7 @@
|
||||
|
||||
= f.inputs :name => :information do
|
||||
= f.input :name
|
||||
= f.input :source
|
||||
= f.input :source, :hint => preserve(t("formtastic.hints.asset.#{action_name}.source", :url => link_to(@asset.source_filename, @asset.source.url)))
|
||||
|
||||
- unless @asset.custom_fields.blank?
|
||||
= render 'admin/custom_fields/custom_form', :form => f, :title => :other_fields, :parent => @asset_collection
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
= form.inputs :name => title || :attributes do
|
||||
- form.object.custom_fields.each do |field|
|
||||
- required = highlighted_field_name == field._name
|
||||
- required = highlighted_field_name == field._name || field.required
|
||||
|
||||
- if field.string?
|
||||
= form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
|
||||
|
@ -7,4 +7,9 @@
|
||||
= g.inputs :name => :attributes do
|
||||
= g.input :_alias
|
||||
= g.input :hint
|
||||
= g.input :text_formatting, :as => 'select', :collection => options_for_text_formatting, :include_blank => false
|
||||
= g.input :text_formatting, :as => 'select', :collection => options_for_text_formatting, :include_blank => false, :wrapper_html => { :style => 'display: none' }
|
||||
|
||||
.popup-actions
|
||||
%p
|
||||
%button.button.light{ :type => 'submit' }
|
||||
%span= t('admin.shared.form_actions.update')
|
@ -1,61 +1,48 @@
|
||||
- collection_name = "#{collection_name.singularize}_custom_fields"
|
||||
- custom_fields = form.object.send(collection_name.to_sym)
|
||||
- ordered_custom_fields = form.object.send(:"ordered_#{collection_name}")
|
||||
- field_klass = "#{form.object.class.name}#{collection_name.classify}".gsub(/CustomField$/, 'Field').constantize
|
||||
|
||||
= form.foldable_inputs :name => :custom_fields, :class => 'editable-list fields' do
|
||||
- ordered_custom_fields.each do |field|
|
||||
= form.fields_for collection_name.to_sym, field, :child_index => field._index do |g|
|
||||
%li{ :class => "item added #{'new' if form.object.new_record?} #{'error' unless field.errors.empty?}"}
|
||||
%span.handle
|
||||
= image_tag 'admin/form/icons/drag.png'
|
||||
|
||||
= g.hidden_field :position, :class => 'position'
|
||||
|
||||
= g.hidden_field :_alias, :class => 'alias'
|
||||
|
||||
= g.hidden_field :hint, :class => 'hint'
|
||||
|
||||
= g.hidden_field :text_formatting, :class => 'text-formatting'
|
||||
|
||||
= g.text_field :label, :class => 'label'
|
||||
|
||||
—
|
||||
|
||||
%em= t("admin.custom_fields.kind.#{field.kind.downcase}")
|
||||
|
||||
= g.select :kind, options_for_field_kind
|
||||
|
||||
|
||||
|
||||
%span.actions
|
||||
= link_to image_tag('admin/form/pen.png'), '#edit-custom-field', :class => 'edit first'
|
||||
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
|
||||
|
||||
= form.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name', :_alias => ''), :child_index => '-1' do |g|
|
||||
%li{ :class => 'item template' }
|
||||
%script{ :type => 'text/x-mustache-template', :name => 'template', :'data-base-input-name' => "#{form.object.class.name.underscore}[#{collection_name}_attributes]" }
|
||||
%li{ :class => "item {{behaviour_flag}} {{new_record_flag}} {{errors_flag}} {{required_flag}}" }
|
||||
%span.handle
|
||||
= image_tag 'admin/form/icons/drag.png'
|
||||
|
||||
= g.hidden_field :position, :class => 'position'
|
||||
{{#if_existing_record}}
|
||||
%input{ :name => '{{base_name}}[id]', :value => '{{{id}}}', :type => 'hidden', :'data-field' => 'id' }
|
||||
%input{ :name => '{{base_name}}[_destroy]', :value => '0', :type => 'hidden', :'data-field' => '_destroy' }
|
||||
{{/if_existing_record}}
|
||||
|
||||
= g.hidden_field :_alias, :class => 'alias'
|
||||
%input{ :name => '{{base_name}}[position]', :value => '{{{position}}}', :type => 'hidden', :'data-field' => 'position' }
|
||||
|
||||
= g.hidden_field :hint, :class => 'hint'
|
||||
%input{ :name => '{{base_name}}[_alias]', :value => '{{{_alias}}}', :type => 'hidden', :'data-field' => '_alias' }
|
||||
|
||||
= g.hidden_field :text_formatting, :class => 'text-formatting'
|
||||
%input{ :name => '{{base_name}}[hint]', :value => '{{{hint}}}', :type => 'hidden', :'data-field' => 'hint' }
|
||||
|
||||
= g.text_field :label, :class => 'string label void'
|
||||
%input{ :name => '{{base_name}}[text_formatting]', :value => '{{{text_formatting}}}', :type => 'hidden', :'data-field' => 'text_formatting' }
|
||||
|
||||
%input{ :name => '{{base_name}}[label]', :value => '{{{label}}}', :type => 'text', :'data-field' => 'label' }
|
||||
|
||||
—
|
||||
|
||||
%em
|
||||
%em {{kind_name}}
|
||||
|
||||
= g.select :kind, options_for_field_kind
|
||||
= select_tag '{{base_name}}[kind]', options_for_select(options_for_field_kind), :'data-field' => 'kind'
|
||||
|
||||
|
||||
|
||||
%input{ :name => '{{base_name}}[required]', :value => '0', :type => 'hidden', :'data-field' => 'hidden_required' }
|
||||
%input{ :name => '{{base_name}}[required]', :'{{required_checked}}' => '{{required_checked}}', :value => '1', :type => 'checkbox', :'data-field' => 'required', :id => '{{base_dom_id}}_required' }
|
||||
|
||||
%label{ :for => "{{{base_dom_id}}}_required" }= t('.is_required')
|
||||
|
||||
%span.actions
|
||||
= link_to image_tag('admin/form/pen.png'), '#edit-custom-field', :class => 'edit first'
|
||||
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
|
||||
%button{ :class => 'button light add', :type => 'button' }
|
||||
%span!= t('admin.buttons.new_item')
|
||||
|
||||
%script{ :type => 'text/javascript', :name => 'data' }
|
||||
!= collection_to_js(ordered_custom_fields, :template => field_klass.new(:label => t('.default_label'), :_alias => '', :kind => 'string').to_hash)
|
||||
|
@ -18,10 +18,8 @@
|
||||
|
||||
= f.foldable_inputs :name => :credentials do
|
||||
= f.input :email
|
||||
= f.custom_input :password, :label => :new_password do
|
||||
= f.password_field :password, :autocomplete => "off"
|
||||
= f.custom_input :password_confirmation, :label => :new_password_confirmation do
|
||||
= f.password_field :password_confirmation, :autocomplete => "off"
|
||||
= f.input :password, :input_html => { :autocomplete => "off" }
|
||||
= f.input :password_confirmation, :input_html => { :autocomplete => "off" }
|
||||
|
||||
= f.foldable_inputs :name => :sites, :class => 'sites off' do
|
||||
- @account.sites.each do |site|
|
||||
|
@ -11,6 +11,9 @@
|
||||
|
||||
= f.input :slug, :required => false, :hint => @page.slug.blank? ? ' ' : @page.url, :input_html => { :data_url => get_path_admin_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized?}; height: 50px" }
|
||||
|
||||
|
||||
= f.foldable_inputs :name => :advanced_options do
|
||||
|
||||
= f.input :content_type_id, :as => :select, :collection => current_site.content_types.all.to_a, :include_blank => false, :wrapper_html => { :style => "#{'display: none' unless @page.templatized?}; height: 50px" }
|
||||
|
||||
= f.custom_input :templatized, :css => 'toggle', :style => "#{'display: none' if @page.redirect?}" do
|
||||
|
@ -6,7 +6,6 @@
|
||||
- else
|
||||
= link_to current_site.name, admin_pages_url, :class => 'single'
|
||||
|
||||
|
||||
#global-actions-bar
|
||||
!= t('.welcome', :name => link_to(current_admin.name, edit_admin_my_account_url))
|
||||
%span= '|'
|
||||
|
@ -1,7 +1,7 @@
|
||||
%ul
|
||||
- @asset_collections.each do |c|
|
||||
%li{ :class => "#{'on' if @asset_collection.id == c.id}" }
|
||||
= link_to content_tag(:span, truncate(c.name, :length => 20)), edit_admin_asset_collection_url(c)
|
||||
%li
|
||||
= link_to content_tag(:span, truncate(c.name, :length => 20)), edit_admin_asset_collection_url(c), :class => "#{'on' if @asset_collection.id == c.id}"
|
||||
|
||||
.action
|
||||
= link_to content_tag(:span, t('admin.asset_collections.index.new')), new_admin_asset_collection_url
|
@ -10,7 +10,7 @@
|
||||
= link_to truncate(page.title, :length => 25), edit_admin_page_url(page)
|
||||
%span= time_ago_in_words(page.updated_at)
|
||||
|
||||
- current_site.content_types.each do |content_type|
|
||||
- current_site.content_types.to_a.each do |content_type|
|
||||
- next if content_type.new_record?
|
||||
- item_on = (content_type.slug == @content_type.slug) rescue nil
|
||||
= admin_submenu_item content_type.name, admin_contents_url(content_type.slug), :i18n => false, :css => (item_on ? 'on' : '') do
|
||||
@ -25,4 +25,4 @@
|
||||
%span= time_ago_in_words(content.updated_at)
|
||||
|
||||
.action
|
||||
= link_to content_tag(:span, t('admin.content_types.index.new')), new_admin_content_type_url
|
||||
= link_to content_tag(:em) + content_tag(:span, t('admin.content_types.index.new')), new_admin_content_type_url
|
@ -25,6 +25,7 @@ javascripts:
|
||||
- public/javascripts/admin/application.js
|
||||
custom_fields:
|
||||
- public/javascripts/admin/plugins/fancybox.js
|
||||
- public/javascripts/admin/plugins/mustache.js
|
||||
- public/javascripts/admin/custom_fields.js
|
||||
edit_custom_fields:
|
||||
- public/javascripts/admin/plugins/tiny_mce/tinymce.js
|
||||
@ -33,6 +34,7 @@ javascripts:
|
||||
- public/javascripts/admin/custom_fields/category.js
|
||||
asset_collections:
|
||||
- public/javascripts/admin/plugins/fancybox.js
|
||||
- public/javascripts/admin/plugins/mustache.js
|
||||
- public/javascripts/admin/custom_fields.js
|
||||
- public/javascripts/admin/asset_collections.js
|
||||
assets:
|
||||
|
@ -51,13 +51,6 @@ de:
|
||||
custom_fields:
|
||||
edit:
|
||||
title: Benutzerdefinierte Felder bearbeiten
|
||||
kind:
|
||||
string: Einfache Texteingabe
|
||||
text: Text
|
||||
category: Auswahlbox
|
||||
boolean: Checkbox
|
||||
date: Datum
|
||||
file: Datei
|
||||
text_formatting:
|
||||
none: Keine
|
||||
html: HTML
|
||||
|
@ -51,13 +51,6 @@ en:
|
||||
custom_fields:
|
||||
edit:
|
||||
title: Editing custom field
|
||||
kind:
|
||||
string: Simple Input
|
||||
text: Text
|
||||
category: Select
|
||||
boolean: Checkbox
|
||||
date: Date
|
||||
file: File
|
||||
text_formatting:
|
||||
none: None
|
||||
html: HTML
|
||||
@ -70,6 +63,9 @@ en:
|
||||
custom_form:
|
||||
edit_categories: Edit options
|
||||
delete_file: Delete file
|
||||
index:
|
||||
is_required: is required
|
||||
default_label: Field name
|
||||
|
||||
sessions:
|
||||
new:
|
||||
|
@ -51,13 +51,6 @@ fr:
|
||||
custom_fields:
|
||||
edit:
|
||||
title: Editer champ personnalisé
|
||||
kind:
|
||||
string: Texte
|
||||
text: Zone de texte
|
||||
category: Liste déroulante
|
||||
boolean: Case à cocher
|
||||
date: Date
|
||||
file: Fichier
|
||||
text_formatting:
|
||||
none: Aucun
|
||||
html: HTML
|
||||
@ -70,6 +63,9 @@ fr:
|
||||
custom_form:
|
||||
edit_categories: Editer options
|
||||
delete_file: Supprimer fichier
|
||||
index:
|
||||
is_required: est obligatoire
|
||||
default_label: Nom du champ
|
||||
|
||||
sessions:
|
||||
new:
|
||||
|
@ -51,13 +51,6 @@ pt-BR:
|
||||
custom_fields:
|
||||
edit:
|
||||
title: Editando campo customizado
|
||||
kind:
|
||||
string: Texto Simples
|
||||
text: Texto
|
||||
category: Caixa de Seleção
|
||||
boolean: Checkbox
|
||||
date: Data
|
||||
file: Arquivo
|
||||
text_formatting:
|
||||
none: Nenhum
|
||||
html: HTML
|
||||
|
@ -46,9 +46,9 @@ de:
|
||||
title: "Seite nicht gefunden"
|
||||
body: "Inhalt der 404 Seite"
|
||||
other:
|
||||
body: "Inhalte kommen hier rein"
|
||||
body: "{% extends 'parent' %}"
|
||||
|
||||
activemodel:
|
||||
mongoid:
|
||||
attributes:
|
||||
page:
|
||||
title: Titel
|
||||
@ -75,8 +75,8 @@ de:
|
||||
email: Email
|
||||
name: Name
|
||||
language: Sprache
|
||||
new_password: "Neues Passwort"
|
||||
new_password_confirmation: "Bestätigung des neuen Passworts"
|
||||
password: Passwort
|
||||
password_confirmation: Bestätigung des Passworts
|
||||
snippet:
|
||||
body: Code
|
||||
slug: Slug
|
||||
|
@ -25,7 +25,7 @@ en:
|
||||
title: "Page not found"
|
||||
body: "Content of the 404 page"
|
||||
other:
|
||||
body: "Content goes here"
|
||||
body: "{% extends 'parent' %}"
|
||||
|
||||
pagination:
|
||||
previous: "« Previous"
|
||||
|
@ -46,16 +46,20 @@ fr:
|
||||
title: "Page non trouvée"
|
||||
body: "Contenu de la page d'erreur 404"
|
||||
other:
|
||||
body: "Le contenu va ici"
|
||||
body: "{% extends 'parent' %}"
|
||||
|
||||
activemodel:
|
||||
mongoid:
|
||||
attributes:
|
||||
page:
|
||||
title: Titre
|
||||
parent: Parent
|
||||
parent: Dossier parent
|
||||
parent_id: Dossier parent
|
||||
slug: Raccourci
|
||||
listed: Menu
|
||||
templatized: Templatisée
|
||||
published: Publiée
|
||||
redirect: Redirection
|
||||
redirect_url: Url de redirection
|
||||
cache_strategy: Cache
|
||||
content_type:
|
||||
name: Nom
|
||||
@ -72,11 +76,11 @@ fr:
|
||||
name: Nom
|
||||
source: Fichier
|
||||
account:
|
||||
email: Email
|
||||
email: E-mail
|
||||
name: Nom
|
||||
language: Langue
|
||||
new_password: "Nouveau mot de passe"
|
||||
new_password_confirmation: "Confirmation nouveau mot de passe"
|
||||
password: Mot de passe
|
||||
password_confirmation: Confirmation mot de passe
|
||||
snippet:
|
||||
body: Code
|
||||
slug: Raccourci
|
||||
@ -90,6 +94,12 @@ fr:
|
||||
restricted_access: Activer ?
|
||||
access_login: Identifiant
|
||||
access_password: "Mot de passe"
|
||||
custom_fields:
|
||||
field:
|
||||
_alias: Alias
|
||||
hint: Aide
|
||||
required: Requis ?
|
||||
text_formatting: Formattage
|
||||
|
||||
pagination:
|
||||
previous: "« Précédent"
|
||||
|
@ -50,9 +50,9 @@ pt-BR:
|
||||
title: "Página não encontrada"
|
||||
body: "Conteúdo da página de erro 404"
|
||||
other:
|
||||
body: "Conteúdo vai aqui"
|
||||
body: "{% extends 'parent' %}"
|
||||
|
||||
activemodel:
|
||||
mongoid:
|
||||
attributes:
|
||||
page:
|
||||
title: Título
|
||||
@ -79,8 +79,8 @@ pt-BR:
|
||||
email: Email
|
||||
name: Nome
|
||||
language: Lingugaem
|
||||
new_password: "Nova senha"
|
||||
new_password_confirmation: "Confirmação da nova senha"
|
||||
password: Senha
|
||||
password_confirmation: Confirmação da senha
|
||||
snippet:
|
||||
body: Código
|
||||
slug: slug
|
||||
@ -211,4 +211,3 @@ pt-BR:
|
||||
words_connector: ", "
|
||||
two_words_connector: " e "
|
||||
last_word_connector: " e "
|
||||
|
@ -37,6 +37,10 @@ de:
|
||||
reset: Webseite zurücksetzen
|
||||
content_type:
|
||||
api_accounts: Benachrichtigte Accounts
|
||||
account:
|
||||
edit:
|
||||
password: "Neues Passwort"
|
||||
password_confirmation: "Bestätigung des neuen Passworts"
|
||||
|
||||
hints:
|
||||
page:
|
||||
|
@ -2,6 +2,7 @@ en:
|
||||
formtastic:
|
||||
titles:
|
||||
information: General information
|
||||
advanced_options: Advanced options
|
||||
meta: SEO Metadata
|
||||
code: Code
|
||||
raw_template: Template
|
||||
@ -37,6 +38,10 @@ en:
|
||||
reset: Reset site
|
||||
content_type:
|
||||
api_accounts: Notified Accounts
|
||||
account:
|
||||
edit:
|
||||
password: New password
|
||||
password_confirmation: New password confirmation
|
||||
|
||||
hints:
|
||||
page:
|
||||
@ -55,6 +60,11 @@ en:
|
||||
slug: "You do not need to add the extension file (.css or .js)"
|
||||
edit:
|
||||
source: "You can replace it by a file of the same extension"
|
||||
asset:
|
||||
new:
|
||||
source: "All file types are accepted."
|
||||
edit:
|
||||
source: "The current file is available here %{url}"
|
||||
custom_fields:
|
||||
field:
|
||||
_alias: "Property available in liquid templates"
|
||||
|
@ -2,6 +2,7 @@ fr:
|
||||
formtastic:
|
||||
titles:
|
||||
information: Informations générales
|
||||
advanced_options: Options avancées
|
||||
meta: SEO Metadata
|
||||
code: Code
|
||||
raw_template: Gabarit
|
||||
@ -40,6 +41,10 @@ fr:
|
||||
reset: Remettre à zéro
|
||||
content_type:
|
||||
api_accounts: Comptes à notifier
|
||||
account:
|
||||
edit:
|
||||
password: Nouveau mot de passe
|
||||
password_confirmation: Confirmation nouveau mot de passe
|
||||
|
||||
hints:
|
||||
page:
|
||||
@ -58,6 +63,11 @@ fr:
|
||||
plain_text_name: "Vous n'avez pas besoin de mettre l'extension du fichier (.css ou .js)"
|
||||
edit:
|
||||
source: "Vous pouvez le remplacer par un fichier avec la meme extension."
|
||||
asset:
|
||||
new:
|
||||
source: "Tous les types de fichier sont acceptés."
|
||||
edit:
|
||||
source: "Le fichier actuel est accessible ici %{url}"
|
||||
custom_fields:
|
||||
field:
|
||||
_alias: "Champ utilisable dans les templates liquid"
|
||||
@ -67,5 +77,6 @@ fr:
|
||||
samples: "Si activé, les contenus et les média seront aussi copiés lors de l'import"
|
||||
reset: "Si activé, toutes les données de votre site seront détruites avant l'import du nouveau site"
|
||||
content_type:
|
||||
slug: Nom utilisé dans les templates liquid afin d'accéder aux enregistrements de ce modèle
|
||||
api_enabled: "Utilisé pour autoriser la création de nouvelles instances de l'extérieur (ex.: les messages dans un formulaire de contact)"
|
||||
api_accounts: "Un email de notification sera envoyé à chaque compte listé ci-dessus lors de la création d'une nouvelle instance"
|
||||
|
@ -37,6 +37,10 @@ pt-BR:
|
||||
reset: Reiniciar site
|
||||
content_type:
|
||||
api_accounts: Contas notificadas
|
||||
account:
|
||||
edit:
|
||||
password: Nova senha
|
||||
password_confirmation: Confirmação da nova senha
|
||||
|
||||
hints:
|
||||
page:
|
||||
|
35
doc/TODO
@ -1,27 +1,21 @@
|
||||
BOARD:
|
||||
|
||||
x pull requests #31 et #32
|
||||
- pull request #44
|
||||
- integrate new home
|
||||
- editable_elements: inheritable: false (Mattias) => seems to be fixed by Dirk's last pull request (#44)
|
||||
- duostack version
|
||||
- bugs
|
||||
- editable_elements slug becomes nil
|
||||
- uploading videos http://groups.google.com/group/carrierwave/browse_thread/thread/6e211d98f1ff4bc0/51717c2167695ca2?lnk=gst&q=version#51717c2167695ca2
|
||||
- editable_elements not updated (doesn't use index anymore)
|
||||
- custom_fields not deleted (doesn't use index anymore)
|
||||
- editable_elements: inheritable: false (Mattias)
|
||||
- 2 different sites on the same main domain (one in www, the other one in something else) (Raphael Costa)
|
||||
- seo section for the page form: seo title, seo keywords, seo description
|
||||
|
||||
BACKLOG:
|
||||
|
||||
|
||||
- validation for custom fields
|
||||
- new custom field types:
|
||||
- belongs_to => association
|
||||
|
||||
- custom_fields:
|
||||
- validation: regexp (pre-defined regexps ?)
|
||||
- new type: belongs_to => association
|
||||
- inline editing (http://www.aloha-editor.com/wiki/index.php/Aloha_PHP_Example)
|
||||
- html view in the aloha popup
|
||||
- editable elements should wrap a tag: div, h1, ...etc (default span)
|
||||
- edit images (upload new ones, ...etc) => wait for aloha or send them an email ?
|
||||
|
||||
- global regions: keyword in editable element (http://www.mongodb.org/display/DOCS/Updating)
|
||||
- write my first tutorial about locomotive
|
||||
- cucumber features for admin pages (in progress)
|
||||
@ -33,19 +27,18 @@ REFACTORING:
|
||||
|
||||
BUGS:
|
||||
|
||||
- custom fields: accepts_nested_attributes weird behaviour when creating new content type + adding random fields
|
||||
|
||||
NICE TO HAVE:
|
||||
- export site
|
||||
- asset collections: custom resizing if image
|
||||
- super_finder
|
||||
- better icons for mime type
|
||||
- traffic statistics
|
||||
- asset picker (content instance)
|
||||
- page with regexp url ?
|
||||
- automatic update !
|
||||
- page not found (front) => if logged in, link to create the page
|
||||
- switch to list (theme assets / assets ?). delete all in once (with checkbox) or see details (updated_at, size, ...etc)
|
||||
- resizing images on the fly
|
||||
- code completion ? http://blog.quplo.com/2010/06/common-sense-code-completion/
|
||||
|
||||
DONE:
|
||||
|
||||
@ -201,3 +194,13 @@ x moving to mongoid 2.0.0 rc.6
|
||||
x check the theme uploader
|
||||
x release new version of CustomFields, ActsAsTree gems
|
||||
x add metadata to sites
|
||||
x pull requests #31 et #32
|
||||
x password / new_password
|
||||
x bugs
|
||||
x custom_fields not deleted (doesn't use index anymore)
|
||||
? editable_elements slug becomes nil
|
||||
x editable_elements not updated (doesn't use index anymore)
|
||||
x uploading videos http://groups.google.com/group/carrierwave/browse_thread/thread/6e211d98f1ff4bc0/51717c2167695ca2?lnk=gst&q=version#51717c2167695ca2
|
||||
x custom fields: accepts_nested_attributes weird behaviour when creating new content type + adding random fields
|
||||
x better icons for mime type (css3)
|
||||
x validation for custom fields: required done
|
@ -56,6 +56,10 @@ module Locomotive
|
||||
|
||||
# Devise
|
||||
Devise.mailer_sender = self.config.mailer_sender
|
||||
|
||||
# Load all the dynamic classes (custom fields)
|
||||
ContentType.all.collect(&:fetch_content_klass)
|
||||
AssetCollection.all.collect(&:fetch_asset_klass)
|
||||
end
|
||||
|
||||
def self.logger(message)
|
||||
|
@ -25,6 +25,8 @@ $:.unshift File.dirname(__FILE__)
|
||||
module Locomotive
|
||||
class Engine < Rails::Engine
|
||||
|
||||
config.autoload_once_paths += %W( #{config.root}/app/controllers #{config.root}/app/models #{config.root}/app/helpers #{config.root}/app/uploaders)
|
||||
|
||||
rake_tasks do
|
||||
load "railties/tasks.rake"
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
module Locomotive #:nodoc
|
||||
VERSION = "1.0.0.beta.2"
|
||||
VERSION = "1.0.0.beta.3"
|
||||
end
|
||||
|
@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
||||
s.required_rubygems_version = ">= 1.3.6"
|
||||
s.rubyforge_project = "nowarning"
|
||||
|
||||
s.add_dependency "rails", ">= 3.0.4"
|
||||
s.add_dependency "rails", ">= 3.0.5"
|
||||
s.add_dependency "warden"
|
||||
s.add_dependency "devise", "1.1.3"
|
||||
s.add_dependency "mongoid", "~> 2.0.0.rc.7"
|
||||
@ -31,10 +31,10 @@ Gem::Specification.new do |s|
|
||||
s.add_dependency "inherited_resources", "~> 1.1.2"
|
||||
|
||||
s.add_dependency "rmagick", "2.12.2"
|
||||
s.add_dependency "locomotive_carrierwave", "0.5.0.1.beta2"
|
||||
s.add_dependency "locomotive_carrierwave", "0.5.0.1.beta3"
|
||||
|
||||
s.add_dependency "custom_fields", "1.0.0.beta.4"
|
||||
s.add_dependency "fog", "0.5.3"
|
||||
s.add_dependency "custom_fields", "1.0.0.beta.5"
|
||||
s.add_dependency "fog", "0.3.7"
|
||||
s.add_dependency "mimetype-fu"
|
||||
s.add_dependency "actionmailer-with-request"
|
||||
s.add_dependency "heroku"
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 11 KiB |