
<%= stylesheet_link_tag "gallery" %>

<div id="filter" class="subnav">
  <ul class="nav nav-pills filter">
    <li class="accordion-group">
      <div class="accordion-heading">
        <a href="#collapse-categories" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t("gallery.category") %> <b class="web-symbol"></b></a>
      </div>
    </li>
    <li class="accordion-group">
      <div class="accordion-heading">
        <a href="#collapse-tags" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t("gallery.tag") %> <b class="web-symbol"></b></a>
      </div>
    </li>
  </ul>
  <div class="filters">
    <div class="accordion-body collapse" id="collapse-categories">
      <div class="accordion-inner filter_btns cats" data-toggle="buttons-checkbox">
         <% @categorylist.each do |category| %>
            <a href="cat=<%= category.id %>" class="btn" onclick="return false;"><%= category.name %></a>
          <% end %>
      </div>
      <div class="filter-clear">
        <a href="" class="btn" onclick="return false;"  for="cats"><i class="icons-brush-large"></i>清除</a>
      </div>
    </div>
    <div class="accordion-body collapse" id="collapse-tags">
      <div class="accordion-inner filter_btns tags" data-toggle="buttons-checkbox">
        <% @tags.each do |tag| %>
        <a href="tag=<%= tag.id %>" class="btn" onclick="return false;"><%= tag[I18n.locale] %></a>
        <% end %>
      </div>
      <div class="filter-clear">
        <a href="" class="btn" onclick="return false;" for="tags"><i class="icons-brush-large" ></i>清除</a>
      </div>
    </div>
  </div>
</div>

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

    </div>
  </div>
  <div class="form-actions form-fixed pagination-right rghead">
  <div class="rgfn">
   <% if @authenticated %>
      <a class="btn btn-primary pull-right" title="<%= I18n.t("gallery.add_album") %>" href="<%= new_panel_gallery_back_end_album_path %>" onclick="return false;"><i class="icon-plus icon-white"></i><%= I18n.t("gallery.add_album") %></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();
  if(typeof gallery.urlVars['cat']!= "undefined"){
       gallery.loadArea = "albums";
       gallery.loadAlbums(gallery.urlVars['cat']);
    }else if(typeof gallery.urlVars['tag']!= "undefined"){
        gallery.loadArea = "albums";
        gallery.loadAlbums(gallery.urlVars['tag']);
    }else{
      gallery.loadArea = "albums";
      g.loadAlbums("all");
    }
</script>





