
<%= stylesheet_link_tag "gallery" %>

<div id="orbit_gallery" class="rg">
  <div class="rgbody">
    <div id="imgholder">

    </div>
  </div>
  <!-- tag part -->
  <div id="tag_panel" class="my_scroll">
    <div class="scrollbar">
      <div class="track">
        <div class="thumb">
          <div class="end"></div>
        </div>
      </div>
    </div>
     <% 
        @locales = Array.new
        @site_valid_locales.each do |locale|
          @locales << locale
        end
      %>
    <div class="viewport">
      <div class="overview">
        <ul class="tag_list" id="gallery_tag_list">
          <% if @authenticated %>
          <% @tags.each do |tag| %>
             <li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
          <% end %>
          <% end %>
        </ul>
      </div>
    </div>
    <% if @authenticated %>
     <div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
    <% end %>
    
  </div>
  
  <script type="text/javascript">
      var $tag_panel = $('#tag_panel');
          orbit_bar_height = $('#orbit-bar').outerHeight();
          action_panel_height = $('.form-actions').outerHeight();
          window_height = $(window).height();

      
      $tag_panel.height( window_height - orbit_bar_height - 90 );
      $tag_panel.tinyscrollbar();

      $(window).resize(function(){
        $tag_panel.tinyscrollbar_update('relative');
        $tag_panel.height( $(window).height() - orbit_bar_height - 90 );
      });

      
  </script>
  <!-- tag end -->
  <div class="form-actions form-fixed pagination-right rghead">
    <div class="rgfn">
   		<a class="bt-back btn btn-primary pull-left" title="<%= I18n.t("gallery.back_to_albums") %>" href="<%= panel_gallery_back_end_albums_path %>"><i class="icon-arrow-left icon-white"></i><%= I18n.t("gallery.back_to_albums") %></a>
       <a class="bt-tag btn btn-primary pull-right" title="<%= I18n.t("gallery.album_tag") %>" href="" ><i class="icon-tag icon-white"></i><%= I18n.t("gallery.album_tag") %></	a>
      <% if @authenticated %>
       <a class="bt-add btn btn-primary pull-right" title="<%= I18n.t("gallery.add_images") %>" href="images" onclick="return false;"><i class="icon-plus icon-white"></i><%= I18n.t("gallery.add_images") %></a>
        <a class="bt-del btn btn-primary pull-right" title="<%= I18n.t("gallery.del_album") %>" href="delete" onclick="return false;"><i class="icon-trash icon-white"></i><%= I18n.t("gallery.del_album") %></a>
        <a class="bt-edit btn btn-primary pull-right" title="<%= I18n.t("gallery.edit") %>" href="<%= edit_panel_gallery_back_end_album_path(@album) %>" ><i class="icon-pencil icon-white"></i><%= I18n.t("gallery.edit") %></a>
      <% end %>
  </div>
</div>
</div>

<% content_for :page_specific_javascript do %>
  <%= javascript_include_tag "galleryAPI" %>
<% end %>

<script type="text/javascript">
  galleryAPI.prototype.locale = "<%= I18n.locale %>";
  var gallery = new galleryAPI();
  gallery.initialize();
   gallery.loadArea = "images";
   gallery.loadImages("<%= params[:id] %>");
</script>





