Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/admin/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def add_bucket
def clear_bucket
session[:bucket] = nil
render :update do |page|
page[:bucket_list].replace_html '<li><p class="note"><em>Your bucket is empty.</em></p></li>'
page[:bucket_list].replace_html "<li><p class='note'>#{I18n.t('bucket.empty')}<em></em></p></li>"
end
end

Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/assets/_asset.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
= link_to image_tag(asset.thumbnail(:thumbnail)), asset.thumbnail, :onclick => "return false;", :class => "bucket_link", :title => asset.title
.info{ :id => "#{dom_id}_info" }
%strong
= link_to image_tag('/images/assets/edit.png'), edit_admin_asset_path(asset), :class => "edit_asset", :title => "Edit #{asset.title}"
= link_to image_tag('/images/assets/edit.png'), edit_admin_asset_path(asset), :class => "edit_asset", :title => "#{t('buttons.hints.edit')} #{asset.title}"
- if @page
= link_to_remote image_tag('/images/assets/delete.png'), :html => { :class => "remove_asset", :title => "Remove from page" }, :url => remove_page_asset_url(:asset => asset.id, :page => @page.id), |
= link_to_remote image_tag('/images/assets/delete.png'), :html => { :class => "remove_asset", :title => t('buttons.hints.remove') }, :url => remove_page_asset_url(:asset => asset.id, :page => @page.id), |
:confirm => "Are you sure you want to remove this asset from the page?", |
:after => "Effect.Fade('#{dom_id}', { duration: 0.5 })", :complete => "Element.remove('#{dom_id}'); Element.highlight('assets')" |
= image_tag "/images/assets/reorder_assets.png", :class => "reorder", :title => "Reorder"
= image_tag "/images/assets/reorder_assets.png", :class => "reorder", :title => t('buttons.hints.reorder')
%script


Expand Down
8 changes: 4 additions & 4 deletions app/views/admin/assets/_asset_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
%tr
- render_region :thead do |thead|
- thead.thumbnail_header do
%th.asset Asset
%th.asset= t('asset')
- thead.title_header do
%th.asset-title Title
%th.asset-title= t('assets_views.title')
- thead.content_type_header do
%th.content_type Type
%th.content_type= t('assets_views.type')
- thead.modify_header do
%th.modify{ :colspan =>"2"} Modify
%th.modify{ :colspan =>"2"}= t('assets_views.modify')

%tbody
- unless assets.empty?
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/assets/_assets_bucket.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
= render :partial => "/admin/assets/assets_container"

#close-link
= link_to "Close", "#"
= link_to t('links.close'), "#"
24 changes: 11 additions & 13 deletions app/views/admin/assets/_assets_container.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
- render_region :asset_tabs do |asset_tabs|
- if @page && [email protected]_record?
- asset_tabs.attachment_tab do
%a.asset-tab{ :href => "#page-attachments", :id => "tab_page-attachments" } Attached Assets
%a.asset-tab{ :href => "#page-attachments", :id => "tab_page-attachments" }= t('assets_views.attached_assets')
- asset_tabs.upload_tab do
%a.asset-tab{ :href => "#upload-assets", :id => "tab_upload-assets" } Upload
%a.asset-tab{ :href => "#upload-assets", :id => "tab_upload-assets" }= t('assets_views.upload')
- asset_tabs.bucket_tab do
%a.asset-tab{ :href => "#bucket", :id => "tab_bucket" } Bucket
%a.asset-tab{ :href => "#bucket", :id => "tab_bucket" }= t('bucket.name')
- asset_tabs.search_tab do
%a.asset-tab{ :href => "#search-assets" } Search
%a.asset-tab{ :href => "#search-assets" }= t('buttons.search')
- else
- asset_tabs.bucket_tab do
%a.asset-tab.here{ :href => "#" } Bucket
%a.asset-tab.here{ :href => "#" }= t('bucket.name')

#assets
#bucket.pane
- render_region :bucket_pane do |bucket_pane|
- bucket_pane.bucket_notes do
%p
%span.note The Bucket provides temporary storage for your items. You can use it to place items in your pages or snippets.
%span.note= t('bucket.info')
%span#clear-bucket
= link_to_remote('Clear Bucket', {:url => clear_bucket_url} )
= link_to_remote(t('bucket.clear'), {:url => clear_bucket_url} )
- bucket_pane.bucket do
= render :partial => "admin/assets/bucket"
- bucket_pane.bucket_bottom do
Expand All @@ -39,28 +39,26 @@
- asset_panes.page_attachments do
#page-attachments.pane
%p
%span.note
Attached assets. These can be inserted with drag and drop
or shown with the <code>&lt;r:assets:each /&gt;</code> tag.
%span.note= t('assets_views.attached_assets_info')
%ul#attachments
= render :partial => "admin/assets/page_assets"
.clear

- asset_panes.upload do
#upload-assets.pane
%p
%span.note Assets uploaded here will be automatically associated with this page.
%span.note= t('assets_views.upload_info')
= render :partial => "admin/assets/upload_to_page"
.clear

- asset_panes.search do
#search-assets.pane
- form_tag do
%p
%label.note{ :for => 'search' } Search for assets
%label.note{ :for => 'search' }= t('assets_views.search_info')
%input{ :type => "hidden", :name => "search", :value => @page.id }
%input{ :type => "search", :id => "search", :name => "search" }
= submit_tag "Search"
= submit_tag t('buttons.search')
#search-results
.clear
= observe_field 'search', :frequency => 1, :update => 'search-results', :url => admin_assets_path(:asset_page => @page), :method => 'get', :with => "'search=' + escape(value)"
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/assets/_bucket.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
= render :partial => 'admin/assets/bucket_asset', :locals => { :asset_url => url, :asset_id => info[:id], :asset_type => info[:type], :asset_title => info[:title], :asset_thumbnail =>info[:thumbnail], :page => @page }
- else
%li
%p.note Your bucket is empty
%p.note= t('bucket.empty')



8 changes: 4 additions & 4 deletions app/views/admin/assets/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
- render_region :form do |form|
- form.edit_title do
%p.title
%label{ :for => "asset_title" } Title
%label{ :for => "asset_title" }= t('assets_views.title')
= f.text_field :title, :class => 'textbox', :maxlength => 100
- form.edit_metadata do
#extended-metadata{ :class => "row", :style => "display: none" }
%table.fieldset{ :cellpadding => "0", :cellspacing => "0", :border => "0" }
%tr
%td.label
%label{ :for => "asset_caption" } Caption
%label{ :for => "asset_caption" }= t('assets_views.caption')
%td.field
= f.text_field :caption, :class => 'textbox', :maxlength => 255
= render_region :extended_metadata
%p
%small
%a{ :id => "more-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;" } More
%a{ :id => "less-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;", :style => "display: none" } Less
%a{ :id => "more-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;" }= t('links.more')
%a{ :id => "less-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;", :style => "display: none" }= t('links.less')

2 changes: 1 addition & 1 deletion app/views/admin/assets/_show_bucket_link.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- unless @page.new_record?
#show-bucket
= link_to "Show Assets Bucket", "#"
= link_to t('assets_views.show_bucket'), "#"
4 changes: 2 additions & 2 deletions app/views/admin/assets/_upload_to_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#upload-form
- form_for :asset, :url => admin_assets_path(:page => @page, :format => 'js'), :html => { :id => 'asset-upload', :method => "post", :multipart => true, :target => 'ulframe' } do |form|
%div.file
%label.upload Choose a file to upload
%label.upload= t('assets_views.choose_file')
= form.file_field :asset, :class => "", :style => "width: 100%"

.upload-buttons
= form.submit "Save and Upload", :class => "button"
= form.submit t('buttons.upload'), :class => "button"
%div.spinner

%iframe{ :id => 'ulframe', :name => "ulframe", :src => "about:blank"}
Expand Down
20 changes: 10 additions & 10 deletions app/views/admin/assets/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- render_region :main do |main|
- main.edit_header do
%h1= "Edit Asset"
%h1= t('assets_views.edit_asset')

- main.edit_form do
- form_for :asset, :url => admin_asset_path(@asset), :html => { :method => "put", :multipart => true } do |f|
Expand All @@ -12,7 +12,7 @@

%p.content
%label.filename
= "Filename: #{@asset.asset_file_name unless @asset.new_record?}"
= "#{t('assets_views.filename')}: #{@asset.asset_file_name unless @asset.new_record?}"
.asset
- if @asset.image?
= image_tag @asset.thumbnail(Radiant::Config['assets.display_size'].to_sym)
Expand All @@ -21,29 +21,29 @@
= updated_stamp @asset

%p.upload
%label.upload Replace File
%label.upload= t('assets_views.replace_file')
= f.file_field :asset, :class => "", :style => "width: 100%"

%p.buttons
= save_model_button(@asset)
= save_model_and_continue_editing_button(@asset)
or
= link_to_remote 'Add asset to Bucket', :url => add_bucket_path(:id => @asset)
or
= link_to "Cancel", admin_assets_path
= t('assets_views.or')
= link_to_remote t('links.add_to_bucket'), :url => add_bucket_path(:id => @asset)
= t('assets_views.or')
= link_to t('links.cancel'), admin_assets_path

- main.assets_container do
= render :partial => 'assets_container'

- main.edit_regenerate do
- if current_user.admin? or current_user.developer?
%p
You can regenerate the asset thumbnails here. Beware that this will take a while and consume considerable resources on your server.

= t('bucket.regenerate_info')
- form_tag refresh_admin_assets_path do
%p.asset-buttons
%input{ :type => "hidden", :name => "id", :value => @asset.id }
%input.button{ :type => "submit", :value => "Regenerate" }
%input.button{ :type => "submit", :value => t('buttons.regenerate') }



Expand Down
27 changes: 14 additions & 13 deletions app/views/admin/assets/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@

- render_region :preamble do |preamble|
- preamble.header do
%h1 Assets
%h1= t('assets')

- preamble.explanation do
%p
Assets and images can be uploaded and then attached or inserted into pages, snippets and layouts.
Click on a asset name below to edit it or click <code>Remove</code> to delete it.

%p= t('assets_views.info')
- preamble.new_button do
%p= link_to image_tag('assets/new-asset.png', :alt => 'New Asset'), new_admin_asset_path

- preamble.filters do
%p
- form_tag(admin_assets_path,:id => 'filesearchform', :method => 'get') do
%span
= link_to "Images", "#"
= link_to t("assets_views.types.images"), "#"
|
%span
= link_to "Others", "#"
= link_to t("assets_views.types.audio"), "#"
|
%span
= link_to "Audio", "#"
= link_to t("assets_views.types.movies"), "#"
|
%span
= link_to "Movies", "#"
= link_to t("assets_views.types.others"), "#"
|

#type_boxes{ :style => "display: none" }
= check_box_tag 'filter[audio]', '1', false, :id => 'audio-check'
Expand All @@ -33,7 +34,7 @@

%label Search
%input{ :type => "search", :id => "search", :name => "search" , :value => params[:search] }
= submit_tag "Search"
= submit_tag t('buttons.search')
= observe_field 'search', :frequency => 1, :update => 'assets_table', :url => { :controller => 'assets', :action=> 'index' }, :method => 'get', :with => "'search=' + escape(value)"

#assets_table
Expand All @@ -44,7 +45,7 @@
- render_region :bottom do |bottom|
- bottom.regenerate do
- if current_user.admin?
%p
You can regenerate all thumbnails here. Beware that this will take a while and consume considerable resources on your server.
%p
= t('bucket.regenerate_info')
- form_tag refresh_admin_assets_path do
%input.button{ :type => "submit", :value => "Regenerate" }
%input.button{ :type => "submit", :value => t('buttons.regenerate') }
9 changes: 3 additions & 6 deletions app/views/admin/assets/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

- render_region :main do |main|
- main.edit_header do
%h1= "New Asset"
%p
Choose an asset to upload here. If the <code>Title</code> field is left blank, the filename (without the file type) will be automatically added.
By clicking on <code>More</code>, you can add a caption as well.

%h1= "#{t('assets_views.new')} #{t('asset')}"
%p= t('assets_views.new_info')
- main.edit_form do
- form_for :asset, :url => admin_assets_path, :html => { :method => "post", :multipart => true } do |f|
.form-area
= render :partial => "form", :locals => { :f => f }

%p.upload
%label.upload Choose a file to upload
%label.upload= t('assets_views.file_upload_info')
= f.file_field :asset, :class => "", :style => "width: 100%"

%p.buttons
Expand Down
15 changes: 6 additions & 9 deletions app/views/admin/assets/remove.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
table td.asset { vertical-align: top; font-weight: bold; }


%h1 Remove Asset
%p
Are you sure you want to
%strong.warning permanently remove
the following asset?

%h1= t('assets_views.remove_asset')
%p= t('assets_views.remove_info')

%table#site-map.index{ :cellpadding => "0", :cellspacing => "0", :border => "0" }
%tbody
%tr.node.level-1{ :onmouseover => "Element.addClassName(this, 'highlight');", :onmouseout => "Element.removeClassName(this, 'highlight');" }
Expand All @@ -18,6 +15,6 @@

- form_for [:admin, @asset], :html => { :method => 'delete' } do
%p.buttons
%input.button{ :type => "submit", :value => "Delete Asset" }
or
= link_to 'Cancel', admin_assets_path
%input.button{ :type => "submit", :value => "#{t('buttons.delete_asset')}" }
= t('assets_views.or')
= link_to t('links.cancel'), admin_assets_path
53 changes: 53 additions & 0 deletions lib/locale/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
de:
assets: Anlagen
asset: Anlage
assets_views:
attached_assets: Zugeordnete Anlagen
attached_assets_info: Zugeordnete Anlagen. Diese können per Drag & Drop oder mit dem <code> r:assets:each </code>-Tag eingefügt werden.
caption: Beschriftung
choose_file: Bitte Datei auswählen
edit_asset: Anlage bearbeiten
file_upload_info: Wählen Sie eine Datei aus
filename: Dateiname
info: "Anlagen und Bilder können hier hochgeladen und dann in die Seiten, Snippets und Layouts eingefügt werden. Klicken Sie auf einen Anlagen-Namen um sie zu bearbeiten oder klicken Sie auf <code>Entfernen</code>, um sie zu löschen."
modify:
new: Neue
new_info: Wählen Sie eine Anlage, welche Sie hochladen möchten, hier aus. Wenn das <code>Titel</code> Feld leer bleibt, wird der Dateiname (ohne den Datei-Typ) automatisch hinzugefügt. Mit einem Klick auf <code>Mehr</code> können Sie eine Bildunterschrift hinzufügen.
name: Anlagen
or: oder
remove_asset: Anlage löschen
remove_info: Sind Sie sich sicher, dass Sie die Anlage <strong class='warning'>vollständig entfernen</strong> wollen?
replace_file: Datei ersetzen
search_info: Suche nach Anlagen
show_bucket: Anlagen-Merkliste zeigen
title: Titel
type: Typ
types:
images: Bilder
audio: Audio
movies: Video
others: Andere
upload: Hochladen
upload_info: Hier hochgeladene Anlagen, werden automatisch mit der Seite verknüpft.
bucket:
clear: "Merkliste löschen"
empty: Ihre Merkliste ist leer.
info: Die Merkliste ist für die vorübergehende Speicherung ihre Anlagen. Sie können sie verwenden, um Anlagen in ihre Seiten oder Snippets einzufügen.
name: Merkliste
regenerate_info: Sie können alle Thumbnails hier neu generieren. Beachten Sie, dass dies eine Weile dauern kann.
buttons:
search: Suchen
delete_asset: Anlage löschen
hints:
edit: Bearbeite
remove: Zuordnung entfernen
reorder: Sortierung ändern
regenerate: neu generieren
upload: Hochladen
links:
add_to_bucket: zu Merkliste hinzufügen
cancel: abbrechen
close: Schließen
less: Verbergen
more: Mehr
Loading