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

@@ -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 %>";