From 11135bfabf7aabfbc3337032ce76b2de571dc1c2 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Dec 2016 11:30:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E5=90=A7=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 ++ app/controllers/memos_controller.rb | 1 - app/views/forums/_edit.html.erb | 55 +++++++++++++++++++ app/views/forums/_form.html.erb | 61 ++++++++++++++++++++++ app/views/forums/edit.js.erb | 5 ++ app/views/forums/show.html.erb | 16 +++--- app/views/memos/_my_count_message.html.erb | 15 +++--- app/views/memos/show.html.erb | 4 +- public/stylesheets/css/structure.css | 2 +- 9 files changed, 146 insertions(+), 17 deletions(-) create mode 100644 app/views/forums/_edit.html.erb create mode 100644 app/views/forums/_form.html.erb create mode 100644 app/views/forums/edit.js.erb diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index f953c8c5e..35f8ee97b 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -203,6 +203,10 @@ class ForumsController < ApplicationController # GET /forums/1/edit def edit @forum = Forum.find(params[:id]) + respond_to do |format| + format.html + format.js + end end # POST /forums diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 6ab8abdb0..a86ee89b4 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -85,7 +85,6 @@ class MemosController < ApplicationController REPLIES_PER_PAGE = 20 unless const_defined?(:REPLIES_PER_PAGE) def show - # 更新贴吧帖子留言对应的memo_messages的viewed字段 unless @memo.children.blank? @memo.children.each do |child| diff --git a/app/views/forums/_edit.html.erb b/app/views/forums/_edit.html.erb new file mode 100644 index 000000000..234c965e2 --- /dev/null +++ b/app/views/forums/_edit.html.erb @@ -0,0 +1,55 @@ +
+
+

新建贴吧

+ +
+
+
+ <%= labelled_form_for @forum, :html => {:id => "forum_new"} do |f| %> + <%= render :partial => "forums/form" %> + <% end %> + <%#= form_tag({:controller => 'forums', :action => 'create'}, :method => 'post', :id => "forum_new") do |f| %> + + <%# end %> +
+
+ + \ No newline at end of file diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb new file mode 100644 index 000000000..ec05d74a4 --- /dev/null +++ b/app/views/forums/_form.html.erb @@ -0,0 +1,61 @@ + +
+ 取消 + 确定 +
+ + \ No newline at end of file diff --git a/app/views/forums/edit.js.erb b/app/views/forums/edit.js.erb new file mode 100644 index 000000000..98fbc95b7 --- /dev/null +++ b/app/views/forums/edit.js.erb @@ -0,0 +1,5 @@ +var htmlvalue = "<%= escape_javascript(render :partial => 'forums/edit') %>"; +pop_box_new(htmlvalue,460,190); + + + diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 17900055e..fcc44196a 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -21,16 +21,20 @@ -<%= render :partial => "memos/my_count_message" %> +
+ <%= render :partial => "memos/my_count_message" %> -
-
-
-

推荐问吧

+
+
+
+

推荐问吧

+
+ <%= render :partial => "forums/right_bar" %>
- <%= render :partial => "forums/right_bar" %>
+ +