<% 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/modal-preview" %>
  <%= javascript_include_tag "lib/file-type" %>
<% end %>
<%= f.error_messages %>
   <fieldset>           
            <!-- Input Area -->
            <div class="input-area">

              <!-- Module Tabs -->
              <div class="nav-name"><strong>Module</strong></div>
              <ul class="nav nav-pills module-nav">
                <li class="active">
                  <a href="#basic" data-toggle="tab">Basic</a>
                </li>
                <li>
                  <a href="#tag" data-toggle="tab">Tags</a>
                </li>
              </ul>

              <!-- Module -->
              <div class="tab-content module-area">

                <!-- Basic Module -->
                <div class="tab-pane fade in active" id="basic">

                  <!-- Category -->
                  <div class="control-group">
                    <label class="control-label muted">Category</label>
                    <div class="controls">
                     <%= f.select(:category_id, @categories.collect {|p| [ p.title, p.id ] }) %>
                    </div>
                  </div>

                </div>
 <!-- Tag Module -->
                <div class="tab-pane fade" id="tag">

                  <!-- Tag -->
                  <div class="control-group">
                    <label class="control-label muted">Tag</label>
                    <div class="controls" data-toggle="buttons-checkbox">
                      <%@tags.each do |tag|%>
                          <label class="checkbox inline btn <%= 'active' if @album.tag_ids.include?(tag.id) %>">
                            <%= check_box_tag 'album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
                            <%= tag.name %>
                          </label>
                      <%end %>
                    </div>
                  </div>

                </div>

              </div>
              <div class="nav-name"><strong>Language</strong></div>
                 <ul class="nav nav-pills language-nav">
                  <% @site_in_use_locales.each_with_index do |locale, i| %>
                      <li <%= (i == 0 ? 'class=active' : '') %>>
                        <a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
                      </li>
                   <% end %>
                </ul>
                <div class="tab-content language-area">
              <!-- Language Tabs -->
               
                 
                    <% @site_in_use_locales.each_with_index do |locale, i| %>

                         <div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
                          <div class="control-group input-title">
                            <%= f.fields_for :name_translations do |name| %>
                                <%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
                                <div class="controls">
                                   <%= name.text_field locale, :class => "input-block-level", :placeholder=>"Title",:value => (@album.name_translations[locale] rescue nil) %>
                                </div>
                             <% end %> 
                          </div>
                          <div class="control-group input-content">
                             <%= f.fields_for :description_translations do |desc| %>
                                 <%= label_tag(locale, t("gallery.album_desc"), :class=>"control-label muted") %>
                                <div class="controls">
                                  <div class="textarea">
                                    <%= desc.text_area locale, :class => "ckeditor input-block-level", :value => (@album.description_translations[locale] rescue nil)%>
                                  </div>
                                </div>
                            <% end %>
                          </div>
                        </div>
                    <% end %>
                           
              </div>
             
            </div>
            <!-- Form Actions -->
            <div class="form-actions">
              <%= f.submit t("gallery.save"), :class=> "btn btn-primary bt-form-save" %>
            </div>

          </fieldset>