<% # encoding: utf-8 %>
<% 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/datetimepicker/datetimepicker.js" %>
  <%= javascript_include_tag "lib/module-area" %>
<% end %>

<%= f.error_messages %>



<!-- Input Area -->
<div class="input-area">

  <!-- Language Tabs -->
  <div class="nav-name"><strong><%= t(:language) %></strong></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 %>"><%= I18nVariable.from_locale(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" : '' %>">

        <!-- Description -->
        <div class="control-group input-subtitle">
          <label class="control-label muted"><%= t('survey_b.description') %></label>
          <div class="controls">
            <div class="textarea">
              <%= f.fields_for :description_translations do |f| %>
                <%= f.text_area locale, rows: 7, class: "input-block-level", value: (@setting.description_translations[locale] rescue nil) %>
              <% end %>
            </div>
          </div>
        </div>

        <!-- Announcement -->
        <div class="control-group input-content">
          <label class="control-label muted"><%= t('survey_b.announcement') %></label>
          <div class="controls">
            <div class="textarea">
              <%= f.fields_for :announcement_translations do |f| %>
                <%= f.text_area locale, rows: 7, class: "input-block-level", :value => (@setting.announcement_translations[locale] rescue nil) %>
              <% end %>
            </div>
          </div>
        </div>

      </div>

    <% end %>
  </div>
</div>

<!-- Form Actions -->
<div class="form-actions">
  <%= f.submit t('submit'), class: 'btn btn-primary' %>
  <%= link_to t('cancel'), get_go_back, :class=>"btn" %>  
</div>
