fixed tag subscription tests

This commit is contained in:
albert
2011-07-20 17:23:38 -04:00
parent c453e7db0f
commit 6791d4d113
13 changed files with 99 additions and 44 deletions

View File

@@ -0,0 +1,6 @@
<%= simple_form_for(@tag_subscription) do |f| %>
<%= f.input :name %>
<%= f.input :tag_query %>
<%= f.input :is_public %>
<%= f.button :submit %>
<% end %>

View File

@@ -0,0 +1,14 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", tag_subscriptions_path %></li>
<li><%= link_to "New", new_tag_subscription_path %></li>
<li><%= link_to "Help", wiki_pages_path(:title => "help:tag_subscriptions") %></li>
<% if @tag_subscription && !@tag_subscription.new_record? && @tag_subscription.editable_by?(CurrentUser.user) %>
<li>|</li>
<li><%= link_to "Show", tag_subscription_path(@tag_subscription) %></li>
<li><%= link_to "Edit", edit_tag_subscription_path(@tag_subscription) %></li>
<li><%= link_to "Delete", tag_subscription_path(@tag_subscription, :method => :delete, :confirm => "Are you sure you want to delete this tag subscription?") %></li>
<% end %>
</menu>
<% end %>

View File

@@ -0,0 +1,6 @@
<div id="c-tag-subscriptions">
<div id="a-edit">
<h1>Edit Tag Subscription</h1>
<%= render "form" %>
</div>
</div>

View File

@@ -1,14 +1,25 @@
<% form_tag(:action => "update") do %>
<h4>Edit Tag Subscriptions</h4>
<div style="margin-bottom: 1em;">
You can only create up to <%= CONFIG["max_tag_subscriptions"] %> groups and each group can have up to 20 tags.
<div id="c-tag-subscriptions">
<div id="a-index">
<h1>Tag Subscriptions</h1>
<table>
<thead>
<tr>
<th>Creator</th>
<th>Name</th>
<th>Tag Query</th>
</tr>
</thead>
<tbody>
<% @tag_subscriptions.each do |tag_subscription| %>
<tr>
<td><%= tag_subscription.creator.name %></td>
<td><%= link_to tag_subscription.name, tag_subscription_path(tag_subscription.id) %></td>
<td><%= link_to tag_subscription.tag_query, posts_path(:tags => "sub:#{@user.name}:#{tag_subscription.name}") %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<table width="100%" class="highlightable">
<%= render :partial => "listing", :locals => {:tag_subscriptions => @tag_subscriptions} %>
</table>
<% end %>
</div>
<% content_for("subnavbar") do %>
<li><%= link_to "Help", :controller => "help", :action => "tag_subscriptions" %></li>
<% end %>
<%= render "secondary_links" %>

View File

@@ -0,0 +1,6 @@
<div id="c-tag-subscriptions">
<div id="a-new">
<h1>New Tag Subscription</h1>
<%= render "form" %>
</div>
</div>