pool views
This commit is contained in:
6
app/views/pools/_advanced_edit.html.erb
Normal file
6
app/views/pools/_advanced_edit.html.erb
Normal 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 %>
|
||||
6
app/views/pools/_form.html.erb
Normal file
6
app/views/pools/_form.html.erb
Normal 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 %>
|
||||
7
app/views/pools/_search.html.erb
Normal file
7
app/views/pools/_search.html.erb
Normal 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>
|
||||
13
app/views/pools/_secondary_links.html.erb
Normal file
13
app/views/pools/_secondary_links.html.erb
Normal 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 %>
|
||||
17
app/views/pools/_simple_edit.html.erb
Normal file
17
app/views/pools/_simple_edit.html.erb
Normal 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 %>
|
||||
@@ -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" %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>New Pool</h1>
|
||||
<%= render :partial => "form", :locals => {:pool => @pool} %>
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
|
||||
1
app/views/pools/update.js.erb
Normal file
1
app/views/pools/update.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
window.location.href = "/pools/<%= @pool.id %>";
|
||||
Reference in New Issue
Block a user