Orbit/app/views/admin/assets/_form.html.erb

39 lines
1.5 KiB
Plaintext

<div class="control-group">
<label for="title" class="control-label"><%= t :title %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= content_tag :label do -%>
<div>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class => "input-large", :value => (@asset.title_translations[locale] rescue nil) %>
</div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= f.label :category, t(:category) %></label>
<div class="controls">
<%= f.select :asset_category_id, @asset_categories.collect{|t| [ t.title, t.id ]}, {}, :class => "input-large" %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t :tags %></label>
<div class="controls">
<% @tags.each do |tag| %>
<%= content_tag :label, :class => "checkbox inline" do -%>
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
<%= tag.name %>
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= f.label :data, t(:data) %></label>
<div class="controls">
<%= f.file_field :data, :class => 'upload' %>
</div>
</div>