diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 41d302829..00d814bd3 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -5,9 +5,9 @@ class HomeworkCommonController < ApplicationController layout "base_courses" include StudentWorkHelper - before_filter :find_course, :only => [:index,:new,:create,:next_step] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy] - before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment] + before_filter :find_course, :only => [:index,:new,:create] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr] + before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr] before_filter :member_of_course, :only => [:index] def index @@ -23,116 +23,11 @@ class HomeworkCommonController < ApplicationController #新建作业,在个人作业列表创建作业 def new render_404 - # @homework_type = "1" - # - # @homework = HomeworkCommon.new - # @homework.safe_attributes = params[:homework_common] - # @homework.late_penalty = 2 - # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.publish_time = Time.now.strftime('%Y-%m-%d') - # - # if @homework_type == "1" - # #匿评作业相关属性 - # @homework_detail_manual = HomeworkDetailManual.new - # @homework_detail_manual.ta_proportion = 0.6 - # @homework_detail_manual.absence_penalty = 2 - # @homework_detail_manual.evaluation_num = 3 - # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') - # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.homework_detail_manual = @homework_detail_manual - # elsif @homework_type == "2" - # #编程作业相关属性 - # @homework_detail_programing = HomeworkDetailPrograming.new - # @homework.homework_detail_programing = @homework_detail_programing - # end - # respond_to do |format| - # format.html - # end end #新建作业,在个人作业列表创建作业 def create redirect_to user_homeworks_user_path(User.current.id) - # if params[:homework_common] - # homework = HomeworkCommon.new - # homework.name = params[:homework_common][:name] - # homework.description = params[:homework_common][:description] - # homework.end_time = params[:homework_common][:end_time] - # homework.publish_time = params[:homework_common][:publish_time] - # homework.homework_type = params[:homework_common][:homework_type] - # homework.late_penalty = params[:late_penalty] - # homework.user_id = User.current.id - # homework.course_id = @course.id - # - # homework.save_attachments(params[:attachments]) - # render_attachment_warning_if_needed(homework) - # - # if homework.homework_type == 2 - # homework_detail_programing = HomeworkDetailPrograming.new - # homework_detail_programing.language = params[:language] - # homework_detail_programing.standard_code = params[:standard_code] - # homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6 - # question = {title:homework.name,content:homework.description} - # question[:input] = [] - # question[:output] = [] - # if params[:input] && params[:output] && params[:result] - # params[:input].each do |k,v| - # if params[:output].include? k - # homework_test = HomeworkTest.new - # homework_test.input = v - # homework_test.output = params[:output][k] - # homework_test.result = params[:result][k] - # homework_test.error_msg = params[:error_msg] - # homework.homework_tests << homework_test - # question[:input] << homework_test.input - # question[:output] << homework_test.output - # end - # end - # end - # - # # uri = URI('http://192.168.80.21:8080/api/questions.json') - # # body = question.to_json - # # res = Net::HTTP.new(uri.host, uri.port).start do |client| - # # request = Net::HTTP::Post.new(uri.path) - # # request.body = body - # # request["Content-Type"] = "application/json" - # # client.request(request) - # # end - # # result = JSON.parse(res.body) - # # homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 - # - # homework.homework_detail_programing = homework_detail_programing - # else - # #匿评作业相关属性 - # homework_detail_manual = HomeworkDetailManual.new - # homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 - # homework_detail_manual.comment_status = 1 - # homework_detail_manual.evaluation_start = params[:evaluation_start] - # homework_detail_manual.evaluation_end = params[:evaluation_end] - # homework_detail_manual.evaluation_num = params[:evaluation_num] - # homework_detail_manual.absence_penalty = params[:absence_penalty] - # homework.homework_detail_manual = homework_detail_manual - # end - # - # if homework.save - # homework_detail_programing.save if homework_detail_programing - # homework_detail_manual.save if homework_detail_manual - # respond_to do |format| - # format.html { - # flash[:notice] = l(:notice_successful_create) - # redirect_to homework_common_index_path(:course => @course.id) - # } - # end - # return - # end - # end - # - # respond_to do |format| - # format.html { - # flash[:notice] = l(:notice_failed_create) - # redirect_to new_homework_common_path(:course => @course.id) - # } - # end end def edit @@ -294,6 +189,27 @@ class HomeworkCommonController < ApplicationController end end + #启动匿评参数设置 + def start_evaluation_set + + end + + #设置匿评参数 + def set_evaluation_attr + if @homework_detail_manual + unless params[:evaluation_start].to_s == @homework_detail_manual.evaluation_start.to_s + @homework_detail_manual.evaluation_start = params[:evaluation_start] + end + + unless @homework_detail_manual.evaluation_end.to_s == params[:evaluation_end].to_s + @homework_detail_manual.evaluation_end = params[:evaluation_end] + end + + @homework_detail_manual.evaluation_num = params[:evaluation_num] + @homework_detail_manual.save + end + end + private #获取课程 def find_course 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{
((.|\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/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 4d80efdf3..414ef6d70 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,7 @@ 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] 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 +220,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/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/application_helper.rb b/app/helpers/application_helper.rb index d7fac9a7d..e100a8fc9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2306,7 +2306,7 @@ module ApplicationHelper when 2 link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink' when 3 - link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" + # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" end else link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于2时才可以启动匿评" 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/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/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/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/homework_common/_set_evalutation_att.html.erb b/app/views/homework_common/_set_evalutation_att.html.erb new file mode 100644 index 000000000..01d9351ee --- /dev/null +++ b/app/views/homework_common/_set_evalutation_att.html.erb @@ -0,0 +1,53 @@ ++ <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id},:method => "post",:remote => true) do |f|%> + 匿评设置 + + +\ No newline at end of file diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 4bf3d1781..8799bcab9 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -25,9 +25,9 @@ ( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> ) <% if @is_teacher%> - <%= homework_anonymous_comment(homework)%> <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework,:is_in_course => 1),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %> - <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit") %> + <%= link_to(l(:button_edit),edit_homework_common_path(homework,:is_in_course => 1), :class => "fr mr10 work_edit ml10") %> + <%= homework_anonymous_comment(homework)%> <% elsif @is_student%> <%= student_anonymous_comment homework %> <%= student_new_homework homework %> diff --git a/app/views/homework_common/set_evaluation_attr.js.erb b/app/views/homework_common/set_evaluation_attr.js.erb new file mode 100644 index 000000000..d6ab73df5 --- /dev/null +++ b/app/views/homework_common/set_evaluation_attr.js.erb @@ -0,0 +1 @@ +clickCanel(); \ No newline at end of file diff --git a/app/views/homework_common/start_evaluation_set.js.erb b/app/views/homework_common/start_evaluation_set.js.erb new file mode 100644 index 000000000..9d494f908 --- /dev/null +++ b/app/views/homework_common/start_evaluation_set.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>'); +showModal('ajax-modal', '350px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + +""); +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); \ No newline at end of file diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 3cbac1bf6..4725d5731 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -1,2 +1,2 @@ -$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('匿评结束'); +$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith(''); alert('关闭成功'); \ 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 @@+ 开启匿评 ++ + ++ + <%= calendar_for('evaluation_start_time')%> ++ + ++ 关闭匿评 ++ + ++ + <%= calendar_for('evaluation_end_time')%> ++ + ++ 匿评人数 + + + ++ + ++ 禁用匿评 + + 禁用后将无法进行学生互评 ++ + + + + <% end%> +<% 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| %> ++ \ 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 @@ - <% end %> - - <% if @journals.present? %>+
+- + + <% unless @issue.disabled_core_fields.include?('assigned_to_id') %> +
状态 :
<%= @issue.status.name %>
+- + <% end %> + +
指派给 :
<%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %> ++
+- + + <% unless @issue.disabled_core_fields.include?('done_ratio') %> +
优先级 :
<%= @issue.priority.name %> +- + <% end %> + +
% 完成 :
<%= @issue.done_ratio %>% ++ <% unless @issue.disabled_core_fields.include?('start_date') %> +
+- + <% end %> + + <% unless @issue.disabled_core_fields.include?('estimated_hours') %> +
开始 :
<%= format_date(@issue.start_date) %>
+- + <% end %> + +
周期 :
<%= l_hours(@issue.estimated_hours) %> ++ <% unless @issue.disabled_core_fields.include?('due_date') %> +
+ <% end %> + <%#= render_custom_fields_rows(@issue) %> + <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %> +- + <% end %> + + <% unless @issue.disabled_core_fields.include?('fixed_version_id') %> +
计划完成 :
<%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %> +- + <% end %> + +
目标版本 :
<%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %> +<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %><% end %> - ++ +