Commit 56d114f4 authored by 神楽坂玲奈's avatar 神楽坂玲奈

帖子内容页发帖回复按钮链接

git-svn-id: http://glupx.googlecode.com/svn/trunk/Reliz@78 189f022a-1064-8ae2-3e6f-c4a67275c50b
parent e53e6321
......@@ -27,8 +27,12 @@ class PostsController < ApplicationController
# GET /posts/new
# GET /posts/new.xml
def new
@topic = Topic.find(params[:topic_id])
if @topic.nil? or @topic.locked
return render :text => "Topic not found or locked."
end
@post = Post.new
@actions = [@topic, :reply]
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
......
......@@ -49,8 +49,7 @@ class TopicsController < ApplicationController
@actions = [@topic.category, @topic]
@posts = Post.find_all_by_topic_id(params[:id], :offset => 10*@page-10, :limit => 10, :order => :displayorder)
@topic.viewnum += 1
@topic.save
@topic.update_attribute(:viewnum, @topic.viewnum + 1)
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => params[:page] && !params[:page].empty? ? @posts : @topic }
......
......@@ -78,5 +78,7 @@ class User < ActiveRecord::Base
user.credit6 = 0
user.credit7 = 0
user.credit8 = 0
end
def user.create
end
end
end
......@@ -31,7 +31,7 @@
</p>
<% end %>
</div>
<div id=b2_2_d2_inf3><div style="float:left; margin-top:5px;"> <%=t 'board.topic' %>: <%= board.topics.count %> <%=t 'board.post' %><%= board.posts.count %></div> <div style="margin-left:10px; float:left; margin-top:2px;"><%= image_tag 'topic/post.png' %></div></div>
<div id=b2_2_d2_inf3><div style="float:left; margin-top:5px;"> <%=t 'board.topic' %>: <%= board.topics.count %> <%=t 'board.post' %>:<%= board.posts.count %></div> <div style="margin-left:10px; float:left; margin-top:2px;"><%= image_tag 'topic/post.png' %></div></div>
</div>
</td>
<td width="283px">
......
......@@ -20,7 +20,7 @@
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecial" prompt="post_newthread"><%= link_to t('topic.new'), new_topic_path %></span>
<span class="postbtn" id="newspecial" prompt="post_newthread"><%= link_to t('topic.new'), new_topic_path(:board_id => @board.id) %></span>
<span><%= link_to t('board.control'), edit_board_path(@board) %></span>
</div>
......@@ -99,7 +99,7 @@
<div class="pages_btns s_clear">
<%= render 'layouts/pages', :count => @board.topics.count %>
<span id="visitedboards" onmouseover="$('visitedboards').id = 'visitedboardstmp';this.id = 'visitedboards';showMenu({'ctrlid':this.id})" class="pageback"><a href="index.php">返回首页</a></span>
<span class="postbtn" id="newspecialtmp" ><%= link_to t('topic.new'), new_topic_path %></span>
<span class="postbtn" id="newspecialtmp" ><%= link_to t('topic.new'), new_topic_path(:board_id => @board.id) %></span>
</div>
<p id="notice"><%= notice %></p>
......@@ -111,7 +111,7 @@
<%=t 'topic.title' %><%= text_field_tag "topic[name]" %>
</p>
<p>
<%= text_area_tag "post[content]" %>
<%= render 'topics/editor_lite' %>
</p>
<%= hidden_field_tag "topic[category_id]", @board.id%>
<%= hidden_field_tag "topic[category_type]", :board%>
......
<h1>New post</h1>
<%= render 'form' %>
<%= link_to 'Back', posts_path %>
<%= form_tag :controller => :posts do %>
<p>
<%= @topic %>
</p>
<p>
<%= render 'topics/editor' %>
</p>
<%= hidden_field_tag "post[topic_id]", @topic.id %>
<%= submit_tag t("topic.submit") %>
<% end %>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<%=t 'topic.title' %><%= text_field_tag "topic[name]" %>
</p>
<p>
<%= text_area_tag "post[content]" %>
<%= render 'topics/editor' %>
</p>
<%= hidden_field_tag "topic[category_id]", @board.id %>
<%= hidden_field_tag "topic[category_type]", :board %>
......
......@@ -15,8 +15,8 @@
</td>
<td>
<span class="pageback" id="visitedforums" onmouseover="$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id})"><a href="forumdisplay.php?fid=2&amp;page=1">返回列表</a></span>
<span class="replybtn" id="post_reply" prompt="post_reply"><a href="post.php?action=reply&amp;fid=2&amp;tid=29727" onclick="showWindow('reply', this.href);return false;">回复</a></span>
<span class="postbtn" id="newspecial" prompt="post_newthread" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"><a href="post.php?action=newthread&amp;fid=2" onclick="showWindow('newthread', this.href);return false;">发帖</a></span>
<span class="replybtn" id="post_reply" prompt="post_reply"><%= link_to t('topic.reply'), new_post_path(:topic_id => @topic.id) %></span>
<span class="postbtn" id="newspecial" prompt="post_newthread"><%= link_to t('topic.new'), new_topic_path(:board_id => @topic.board.id) %></span>
</td>
</tr>
</tbody></table>
......@@ -127,8 +127,8 @@
</span>
<div class="postact s_clear">
<em>
<a class="fastreply" href="post.php?action=reply&amp;fid=2&amp;tid=29727&amp;reppost=751931&amp;extra=page%3D1&amp;page=1" onclick="showWindow('reply', this.href);return false;">回复</a>
<a class="repquote" href="post.php?action=reply&amp;fid=2&amp;tid=29727&amp;repquote=751931&amp;extra=page%3D1&amp;page=1" onclick="showWindow('reply', this.href);return false;">引用</a>
<%= link_to t('topic.reply'), new_post_path(:topic_id => @topic.id), :class => :fastreply %>
<%= link_to t('topic.quote'), new_post_path(:topic_id => @topic.id), :class => :fastreply %>
<%= link_to t('post.edit'), edit_post_path(post), :class => :editpost %>
</em>
<p>
......
......@@ -17,7 +17,7 @@
</div>
<div class="field">
<%= f.label t('user.password') %><br />
<%= f.text_field :password %>
<%= f.password_field :password %>
</div>
<div class="actions">
<%= f.submit t('user.login') %>
......
......@@ -5,10 +5,6 @@
<%= @user.name %>
</p>
<p>
<b><%=t 'user.password' %>:</b>
<%= @user.password %>
</p>
<p>
<b><%=t 'user.email' %>:</b>
......
......@@ -36,7 +36,7 @@ zh-CN:
postperm: "回帖权限"
submit: "提交"
topic: "主题"
post: "回复"
post: "帖子"
none: "从未"
subboard: "子版快"
search:
......@@ -52,6 +52,7 @@ zh-CN:
topic:
new: "发帖"
reply: "回复"
quote: "引用"
title: "标题"
submit: "提交"
order: "排序"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
6596
\ No newline at end of file
408
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment