diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb
index 2b44d51de..be6543be2 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,:destroy,:update,:edit]
helper :sort
include SortHelper
@@ -97,7 +97,24 @@ class ForumsController < ApplicationController
def index
@offset, @limit = api_offset_and_limit({:limit => 10})
- @forums_all = Forum.reorder("sticky DESC")
+ if(params[:reorder_complex])
+ @type="reorder_complex"
+ @str=params[:reorder_complex]
+ @forums_all = Forum.reorder("topic_count #{params[:reorder_complex]},updated_at #{params[:reorder_complex]}")
+ elsif(params[:reorder_popu])
+ @type="reorder_popu"
+ @str=params[:reorder_popu]
+ @forums_all = Forum.reorder("topic_count #{params[:reorder_popu]}")
+ elsif(params[:reorder_time])
+ @type="reorder_time"
+ @str=params[:reorder_time]
+ @forums_all = Forum.reorder("updated_at #{params[:reorder_time]}")
+ else
+ params[:reorder_complex] = "desc"
+ @type="reorder_complex"
+ @str=params[:reorder_complex]
+ @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 +123,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,11 +131,25 @@ 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 = ""
+ @order_str = ""
+ if(params[:reorder_complex])
+ order = " last_replies_memos.created_at #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
+ @order_str = "reorder_complex="+params[:reorder_complex]
+ elsif(params[:reorder_popu])
+ order = "replies_count #{params[:reorder_popu]}"
+ @order_str = "reorder_popu="+params[:reorder_popu]
+ elsif(params[:reorder_time])
+ order = "#{Memo.table_name}.updated_at #{params[:reorder_time]}"
+ @order_str = "reorder_time="+params[:reorder_time]
+ else
+ order = "last_replies_memos.created_at desc, #{Memo.table_name}.created_at desc"
+ @order_str = "reorder_complex=desc"
+ end
@memo = Memo.new(:forum => @forum)
@topic_count = @forum.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@@ -126,19 +158,15 @@ class ForumsController < ApplicationController
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
- order(sort_clause).
+ reorder(order).
preload(:author, {:last_reply => :author}).
all
@memos
- # @offset, @limit = api_offset_and_limit({:limit => 10})
- # @forum = Forum.find(params[:id])
- # @memos_all = @forum.topics
- # @topic_count = @memos_all.count
- # @topic_pages = Paginator.new @topic_count, @limit, params['page']
-
- # @offset ||= @topic_pages.offset
- # @memos = @memos_all.offset(@offset).limit(@limit).all
+ @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
+ @errors = params[:errors]
respond_to do |format|
+ format.js
format.html {
render :layout => 'base_forums'
}# show.html.erb
@@ -172,20 +200,23 @@ class ForumsController < ApplicationController
# Author lizanle
# Description after save后需要进行资源记录的更新
# owner_type = 2 对应的是 forum
+ @save_flag=true
if params[:asset_id]
ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids ,@forum.id,OwnerTypeHelper::FORUM
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
else
+ @save_flag=false
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 +230,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 +294,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/issues_controller.rb b/app/controllers/issues_controller.rb
index bf854abe8..2232602aa 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -223,7 +223,6 @@ class IssuesController < ApplicationController
end
if saved
-
#修改界面增加跟踪者
watcherlist = @issue.watcher_users
select_users = []
@@ -253,9 +252,7 @@ class IssuesController < ApplicationController
JournalReply.add_reply(@issue.current_journal.id, reply_id, User.current.id)
end
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
-
respond_to do |format|
-
format.html { redirect_to issue_url(@issue.id) }
format.api { render_api_ok }
end
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index 6cebfef7a..769e62209 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -36,8 +36,7 @@ class JournalsController < ApplicationController
sort_update(@query.sortable_columns)
if @query.valid?
- @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC",
- :limit => 25)
+ @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC", :limit => 25)
end
@title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
render :layout => false, :content_type => 'application/atom+xml'
@@ -72,9 +71,9 @@ class JournalsController < ApplicationController
end
# Replaces pre blocks with [...]
text = text.to_s.strip.gsub(%r{
" << @content
+ @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n"
+ @content << text.gsub(/(\r?\n|\r\n?)/, "\n ") + "\n"
+ @content = "" << @content << " "
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404
diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb
index 27e0d472f..4181090a5 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
@@ -73,41 +73,14 @@ class MemosController < ApplicationController
end
end
#end
- format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
- format.json { render json: @memo, status: :created, location: @memo }
+ format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
+ format.json { render json: @memo, status: :created, location: @memo }
else
flash.now[:error] = "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}"
- # back_error_page = @memo.parent_id.nil? ? forum_path(@forum) : forum_memo_path(@forum, @memo.parent_id)
- pre_count = REPLIES_PER_PAGE
-
- @memo_new = @memo.dup
- @memo = @memo.root # 取出楼主,防止输入帖子id让回复作为主贴显示
- unless @memo.new_record?
- @memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1))
- end
-
-
- page = params[:page]
- if params[:r] && page.nil?
- offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count
- page = 1 + offset / pre_count
- else
-
- end
- @reply_count = @memo.children.count
- @reply_pages = Paginator.new @reply_count, pre_count, page
- @replies = @memo.children.
- includes(:author, :attachments).
- reorder("#{Memo.table_name}.created_at DESC").
- limit(@reply_pages.per_page).
- offset(@reply_pages.offset).
- all
- if @memo.new_record?
- format.html { render :new,:layout=>'base'}
- else
- format.html { render action: :show }
+ format.js
+ format.html { redirect_to( forum_path(Forum.find(params[:forum_id]),:errors=>@memo.errors.full_messages[0])) }
format.json { render json: @memo.errors, status: :unprocessable_entity }
- end
+ #end
end
end
@@ -115,6 +88,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,21 +128,27 @@ 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
end
def edit
+ @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
@replying = false
+ respond_to do |format|
+ format.html {render :layout=>'base_forums'}
+ end
end
def update
@@ -176,7 +156,8 @@ class MemosController < ApplicationController
if( #@memo.update_column(:subject, params[:memo][:subject]) &&
@memo.update_column(:content, params[:memo][:content]) &&
@memo.update_column(:sticky, params[:memo][:sticky]) &&
- @memo.update_column(:lock, params[:memo][:lock]))
+ @memo.update_column(:lock, params[:memo][:lock]) &&
+ @memo.update_column(:subject,params[:memo][:subject]))
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@memo.save
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
@@ -227,7 +208,7 @@ class MemosController < ApplicationController
end
def back_memo_url
- forum_memo_path(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))
+ forum_memo_path(@forum, (@memo.root.nil? ? @memo : @memo.root))
end
def back_memo_or_forum_url
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index f9b5b7d32..2c7df84cf 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -160,6 +160,7 @@ class MessagesController < ApplicationController
@reply.safe_attributes = params[:reply]
@reply.content = @quote + @reply.content
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
+ # @reply.reply_id = params[:id]
@topic.children << @reply
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
user_activity.updated_at = Time.now
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 4d80efdf3..251c47d4c 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -162,7 +162,7 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
- render :layout => 'base'
+ render :layout => 'new_base'
else
redirect_to signin_url
end
@@ -188,7 +188,8 @@ class ProjectsController < ApplicationController
@project.safe_attributes = params[:project]
@project.organization_id = params[:organization_id]
@project.user_id = User.current.id
- @project.project_new_type = 1
+ @project.project_new_type = params[:project_new_type]
+ params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
# Add current user as a project member if he is not admin
@@ -220,7 +221,7 @@ class ProjectsController < ApplicationController
end
else
respond_to do |format|
- format.html { render :action => 'new', :layout => 'base'}#Added by young
+ format.html { render :action => 'new', :layout => 'new_base'}#Added by young
format.api { render_validation_errors(@project) }
end
end
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index e0cb8af8e..0ffa334c2 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -15,6 +15,7 @@ class TagsController < ApplicationController
include ContestsHelper
include ActsAsTaggableOn::TagsHelper
include TagsHelper
+ include FilesHelper
helper :projects
helper :courses
helper :tags
@@ -236,47 +237,91 @@ class TagsController < ApplicationController
@rename_tag_name = params[:renameName]
@taggable_id = params[:taggableId]
@taggable_type = numbers_to_object_type(params[:taggableType])
-
+ @course_id = params[:courseId]
@rename_tag = (ActsAsTaggableOn::Tag.find_by_name(@rename_tag_name)) #查找重命名后的tag
@tag_id = (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).id #重命名前的tag_id
- @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type)
- @obj = get_object(@taggable_id,params[:taggableType])
- if(@rename_tag.nil?) #这次命名的是新的tag
-
- # 是否还有其他记录 引用了 tag_id
- @tagging = ActsAsTaggableOn::Tagging.where("tag_id = #{@tag_id}")
- # 如果taggings表中记录为 1 ,那么改变@tag_id对应的tag的名字
- if @tagging.count == 1
- @tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
- @tag.update_attributes({:name=>@rename_tag_name})
- else #如果tagging表中的记录大于1,那么就要新增tag记录
-
- unless @obj.nil?
- @obj.tag_list.add(@rename_tag_name.split(","))
- @obj.save
+ @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) unless @taggable_id.blank?
+ @obj = get_object(@taggable_id,params[:taggableType]) unless @taggable_id.blank?
+ if @taggable_id.blank? #如果没有传tag_id,那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。
+ #看重命名后的tag是否存在。如果存在的话,只需要更改taggings里边的id即可
+ if @rename_tag
+ @taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type)
+ @taggings.update_attributes({:tag_id=>@rename_tag.id})
+ else #如果不存在,那么就直接更新该tag名称为新的名称
+ (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name)
+ end
+ else
+ if(@rename_tag.nil?) #这次命名的是新的tag
+
+ # 是否还有其他记录 引用了 tag_id
+ @tagging = ActsAsTaggableOn::Tagging.where("tag_id = #{@tag_id}")
+ # 如果taggings表中记录为 1 ,那么改变@tag_id对应的tag的名字
+ if @tagging.count == 1
+ @tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
+ @tag.update_attributes({:name=>@rename_tag_name})
+ else #如果tagging表中的记录大于1,那么就要新增tag记录
+
+ unless @obj.nil?
+ @obj.tag_list.add(@rename_tag_name.split(","))
+ @obj.save
+ end
+ #删除原来的对应的taggings的记录
+ unless @taggings.nil?
+ @taggings.delete
+ end
end
- #删除原来的对应的taggings的记录
+ else #这是已有的tag
+ # 更改taggings记录里的tag_id
unless @taggings.nil?
- @taggings.delete
+ @taggings.update_attributes({:tag_id=>@rename_tag.id})
end
end
- else #这是已有的tag
- # 更改taggings记录里的tag_id
- unless @taggings.nil?
- @taggings.update_attributes({:tag_id=>@rename_tag.id})
- end
end
+
@obj_flag = params[:taggableType]
if @obj && @obj_flag == '6' && @obj.container.kind_of?(Course)
@course = @obj.container
@tag_list = @tag_list = get_course_tag_list @course
+ elsif @course_id
+ @course = Course.find(@course_id)
+ @tag_list = get_course_tag_list @course
+
+ #这里要引用FilesController里的逻辑了。将资源库当前的文件列表刷新一遍。
+ @flag = params[:flag] || false
+ sort = ""
+ @sort = ""
+ @order = ""
+ @is_remote = false
+ @isproject = false
+
+ sort = "#{Attachment.table_name}.created_on desc"
+
+ @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
+
+ show_attachments @containers
+ elsif @obj && @obj_flag == '5'
+ @forum = @obj
end
respond_to do |format|
format.js
end
end
+ def show_attachments obj
+ @attachments = []
+ obj.each do |container|
+ @attachments += container.attachments
+ end
+ @all_attachments = User.current.admin? ? @attachments : visable_attachemnts(@attachments)
+ @limit = 10
+ @feedback_count = @all_attachments.count
+ @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
+ @offset ||= @feedback_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @obj_attachments = paginateHelper @all_attachments,10
+ end
+
def tag_save
@select_tag_name = params[:tag_for_save][:tag_name]
@tags = params[:tag_for_save][:name]
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 76643a099..35860c728 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -101,33 +101,12 @@ class UsersController < ApplicationController
elsif @user != User.current && !User.current.admin?
return render_403
end
- # 记录当前点击按钮的时间
- # 考虑到用户未退出刷新消息页面
- message_time = OnclickTime.where("user_id =?", User.current).first
- if message_time.nil?
- message_new_time = OnclickTime.new
- message_new_time.user_id = User.current.id
- message_new_time.onclick_time = Time.now
- message_new_time.save
- else
- # 24小时内显示
- contrast_time = Time.now - 86400
- message_time.update_attributes(:onclick_time => Time.now)
- end
- @user_system_messages = SystemMessage.where("created_at >?", contrast_time).order("created_at desc")
- # 当前用户查看消息,则设置消息为已读
- # DO 待优化,只需查出符合条件的再更新
+ # 初始化/更新 点击按钮时间
+ # 24小时内显示系统消息
+ update_onclick_time
+ # 全部设为已读
if params[:viewed] == "all"
- course_querys = @user.course_messages
- forge_querys = @user.forge_messages
- user_querys = @user.user_feedback_messages
- forum_querys = @user.memo_messages
- if User.current.id == @user.id
- course_querys.update_all(:viewed => true)
- forge_querys.update_all(:viewed => true)
- user_querys.update_all(:viewed => true)
- forum_querys.update_all(:viewed => true)
- end
+ update_message_viewed(@user)
end
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
case params[:type]
@@ -197,6 +176,39 @@ class UsersController < ApplicationController
end
end
+ # 初始化/更新 点击按钮时间
+ def update_onclick_time
+ # 记录当前点击按钮的时间
+ # 考虑到用户未退出刷新消息页面
+ message_time = OnclickTime.where("user_id =?", User.current).first
+ if message_time.nil?
+ message_new_time = OnclickTime.new
+ message_new_time.user_id = User.current.id
+ message_new_time.onclick_time = Time.now
+ message_new_time.save
+ else
+ # 24小时内显示
+ contrast_time = Time.now - 86400
+ message_time.update_attributes(:onclick_time => Time.now)
+ end
+ # 24小时内显示系统消息
+ @user_system_messages = SystemMessage.where("created_at >?", contrast_time).order("created_at desc")
+ end
+
+ # 消息设置为已读
+ def update_message_viewed(user)
+ course_querys = CourseMessage.where("user_id =? and viewed =?", user, 0)
+ forge_querys = ForgeMessage.where("user_id =? and viewed =?", user, 0)
+ user_querys = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0)
+ forum_querys = MemoMessage.where("user_id =? and viewed =?", user, 0)
+ if User.current.id == @user.id
+ course_querys.update_all(:viewed => true)
+ forge_querys.update_all(:viewed => true)
+ user_querys.update_all(:viewed => true)
+ forum_querys.update_all(:viewed => true)
+ end
+ end
+
# 系统消息
def user_system_messages
@sytem_messages = SystemMessage.order("created_at desc").all
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 6a865b203..41f25d1a3 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -76,6 +76,36 @@ module ProjectsHelper
return result
end
+ # 项目类型
+ def project_type_select
+ type = []
+ option1 = []
+ option1 << l(:label_development_team)
+ option1 << l(:label_development_team)
+ option2 = []
+ option2 << l(:label_research_group)
+ option2 << l(:label_research_group)
+ option3 = []
+ option3 << l(:label_friend_organization)
+ option3 << l(:label_friend_organization)
+ type << option1
+ type << option2
+ type << option3
+ type
+ end
+
+ # 项目类型描述
+ def project_newtype_descrption
+ case params
+ when 1
+ value = l(:label_type_des_development)
+ when 2
+ value = l(:label_type_des_research)
+ when 3
+ value = l(:label_type_des_friend)
+ end
+ end
+
# 被邀请成员的状态
def status_for_ivitied(ivite_list, project)
if ivite_list.user.member_of?(project)
diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb
index 284ee8c43..2e8b98a2d 100644
--- a/app/helpers/tags_helper.rb
+++ b/app/helpers/tags_helper.rb
@@ -1,5 +1,6 @@
module TagsHelper
include StoresHelper
+ include CoursesHelper
# 通过 id和type获取对象
def get_object(obj_id,obj_type)
@obj = nil
@@ -62,6 +63,27 @@ module TagsHelper
end
+#判断课程course中是否包含课件attachment,course中引用了attachment也算作包含
+def course_contains_attachment? course,attachment
+ course.attachments.each do |att|
+ if att.id == attachment.id || (!att.copy_from.nil? && !attachment.copy_from.nil? && att.copy_from == attachment.copy_from) || att.copy_from == attachment.id || att.id == attachment.copy_from
+ return true
+ end
+ end
+ false
+end
+
+#判断用户是否拥有不包含当前资源的课程,需用户在该课程中角色为教师且该课程属于当前学期或下一学期
+def has_course? user,file
+ result = false
+ user.courses.each do |course|
+ if !course_contains_attachment?(course,file) && is_course_teacher(User.current,course) && course_in_current_or_next_term(course)
+ return true
+ end
+ end
+ result
+end
+
# 判断用户是否是贴吧的管理员
# add by chenmin
def is_forum_manager?(user_id,forum_id)
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 15eebc15e..b1020d938 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -463,7 +463,7 @@ module UsersHelper
def get_issue_des_update(journal)
no_html = "message"
arr = details_to_strings(journal.details, no_html)
- unless journal.notes.empty?
+ unless journal.notes.blank?
arr << "留言内容:" + journal.notes
end
str = ''
diff --git a/app/models/forum.rb b/app/models/forum.rb
index 530639f81..9fa1b7dfd 100644
--- a/app/models/forum.rb
+++ b/app/models/forum.rb
@@ -14,7 +14,7 @@ class Forum < ActiveRecord::Base
'sticky',
'locked'
validates_presence_of :name, :creator_id, :description
- validates_length_of :name, maximum: 50
+ validates_length_of :name, maximum: 160
#validates_length_of :description, maximum: 255
validates :name, :uniqueness => true
after_destroy :delete_kindeditor_assets
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 0d86d12ff..9ffc5d405 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -171,11 +171,16 @@ class Journal < ActiveRecord::Base
# 缺陷状态更改,消息提醒
def act_as_forge_message
+ receivers = []
+ # 直接回复
if self.user_id != self.issue.author_id
- self.forge_messages << ForgeMessage.new(:user_id => self.issue.author_id, :project_id => self.issue.project_id, :viewed => false)
+ receivers << self.issue.author_id
end
if self.user_id != self.issue.assigned_to_id && self.issue.assigned_to_id != self.issue.author_id # 指派人不是自己的话,则给指派人发送
- self.forge_messages << ForgeMessage.new(:user_id => self.issue.assigned_to_id, :project_id => self.issue.project_id, :viewed => false)
+ receivers << self.issue.assigned_to_id
+ end
+ receivers.each do |r|
+ self.forge_messages << ForgeMessage.new(:user_id => r, :project_id => self.issue.project_id, :viewed => false)
end
end
diff --git a/app/models/journal_reply.rb b/app/models/journal_reply.rb
index 814231776..a1ea761af 100644
--- a/app/models/journal_reply.rb
+++ b/app/models/journal_reply.rb
@@ -5,8 +5,34 @@ class JournalReply < ActiveRecord::Base
belongs_to :user
belongs_to :journal
+ after_create :send_journal_messages
def self.add_reply(journal_id, reply_id, user_id)
self.create(:journal_id => journal_id, :reply_id => reply_id, :user_id => user_id)
end
+
+ def send_journal_messages
+ journal = self.journal
+ replier = User.find(self.reply_id)
+ receivers = []
+ # 被回复的人发送消息
+ if journal.user_id != self.reply_id && self.reply_id != journal.issue.author_id
+ receivers << replier
+ end
+ if journal.user_id != journal.issue.author_id && self.reply_id != journal.issue.author_id
+ receivers << self.journal.issue.author
+ end
+ # journal_forge_messages = ForgeMessage.new
+ receivers.each do |r|
+ journal.forge_messages << ForgeMessage.new(:user_id =>r.id, :project_id => journal.issue.project_id, :viewed => false)
+ end
+
+ # if self.user_id != self.journal_reply.user_id
+ # receivers << self.journal_reply.user_id
+ # end
+ # # 给缺陷发布者发送
+ # if self.user_id != self.issue.author_id && self.journal_reply.user_id != self.issue.author_id
+ # receivers << self.issue.author_id
+ # end
+ end
end
diff --git a/app/models/message.rb b/app/models/message.rb
index 37129885f..2c46857f8 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -86,7 +86,7 @@ class Message < ActiveRecord::Base
}
- safe_attributes 'subject', 'content'
+ safe_attributes 'subject', 'content', 'reply_id'
safe_attributes 'board_id','locked', 'sticky',
:if => lambda {|message, user|
if message.project
diff --git a/app/models/user.rb b/app/models/user.rb
index 48b269e6e..0ed8aeda0 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -264,6 +264,7 @@ class User < Principal
if OnclickTime.where("user_id =?", User.current).first.nil?
message_new_time = OnclickTime.new
message_new_time.user_id = User.current.id
+ # 第一次初始化点击铃铛时间
message_new_time.onclick_time = User.current.last_login_on.nil? ? Time.now : User.current.last_login_on
message_new_time.save
end
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index 353d19dab..e31eea960 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -3,13 +3,13 @@
共有 <%= all_attachments.count%> 个资源
<% if order == "asc" %>
- 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
- <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
- <%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
+ 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
+ <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
+ <%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
<% else %>
- 按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
- <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
- <%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
+ 按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
+ <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
+ <%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
<% end %>
diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb
index 9db34ece4..b2c7ab79f 100644
--- a/app/views/files/_tag_yun.html.erb
+++ b/app/views/files/_tag_yun.html.erb
@@ -3,7 +3,7 @@
<% if tag_name && tag_name == k%>
<%= k%>×<%= v%>
<% else%>
- <%= k%>×<%= v%>
+ <%= k%>×<%= v%>
<% end%>
<% end%>
<% end%>
\ No newline at end of file
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index fa15c1fc7..489c0357d 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -229,6 +229,9 @@
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
+ //这里renameTag有两种情况,一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
+ //第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
+ //目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id,就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(domEle.children().get(0) != undefined ){ //已经是编辑框的情况下不要动
return;
@@ -239,7 +242,8 @@
ele = domEle;
tagId = id;
taggableType = type;
- domEle.html(' ');
+ width = parseInt(domEle.css('width').replace('px','')) >=100 ? parseInt(domEle.css('width').replace('px','')) : 100
+ domEle.html(' ');
domEle.parent().css("border","1px solid #ffffff");
$("#renameTagName").focus();
}
@@ -256,14 +260,10 @@
}else{ //否则就要更新tag名称了
if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){
- $.post(
- '<%= update_tag_name_path %>',
- {"taggableId":tagId,"taggableType":taggableType,"tagName":tagName,"renameName":$("#renameTagName").val().trim()}
-// function(data){
-// ele.parent().css("border","");
-// ele.parent().html(tagNameHtml);
-// }
- )
+ $.post(
+ '<%= update_tag_name_path %>',
+ {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
+ )
}else{
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb
new file mode 100644
index 000000000..030c8ff0e
--- /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/_form_edit_mode.html.erb b/app/views/forums/_form_edit_mode.html.erb
index a9bb05f79..9c0ec27bd 100644
--- a/app/views/forums/_form_edit_mode.html.erb
+++ b/app/views/forums/_form_edit_mode.html.erb
@@ -1,49 +1,26 @@
-
-
-
- <%= labelled_form_for(@forum) do |f| %>
- <% if @forum.errors.any? %>
-
- <% end %>
-
-
- <%= f.text_field :name, :required => true, :style => 'width: 100%;', :class => 'create-share', :maxlength => 50%>
-
-
- <% if User.current.logged? && User.current.admin? %>
- <% if @forum.safe_attribute? 'sticky' %>
- <%= f.check_box :sticky %>
- <%= label_tag 'message_sticky', l(:label_board_sticky) %>
- <% end %>
- <% if @forum.safe_attribute? 'locked' %>
- <%= f.check_box :locked %>
- <%= label_tag 'message_locked', l(:label_board_locked) %>
- <% end %>
+
+ <%= labelled_form_for(@forum) do |f| %>
+
+
+
+
+
+
+
+
+
<% end %>
-
-
- <%= f.kindeditor :description, :required => true,:owner_id => @forum.id,:owner_type => 2 %>
-
-
-
- (<%= l(:label_forums_max_length) %>)
-
-
-
- <%= submit_tag l(:button_submit) %>
- <%= link_to l(:button_back), forums_path ,:style => 'font-size: 14px; padding: 0px 3px;' %>
-
- <% 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..fbbe023a0 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.topic_count), forum_path(forum),:class=>"linkGrey5 fb" %>
+
+
帖子
+
+
+
+
+
+ <%= link_to (forum.memo_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..2a0257d63
--- /dev/null
+++ b/app/views/forums/_forum_tag_list.html.erb
@@ -0,0 +1,8 @@
+<% forum.tag_list.each do |tag|%>
+
+ <%= tag %>
+ <%if forum.creator.id == User.current.id%>
+ ×
+ <% end %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/forums/_post_banner.html.erb b/app/views/forums/_post_banner.html.erb
new file mode 100644
index 000000000..797b43245
--- /dev/null
+++ b/app/views/forums/_post_banner.html.erb
@@ -0,0 +1,33 @@
+
+
+综合
+ <% if order_type=='reorder_complex' && order_str == 'desc' %>
+
+ <% elsif order_type=='reorder_complex' && order_str == 'asc' %>
+
+ <% else %>
+
+ <% end %>
+
+人气
+ <% if order_type=='reorder_popu' && order_str == 'desc' %>
+
+ <% elsif order_type=='reorder_popu' && order_str == 'asc' %>
+
+ <% else %>
+
+ <% end %>
+
+时间
+ <% if order_type=='reorder_time' && order_str == 'desc' %>
+
+ <% elsif order_type=='reorder_time' && order_str == 'asc' %>
+
+ <% else %>
+
+ <% 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..d6e3f607b 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..be99d724a
--- /dev/null
+++ b/app/views/forums/create.js.erb
@@ -0,0 +1,6 @@
+<%if @save_flag%>
+$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle();
+$('#reorder_time').click();
+<%else%>
+ $("#error").html("<%= @forum.errors.full_messages[0]%>").show();
+<%end %>
\ 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/edit.html.erb b/app/views/forums/edit.html.erb
index 0a40120c7..24130e727 100644
--- a/app/views/forums/edit.html.erb
+++ b/app/views/forums/edit.html.erb
@@ -1,4 +1,72 @@
-
-
编辑讨论区
-<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
+
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %>
+
<%= render 'form_edit_mode' %>
+
\ No newline at end of file
diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb
index 85cab957a..8f5cb15cc 100644
--- a/app/views/forums/index.html.erb
+++ b/app/views/forums/index.html.erb
@@ -1,48 +1,170 @@
-<% @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 %>
+<%= javascript_include_tag 'new_user' %>
+<%= stylesheet_link_tag 'public'%>
+
+
+
+
+
+
+
error
+ <%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
+
+
+
+
+
+
+
+
+
+ <% end %>
+
+
+ <%= render :partial => 'post_banner' ,:locals => {:order_type=>@type,:order_str=>@str}%>
+
+
+
+
+
+
+
+
+ <%= render :partial => 'forum_list',:locals => {:forums=>@forums}%>
+
+
+ <%= pagination_links_full @forums_pages, @forums_count ,:per_page_links => true,:remote =>true,:flag=>true%>
+
+
+
+
+
diff --git a/app/views/forums/index.js.erb b/app/views/forums/index.js.erb
new file mode 100644
index 000000000..642c3c20a
--- /dev/null
+++ b/app/views/forums/index.js.erb
@@ -0,0 +1,4 @@
+//$("#postBanner").html("<%#= render :partial => 'post_banner' ,:locals => {:order_type=>@type,:order_str=>@str }%>");
+$("#forum_list").html("<%= escape_javascript(render :partial => 'forum_list',:locals => {:forums=>@forums}) %>");
+//这里出现一个问题竟然是单双引号引起的。注意!!
+$("#pages").html('<%= pagination_links_full @forums_pages, @forums_count,:per_page_links => false,:remote =>true,:flag=>true%>');
\ No newline at end of file
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 24aa74c23..34c7d6e64 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -1,42 +1,144 @@
-
-
-
- <%=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 %>
+<%= javascript_include_tag 'new_user' %>
+
+
+
+
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}%>
+
+
+ <%= pagination_links_full @topic_pages, @topic_count ,:per_page_links => true, :remote => true, :flag => true %>
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- <%= 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..9e36215ac
--- /dev/null
+++ b/app/views/forums/show.js.erb
@@ -0,0 +1,2 @@
+$("#topics_list").html("<%= escape_javascript(render :partial => 'show_topics',:locals => {:memos=>@memos})%>")
+$("#pages").html('<%= pagination_links_full @topic_pages, @topic_count,:per_page_links => false,:remote =>true%>');
\ No newline at end of file
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb
index 68bd9f82c..54cb85212 100644
--- a/app/views/issues/_attributes.html.erb
+++ b/app/views/issues/_attributes.html.erb
@@ -6,12 +6,11 @@
* <%= l(:field_status) %>:
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
- <%= f.select :status_id,
- (@allowed_statuses.collect { |p| [p.name, p.id] }),
- {:no_label => true},
- # ajax 刷新
- #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
- :class => "w150" %>
+ <%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
+ {:no_label => true},
+ # ajax 刷新
+ #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
+ :class => "w150" %>
<% else %>
<%= h(@issue.status.name) %>
<% end %>
@@ -20,10 +19,9 @@
* <%= l(:field_priority) %>:
<% if @issue.safe_attribute? 'priority_id' %>
- <%= f.select :priority_id,
- (@priorities.collect { |p| [p.name, p.id] }),
- {:required => true, :no_label => true}, :disabled => !@issue.leaf?,
- :class => "w150" %>
+ <%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
+ {:required => true, :no_label => true}, :disabled => !@issue.leaf?,
+ :class => "w150" %>
<% end %>
@@ -32,8 +30,8 @@
<%= l(:field_assigned_to) %>:
<% if @issue.safe_attribute? 'assigned_to_id' %>
<%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to),
- {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
- :class => "w150" %>
+ {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
+ :class => "w150" %>
<% end %>
@@ -41,8 +39,8 @@
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
<%= l(:field_fixed_version) %>:
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
- {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
- :class => "w150" %>
+ {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
+ :class => "w150" %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
new_project_version_path(@issue.project),
:remote => true,
@@ -60,11 +58,7 @@
<%= l(:field_start_date) %>:
<% if @issue.safe_attribute? 'start_date' %>
- <%= f.text_field :start_date,
- :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('start_date') %>
+ <%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('start_date') %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -72,10 +66,7 @@
<%= l(:field_due_date) %>:
<% if @issue.safe_attribute? 'due_date' %>
- <%= f.text_field :due_date, :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('due_date') %>
+ <%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('due_date') %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -83,10 +74,7 @@
<%= l(:field_estimated_hours) %>:
<% if @issue.safe_attribute? 'estimated_hours' %>
- <%= f.text_field :estimated_hours, :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('estimated_hours') %>
+ <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %>
<%= l(:field_hours) %>
<% end %>
@@ -94,9 +82,9 @@
% 完成 :
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
- {:required => @issue.required_attribute?('done_ratio'), :no_label => true},
- :onchange => "PrecentChange(this.value)",
- :class => "w150" %>
+ {:required => @issue.required_attribute?('done_ratio'), :no_label => true},
+ :onchange => "PrecentChange(this.value)",
+ :class => "w150" %>
<% end %>
diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb
new file mode 100644
index 000000000..7b9e2bedf
--- /dev/null
+++ b/app/views/issues/_attributes_show.html.erb
@@ -0,0 +1,52 @@
+
+
+ <%= issue_fields_rows do |rows| %>
+
+
+ 优先级 :
<%= @issue.priority.name %>
+
+
+ <% unless @issue.disabled_core_fields.include?('done_ratio') %>
+ % 完成 :
<%= @issue.done_ratio %>%
+
+ <% end %>
+
+
+
+
+ <% unless @issue.disabled_core_fields.include?('due_date') %>
+ 计划完成 :
<%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %>
+
+ <% end %>
+
+ <% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
+ 目标版本 :
<%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %>
+
+ <% end %>
+
+
+ <% end %>
+ <%#= render_custom_fields_rows(@issue) %>
+ <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
+
+
\ No newline at end of file
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 1f3f984b4..c6b805d0a 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -6,21 +6,17 @@
<%= render :partial => 'form', :locals => {:f => f} %>
-
-
-
-
<% end %>
-
-
<% if @journals.present? %>
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
<% end %>
-
+
+
+
回复
<%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %>
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 41fca87eb..0d5c876f1 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -28,11 +28,7 @@
<% if @issue.safe_attribute? 'subject' %>
* 主题 :
- <%= f.text_field :subject,
- :class => "w576",
- :maxlength => 255,
- :style => "font-size:small",
- :no_label => true %>
+ <%= f.text_field :subject, :class => "w576", :maxlength => 255, :style => "font-size:small", :no_label => true %>
<%= javascript_tag do %>
observeAutocompleteField('issue_subject',
@@ -53,13 +49,7 @@
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %>
<%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
<%#= content_tag 'span', :id => "issue_description_and_toolbar" do %>
- <%= f.kindeditor :description,:editor_id => "issue_desc_editor",
- # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
- # :accesskey => accesskey(:edit),
- # :class => "w583",
- :width=>'87%',
- :resizeType => 0,
- :no_label => true %>
+ <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true %>
<%# end %>
<%#= wikitoolbar_for 'issue_description' %>
<% end %>
@@ -68,13 +58,13 @@
- <% if @copy_from && @copy_from.attachments.any? %>
-
+ <%# if @copy_from && @copy_from.attachments.any? %>
+
-
- <% end %>
+
+ <%# end %>
<% if @copy_from && !@copy_from.leaf? %>
<%= l(:label_copy_subtasks) %>
diff --git a/app/views/issues/_form_custom_fields.html.erb b/app/views/issues/_form_custom_fields.html.erb
index 4da98eb13..c97244902 100644
--- a/app/views/issues/_form_custom_fields.html.erb
+++ b/app/views/issues/_form_custom_fields.html.erb
@@ -1,13 +1,13 @@
-
-<% i = 0 %>
-<% split_on = (@issue.custom_field_values.size / 2.0).ceil - 1 %>
-<% @issue.editable_custom_field_values.each do |value| %>
-
<%= custom_field_tag_with_label :issue, value, :required => @issue.required_attribute?(value.custom_field_id) %>
-<% if i == split_on -%>
-
-<% end -%>
-<% i += 1 -%>
-<% end -%>
-
+
+ <% i = 0 %>
+ <% split_on = (@issue.custom_field_values.size / 2.0).ceil - 1 %>
+ <% @issue.editable_custom_field_values.each do |value| %>
+
<%= custom_field_tag_with_label :issue, value, :required => @issue.required_attribute?(value.custom_field_id) %>
+ <% if i == split_on -%>
+
+ <% end -%>
+ <% i += 1 -%>
+ <% end -%>
+
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 41605a826..67867e2c6 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,4 +1,4 @@
-<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg' %>
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= l(:label_issue_edit) %>
@@ -12,6 +12,7 @@
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
+
@@ -20,114 +21,53 @@
-
由<%= @issue.author %>
- <%# if @issue.created_on != @issue.updated_on %>
- 添加于 <%= format_time(@issue.created_on).html_safe %>
- <%# else %>
- <%#= format_time(@issue.updated_on).html_safe %>
- <%# end %>
+ 由<%= @issue.author %> 添加于 <%= format_time(@issue.created_on).html_safe %>
+
'action_menu' %>
-
- <% if @issue.description? || @issue.attachments.any? -%>
+ <% if @issue.description? || @issue.attachments.any? -%>
+
<% if @issue.description? %>
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>
<% end %>
-
+
+ <% end -%>
+
-
-
-
- <%= issue_fields_rows do |rows| %>
-
+
- <%= @issue.status.name %>
-
-
- <% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
- 指派给 :
- <%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %>
-
- <% end %>
-
-
-
- 优先级 :
- <%= @issue.priority.name %>
-
-
- <% unless @issue.disabled_core_fields.include?('done_ratio') %>
- % 完成 :
- <%= @issue.done_ratio %>%
-
- <% end %>
-
-
+
+ <%= render :partial => 'attributes_show' %>
+
-
-
- <% unless @issue.disabled_core_fields.include?('due_date') %>
- 计划完成 :
- <%= format_date(@issue.due_date) ? format_date(@issue.due_date) : "--" %>
-
- <% end %>
-
- <% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
- 目标版本 :
- <%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %>
-
- <% end %>
-
-
- <% end %>
- <%#= render_custom_fields_rows(@issue) %>
- <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
-
-
-
- <%= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %>
-
-
+
<% if @issue.editable? %>
<%= render :partial => 'edit' %>
-
-
-
+ <%#--引用时不能修改,剥离出引用内容--%>
<%= l(:button_submit) %>
<% end %>
-
<%#= submit_tag l(:button_submit) %>
<%#= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' ,'preview',{:class => "blue_btn fr mr10"}%>
@@ -138,6 +78,7 @@
<%= render :partial => 'changesets', :locals => {:changesets => @changesets} %>
<% end %>
+
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
diff --git a/app/views/journals/new.js.erb b/app/views/journals/new.js.erb
index ae2574595..b24b5ffb6 100644
--- a/app/views/journals/new.js.erb
+++ b/app/views/journals/new.js.erb
@@ -1,10 +1,11 @@
$('#issue_notes').val("<%= raw escape_javascript(@content) %>");
<%
# when quoting a private journal, check the private checkbox
- if @journal && @journal.private_notes?
+ if @journal && @journal.private_notes?
%>
$('#issue_private_notes').attr('checked', true);
<% end %>
+//quote_issue_journal()
showAndScrollTo("update", "notes");
$('#notes').scrollTop = $('#notes').scrollHeight - $('#notes').clientHeight;
diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb
index 07f852914..9fe25ce95 100644
--- a/app/views/layouts/_base_feedback.html.erb
+++ b/app/views/layouts/_base_feedback.html.erb
@@ -1,9 +1,9 @@
@@ -39,7 +39,7 @@
minStatue : true,
skin : 'blue',
durationTime : 1000
- }
+ };
var options = $.extend(defaults, options);
this.each(function(){
@@ -56,13 +56,13 @@
if(options.minStatue == "true"){
$(".show_btn").css("float", options.float);
sideContent.css('width', 0);
- show_btn.css('width', 25);
+ show_btn.css('width', 29);
}
//close
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
- show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
+ show_btn.stop(true, true).delay(300).animate({ width: '29px'},"fast");
cookiesave('minStatue','true','','','');
});
//show
@@ -83,14 +83,10 @@ $(function(){
$("#button1").click(function(){
myTips("<%= l(:label_feedback_success) %>","success");
});
-
});
function f_submit()
{
-// var subject = $("#memo_subject").val();
-// var content = $("#memo_content_1").val();
-// $("#memo_subject").val(subject+":"+ content.substr(0,18)+"...");
$("#new_memo").submit();
}
@@ -169,15 +165,15 @@ function cookieget(n)
<% get_memo %>
- <% if @public_forum %>
- <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
- <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
- <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
- <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
-
您还能输入50 个字符
-
<%= l(:label_submit)%>
- <% end %>
- <% end %>
+ <% if @public_forum %>
+ <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
+ <%= f.text_area :subject,:id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
+ <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
+ <%#= f.submit :value => l(:label_memo_create), :class => "opnionButton", :id => "button1" %>
+
您还能输入50 个字符
+
<%= l(:label_submit)%>
+ <% end %>
+ <% end %>
- <%= l(:label_submit)%>
+
+ <%= l(:label_submit)%>
+
+
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index 812873045..752853c60 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -5,7 +5,7 @@
服务协议 |
<%= l(:label_recruitment_information)%> |
<%= l(:label_surpport_group)%> |
- <%= l(:label_forums)%>
+ <%= l(:label_forums)%>
diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb
index db0a3c3ee..136e49b37 100644
--- a/app/views/layouts/_new_feedback.html.erb
+++ b/app/views/layouts/_new_feedback.html.erb
@@ -30,6 +30,7 @@
- 在线客服
+ <%= l(:label_submit)%>
+
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb
index c68e917f5..0a377b1e5 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,114 @@
<%= 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 +135,77 @@
<% end%>
+
+
+
+
+
<%= link_to image_tag(url_to_avatar(@forum.creator),:width=>75,:height => 75,:alt=>'贴吧图像' ),user_path( @forum.creator) %>
+
+
+
+
+
+
+
+ <%if @forum.creator.id == User.current.id%>
+
+
+
编辑贴吧
+
删除贴吧
+
+ <% end %>
+
+
+
<%= 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) %>
-
-
-
-
-
-
- <%= render_flash_messages %>
- <%= yield %>
- <%= call_hook :view_layouts_base_content %>
-
+
+
+
+
+
+ <%= 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 %>