From 9443c139f0815aa8d436ff174377c8d87eb44fd8 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Fri, 18 Sep 2015 17:44:16 +0800
Subject: [PATCH 01/93] update forum
---
app/controllers/forums_controller.rb | 85 ++++-
app/controllers/memos_controller.rb | 10 +-
app/views/forums/_file_form.html.erb | 79 +++++
app/views/forums/_forum_form.html.erb | 15 +
app/views/forums/_forum_list.html.erb | 87 ++---
app/views/forums/_forum_tag_list.html.erb | 5 +
app/views/forums/_show_topics.html.erb | 64 ++--
app/views/forums/create.js.erb | 1 +
app/views/forums/delete_forum_tag.js.erb | 2 +
app/views/forums/index.html.erb | 164 +++++++---
app/views/forums/index.js.erb | 1 +
app/views/forums/show.html.erb | 144 ++++++---
app/views/forums/show.js.erb | 1 +
app/views/layouts/base_forums.html.erb | 178 ++++++-----
app/views/layouts/users_base.html.erb | 28 +-
app/views/memos/_attachments_links.html.erb | 71 +++++
app/views/memos/_praise_tread.html.erb | 36 +++
app/views/memos/show.html.erb | 297 +++++++-----------
app/views/praise_tread/praise_plus.js.erb | 13 +-
config/routes.rb | 4 +-
public/images/post_portrait.jpg | Bin 0 -> 2360 bytes
public/javascripts/forum.js | 101 ++++++
public/stylesheets/images/homepage_icon2.png | Bin 0 -> 11280 bytes
public/stylesheets/images/post_image_list.png | Bin 0 -> 3091 bytes
public/stylesheets/new_user.css | 72 ++++-
.../stylesheets/application.css | 114 +++----
26 files changed, 1042 insertions(+), 530 deletions(-)
create mode 100644 app/views/forums/_file_form.html.erb
create mode 100644 app/views/forums/_forum_form.html.erb
create mode 100644 app/views/forums/_forum_tag_list.html.erb
create mode 100644 app/views/forums/create.js.erb
create mode 100644 app/views/forums/delete_forum_tag.js.erb
create mode 100644 app/views/forums/index.js.erb
create mode 100644 app/views/forums/show.js.erb
create mode 100644 app/views/memos/_attachments_links.html.erb
create mode 100644 app/views/memos/_praise_tread.html.erb
create mode 100644 public/images/post_portrait.jpg
create mode 100644 public/javascripts/forum.js
create mode 100644 public/stylesheets/images/homepage_icon2.png
create mode 100644 public/stylesheets/images/post_image_list.png
diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index 2b44d51de..112550918 100644
--- a/app/controllers/forums_controller.rb
+++ b/app/controllers/forums_controller.rb
@@ -7,7 +7,7 @@ class ForumsController < ApplicationController
before_filter :find_forum_if_available
before_filter :authenticate_user_edit, :only => [:edit, :update]
before_filter :authenticate_user_destroy, :only => [:destroy]
- before_filter :require_login, :only => [:new, :create]
+ before_filter :require_login, :only => [:new, :create,:show,:destroy,:update,:edit]
helper :sort
include SortHelper
@@ -97,7 +97,15 @@ class ForumsController < ApplicationController
def index
@offset, @limit = api_offset_and_limit({:limit => 10})
- @forums_all = Forum.reorder("sticky DESC")
+ if(params[:reorder_complex])
+ @forums_all = Forum.reorder("topic_count #{params[:reorder_complex]},updated_at #{params[:reorder_complex]}")
+ elsif(params[:reorder_popu])
+ @forums_all = Forum.reorder("topic_count #{params[:reorder_popu]}")
+ elsif(params[:reorder_time])
+ @forums_all = Forum.reorder("updated_at #{params[:reorder_time]}")
+ else
+ @forums_all = Forum.reorder("topic_count desc,updated_at desc")
+ end
@forums_count = @forums_all.count
@forums_pages = Paginator.new @forums_count, @limit, params['page']
@@ -106,6 +114,7 @@ class ForumsController < ApplicationController
#@forums = Forum.all
respond_to do |format|
format.html # index.html.erb
+ format.js
format.json { render json: @forums }
end
end
@@ -113,23 +122,34 @@ class ForumsController < ApplicationController
# GET /forums/1
# GET /forums/1.json
def show
- sort_init 'updated_at', 'desc'
- sort_update 'created_at' => "#{Memo.table_name}.created_at",
- 'replies' => "#{Memo.table_name}.replies_count",
- 'updated_at' => "COALESCE (last_replies_memos.created_at, #{Memo.table_name}.created_at)"
-
+ # sort_init 'updated_at', 'desc'
+ # sort_update 'created_at' => "#{Memo.table_name}.created_at",
+ # 'replies' => "#{Memo.table_name}.replies_count",
+ # 'updated_at' => "COALESCE (last_replies_memos.created_at, #{Memo.table_name}.created_at)"
+ order = ""
+ if(params[:reorder_complex])
+ order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
+ elsif(params[:reorder_popu])
+ order = "replies_count #{params[:reorder_popu]}"
+ elsif(params[:reorder_time])
+ order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}"
+ else
+ order = "last_replies_memos.created_at desc, #{Memo.table_name}.created_at desc"
+ end
@memo = Memo.new(:forum => @forum)
@topic_count = @forum.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @forum.topics.
# reorder("#{Memo.table_name}.sticky DESC").
- includes(:last_reply).
+ includes(:last_reply).where("last_replies_memos.parent_id is null and #{Memo.table_name}.parent_id is null").
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
- order(sort_clause).
+ reorder(order).
preload(:author, {:last_reply => :author}).
all
@memos
+ @my_topic_count = Memo.where("forum_id = #{@forum.id} and author_id = #{User.current.id} and parent_id is null").count
+ @my_replies_count = Memo.where("forum_id = #{@forum.id} and author_id = #{User.current.id} and parent_id is not null").count
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @forum = Forum.find(params[:id])
# @memos_all = @forum.topics
@@ -139,6 +159,7 @@ class ForumsController < ApplicationController
# @offset ||= @topic_pages.offset
# @memos = @memos_all.offset(@offset).limit(@limit).all
respond_to do |format|
+ format.js
format.html {
render :layout => 'base_forums'
}# show.html.erb
@@ -178,7 +199,7 @@ class ForumsController < ApplicationController
end
#end
respond_to do |format|
-
+ format.js
format.html { redirect_to @forum, notice: l(:label_forum_create_succ) }
format.json { render json: @forum, status: :created, location: @forum }
end
@@ -186,6 +207,7 @@ class ForumsController < ApplicationController
else
respond_to do |format|
flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}"
+ format.js
format.html { render action: "new" }
format.json { render json: @forum.errors, status: :unprocessable_entity }
end
@@ -199,10 +221,12 @@ class ForumsController < ApplicationController
respond_to do |format|
if @forum.update_attributes(params[:forum])
+ format.js {render :text=> true}
format.html { redirect_to @forum, notice: l(:label_forum_update_succ) }
format.json { head :no_content }
else
flash.now[:error] = "#{l :label_forum_update_fail}: #{@forum.errors.full_messages[0]}"
+ format.js { render :text=> false}
format.html { render action: "edit" }
format.json { render json: @forum.errors, status: :unprocessable_entity }
end
@@ -261,6 +285,47 @@ class ForumsController < ApplicationController
end
end
+ #检查forum的名字
+ def check_forum_name
+ forum_name_exist = Forum.where("name = '#{params[:forum_name]}'").count >= 1 ? true : false
+ render :text => forum_name_exist
+ end
+
+ #添加论坛tag
+ def add_forum_tag
+ @forum = Forum.find(params[:id])
+ unless @forum.nil?
+ @forum.tag_list.add(params[:tag_str].split(','))
+ @forum.save
+ end
+ respond_to do |format|
+ format.js {render :delete_forum_tag}
+ end
+ end
+
+ #删除forum的tag
+ def delete_forum_tag
+ @tag_id = (ActsAsTaggableOn::Tag.find_by_name(params[:tag_name])).id
+ #forum的taggable_type = 5
+ @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,params[:id],'Forum')
+
+ unless @taggings.nil?
+ @taggings.delete
+ end
+
+ # 是否还有其他记录 引用了 tag_id
+ @tagging = ActsAsTaggableOn::Tagging.find_by_tag_id(@tag_id)
+ # 如果taggings表中记录已经不存在 ,那么检查tags表 作删除动作
+ if @tagging.nil?
+ @tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
+ @tag.delete unless @tag.nil?
+ end
+ @forum = Forum.find(params[:id])
+ respond_to do |format|
+ format.js
+ end
+ end
+
private
def find_forum_if_available
diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb
index 27e0d472f..e354a3293 100644
--- a/app/controllers/memos_controller.rb
+++ b/app/controllers/memos_controller.rb
@@ -11,7 +11,7 @@ class MemosController < ApplicationController
include AttachmentsHelper
include ApplicationHelper
- layout 'base_memos'
+ # layout 'base_memos'
def quote
@subject = @memo.subject
@@ -103,7 +103,7 @@ class MemosController < ApplicationController
offset(@reply_pages.offset).
all
if @memo.new_record?
- format.html { render :new,:layout=>'base'}
+ format.html { render :new,:layout=>'base_forums'}
else
format.html { render action: :show }
format.json { render json: @memo.errors, status: :unprocessable_entity }
@@ -115,6 +115,7 @@ 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|
@@ -154,14 +155,15 @@ class MemosController < ApplicationController
@memo_new = Memo.new
-
+ @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count
+ @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count
# @memo = Memo.find_by_id(params[:id])
# @forum = Forum.find(params[:forum_id])
# @replies = @memo.replies
# @mome_new = Memo.new
respond_to do |format|
- format.html # show.html.erb
+ format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums',
format.json { render json: @memo }
format.xml { render xml: @memo }
end
diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb
new file mode 100644
index 000000000..28bb3fa83
--- /dev/null
+++ b/app/views/forums/_file_form.html.erb
@@ -0,0 +1,79 @@
+
+
+
+<% if defined?(container) && container && container.saved_attachments %>
+ <% container.attachments.each_with_index do |attachment, i| %>
+
+ <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><%= l(:field_is_public) %>:
+ <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
+ <%= if attachment.id.nil?
+ #待补充代码
+ else
+ link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
+ end
+ %>
+ <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
+
+ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
+
+
+ <% end %>
+ <% container.saved_attachments.each_with_index do |attachment, i| %>
+
+ <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
+ <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
+ <%= l(:field_is_public) %>:
+ <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
+ <%= if attachment.id.nil?
+ #待补充代码
+ else
+ link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
+ end
+ %>
+ <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
+
+ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
+
+
+ <% end %>
+<% end %>
+
+ <% project = project %>
+
+
+ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
+
+ <%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %>
+
+ <%= file_field_tag 'attachments[dummy][file]',
+ :id => '_file',
+ :class => 'file_selector',
+ :multiple => true,
+ :onchange => 'addInputFiles(this);',
+ :style => ie8? ? '' : 'display:none',
+ :data => {
+ :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
+ :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
+ :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
+ :upload_path => uploads_path(:format => 'js', :project => project),
+ :description_placeholder => l(:label_optional_description),
+ :field_is_public => l(:field_is_public),
+ :are_you_sure => l(:text_are_you_sure),
+ :file_count => l(:label_file_count),
+ :delete_all_files => l(:text_are_you_sure_all)
+ } %>
+
+
+
+
+ <%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
+
+
+
+ <% content_for :header_tags do %>
+ <%= javascript_include_tag 'attachments' %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/forums/_forum_form.html.erb b/app/views/forums/_forum_form.html.erb
new file mode 100644
index 000000000..9888b674e
--- /dev/null
+++ b/app/views/forums/_forum_form.html.erb
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb
index ac27235eb..9c39c436e 100644
--- a/app/views/forums/_forum_list.html.erb
+++ b/app/views/forums/_forum_list.html.erb
@@ -1,57 +1,38 @@
-
-
+
<% if forums.any? %>
<% forums.each do |forum| %>
-
-
- <%= forum.creator.nil? ? (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar")) : (link_to image_tag(url_to_avatar(forum.creator), :class => "avatar"), user_path(forum.creator)) %>
-
-
-
-
-
-
- <%= link_to h(forum.name), forum_path(forum) %>
-
-
-
-
-
-
- <%= textAreailizable forum.description%>
-
-
-
-
-
-
- <%= authoring forum.created_at, forum.creator %>
-
-
-
-
-
-
-
-
-
- <%= link_to (forum.memo_count), forum_path(forum) %>
-
-
- <%= link_to (forum.topic_count), forum_path(forum) %>
-
-
-
- 回答
- 帖子
-
-
-
-
+
+
+
+
+
+ <%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %>
+
+
描述<%= textAreailizable forum.description%>
+
+
创建时间:<%= format_date(forum.created_at) %>
+
+
+
+
+ <%= link_to (forum.memo_count), forum_path(forum),:class=>"linkGrey5 fb" %>
+
+
帖子
+
+
+
+
+
+ <%= link_to (forum.topic_count), forum_path(forum),:class=>"linkGrey5 fb" %>
+
+
回答
+
+
+
<% end %>
-
+
<% else %>
-<% end %>
-
\ No newline at end of file
+ <%= render :partial => "layouts/no_content" %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/forums/_forum_tag_list.html.erb b/app/views/forums/_forum_tag_list.html.erb
new file mode 100644
index 000000000..156bcc895
--- /dev/null
+++ b/app/views/forums/_forum_tag_list.html.erb
@@ -0,0 +1,5 @@
+<% forum.tag_list.each do |tag|%>
+
+ <%= tag %>
+ ×
+<% end %>
\ No newline at end of file
diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb
index f8679cefa..0457bde55 100644
--- a/app/views/forums/_show_topics.html.erb
+++ b/app/views/forums/_show_topics.html.erb
@@ -1,47 +1,31 @@
-
-共有 <%=link_to @forum.memos.count %> 个贴子
<% if memos.any? %>
<% memos.each do |topic| %>
-
-
-
- <%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%>
-
-
-
-
- <%= link_to h(topic.subject), forum_memo_path(topic.forum, topic) %>
-
-
-
- <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic) %>
-
-
- 回答
-
-
-
-
-
-
-
- <%= authoring topic.created_at, topic.author %>
-
- <% author = topic.last_reply.try(:author)%>
- <% if author%>
- 最后回复:<%=link_to_user author %>
- <% end%>
-
-
-
-
-
-
-
-
+
+
+
+ <%= link_to image_tag(url_to_avatar(topic.author), :width => 50,:height => 50,:alt => '贴吧图片'), user_path(topic.author) if topic.author%>
+
+
+
+
<%= topic.content.html_safe%>
+
+
+ <% author = topic.last_reply.try(:author)%>
+ <% if author%>
+
+
<%= format_date(topic.last_reply.created_at)%>
+ <% end%>
+
+
+
+
+ <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
+
+
+
<% end %>
-
+
<% else %>
<%= l(:label_no_data) %>
<% end %>
diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb
new file mode 100644
index 000000000..a120008b6
--- /dev/null
+++ b/app/views/forums/create.js.erb
@@ -0,0 +1 @@
+$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();
\ No newline at end of file
diff --git a/app/views/forums/delete_forum_tag.js.erb b/app/views/forums/delete_forum_tag.js.erb
new file mode 100644
index 000000000..5080b3bdd
--- /dev/null
+++ b/app/views/forums/delete_forum_tag.js.erb
@@ -0,0 +1,2 @@
+$("#forum_tag_list").html("<%= escape_javascript( render :partial=>'forum_tag_list',:locals=>{:forum=>@forum}) %>");
+$('#add_tag01').hide();
\ No newline at end of file
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index 85cab957a..6e1a26407 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -1,48 +1,118 @@
-<% @nav_dispaly_home_path_label = 1
- @nav_dispaly_main_course_label = 1
- @nav_dispaly_main_project_label = 1
- @nav_dispaly_main_contest_label = 1 %>
-
-
-
-
- 公共贴吧
-
-
- <%= l(:label_user_location) %> :
-
-
-
- <% if User.current.logged? %>
- <%= link_to( l(:label_forum_new), new_forum_path, :class => 'icon icon-add') %>
- <% end %>
-
-
-
- <%#= form_tag(:controller => 'forums', :action => "search_forum", :method => :get) do %>
- <%#= text_field_tag 'name', params[:name], :size => 20 %>
- <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
- <%# end %>
-
-
-
-
-
-
- <%= link_to request.host()+"/forums", forums_path %>
-
-
-
- <%= link_to l(:field_homepage), home_path %> >
- <%= link_to "公共贴吧", forums_path %>
-
-
-
-
-<% if @forums.size > 0 %>
- <%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %>
-<% else %>
- <%= render :partial => "layouts/no_content" %>
-<% end %>
+
+
+
+
+
+
+
error
+ <%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
+
+
+
+
+
+
+
+ <% end %>
+
+
+
+ <%= render :partial => 'forum_list',:locals => {:forums=>@forums}%>
+
+
+
+
+
+
+
diff --git a/app/views/forums/index.js.erb b/app/views/forums/index.js.erb
new file mode 100644
index 000000000..f8f7f45b8
--- /dev/null
+++ b/app/views/forums/index.js.erb
@@ -0,0 +1 @@
+$("#forum_list").html("<%= escape_javascript(render :partial => 'forum_list',:locals => {:forums=>@forums}) %>");
\ No newline at end of file
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 24aa74c23..d72d15df0 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -1,42 +1,104 @@
-
-
-
- <%=l(:label_memo_new)%>
-
- <% if User.current.logged? %>
- <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
-
- <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
-
- <%= f.text_field :subject, :required => true, :maxlength => 50%>
-
-
- <%= f.kindeditor :content, :required => true %>
-
-
-
- (<%= l(:label_memos_max_length) %>)
-
-
- <%= l(:label_attachment_plural) %>
-
- <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
-
-
- <%= f.submit :value => l(:label_memo_create) %>
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
-
- <% end %>
- <% end %>
+
+
+
+
error
+ <%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
+
+
+
+
+
+
+
+
+ <%= render :partial => 'file_form', :locals => {:container => @memo} %>
+
+
+
+
+ <% end %>
+
+
+
+ <%= render :partial => 'show_topics',:locals => {:memos=>@memos}%>
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- <%= link_to(image_tag('edit.png')+l(:label_forum_edit),{:action => 'edit', :id => @forum}, :method => 'get', :title => l(:button_edit)) if @forum.editable_by?(User.current) %>
- <%= link_to(image_tag('delete.png')+'删除讨论区', {:action => 'destroy', :id => @forum}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)
- ) if @forum.destroyable_by?(User.current) %>
-
-
- <%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
- :onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
-
-<%= render :partial => 'forums/show_topics', :locals => {:memos => @memos} %>
+
\ No newline at end of file
diff --git a/app/views/forums/show.js.erb b/app/views/forums/show.js.erb
new file mode 100644
index 000000000..2cd380aca
--- /dev/null
+++ b/app/views/forums/show.js.erb
@@ -0,0 +1 @@
+$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>")
\ No newline at end of file
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index c68e917f5..3646ae019 100644
--- a/app/views/layouts/base_forums.html.erb
+++ b/app/views/layouts/base_forums.html.erb
@@ -7,7 +7,7 @@
<%= csrf_meta_tag %>
<%= favicon %>
- <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application','prettify', 'nyan', :media => 'all' %>
+ <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'prettify' %>
@@ -15,7 +15,56 @@
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
- <%= stylesheet_link_tag 'base','header', :media => 'all'%>
+ <%= stylesheet_link_tag 'base','header','new_user', :media => 'all'%>
+
@@ -28,82 +77,65 @@
<% end%>
+
+
+
+
+
<%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %>
+
+
+
+
+
+
+
+
+
+
<%= link_to image_tag(url_to_avatar(User.current),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path( User.current) %>
+
我在贴吧
+
+
+
+
+
-
-
-
-
-
-
-
- <%= l(:label_projects_community)%>
- <%= l(:label_user_location) %> :
-
-
- <%#= form_tag(:controller => 'forums', :action => "search_memo", :id => params[:id], :method => :get) do %>
- <%#= text_field_tag 'name', params[:name], :size => 20 %>
- <%#= hidden_field_tag 'forum_id', params[:id] %>
- <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
- <%# end %>
-
-
-
-
- <%= link_to request.host()+"/forums", forums_path %>
- <%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %>
-
-
-
-
-
+
+
+
+ <%= yield %>
+ <%#= call_hook :view_layouts_base_content %>
+
+
+
- <%= render_flash_messages %>
- <%= yield %>
- <%= call_hook :view_layouts_base_content %>
-
-
-
- <%#= render :partial => 'layouts/base_footer'%>
-
-
- <%= l(:label_loading) %>
-
-
-
-
-
<%= render :partial => 'layouts/footer' %>
- <%= call_hook :view_layouts_base_body_bottom %>
+ <%#= call_hook :view_layouts_base_body_bottom %>