From 5e9bb9a99f89f5d96c400521ea3cf2b67ee25162 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 16 Dec 2013 14:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E6=A1=86?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=EF=BC=8C=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=E9=99=84=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=B9=8B=E5=90=8E=E8=BF=98=E4=BC=9A=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 1 + app/helpers/welcome_helper.rb | 25 ++----------------------- app/views/bids/_homework.html.erb | 2 +- app/views/bids/add_homework.js.erb | 1 + app/views/bids/show_project.html.erb | 1 - app/views/users/show.html.erb | 2 +- public/javascripts/attachments.js | 2 +- 7 files changed, 7 insertions(+), 27 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index aeaf19b4..15e612fc 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -730,6 +730,7 @@ class BidsController < ApplicationController end end @homework_list = @bid.homeworks + @homework = HomeworkAttach.new end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 779228ce..703917c4 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -19,8 +19,7 @@ module WelcomeHelper - StudentRoles = [5, 10] - + include CoursesHelper def find_all_hot_project sort_project_by_hot @@ -101,13 +100,7 @@ module WelcomeHelper end str.html_safe end - - # 返回学生数量,即roles表中定义的Reporter - def studentCount project - # searchCountByRoles project,StudentRoles - # or - searchStudent(project).count - end + def find_new_forum_topics limit=7 Memo.where('memos.parent_id IS NULL').reorder('memos.created_at DESC').limit(limit) # activity = Redmine::Activity::Fetcher.new(nil) @@ -204,18 +197,4 @@ module WelcomeHelper end end - def searchStudent project - searchPeopleByRoles(project, StudentRoles) - end - - def searchPeopleByRoles project, roles_id - people = [] - begin - people = project.members.joins(:member_roles).where("member_roles.role_id IN (:role_id)", {:role_id => roles_id}) - rescue Exception => e - logger.error "[CoursesHelper] ===> #{e}" - end - people - end - end diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index a7a1df85..79d10bff 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -6,7 +6,7 @@ <%= l(:label_attachment_plural) %> -

+

<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>

diff --git a/app/views/bids/add_homework.js.erb b/app/views/bids/add_homework.js.erb index 7231e64d..90085a50 100644 --- a/app/views/bids/add_homework.js.erb +++ b/app/views/bids/add_homework.js.erb @@ -1,4 +1,5 @@ $('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>'); +$('#put-bid-form-partial').html(' <%= escape_javascript( render( :partial => 'attachments/form', :locals => {:container => @homework}) )%>') $("#project_id").val("请选择项目"); $("#bid_message").val( "<%= l(:label_bid_reason) %>" ); $("#put-bid-form").hide(); \ No newline at end of file diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index 68744ee2..be9c9db3 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -104,7 +104,6 @@ <% end %> <% end %> -<% logger.debug "=============@bidding_project=====================#{@bidding_project.count}" %>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project,:bid => @bid} %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ee6757cf..a3472f04 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -18,7 +18,7 @@ <% unless @activity.empty? %>
<% @activity.each do |e| %> - <% next if( (e.act_type == 'JournalsForMessage') && !(User.current.id.eql?(params[:id].to_i)) ) %> + <% #next if( (e.act_type == 'JournalsForMessage') && !(User.current.id.eql?(params[:id].to_i)) ) %> <% act = e.act %> <% unless act.nil? %> diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 260c060e..86bf0633 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -12,7 +12,7 @@ function addFile(inputEl, file, eagerUpload) { fileSpan.append( $('', { type: 'text', 'class': 'filename readonly', name: 'attachments[' + attachmentId + '][filename]', readonly: 'readonly'} ).val(file.name), $('', { type: 'text', 'class': 'description', name: 'attachments[' + attachmentId + '][description]', maxlength: 255, placeholder: $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), - $(' ').attr({ href: "#", 'class': 'remove-upload' }).click(removeFile).toggle(!eagerUpload) + $(' ').attr({ href: "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload) ).appendTo('#attachments_fields'); if(eagerUpload) {