refactoring

This commit is contained in:
albert
2011-06-12 16:41:23 -04:00
parent 033f0fc266
commit d6e4283cc7
41 changed files with 197 additions and 429 deletions

View File

@@ -1,6 +1,6 @@
<div id="c-pools-posts">
<div id="c-pool-elements">
<div id="a-new">
<%= form_tag(pool_post_path) do %>
<%= form_tag(pool_element_path) do %>
<%= hidden_field_tag "post_id", @post.id %>
<%= text_field_tag "pool_name", "", :size => 20 %>
<%= submit_tag "Select" %>

View File

@@ -0,0 +1,20 @@
<div id="c-pool-orders">
<div id="a-edit">
<h1>Order Pool: <%= @pool.name %></h1>
<p>Drag and drop the list below to determine ordering.</p>
<ul id="sortable">
<% @pool.posts(:limit => 1_000).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)) %>
</li>
<% end %>
</ul>
<%= simple_form_for(@pool, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
<%= submit_tag "Save" %>
<% end %>
</div>
</div>
<%= render :partial => "pools/secondary_links" %>

View File

@@ -1,6 +0,0 @@
<%= 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

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

View File

@@ -7,8 +7,8 @@
<li>|</li>
<li><%= link_to "Show", pool_path(@pool) %></li>
<li><%= link_to "Posts", 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>
<li><%= link_to "Edit", edit_pool_path(@pool) %></li>
<li><%= link_to "Order", edit_pool_order_path(@pool) %></li>
<% end %>
</menu>
<% end %>

View File

@@ -1,17 +0,0 @@
<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="ui-icon ui-icon-closethick delete" title="Remove post"></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

@@ -1,10 +1,12 @@
<div id="c-pools">
<div id="a-edit">
<% if params[:advanced] %>
<%= render "advanced_edit" %>
<% else %>
<%= render :partial => "simple_edit", :locals => {:posts => @pool.posts} %>
<% end %>
<%= simple_form_for(@pool) do |f| %>
<h1>Edit Pool: <%= @pool.name %></h1>
<%= f.input :name %>
<%= f.input :description %>
<%= f.input :post_ids, :label => "Posts" %>
<%= f.button :submit %>
<% end %>
</div>
</div>

View File

@@ -1,9 +1,10 @@
<div id="c-pools">
<div id="a-show">
<aside id="sidebar">
<h2>Pool: <%= @pool.name %></h2>
<p><%= format_text(@pool.description) %></p>
</aside>
<h1>Pool: <%= @pool.name %></h1>
<div id="description">
<%= format_text(@pool.description) %>
</div>
<section id="content">
<%= @post_set.presenter.post_previews_html %>
@@ -11,7 +12,9 @@
<div class="clearfix"></div>
<div class="paginator">
<%= @post_set.presenter.pagination_html(self) %>
<%= numbered_paginator(@post_set) do |page| %>
<%= link_to(page, pool_path(@pool, :page => page)) %>
<% end %>
</div>
</section>
</div>

View File

@@ -22,8 +22,6 @@
</ul>
</section>
<%= render :partial => "posts/partials/index/explore", :locals => {:post_set => @post_set} %>
<section id="tag-box">
<h1>Tags</h1>
<%= @post_set.presenter.tag_list_html(self) %>

View File

@@ -7,7 +7,7 @@
<li>Subscriptions</li>
<li><%= link_to "Changes", post_versions_path %></li>
<li>Approvals</li>
<li><%= link_to "Moderate", post_moderation_moderate_path %></li>
<li><%= link_to "Moderate", moderation_post_dashboard_path %></li>
<li>Help</li>
</menu>
<% end %>

View File

@@ -1,10 +0,0 @@
<% if post_set.date_tag %>
<section>
<h1>Explore</h1>
<ul>
<li>&laquo; Day &raquo;</li>
<li>&laquo; Week &raquo;</li>
<li>&laquo; Month &raquo;</li>
</ul>
</section>
<% end %>

View File

@@ -6,12 +6,12 @@
<li><%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %></li>
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
<% if CurrentUser.is_janitor? %>
<li><%= link_to "Approve", post_moderation_approve_path(:post_id => post.id), :remote => true, :method => :put, :id => "approve" %></li>
<li><%= link_to "Disapprove", post_moderation_disapprove_path(:post_id => post.id), :remote => true, :method => :put, :id => "disapprove" %></li>
<li><%= link_to "Approve", moderation_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve" %></li>
<li><%= link_to "Disapprove", moderation_post_approval_path(:post_id => post.id), :remote => true, :method => :destroy, :id => "disapprove" %></li>
<% end %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Undelete", post_moderation_undelete_path(:post_id => post.id), :remote => true, :method => :post, :id => "undelete" %></li>
<li><%= link_to "Delete", post_moderation_delete_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %></li>
<li><%= link_to "Undelete", moderation_post_deletion_path(:post_id => post.id), :remote => true, :method => :destroy, :id => "undelete" %></li>
<li><%= link_to "Delete", moderation_post_deletion_path(:post_id => post.id), :remote => true, :method => :post, :id => "delete" %></li>
<% end %>
<li><%= link_to "Pool", "#", :id => "pool" %></li>
</ul>

View File

@@ -1,13 +1,13 @@
<ul>
<% post.pools.each do |pool| %>
<li>
<% if pool.neighbor_posts(post)[:previous] %>
<%= link_to "&laquo;".html_safe, post_path(pool.neighbor_posts(post)[:previous]) %>
<% if pool.neighbors(post).previous %>
<%= link_to "&laquo;".html_safe, post_path(pool.neighbors(post).previous) %>
<% else %>
&laquo;
<% end %>
<% if pool.neighbor_posts(post)[:next] %>
<%= link_to "&raquo;".html_safe, post_path(pool.neighbor_posts(post)[:next]) %>
<% if pool.neighbors(post).next %>
<%= link_to "&raquo;".html_safe, post_path(pool.neighbors(post).next) %>
<% else %>
&raquo;
<% end %>

View File

@@ -57,6 +57,10 @@
</section>
<section id="notes">
<% if @post.notes.active.empty? %>
<p>There are no notes.</p>
<% end %>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
</section>
@@ -75,7 +79,7 @@
</div>
<div id="add-to-pool-dialog" title="Add to Pool">
<%= render :template => "pools_posts/new" %>
<%= render :template => "pool_elements/new" %>
</div>
</div>

View File

@@ -19,19 +19,18 @@
<%= submit_tag "Submit" %>
</div>
<% end %>
</section>
<aside>
<h1>Help</h1>
<ul>
<li><%= link_to "I don't have an account", new_user_path %></li>
<li><%= link_to "I forgot my password", reset_password_path %></li>
<li><%= link_to "I forgot my user name", login_reminder_path %></li>
</ul>
</aside>
</section>
</div>
</div>
<% content_for(:page_title) do %>
/login
<% end %>
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Signup", new_user_path %></li>
<li><%= link_to "Reset Password", new_maintenance_user_password_reset_path %></li>
<li><%= link_to "Login Reminder", new_maintenance_user_login_reminder_path %></li>
</menu>
<% end %>

View File

@@ -1 +1,3 @@
<h1>Namasté <%= CurrentUser.pretty_name %>!</h1>
<%= render :partial => "secondary_links" %>