fixes #2220
This commit is contained in:
@@ -2,7 +2,9 @@ class SavedSearchesController < ApplicationController
|
|||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@saved_searches = saved_searches.order("name")
|
@saved_searches = saved_searches.order("tag_query")
|
||||||
|
@categories = @saved_searches.group_by{|saved_search| saved_search.category.to_s}
|
||||||
|
@categories = @categories.sort_by{|category, saved_searches| category.to_s}
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -2,28 +2,31 @@
|
|||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<h1>Saved Searches</h1>
|
<h1>Saved Searches</h1>
|
||||||
|
|
||||||
<table class="striped" width="100%">
|
<% @categories.each do |category, saved_searches| %>
|
||||||
<thead>
|
<h2><%= category.present? ? category : "Uncategorized" %></h2>
|
||||||
<tr>
|
<table class="striped" width="100%">
|
||||||
<th width="80%">Tags</th>
|
<thead>
|
||||||
<th width="10%">Category</th>
|
<tr>
|
||||||
<th width="10%"></th>
|
<th width="80%">Tags</th>
|
||||||
</tr>
|
<th width="10%">Category</th>
|
||||||
</thead>
|
<th width="10%"></th>
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<% @saved_searches.each do |saved_search| %>
|
|
||||||
<tr id="saved-search-<%= saved_search.id %>">
|
|
||||||
<td><%= link_to saved_search.tag_query, posts_path(:tags => saved_search.tag_query) %></td>
|
|
||||||
<td><%= saved_search.category %></td>
|
|
||||||
<td>
|
|
||||||
<%= link_to "edit", edit_saved_search_path(saved_search) %> |
|
|
||||||
<%= link_to "delete", saved_search_path(saved_search), :method => :delete, :remote => true %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
</thead>
|
||||||
</tbody>
|
|
||||||
</table>
|
<tbody>
|
||||||
|
<% saved_searches.each do |saved_search| %>
|
||||||
|
<tr id="saved-search-<%= saved_search.id %>">
|
||||||
|
<td><%= link_to saved_search.tag_query, posts_path(:tags => saved_search.tag_query) %></td>
|
||||||
|
<td><%= saved_search.category %></td>
|
||||||
|
<td>
|
||||||
|
<%= link_to "edit", edit_saved_search_path(saved_search) %> |
|
||||||
|
<%= link_to "delete", saved_search_path(saved_search), :method => :delete, :remote => true %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user