pagecontent/app/views/admin/page_contents/new.html.erb

40 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-05-06 09:20:15 +00:00
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<% end %>
<%= form_for @page_content, :url => {:action => :create}, :html => {:class => 'form-horizontal main-forms'} do |f| %>
<fieldset>
<div class="input-area">
2014-05-16 09:21:44 +00:00
<div class="nav-name"><strong><%= t(:language) %></strong></div>
2014-05-06 09:20:15 +00:00
<ul class="nav nav-pills language-nav">
2014-05-16 09:21:44 +00:00
<% @site_in_use_locales.each_with_index do |locale, i| %>
2014-05-06 09:20:15 +00:00
<li <%= (i == 0 ? 'class=active' : '') %>>
<a href=".<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
</li>
<% end %>
</ul>
<div class="tab-content language-area">
<!-- Language Tabs -->
2014-05-16 09:21:44 +00:00
<% @site_in_use_locales.each_with_index do |locale, i| %>
2014-05-06 09:20:15 +00:00
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
<div class="control-group input-content">
<%= f.fields_for :content_translations do |con| %>
2014-05-16 09:21:44 +00:00
<%= label_tag(locale, t(:content), :class=>"control-label muted") %>
2014-05-06 09:20:15 +00:00
<div class="controls">
<div class="textarea">
<%= con.text_area locale, :class => "ckeditor input-block-level", :value => (@page.page_contexts.last.content_translations[locale] rescue nil)%>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="form-actions">
<%= f.hidden_field :page_id, :value=>@page.id.to_s %>
2014-05-07 05:25:06 +00:00
<%= f.hidden_field :version, :value=>((@page.page_contexts.last.version + 1) rescue 1)%>
2014-05-16 09:21:44 +00:00
<%= f.submit t("save"), :class=> "btn btn-primary bt-form-save" %>
2014-05-06 09:20:15 +00:00
</div>
</div>
</fieldset>
<% end %>