personal-book/app/views/admin/books/_form_author.html.erb

39 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

<% if form_author.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<% else %>
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<% if form_author.name.present? %>
<%= form_author.name %>
<% end %>
<% end %>
<div class="input-prepend input-append">
<label>
<div class="span3 input-medium">
<span class="add-on icons-mail" title='<%= t(:email) %>'></span>
<%= f.email_field :email, placeholder: t(:email) %>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:name) %>'></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :name_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:name), :value => (form_author.name_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
</span>
<% if form_author.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>