* Refactored PostSet, splitting it into PostSets::Post and PostSets::Favorite

* Additional functional tests
This commit is contained in:
albert
2010-12-01 17:21:05 -05:00
parent f8ab736677
commit 39dd2e277a
20 changed files with 342 additions and 198 deletions

View File

@@ -1,28 +1,7 @@
<% form_for @advertisement, :html => {:multipart => true} do |f| %>
<table width="100%">
<tfoot>
<tr>
<td></td>
<td><%= submit_tag "Submit" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%"><%= f.label :file %></th>
<td width="85%"><%= f.file_field "file" %></td>
</tr>
<tr>
<th><%= f.label :referral_url %></th>
<td><%= f.text_field :referral_url %></td>
</tr>
<tr>
<th><%= f.label :ad_type %></th>
<td><%= f.select :ad_type, ["vertical", "horizontal"] %></td>
</tr>
<tr>
<th><%= f.label :status %></th>
<td><%= f.select :status, ["active", "inactive"] %></td>
</tr>
</tbody>
</table>
<%= simple_form_for @advertisement, :html => {:multipart => true} do |f| %>
<%= f.input :file, :as => :file %>
<%= f.input :referral_url %>
<%= f.input :ad_type, :collection => %w(vertical horizontal) %>
<%= f.input :status, :collection => %w(active inactive) %>
<%= f.button :submit %>
<% end %>

View File

@@ -1,28 +1,5 @@
<h4>Advertisements</h4>
<div style="margin-bottom: 1em;">
<% form_tag(advertisements_path, :method => :get) do %>
<table width="100%">
<tfoot>
<tr>
<th></th>
<td><%= submit_tag "Search" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%"><label>Start Date</label></th>
<td width="85%"><%= text_field_tag "start_date", @start_date %></td>
</tr>
<tr>
<th width="15%"><label>End Date</label></th>
<td width="85%"><%= text_field_tag "end_date", @end_date %></td>
</tr>
</tbody>
</table>
<% end %>
</div>
<table width="100%" class="highlightable">
<thead>
<tr>

View File

@@ -20,9 +20,9 @@
<td><%= h artist_version.other_names %></td>
<td><%= h artist_version.group_name %></td>
<td><%= time_ago_in_words artist_version.created_at %> ago</td>
<td><%= link_to artist_version.updater_name, user_path(artist_version.user_id) %></td>
<td><%= link_to artist_version.updater_name, user_path(artist_version.updater_id) %></td>
<td><%= artist_version.is_active? %></td>
<td><%= artist_version.urls.join(" ") %></td>
<td><%= artist_version.url_string %></td>
</tr>
<% end %>
</tbody>

View File

@@ -0,0 +1,42 @@
<div class="favorites">
<div class="index">
<aside id="sidebar">
<section id="search-box">
<h1>Search Favorites</h1>
<%= form_tag(favorites_path, :method => "get") do %>
<%= text_field_tag("tags", params[:tags], :size => 20) %>
<%= submit_tag "Go" %>
<% end %>
</section>
<% if CurrentUser.is_privileged? %>
<section id="mode-box">
<%= render :partial => "posts/partials/index/mode_menu" %>
</section>
<% end %>
<section id="blacklist-box">
<h1>Blacklisted</h1>
<%= link_to "Hidden", "#" %>
<ul>
</ul>
</section>
</aside>
<section id="content">
<h1>Posts</h1>
<%= @post_set.presenter.post_previews_html %>
<div class="clearfix"></div>
<div class="paginator">
<%= @post_set.presenter.pagination_html(self) %>
</div>
</section>
<% content_for(:page_title) do %>
/ fav:<%= CurrentUser.name %>
<% end %>
</div>
</div>