删除提示框作业,作业提交的问题。附件提交之后还会存在。

This commit is contained in:
yanxd 2013-12-16 14:39:02 +08:00
parent 733524b413
commit 5e9bb9a99f
7 changed files with 7 additions and 27 deletions

View File

@ -730,6 +730,7 @@ class BidsController < ApplicationController
end
end
@homework_list = @bid.homeworks
@homework = HomeworkAttach.new
end

View File

@ -19,8 +19,7 @@
module WelcomeHelper
StudentRoles = [5, 10]
include CoursesHelper
def find_all_hot_project
sort_project_by_hot
@ -102,12 +101,6 @@ module WelcomeHelper
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

View File

@ -6,7 +6,7 @@
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</p>
</fieldset>

View File

@ -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();

View File

@ -104,7 +104,6 @@
<% end %>
</div>
<% end %>
<% logger.debug "=============@bidding_project=====================#{@bidding_project.count}" %>
<div id='bidding_project_list'>
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project,:bid => @bid} %>
</div>

View File

@ -18,7 +18,7 @@
<% unless @activity.empty? %>
<div id="activity">
<% @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? %>

View File

@ -12,7 +12,7 @@ function addFile(inputEl, file, eagerUpload) {
fileSpan.append(
$('<input>', { type: 'text', 'class': 'filename readonly', name: 'attachments[' + attachmentId + '][filename]', readonly: 'readonly'} ).val(file.name),
$('<input>', { type: 'text', 'class': 'description', name: 'attachments[' + attachmentId + '][description]', maxlength: 255, placeholder: $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
$('<a>&nbsp</a>').attr({ href: "#", 'class': 'remove-upload' }).click(removeFile).toggle(!eagerUpload)
$('<a>&nbsp</a>').attr({ href: "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload)
).appendTo('#attachments_fields');
if(eagerUpload) {