pool views

This commit is contained in:
albert
2011-02-25 17:41:00 -05:00
parent f48000a8b5
commit 6d0157265c
39 changed files with 1213 additions and 674 deletions

View File

@@ -35,8 +35,10 @@
</section>
<% content_for(:page_title) do %>
/ fav:<%= CurrentUser.name %>
/fav:<%= CurrentUser.name %>
<% end %>
<%= render :partial => "posts/partials/common/secondary_links" %>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<%= simple_form_for(@pool) do |f| %>
<h2>Edit Pool: <%= @pool.name %></h2>
<p>If you know the precise ordering of posts that you want, you can just enter them here instead of sorting each post manually. Enter a list of post ids separated by spaces.</p>
<%= f.input :post_ids, :label => "Posts" %>
<%= f.button :submit %>
<% end %>

View File

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

View File

@@ -0,0 +1,7 @@
<div>
<%= simple_form_for @search, :method => :get do |f| %>
<%= f.input :name_contains, :label => "Name", :required => false %>
<%= f.input :description_contains, :label => "Description", :required => false %>
<%= f.button :submit, "Search" %>
<% end %>
</div>

View File

@@ -0,0 +1,13 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", pools_path %></li>
<li><%= link_to "New", new_pool_path %></li>
<% if @pool %>
<li>|</li>
<li><%= link_to "Show", pool_path(@pool) %></li>
<li><%= link_to "Search", posts_path(:tags => "pool:#{@pool.id}") %></li>
<li><%= link_to "Simple Edit", edit_pool_path(@pool) %></li>
<li><%= link_to "Advanced Edit", edit_pool_path(@pool, :advanced => true) %></li>
<% end %>
</menu>
<% end %>

View File

@@ -0,0 +1,17 @@
<h2>Edit Pool: <%= @pool.name %></h2>
<p>Drag and drop the list below to determine ordering.</p>
<ul id="sortable">
<% posts.each do |post| %>
<li class="ui-state-default" id="pool[post_id_array]_<%= post.id %>">
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
<span class="delete">Delete</span>
</li>
<% end %>
</ul>
<%= simple_form_for(@pool, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
<%= f.input :name %>
<%= f.input :description %>
<%= submit_tag "Save" %>
<% end %>

View File

@@ -0,0 +1,11 @@
<div class="pools">
<div class="edit">
<% if params[:advanced] %>
<%= render "advanced_edit" %>
<% else %>
<%= render :partial => "simple_edit", :locals => {:posts => @pool.posts} %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>

View File

@@ -0,0 +1,36 @@
<div id="pools">
<div id="index">
<%= render "search" %>
<table class="highlightable" width="100%">
<thead>
<tr>
<th width="5%"></th>
<th width="70%">Name</th>
<th width="25%">Creator</th>
</tr>
</thead>
<tbody>
<% @pools.each do |pool| %>
<%= content_tag(:tr, :id => "pool-#{pool.id}") do %>
<td>
</td>
<td>
<%= link_to h(pool.name), pool_path(pool) %>
</td>
<td>
<%= link_to h(pool.creator.name), user_path(pool.creator) %>
</td>
<% end %>
<% end %>
</tbody>
</table>
<div id="paginator">
<%= will_paginate(@pools) %>
</div>
<%= render "secondary_links" %>
</div>
</div>

View File

@@ -0,0 +1,2 @@
<h1>New Pool</h1>
<%= render :partial => "form", :locals => {:pool => @pool} %>

View File

@@ -0,0 +1,21 @@
<div class="pools">
<div class="show">
<aside id="sidebar">
<h2>Pool: <%= @pool.name %></h2>
<p><%= format_text(@pool.description) %></p>
</aside>
<section id="content">
<%= @post_set.presenter.post_previews_html %>
<div class="clearfix"></div>
<div class="paginator">
<%= @post_set.presenter.pagination_html(self) %>
</div>
</section>
</div>
</div>
<%= render "secondary_links" %>

View File

@@ -0,0 +1 @@
window.location.href = "/pools/<%= @pool.id %>";

View File

@@ -0,0 +1,4 @@
<%= form_for(post_pools_path(@post)) do %>
<p>Select a pool:</p>
<%= recent_pool_list %>
<% end %>

View File

@@ -3,7 +3,7 @@
<li><%= link_to "Listing", posts_path %></li>
<li><%= link_to "Upload", new_upload_path %></li>
<li>Popular</li>
<li>Favorites</li>
<li><%= link_to "Favorites", favorites_path %></li>
<li>Subscriptions</li>
<li><%= link_to "Changes", post_versions_path %></li>
<li>Approvals</li>

View File

@@ -4,6 +4,9 @@
<% if post.approver %>
<li>Approver: <%= link_to(post.approver.name, user_path(post.approver_id)) %></li>
<% end %>
<% if post.unapproval %>
<li>Unapproved: <%= post.unapproval.reason %> (by <%= post.unapproval.unapprover.name %>)</li>
<% end %>
<li>
Size: <%= number_to_human_size(post.file_size) %>
<% if post.is_image? %>

View File

@@ -12,5 +12,5 @@
<li><%= link_to "Undelete", "#", :id => "undelete" %> <%= wait_image("undelete-wait") %></li>
<li><%= link_to "Delete", "#", :id => "delete" %> <%= wait_image("delete-wait") %></li>
<% end %>
<li><%= link_to "Pool", "#" %></li>
<li><%= link_to "Pool", "#", :id => "pool" %></li>
</ul>

View File

@@ -56,6 +56,10 @@
<div id="unapprove-dialog" title="Unapprove Post">
<%= render :template => "unapprovals/new" %>
</div>
<div id="add-to-pool-dialog" title="Add to Pool">
<%= render :template => "pools_posts/new" %>
</div>
</div>
<% content_for(:page_title) do %>

View File

@@ -17,7 +17,7 @@
<p>
You can <%= link_to "upload another file", new_upload_path %> or <%= link_to "view your current uploads", uploads_path %>.
<% if CurrentUser.user.is_moderator? %>
<%= link_to "Force update", upload_path(@upload), :remote => true, :method => :put %>.
<%= link_to "Force update", upload_path(@upload, :format => "js"), :remote => true, :method => :put %>.
<% end %>
</p>

View File

@@ -1 +1 @@
location.reload()
location.reload();