ensl.org/app/views/movies/_form.html.erb

51 lines
1.6 KiB
Text
Raw Permalink Normal View History

2014-04-26 21:28:06 +00:00
<%= form_for @movie, html: { multipart: true, class: 'square' } do |f| %>
<%= render 'shared/errors', messages: @movie.errors.full_messages %>
2014-04-26 21:28:06 +00:00
<% if @movie.file %>
<%= link_to "View File", edit_data_file_path(@movie.file), class: 'button tiny' %>
<% end %>
2014-04-26 21:28:06 +00:00
<div class="fields horizontal">
<%= f.label :name %>
<%= f.text_field :name, { value: @movie.file.to_s } %>
</div>
<div class="fields horizontal">
<%= f.label :category_id %>
<%= f.select :category_id, Category.ordered.collect { |c| ["#{c.domains[c.domain]} - #{c}", c.id] } %>
</div>
<div class="fields horizontal">
<%= f.label :content %>
<%= f.text_field :content %>
</div>
<div class="fields horizontal">
<%= f.label :format %>
<%= f.text_field :format %>
</div>
<div class="fields horizontal">
<%= f.label :length, "Length in seconds" %>
<%= f.text_field :length %>
</div>
<div class="fields horizontal">
<%= f.label :user_name, "Author" %>
<%= f.text_field :user_name, { value: @movie.get_user } %>
</div>
<div class="fields horizontal">
<%= f.label :file %>
<div class="inputs">
<%= f.select :file_id, DataFile.movies.collect { |d| ["#{d.name}", d.id] }, { include_blank: true } %>
</div>
</div>
<div class="fields horizontal">
<%= f.label :preview_id %>
<%= f.select :preview_id, @movie.all_files.collect { |d| ["#{d.name}", d.id] }, { include_blank: true } %>
</div>
<div class="fields horizontal">
<%= f.label :picture %>
<%= f.file_field :picture %>
</div>
<div class="controls">
<%= f.submit 'Save' %>
</div>
<% end %>