|
|
|
@ -13,17 +13,19 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function j_submit () {
|
|
|
|
|
alert('start')
|
|
|
|
|
alert('start');
|
|
|
|
|
var submit_homework = function(){
|
|
|
|
|
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
|
|
|
|
|
};
|
|
|
|
|
alert('stop')
|
|
|
|
|
alert('stop');
|
|
|
|
|
$.globalEval(submit_homework());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
|
|
|
|
|
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? &&
|
|
|
|
|
(Member.where('user_id = ? and project_id = ?', User.current.id,
|
|
|
|
|
@bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) && cur_user_homework_for_bid(@bid).count == 0 %>
|
|
|
|
|
<div class='icon icon-add'>
|
|
|
|
|
<!-- <%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %> -->
|
|
|
|
|
<%= link_to l(:label_course_new_homework),new_homework_attach_path %>
|
|
|
|
|