e_paper/app/views/admin/topics/_form.html.erb

52 lines
1.7 KiB
Plaintext

<div class="input-area">
<input type="hidden" name="topic[paper_id]" value="<%= @paper.id.to_s %>">
<!-- Language Tabs -->
<div class="nav-name"></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>" id="title_<%= locale %>">
<div class="control-group">
<%= f.label :episode, t('e_paper.topic_name'), :class => "control-label muted" %>
<div class="controls">
<%= f.fields_for :episode_translations do |f| %>
<%= f.text_field locale, :class=>'input-block-level', :value => (@topic.episode_translations[locale.to_s] rescue nil) %>
<% end %>
</div>
</div>
<!-- Content -->
<div class="control-group input-content">
<label class="control-label muted"><%= t('e_paper.content') %> (<%= t(locale.to_s) %>)</label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :content_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@topic.content_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<input type="hidden" name="referer_url" value="<%= request.referer %>">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
</div>