implemented favorites on post/show page

This commit is contained in:
albert
2011-02-07 18:57:33 -05:00
parent c80df378d8
commit 76a7594a97
16 changed files with 164 additions and 32 deletions

View File

@@ -1,9 +1,10 @@
<div class="comment-preview dtext">
<%= form_tag(comments_path, :remote => true) do %>
<%= hidden_field "comment", "post_id", :value => post.id %>
<%= text_area "comment", "body", :size => "60x7" %>
<br>
<%= submit_tag "Post" %>
<%= submit_tag "Preview" %>
<% end %>
</div>
<%= form_tag(comments_path) do %>
<%= hidden_field "comment", "post_id", :value => post.id %>
<%= text_area "comment", "body", :size => "60x7" %>
<br>
<%= submit_tag "Post" %>
<%= submit_tag "Preview" %>
<% end %>

View File

@@ -1,10 +1,12 @@
<!doctype html>
<html>
<head>
<title><%= @page_title %></title>
<title><%= yield :page_title %></title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<meta name="current-user-name" content="<%= CurrentUser.name %>">
<meta name="current-user-id" content="<%= CurrentUser.id %>">
<% unless CurrentUser.user.blacklisted_tags.blank? %>
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags %>">
<% end %>

View File

@@ -62,7 +62,7 @@
</section>
<% content_for(:page_title) do %>
/ <%= @post_set.tags %>
/<%= @post_set.tags %>
<% end %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -1,7 +1,7 @@
<ul>
<%= resize_image_links(post, CurrentUser.user) %>
<li><%= link_to "Favorite", "#" %></li>
<li><%= link_to "Unfavorite", "#" %></li>
<li><%= link_to "Favorite", "#", :id => "add-to-favorites" %> <img src="/images/wait.gif" style="display: none;" id="add-to-favorites-wait"></li>
<li><%= link_to "Unfavorite", "#", :id => "remove-from-favorites" %> <img src="/images/wait.gif" style="display: none;" id="remove-from-favorites-wait"></li>
<li><%= link_to "Translate", "#" %></li>
<li><%= link_to "Unapprove", "#" %></li>
<% if CurrentUser.user.is_janitor? %>

View File

@@ -55,13 +55,14 @@
</div>
<% content_for(:page_title) do %>
/ <%= @post.tag_string %>
/p/<%= @post.tag_string %>
<% end %>
<% content_for(:html_header) do %>
<meta name="tags" content="<%= @post.tag_string %>">
<meta name="favorites" content="<%= @post.fav_string %>">
<meta name="pools" content="<%= @post.pool_string %>">
<meta name="post-id" content="<%= @post.id %>">
<% end %>
<%= render :partial => "posts/partials/common/secondary_links" %>

View File

@@ -1,7 +1,7 @@
<div id="sessions">
<div id="new">
<section>
<h2>Login</h2>
<h2>Sign In</h2>
<%= form_tag(session_path) do %>
<table width="100%">
<tfoot>
@@ -33,12 +33,12 @@
<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 login", login_reminder_path %></li>
<li><%= link_to "I forgot my user name", login_reminder_path %></li>
</ul>
</aside>
</div>
</div>
<% content_for(:page_title) do %>
/ login
/sign in
<% end %>

View File

@@ -0,0 +1 @@
location.reload()

View File

@@ -1 +0,0 @@
page.reload