added tags to index page, added html safe for show

This commit is contained in:
saurabhbhatia 2013-07-17 19:49:04 +08:00
parent 3287a2ef17
commit 1c558a1783
3 changed files with 15 additions and 8 deletions

View File

@ -15,7 +15,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
@authenticated = false @authenticated = false
end end
@categories = get_categories_for_index @categories = get_categories_for_index
@albums = GalleryAlbum.all @albums = GalleryAlbum.all
@tags = get_tags
end end
def show def show
@ -30,6 +31,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
def new def new
@categories = get_categories_for_index @categories = get_categories_for_index
@tags = get_tags
@album = GalleryAlbum.new @album = GalleryAlbum.new
end end

View File

@ -1,3 +1,13 @@
<% set_default_index do
objects @albums
filterable
filter_field type: 'objects',
values: @tags,
translation: 'tags',
object_field: 'name'
end %>
<%= render 'admin/default_index/index' %>
<%= stylesheet_link_tag "gallery" %> <%= stylesheet_link_tag "gallery" %>
<%#= stylesheet_link_tag "filter" %> <%#= stylesheet_link_tag "filter" %>
@ -37,12 +47,7 @@
</div> </div>
</div> </div>
<div class="accordion-body collapse" id="collapse-tags"> <div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner pagination-right" data-toggle="buttons-checkbox">
<a href="#" class="btn btn-small">Tags1</a>
<a href="#" class="btn btn-small">Tags2</a>
<a href="#" class="btn btn-small">Tags3</a>
<a href="#" class="btn btn-small">Tags4</a>
</div>
<div class="filter-clear"> <div class="filter-clear">
<a href="#" class="btn btn-link btn-small"><i class="icons-cycle"></i>Clear</a> <a href="#" class="btn btn-link btn-small"><i class="icons-cycle"></i>Clear</a>
</div> </div>

View File

@ -84,7 +84,7 @@
<div class="rgbody"> <div class="rgbody">
<div class="gallery-info"> <div class="gallery-info">
<h3><%= @album.name %></h3> <h3><%= @album.name %></h3>
<p class="muted"><%= @album.description %></p> <p class="muted"><%= @album.description.html_safe %></p>
</div> </div>
<ul id="imgholder" class="gallery clearfix" data-gallery-id="album"> <ul id="imgholder" class="gallery clearfix" data-gallery-id="album">
<% @images.each do |image| %> <% @images.each do |image| %>