tilde.news/app/views/filters/index.html.erb

48 lines
1.4 KiB
Plaintext

<div class="box wide">
<div class="legend">
Filtered Tags
</div>
<p>
To hide stories from the home page that have been tagged with certain <a
href="/tags">tags</a>, check them below.
</p>
<% if !@user %>
<p>
Since you are not logged in, your filters will be stored in a long-lasting
browser cookie. To permanently store your tag filters and have them work
across browsers, <a href="/login">login</a> to your account.
</p>
<% end %>
<%= form_with url: "/filters", :method => :post do |f| %>
<table class="data zebra" cellspacing=0 width="75%">
<tr>
<th width="7%">Hide</th>
<th width="13%">Tag</th>
<th width="65%">Description</th>
<th width="5%" style="text-align: right; padding-right: 1em;">Stories</th>
</tr>
<% @tags.each do |tag| %>
<tr>
<td><%= check_box_tag "tags[]", tag.tag,
@filtered_tags.include?(tag) %></td>
<td><%= link_to tag.tag, tag_path(tag), :class => tag.css_class %></td>
<td><%= tag.description %>
<% if tag.hotness_mod != 0 %>
&nbsp;
<em>(hotness mod <%= tag.hotness_mod > 0 ? "+" : ""%><%=
tag.hotness_mod %>)</em>
<% end %></td>
<td style="text-align: right; padding-right: 1em;"><%=
tag.stories_count %></td>
</tr>
<% end %>
</table>
<p>
<%= f.submit "Save Filters" %>
</p>
<% end %>
</div>