translations are html safe (xss)

This commit is contained in:
dinedine 2010-07-22 01:56:42 +02:00
parent 35e0120cab
commit d632a5363c
44 changed files with 172 additions and 172 deletions

View File

@ -3,7 +3,7 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @account, :url => admin_accounts_url do |f|
@ -12,11 +12,11 @@
= 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
= render 'admin/shared/form_actions', :back_url => edit_admin_current_site_url, :button_label => :create

View File

@ -7,27 +7,27 @@
- content_for :submenu do
= render 'admin/shared/menu/assets'
%p= t('.help')
%p!= t('.help')
- content_for :buttons do
= admin_button_tag :add_asset, new_admin_asset_url(@asset_collection), :class => 'new'
%p.no-items{ :style => "#{'display: none' unless @asset_collection.assets.empty? }" }
= t('.no_items', :url => new_admin_asset_url(@asset_collection))
!= t('.no_items', :url => new_admin_asset_url(@asset_collection))
%ul#assets.assets.sortable
= render :partial => 'asset', :collection => @asset_collection.ordered_assets
%li.clear
= semantic_form_for @asset_collection, :url => admin_asset_collection_url(@asset_collection), :html => { :multipart => true } do |f|
= f.hidden_field :assets_order
= f.foldable_inputs :name => :options do
= f.input :name
= f.input :slug, :required => false
= render 'admin/custom_fields/index', :form => f, :collection_name => 'assets'
= render 'admin/shared/form_actions', :delete_button => link_to(content_tag(:em, escape_once(' ')) + t('.destroy'), admin_asset_collection_url(@asset_collection), :confirm => t('admin.messages.confirm'), :method => :delete, :class => 'button small remove'), :button_label => :update
= render 'admin/custom_fields/edit_field'

View File

@ -3,6 +3,6 @@
- content_for :submenu do
= render 'admin/shared/menu/assets'
%p= t('.help')
%p!= t('.help')
%p.no-items= t('.no_items', :url => new_admin_asset_collection_url)
%p.no-items!= t('.no_items', :url => new_admin_asset_collection_url)

View File

@ -6,12 +6,12 @@
- content_for :submenu do
= render 'admin/shared/menu/assets'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @asset_collection, :url => admin_asset_collections_url do |f|
= f.inputs :name => :information do
= f.input :name
= f.input :slug, :required => false
= render 'admin/shared/form_actions', :back_url => admin_asset_collections_url, :button_label => :create

View File

@ -6,7 +6,7 @@
- content_for :buttons do
= admin_button_tag t('admin.asset_collections.edit.add_asset'), new_admin_asset_url(@asset_collection), :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @asset, :url => admin_asset_url(@asset_collection, @asset), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form|

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/assets'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @asset, :url => admin_assets_url(@asset_collection), :html => { :multipart => true } do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => edit_admin_asset_collection_url(@asset_collection), :button_label => :create

View File

@ -7,12 +7,12 @@
= admin_button_tag :show_items, admin_contents_url(@content_type.slug), :class => 'show'
= admin_button_tag :new_item, new_admin_content_url(@content_type.slug), :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @content_type, :url => admin_content_type_url(@content_type) do |f|
= render 'form', :f => f
= render 'admin/shared/form_actions', :back_url => admin_contents_url(@content_type.slug), :button_label => :update
= render 'admin/custom_fields/edit_field'

View File

@ -6,12 +6,12 @@
- content_for :submenu do
= render 'admin/shared/menu/contents'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @content_type, :url => admin_content_types_url do |f|
= render 'form', :f => f
= render 'admin/shared/form_actions', :back_url => admin_pages_url, :button_label => :create
= render 'admin/custom_fields/edit_field'

View File

@ -1,5 +1,5 @@
- if contents.empty?
%p.no-items= t('.no_items', :url => new_admin_content_url(@content_type.slug))
%p.no-items!= t('.no_items', :url => new_admin_content_url(@content_type.slug))
- else
%ul{ :id => 'contents-list', :class => "list #{'sortable' if @content_type.order_by == '_position_in_list'}" }
- contents.each do |content|
@ -9,7 +9,7 @@
= link_to content.send(@content_type.highlighted_field_name), edit_admin_content_path(@content_type.slug, content)
.more
%span
= t('admin.contents.index.updated_at')
!= t('admin.contents.index.updated_at')
= l content.updated_at, :format => :short rescue 'n/a'
= link_to image_tag('admin/list/icons/trash.png'), admin_content_path(@content_type.slug, content), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete

View File

@ -3,14 +3,14 @@
= f.foldable_inputs :name => :information, :style => "#{'display: none' unless @site.new_record?}" do
= f.input :name, :required => false
= f.foldable_inputs :name => :meta do
= f.input :meta_keywords
= f.input :meta_description
= f.foldable_inputs :name => :access_points, :class => 'editable-list off' do
= f.custom_input :subdomain, :css => 'path' do
%em
http://
@ -18,8 +18,8 @@
\.
%em
= application_domain
- @site.domains_without_subdomain.each_with_index do |name, index|
- @site.domains_without_subdomain.each_with_index do |name, index|
%li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
%em
http://
@ -28,7 +28,7 @@
= error_on_domain(@site, name)
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
%li.item.template
%em
http://
@ -37,8 +37,8 @@
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
%button{ :class => 'button light add', :type => 'button' }
%span= t('admin.buttons.new_item')
%span!= t('admin.buttons.new_item')
= f.foldable_inputs :name => :memberships, :class => 'memberships' do
- @site.memberships.each_with_index do |membership, index|
- account = membership.account
@ -47,4 +47,4 @@
%em= account.email
- if account != current_admin
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), admin_membership_url(membership), :class => 'remove first', :confirm => t('admin.messages.confirm'), :method => :delete
= link_to image_tag('admin/form/icons/trash.png'), admin_membership_url(membership), :class => 'remove first', :confirm => t('admin.messages.confirm'), :method => :delete

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag t('.new_membership'), new_admin_membership_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @site, :as => :current_site, :url => admin_current_site_url, :html => { :class => 'save-with-shortcut' } do |f|
= render 'form', :f => f
= render 'admin/shared/form_actions', :button_label => :update

View File

@ -3,7 +3,7 @@
= form.inputs :name => title || :attributes do
- form.object.custom_fields.each do |field|
- required = highlighted_field_name == field._name
- if field.string?
= form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
- elsif field.text?
@ -12,7 +12,7 @@
= form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
= form.select field._name.to_sym, field.ordered_category_items.collect { |item| [item.name, item.id] }
%button.button.light.edit-categories-link{ :type => 'button', :'data-url' => edit_admin_custom_field_path(parent.model_name.underscore, parent.slug, field) }
%span= t('.edit_categories')
%span!= t('.edit_categories')
- elsif field.boolean?
= form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
= form.check_box field._alias.to_sym
@ -27,5 +27,5 @@
= link_to File.basename(form.object.send(field._name).url), form.object.send(field._name).url
%span
 / 
= t('.delete_file')
!= t('.delete_file')
= form.check_box :"remove_#{field._name}"

View File

@ -1,6 +1,6 @@
.box-wrapper
#edit-custom-field
%h2= t('.title')
%h2!= t('.title')
= form_tag '#', :class => 'formtastic' do
= fields_for CustomFields::Field.new, :builder => Formtastic::SemanticFormHelper.builder do |g|

View File

@ -4,58 +4,58 @@
= 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|
= 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|
= form.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name', :_alias => ''), :child_index => '-1' do |g|
%li{ :class => 'item template' }
%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 => 'string label void'
—
%em
= 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')
%button{ :class => 'button light add', :type => 'button' }
%span= t('admin.buttons.new_item')
%span!= t('admin.buttons.new_item')

View File

@ -1,43 +1,43 @@
#edit-custom-field-category
.inner
%h2= t('.title')
%h2!= t('.title')
%p= t('.help')
%p!= t('.help')
= semantic_form_for @field, :as => :custom_field, :url => admin_custom_field_url(@parent.model_name.underscore, @parent.slug, @field) do |f|
= f.foldable_inputs :name => t('.collection_label'), :class => 'editable-list off' do
- @field.ordered_category_items.each do |item|
= f.fields_for :category_items, item, :child_index => item._index do |g|
= f.fields_for :category_items, item, :child_index => item._index do |g|
%li{ :class => "item added #{'error' unless item.errors.empty?}"}
%span.handle
= image_tag 'admin/form/icons/drag.png'
= g.hidden_field :position, :class => 'position'
= g.text_field :name
 
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
= f.fields_for :category_items, @field.category_items.build, :child_index => '-1' do |g|
= f.fields_for :category_items, @field.category_items.build, :child_index => '-1' do |g|
%li{ :class => 'item template' }
%span.handle
= image_tag 'admin/form/icons/drag.png'
= g.hidden_field :position, :class => 'position'
= g.text_field :name, :class => 'string name'
 
%span.actions
= 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')
%span!= t('admin.buttons.new_item')
.popup-actions
%p
%button.button.light{ :type => 'button' }
%span= t('admin.shared.form_actions.update')
%span!= t('admin.shared.form_actions.update')

View File

@ -1,7 +1,7 @@
%li
%strong= link_to layout.name, edit_admin_layout_path(layout)
.more
%span= t('.updated_at')
%span!= t('.updated_at')
= l layout.updated_at, :format => :short
= link_to image_tag('admin/list/icons/trash.png'), admin_layout_path(layout), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag :new, new_admin_layout_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @layout, :url => admin_layout_url(@layout), :html => { :class => 'save-with-shortcut' } do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_layouts_url, :button_label => :update
= render 'admin/shared/form_actions', :back_url => admin_layouts_url, :button_label => :update

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag :new, new_admin_layout_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
- if @layouts.empty?
%p.no-items= t('.no_items', :url => new_admin_layout_url)
%p.no-items!= t('.no_items', :url => new_admin_layout_url)
- else
%ul#layouts-list.list
= render @layouts

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @layout, :url => admin_layouts_url do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_layouts_url, :button_label => :create

View File

@ -1,8 +1,8 @@
%p
= t('admin.mailer.common.hello')
!= t('admin.mailer.common.hello')
= @resource.email
\!
%p
= t('.you_can_confirm_your_account_through_the_link_below')
!= t('.you_can_confirm_your_account_through_the_link_below')
%p
= link_to t('.confirm_my_account'), confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)

View File

@ -1,12 +1,12 @@
%p
= t('admin.mailer.common.hello')
!= t('admin.mailer.common.hello')
= @resource.email
\!
%p
= t('.reset_password_instruction')
!= t('.reset_password_instruction')
%p
= link_to t('.change_my_password'), edit_admin_password_url(@resource, :reset_password_token => @resource.reset_password_token)
%p
= t('.wrong_request_instruction')
!= t('.wrong_request_instruction')
%p
= t('.unchange_password_message')
!= t('.unchange_password_message')

View File

@ -1,10 +1,10 @@
%p
= t('admin.mailer.common.hello')
!= t('admin.mailer.common.hello')
= @resource.email
\!
%p
= t('.locked_account_message')
!= t('.locked_account_message')
%p
= t('.unlock_account_instruction')
!= t('.unlock_account_instruction')
%p
= link_to t('.unlock_my_account'), unlock_url(@resource, :unlock_token => @resource.unlock_token)

View File

@ -3,13 +3,13 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @membership, :url => admin_memberships_url do |f|
= f.inputs :name => :membership_email, :class => 'inputs email' do
= f.custom_input :email, { :css => 'string full', :with_label => false } do
= f.text_field :email
= render 'admin/shared/form_actions', :back_url => edit_admin_current_site_url, :button_label => :create

View File

@ -9,17 +9,17 @@
- content_for :buttons do
= admin_button_tag t('.new_site'), new_admin_site_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @account, :as => :my_account, :url => admin_my_account_url, :html => { :class => 'save-with-shortcut' } do |f|
= f.foldable_inputs :name => :information, :style => 'display: none' do
= f.input :name
= f.foldable_inputs :name => :credentials do
= f.input :email
= f.custom_input :password, :label => :new_password do
= f.password_field :password
= f.password_field :password
= f.custom_input :password_confirmation, :label => :new_password_confirmation do
= f.password_field :password_confirmation
@ -28,11 +28,11 @@
%li{ :class => 'item' }
%strong= link_to site.name, main_site_url(site, :uri => true)
%em= site.domains.join(', ')
- if admin_on?(site) && site != current_site
%span{ :class => 'actions' }
= link_to image_tag('admin/form/icons/trash.png'), admin_site_url(site), :class => 'remove first', :confirm => t('admin.messages.confirm'), :method => :delete
= f.foldable_inputs :name => :language, :class => 'language' do
= f.custom_input :language, { :css => 'full', :with_label => false } do
- Locomotive.config.locales.each do |locale|
@ -41,5 +41,5 @@
= f.radio_button :locale, locale
 
= t(".#{locale}")
= render 'admin/shared/form_actions', :button_label => :update

View File

@ -3,14 +3,14 @@
= image_tag 'admin/list/icons/node_closed.png', :class => 'toggler'
%em
%strong= link_to truncate(page.title, :length => 80), edit_admin_page_url(page)
.more
%span= t('.updated_at')
.more
%span!= t('.updated_at')
= l page.updated_at, :format => :short
- if not page.index? and not page.not_found?
= link_to image_tag('admin/list/icons/trash.png'), admin_page_url(page), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete
- if not page.children.empty?
%ul{ :id => "folder-#{page._id}", :class => "folder depth-#{(page.depth || 0) + 1}", :data_url => sort_admin_page_url(page), :style => "display: #{cookies["folder-#{page._id}"] || 'block'}" }
= render page.children

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag :show, "/#{@page.fullpath}", :class => 'show'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @page, :url => admin_page_url(@page), :html => { :class => 'save-with-shortcut' } do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_pages_url, :button_label => :update

View File

@ -9,10 +9,10 @@
- content_for :buttons do
= admin_button_tag :new, new_admin_page_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
- if @pages.empty?
%p.no-items= t('.no_items', :url => new_admin_page_url)
%p.no-items!= t('.no_items', :url => new_admin_page_url)
- else
%ul#pages-list
= render @pages

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/contents'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @page, :url => admin_pages_url do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_pages_url, :button_label => :create

View File

@ -6,13 +6,13 @@
.inner
= login_flash_message
= f.inputs do
= f.input :password, :label => t('.password'), :required => false
= f.input :password_confirmation, :label => t('.password_confirmation'), :required => false
%p.link
= link_to t('.link'), new_admin_session_path
= link_to preserve(t('.link')), new_admin_session_path
.footer
= login_button_tag t('admin.buttons.change_password')

View File

@ -1,17 +1,17 @@
- title t('.title')
= semantic_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f|
= f.hidden_field :reset_password_token
.inner
= login_flash_message
= f.inputs do
= f.input :email, :label => t('.email'), :required => false
%p.link
= link_to t('.link'), new_admin_session_path
= link_to preserve(t('.link')), new_admin_session_path
.footer
= login_button_tag t('admin.buttons.send_password')

View File

@ -1,2 +1,2 @@
%p.tcenter
= preserve(t('.who_is_behind', :development => nocoffee_tag))
!= t('.who_is_behind', :development => nocoffee_tag)

View File

@ -1,7 +1,7 @@
%h1= link_to current_site.name, '#'
#global-actions-bar
= preserve(t('.welcome', :name => link_to(current_admin.name, edit_admin_my_account_url)))
!= t('.welcome', :name => link_to(current_admin.name, edit_admin_my_account_url))
%span= '|'
= link_to t('.see'), main_site_url
%span= '|'

View File

@ -3,7 +3,7 @@
.header
%p= link_to t('admin.pages.index.new'), new_admin_page_url
.inner
%h2= t('admin.pages.index.lastest_items')
%h2!= t('admin.pages.index.lastest_items')
%ul
- current_site.pages.latest_updated.each do |page|
%li
@ -16,12 +16,12 @@
.header
%p= link_to t('admin.contents.index.new'), new_admin_content_url(content_type.slug)
.inner
%h2= t('admin.contents.index.lastest_items')
%h2!= t('admin.contents.index.lastest_items')
%ul
- content_type.contents.latest_updated.each do |content|
%li
= link_to truncate(content.send(content_type.highlighted_field_name), :length => 30), edit_admin_content_path(content_type.slug, content)
%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

View File

@ -5,7 +5,7 @@
= f.input :name, :required => false
= f.foldable_inputs :name => :access_points, :class => 'editable-list off' do
= f.custom_input :subdomain, :css => 'path' do
%em
http://
@ -13,8 +13,8 @@
\.
%em
= application_domain
- @site.domains_without_subdomain.each_with_index do |name, index|
- @site.domains_without_subdomain.each_with_index do |name, index|
%li{ :class => "item added #{'last' if index == @site.domains.size - 1}"}
%em
http://
@ -23,7 +23,7 @@
= error_on_domain(@site, name)
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
%li.item.template
%em
http://
@ -32,4 +32,4 @@
%span.actions
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove first', :confirm => t('admin.messages.confirm')
%button{ :class => 'button light add', :type => 'button' }
%span= t('admin.buttons.new_item')
%span!= t('admin.buttons.new_item')

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @site, :url => admin_sites_url do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => edit_admin_my_account_url, :button_label => :create

View File

@ -1,7 +1,7 @@
%li
%strong= link_to snippet.name, edit_admin_snippet_path(snippet)
.more
%span= t('.updated_at')
%span!= t('.updated_at')
= l snippet.updated_at, :format => :short
= link_to image_tag('admin/list/icons/trash.png'), admin_snippet_path(snippet), :class => 'remove', :confirm => t('admin.messages.confirm'), :method => :delete

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag t('admin.snippets.index.new'), new_admin_snippet_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @snippet, :url => admin_snippet_url(@snippet), :html => { :class => 'save-with-shortcut' } do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_snippets_url, :button_label => :update
= render 'admin/shared/form_actions', :back_url => admin_snippets_url, :button_label => :update

View File

@ -6,10 +6,10 @@
- content_for :buttons do
= admin_button_tag :new, new_admin_snippet_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
- if @snippets.empty?
%p.no-items= t('.no_items', :url => new_admin_snippet_url)
%p.no-items!= t('.no_items', :url => new_admin_snippet_url)
- else
%ul#snippets-list.list
= render @snippets

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @snippet, :url => admin_snippets_url do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_snippets_url, :button_label => :create

View File

@ -10,27 +10,27 @@
- if @theme_asset.new_record? || @theme_asset.stylesheet_or_javascript?
%span.alt
= t('admin.theme_assets.form.choose_plain_text')
!= t('admin.theme_assets.form.choose_plain_text')
- if allow_plain_text_editing?(@theme_asset)
#text-selector{ :class => "selector #{'hidden' if !@theme_asset.performing_plain_text?}", :style => "#{'display: none' if !@theme_asset.performing_plain_text?}" }
= f.inputs :name => :code, :class => 'inputs code' do
- if @theme_asset.new_record?
= f.input :slug
= f.custom_input :content_type do
= f.select :content_type, ["stylesheet", "javascript"]
= f.custom_input :plain_text, :css => 'full', :with_label => false do
%code{ :class => (@theme_asset.size && @theme_asset.size > 40000 ? 'nude' : (@theme_asset.content_type || 'stylesheet')) }
= f.text_area :plain_text
.more
= link_to t('admin.image_picker.link'), admin_theme_assets_path, :id => 'image-picker-link'
%span.alt
= t('admin.theme_assets.form.choose_file')
!= t('admin.theme_assets.form.choose_file')
- if @theme_asset.image?
= f.foldable_inputs :name => "#{t('formtastic.titles.preview')} #{image_dimensions_and_size(@theme_asset)}", :class => 'preview' do
%li

View File

@ -6,7 +6,7 @@
- content_for :buttons do
= admin_button_tag t('admin.theme_assets.index.new'), new_admin_theme_asset_url, :class => 'new'
%p= t('.help', :url => @theme_asset.source.url)
%p!= t('.help', :url => @theme_asset.source.url)
= semantic_form_for @theme_asset, :url => admin_theme_asset_url(@theme_asset), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form|

View File

@ -1,15 +1,15 @@
#theme-images.asset-picker
%h2= t('.title')
%h2!= t('.title')
.actions
= admin_button_tag t('admin.theme_assets.index.new'), admin_theme_assets_url(:json), :class => 'button small add', :id => 'upload-link'
- if @image_assets.empty?
%p.no-items= t('.no_items')
%p.no-items!= t('.no_items')
%ul.assets
= render 'asset', :asset => current_site.theme_assets.build, :edit => false
= render :partial => 'asset', :collection => @image_assets, :locals => { :per_row => 3, :edit => false }
%li.clear

View File

@ -6,21 +6,21 @@
- content_for :buttons do
= admin_button_tag :new, new_admin_theme_asset_url, :class => 'new'
%p= t('.help')
%p!= t('.help')
%h3= t('.css_and_js')
%h3!= t('.css_and_js')
- if @non_image_assets.empty?
%p.no-items= t('.no_items', :url => new_admin_theme_asset_url)
%p.no-items!= t('.no_items', :url => new_admin_theme_asset_url)
- else
%ul.assets
= render :partial => 'asset', :collection => @non_image_assets
%li.clear
%br
%h3= t('.images')
%h3!= t('.images')
- if @image_assets.empty?
%p.no-items= t('.no_items', :url => new_admin_theme_asset_url)
%p.no-items!= t('.no_items', :url => new_admin_theme_asset_url)
- else
%ul.assets
= render :partial => 'asset', :collection => @image_assets
@ -30,7 +30,7 @@
- if not @flash_assets.empty?
%br
%h3= t('.flashes')
%h3!= t('.flashes')
%ul.assets
= render :partial => 'asset', :collection => @flash_assets
%li.clear

View File

@ -3,10 +3,10 @@
- content_for :submenu do
= render 'admin/shared/menu/settings'
%p= t('.help')
%p!= t('.help')
= semantic_form_for @theme_asset, :url => admin_theme_assets_url, :html => { :multipart => true } do |form|
= render 'form', :f => form
= render 'admin/shared/form_actions', :back_url => admin_theme_assets_url, :button_label => :create