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

105 lines
3.8 KiB
Plaintext
Raw Normal View History

2017-08-07 07:46:44 +00:00
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/file-type" %>
<% end %>
<fieldset>
2017-07-05 09:16:55 +00:00
<div class="input-area">
2017-08-07 07:46:44 +00:00
<!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li class="active">
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></a>
</li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="imageupload">
<div class="control-group">
<label class="control-label muted"><%= t(:image) %></label>
<div class="controls">
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @topic.image.file %>" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @topic.image.file %>
<%= image_tag @topic.image %>
<% else %>
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<span class="fileupload-exists"><%= t(:change) %></span>
<%= f.file_field :image %>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<%= f.check_box :remove_image %><%= t(:remove) %>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
2017-07-05 09:16:55 +00:00
<!-- Language Tabs -->
2017-08-07 07:46:44 +00:00
<div class="nav-name"><strong>Language</strong></div>
2017-07-05 09:16:55 +00:00
<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 %>">
2017-08-07 07:46:44 +00:00
<input type="hidden" name="topic[paper_id]" value="<%= @paper.id.to_s %>">
2017-07-05 09:16:55 +00:00
<%= f.submit t('submit'), class: 'btn btn-primary' %>
2017-08-07 07:46:44 +00:00
</div>
</fieldset>