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) {