parent
9221d1b376
commit
805ad6600b
@ -0,0 +1,9 @@
|
|||||||
|
class HomeworkAttach < ActiveRecord::Base
|
||||||
|
attr_accessible :bid_id, :user_id
|
||||||
|
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :bid
|
||||||
|
|
||||||
|
acts_as_attachable
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,17 @@
|
|||||||
|
<div id="put-bid-form" style="display: none">
|
||||||
|
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add_homework'},
|
||||||
|
:update => "bidding_project_list",
|
||||||
|
:complete => '$("#put-bid-form").hide();' do |f| %>
|
||||||
|
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
|
||||||
|
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
|
||||||
|
</fieldset>
|
||||||
|
<%= submit_tag l(:button_create) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class='icon icon-add'>
|
||||||
|
<%= toggle_link l(:button_bidding), 'put-bid-form' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id='bidding_project_list'>
|
||||||
|
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
|
||||||
|
</div>
|
@ -0,0 +1,30 @@
|
|||||||
|
<!-- fq -->
|
||||||
|
<%= render_flash_messages %>
|
||||||
|
|
||||||
|
<% @homework_list.each do |homework|%>
|
||||||
|
<% if homework.attachments.any?%>
|
||||||
|
|
||||||
|
<table width="660px" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %></td>
|
||||||
|
<td>
|
||||||
|
<table width="580px" border="0">
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" valign="top"><strong> <%= link_to homework.user, user_path(homework.user)%></strong> <span class="font_lighter">提交了作业</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" width="580px" >
|
||||||
|
<p class="font_description">
|
||||||
|
<% options = {:author => true} %>
|
||||||
|
<%= render :partial => 'attachments/links',
|
||||||
|
:locals => {:attachments => homework.attachments, :options => options} %>
|
||||||
|
<% end %>
|
||||||
|
</p></td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="line_under"></div>
|
||||||
|
|
||||||
|
|
||||||
|
<% end %>
|
@ -0,0 +1,4 @@
|
|||||||
|
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>');
|
||||||
|
$("#project_id").val("请选择项目");
|
||||||
|
$("#bid_message").val("#{l(:label_bid_reason)} ");
|
||||||
|
$("#put-bid-form").hide();
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddHomeworkTypeToBid < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :bids, :homework_type, :integer
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,10 @@
|
|||||||
|
class CreateHomeworkAttaches < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :homework_attaches do |t|
|
||||||
|
t.integer :bid_id
|
||||||
|
t.integer :user_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue