From 70357683f763afd806bd45f495583adf3efd3de8 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 14:51:06 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=A1=B9=E7=9B=AE=E9=82=AE=E4=BB=B6=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/mailer/applied_project.html.erb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/mailer/applied_project.html.erb b/app/views/mailer/applied_project.html.erb index 4f266e6ce..eb49c35b9 100644 --- a/app/views/mailer/applied_project.html.erb +++ b/app/views/mailer/applied_project.html.erb @@ -1,5 +1,11 @@ -<%= l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) %> -
- -

<%= link_to(h(@project.name), @applied_url) %>

+
+ +
+
From b70104cee819082d2dda69ff7b88c4e8bc3ebf5d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 14:54:03 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=AE=8C=E6=95=B4mail.text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/mailer/applied_project.text.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/mailer/applied_project.text.erb b/app/views/mailer/applied_project.text.erb index 7af8c2018..0dd3f308d 100644 --- a/app/views/mailer/applied_project.text.erb +++ b/app/views/mailer/applied_project.text.erb @@ -1,4 +1,7 @@ -<%= l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) %> +<%= l(:mail_issue_content)%> +<%=link_to @user.show_name, user_url(@user) %> +<%=link_to @project.name, @applied_url %> + + -

<%= link_to(h(@project.name), @applied_url) %>

From 6e9db8b9226c7d48ff3829a0fd29ca5ce76126cb Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 15:08:40 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=B0=81=E8=A3=85=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 40 +++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0783d1805..c00f7ec17 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -101,22 +101,10 @@ 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 @@ -197,6 +185,26 @@ 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 user_system_messages @sytem_messages = SystemMessage.order("created_at desc").all From d9620e416edf0f7fb12920d2db8a31f5d7b0bb44 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 15:17:10 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E4=BC=98=E5=8C=96=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E8=AE=BE=E4=B8=BA=E5=B7=B2=E8=AF=BB=E2=80=9D=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c00f7ec17..874f9c607 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -106,16 +106,7 @@ class UsersController < ApplicationController 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] @@ -189,7 +180,6 @@ class UsersController < ApplicationController def update_onclick_time # 记录当前点击按钮的时间 # 考虑到用户未退出刷新消息页面 - message_time = OnclickTime.where("user_id =?", User.current).first if message_time.nil? message_new_time = OnclickTime.new @@ -205,6 +195,20 @@ class UsersController < ApplicationController @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 From b49d19cdb26220196c4b21a91a8b3fcb8bf172b5 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 15:32:28 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) 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 From 48b93f21133f6c18c69547b42214738faa68ee8d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 21 Sep 2015 17:51:00 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=82=B9=E5=AF=B9=E7=82=B9=E5=8F=91=E9=80=81?= =?UTF-8?q?=20=E5=9B=9E=E5=A4=8D=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=E6=88=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 3 --- app/models/journal.rb | 9 +++++++-- app/models/journal_reply.rb | 25 +++++++++++++++++++++++++ app/views/issues/_edit.html.erb | 6 ------ 4 files changed, 32 insertions(+), 11 deletions(-) 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/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..430d506ed 100644 --- a/app/models/journal_reply.rb +++ b/app/models/journal_reply.rb @@ -5,8 +5,33 @@ 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 + receivers << self.replier + end + if journal.user_id != journal.issue.author_id && self.reply_id != journal.issue.author_id + receivers << self.journal.issue.author + end + receivers.each do |r| + journal.forge_messages << ForgeMessage.new(:user_id =>r, :project_id => journal.issue.project, :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/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index 1f3f984b4..3a3782e47 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -6,15 +6,9 @@ - <% end %> - - <% if @journals.present? %>
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %> From e295c74a918b8ee09cf9dc72c30de58de666fc32 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 22 Sep 2015 14:36:28 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E7=95=99=E8=A8=80=E4=B8=AD=EF=BC=8C=E5=BD=93=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA=EF=BC=88blank=EF=BC=89?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = '' From 200861cfefc82291e24fb76f57d381afdcb8932b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 22 Sep 2015 16:08:30 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E5=AE=8C=E6=88=90issue=E7=82=B9=E5=AF=B9?= =?UTF-8?q?=E7=82=B9=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal_reply.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/journal_reply.rb b/app/models/journal_reply.rb index 430d506ed..a1ea761af 100644 --- a/app/models/journal_reply.rb +++ b/app/models/journal_reply.rb @@ -16,14 +16,15 @@ class JournalReply < ActiveRecord::Base replier = User.find(self.reply_id) receivers = [] # 被回复的人发送消息 - if journal.user_id != self.reply_id - receivers << self.replier + 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, :project_id => journal.issue.project, :viewed => false) + 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 From 8d64114c5827f526a08e0d9a9729aa9d17f1a65a Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 22 Sep 2015 17:31:33 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/journals_controller.rb | 9 ++++----- app/views/issues/show.html.erb | 8 ++------ 2 files changed, 6 insertions(+), 11 deletions(-) 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{
((.|\s)*?)
}m, '[...]') - @content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> " - @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - # @content = "
" << @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/views/issues/show.html.erb b/app/views/issues/show.html.erb index 01cbea1c1..d57be8a91 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -20,12 +20,8 @@


-

<%= @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' %> From 5b671c5109ef0b5dd26f17a6f2b3295084e57695 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 23 Sep 2015 14:27:47 +0800 Subject: [PATCH 10/18] =?UTF-8?q?issue=20=E5=BC=95=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9=20issue=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_attributes.html.erb | 48 ++++----- app/views/issues/_attributes_show.html.erb | 52 ++++++++++ app/views/issues/_edit.html.erb | 4 +- app/views/issues/_form.html.erb | 22 ++--- app/views/issues/_form_custom_fields.html.erb | 22 ++--- app/views/issues/show.html.erb | 99 +++++-------------- app/views/journals/new.js.erb | 3 +- public/javascripts/project.js | 3 + 8 files changed, 122 insertions(+), 131 deletions(-) create mode 100644 app/views/issues/_attributes_show.html.erb 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 @@
  • <% 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 @@
  • <% 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 @@ <% 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? %> <%= 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 @@
  • <% 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 @@
  • <% 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 @@
  • <% 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.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 %> +
      +
    +
      + <% unless @issue.disabled_core_fields.include?('start_date') %> +
    •  开始  : 

      <%= format_date(@issue.start_date) %>

      +
    • + <% end %> +
      + <% unless @issue.disabled_core_fields.include?('estimated_hours') %> +
    •  周期  : 

      <%= l_hours(@issue.estimated_hours) %> +
    • + <% 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 3a3782e47..c6b805d0a 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -14,7 +14,9 @@ <%= 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? %>

    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 d57be8a91..67867e2c6 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -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,100 +21,53 @@


    - 由<%= @issue.author %> - 添加于 <%= format_time(@issue.created_on).html_safe %> + 由<%= @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 -%> + +
    + + + <%= link_to_attachment_project @issue, :thumbnails => true %>
    <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> -
    -
    - -
    - <%= 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' %> + + + <%# 该应用是对issue主题内容的引用,对应:to => 'journals#new %> + + +
    +
    -
      - <% unless @issue.disabled_core_fields.include?('start_date') %> -
    •  开始  : 

      <%= format_date(@issue.start_date) %>

      -
    • - <% end %> -
      - <% unless @issue.disabled_core_fields.include?('estimated_hours') %> -
    •  周期  : 

      <%= l_hours(@issue.estimated_hours) %> -
    • - <% 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) %> - - -
    - <%= 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"}%> @@ -124,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/public/javascripts/project.js b/public/javascripts/project.js index 7e9643bc7..d3c3377f5 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -369,6 +369,9 @@ $(document).ready(function () { $('html, body').animate({scrollTop: $('#' + id).offset().top}, 400); } + function quote_issue_journal(){ + document.getElementById("#issue_notes").focus(); + } /*缺陷完成度决定缺陷状态*/ function PrecentChange(obj) { From 841c680bb14c04d3d7b826b6793540dc80469bb4 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 23 Sep 2015 14:53:50 +0800 Subject: [PATCH 11/18] =?UTF-8?q?1.=E4=BD=9C=E4=B8=9A=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E8=80=81=E5=B8=88=E3=80=81?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E8=AF=BE=E7=A8=8B=E5=AD=A3=E5=BA=A6?= =?UTF-8?q?=E7=AD=89=E4=BF=A1=E6=81=AF=202.=E4=BD=9C=E4=B8=9A=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8Ctips=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 9 ++++++--- public/stylesheets/new_user.css | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index ac4572b5b..97a67a717 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -118,15 +118,18 @@ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
    • <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
    • -
    • <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了作业:
    • -
    • +
    • <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %> + ">发布了作业于课程:<%= ma.course_message.course.name %> +
    • +
    • <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
    保存 <% end %> diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4f44a8b60..d8902876e 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -852,7 +852,7 @@ div.flash.warning, .conflict { /*弹出框*/ .black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);} .white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} -.white_content02{display:none;position:fixed;top:15%;left:30%;width:310px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} +.white_content02{display:none;position:fixed;top:15%;left:30%;width:450px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} .floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;} a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;} a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} From 4c71e2c2562e101cd6097b7fad38c940f2716504 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 24 Sep 2015 11:44:02 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=8F=90=E7=A4=BAJS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/projects_helper.rb | 11 ++++++++++- app/views/projects/new.html.erb | 19 +++++++++++++++---- config/locales/projects/zh.yml | 3 +++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index f0ce70dc2..41f25d1a3 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -95,7 +95,16 @@ module ProjectsHelper 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) diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index f78bbf0c5..e57afe0ad 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -17,7 +17,8 @@
  • - <%= select_tag :project_new_type, options_for_select([["开发模式", "1"], ["研讨模式", "2"], ["圈子模式", "3"]]) %>为团队提供系列在线开发工具! + <%= select_tag :project_new_type, options_for_select([["开发模式", "1"], ["研讨模式", "2"], ["圈子模式", "3"]]) %> + 为团队提供系列在线开发工具!
  • @@ -90,12 +91,22 @@ } } - $(document).ready(function(){ + $(function(){ $('#project_new_type').change(function(){ - alert($(this).children('option:selected').val("开发模式:面向小组开发,支持问题跟踪、代码托管、论坛交流等所有功能。")); - var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值 + var type = $('#project_new_type').val(); + if(type == '1'){ + $(this).next().html("<%= l(:label_type_des_development)%>"); + } + else if(type == '2'){ + $(this).next().html("<%= l(:label_type_des_research)%>"); + } + else if(type == '3'){ + $(this).next().html("<%= l(:label_type_des_friend)%>"); + } +// var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值 // var p2=$('#param2').val();//获取本页面其他标签的值 }) + }) diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index b4234f358..dbce93219 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -61,6 +61,9 @@ zh: label_research_group: 研讨模式 label_development_team: 开发模式 label_type_project: 项目类型 + label_type_des_development: 开发模式:面向小组开发,支持问题跟踪、代码托管、论坛交流等所有功能。 + label_type_des_research: 研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。 + label_type_des_friend: 圈子模式:面向好友分享,支持论坛交流、资源分享等。 label_member: 成员 project_module_attachments: 资源