engine/app/views/locomotive/theme_assets/index.html.haml

50 lines
2.3 KiB
Plaintext

- title t('.title')
- content_for :head do
= render 'asset'
= render 'list', :name => 'images', :title => t('.images'), :empty_message => t('.no_items', :url => new_theme_asset_url)
= render 'list', :name => 'media', :title => t('.media'), :empty_message => t('.no_items', :url => new_theme_asset_url)
- if can?(:manage, Locomotive::Snippet)
= render '/locomotive/snippets/snippet'
= render 'list', :name => 'snippets', :title => t('.snippets'), :empty_message => t('locomotive.snippets.index.no_items', :url => new_snippet_url)
- if can?(:manage, Locomotive::ThemeAsset)
= render 'list', :name => 'js_and_css', :title => t('.css_and_js'), :empty_message => t('.no_items', :url => new_theme_asset_url)
= render 'list', :name => 'fonts', :title => t('.fonts'), :empty_message => t('.no_items', :url => new_theme_asset_url)
- content_for :backbone_view_data do
:plain
snippets: #{can?(:manage, Locomotive::Snippet) ? @snippets.map { |snippet| snippet.to_presenter.as_json_for_html_view }.to_json : 'null'},
images: #{theme_assets_to_json(@assets[:images])},
media: #{theme_assets_to_json(@assets[:media])},
js_and_css_assets: #{can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@js_and_css_assets) : 'null'},
fonts: #{can?(:manage, Locomotive::ThemeAsset) ? theme_assets_to_json(@assets[:fonts]) : 'null'}
- content_for :submenu do
= render_cell 'locomotive/settings_menu', :show
- content_for :buttons do
- if can?(:manage, Locomotive::ThemeAsset)
= form_tag theme_assets_url(:json), :id => 'theme-assets-quick-upload', :class => 'quick-upload', :'data-sending-form-message' => t('locomotive.messages.sending_form') do
= file_field_tag 'theme_asset[source]', :multiple => 'multiple'
= local_action_button :quick_upload, '#', :class => 'new'
= local_action_button t('locomotive.snippets.index.new'), new_snippet_url, :class => 'new' if can?(:manage, Locomotive::Snippet)
= local_action_button :new, new_theme_asset_url, :class => 'new' if can?(:manage, Locomotive::ThemeAsset)
%p!= t('.help')
- if can?(:manage, Locomotive::Snippet)
#snippets-anchor
- if can?(:manage, Locomotive::ThemeAsset)
#js-and-css-anchor
#images-anchor
- if can?(:manage, Locomotive::ThemeAsset)
#fonts-anchor
#media-anchor