parent
ca9da99f7e
commit
60be338848
@ -1,9 +1,10 @@
|
|||||||
class HomeworkAttach < ActiveRecord::Base
|
class HomeworkAttach < ActiveRecord::Base
|
||||||
attr_accessible :bid_id, :user_id
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :bid
|
belongs_to :bid
|
||||||
|
|
||||||
|
safe_attributes "bid_id",
|
||||||
|
"user_id"
|
||||||
acts_as_attachable
|
acts_as_attachable
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
|
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
|
||||||
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
|
<% if @attachment.new_record? %>
|
||||||
fileSpan.find('a.remove-upload')
|
fileSpan.hide();
|
||||||
.attr({
|
alert("<%= escape_javascript @attachment.errors.full_messages.join(', ') %>");
|
||||||
"data-remote": true,
|
<% else %>
|
||||||
"data-method": 'delete',
|
$('<input>', { type: 'hidden', name: 'attachments[<%= j params[:attachment_id] %>][token]' } ).val('<%= j @attachment.token %>').appendTo(fileSpan);
|
||||||
href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
|
fileSpan.find('a.remove-upload')
|
||||||
})
|
.attr({
|
||||||
.off('click');
|
"data-remote": true,
|
||||||
|
"data-method": 'delete',
|
||||||
|
href: '<%= j attachment_path(@attachment, :attachment_id => params[:attachment_id], :format => 'js') %>'
|
||||||
|
})
|
||||||
|
.off('click');
|
||||||
|
<% end %>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
$('#bidding_project_list').html('<%= escape_javascript(render(:partial => 'homework_list', :locals => {:homework => @homework_list})) %>');
|
$('#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}) )%>')
|
$('#put-bid-form-partial').html(' <%= escape_javascript( render( :partial => 'attachments/form') )%>')
|
||||||
|
$('#flash_notice').remove()
|
||||||
$("#project_id").val("请选择项目");
|
$("#project_id").val("请选择项目");
|
||||||
$("#bid_message").val( "<%= l(:label_bid_reason) %>" );
|
$("#bid_message").val( "<%= l(:label_bid_reason) %>" );
|
||||||
$("#put-bid-form").hide();
|
$("#put-bid-form").hide();
|
||||||
|
alert('<%= @homework_flag %>');
|
@ -0,0 +1,15 @@
|
|||||||
|
<h3><%= l :label_bidding_homework %></h3>
|
||||||
|
<div id="put-bid-form">
|
||||||
|
<%= form_for HomeworkAttach.new, :method => :post, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true} do |f| %>
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<%= l(:label_attachment_plural) %>
|
||||||
|
</legend>
|
||||||
|
<p id="put-bid-form-partial">
|
||||||
|
<%= render :partial => 'attachments/form' %>
|
||||||
|
</p>
|
||||||
|
</fieldset>
|
||||||
|
<%= submit_tag l(:button_create) %>
|
||||||
|
<%= link_to (t :button_back), project_for_bid_homework_path %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
@ -1,58 +1,58 @@
|
|||||||
<div class="project-block">
|
<div class="project-block">
|
||||||
<div class="img-tag">
|
<div class="img-tag">
|
||||||
<%= content_tag('div', tag('img', {:src => '../images/logo-only_med.png', :class => 'img_ta'}, false, false), :class => 'img-tag') %>
|
<%= content_tag('div', tag('img', {:src => '../images/logo-only_med.png', :class => 'img_ta'}, false, false), :class => 'img-tag') %>
|
||||||
</div>
|
</div>
|
||||||
<div class="wiki-description">
|
<div class="wiki-description">
|
||||||
<p>
|
<p>
|
||||||
<span>Claimed by </span><%= content_tag('a', project.name) %> | <span>Analyzed about 11 hours ago</span>
|
<span>Claimed by </span><%= content_tag('a', project.name) %> | <span>Analyzed about 11 hours ago</span>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= textilizable(project.short_description, :project => project) %>
|
<%= textilizable(project.short_description, :project => project) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="information">
|
<div class="information">
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<%= content_tag('a', "9.23M") %><%= content_tag('span', "lines of codes") %>
|
<%= content_tag('a', "9.23M") %><%= content_tag('span', "lines of codes") %>
|
||||||
</p>
|
</p>
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<%= content_tag('a', "963") %><%= content_tag('span', "current contributors") %>
|
<%= content_tag('a', "963") %><%= content_tag('span', "current contributors") %>
|
||||||
</p>
|
</p>
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<%= content_tag('a', "1 day") %><%= content_tag('span', "since last commits") %>
|
<%= content_tag('a', "1 day") %><%= content_tag('span', "since last commits") %>
|
||||||
</p>
|
</p>
|
||||||
<p class="stats">
|
<p class="stats">
|
||||||
<%= content_tag('a', "12,169") %><%= content_tag('span', "users on trustie2") %>
|
<%= content_tag('a', "12,169") %><%= content_tag('span', "users on trustie2") %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="reviews">
|
<div class="reviews">
|
||||||
<%= content_tag('a', tag('img', {:src => '../images/pai.png', :class => 'img-ta'}, false, false), :class => 'img-tag3') %>
|
<%= content_tag('a', tag('img', {:class => 'img-ta'}, false, false), :class => 'img-tag3') %>
|
||||||
<%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %>
|
<%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %>
|
||||||
<%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %>
|
<%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %>
|
||||||
<%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %>
|
<%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="add-info">
|
<div class="add-info">
|
||||||
<div class="main-language">
|
<div class="main-language">
|
||||||
<%= content_tag('a', 'Mostly written in C++') %>
|
<%= content_tag('a', 'Mostly written in C++') %>
|
||||||
</div>
|
</div>
|
||||||
<div class="licences">
|
<div class="licences">
|
||||||
<%= content_tag('a', 'Licenses:') %><%= content_tag('span', 'GPL-2.0+, LGPL, MPL-1.1') %>
|
<%= content_tag('a', 'Licenses:') %><%= content_tag('span', 'GPL-2.0+, LGPL, MPL-1.1') %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<%= tag('img', {:src => "../images/user.png"}, false, false) %>
|
<%= tag('img', {:src => "../images/user.png"}, false, false) %>
|
||||||
<% tags = ProjectTags.find_tag(project.id)
|
<% tags = ProjectTags.find_tag(project.id)
|
||||||
tags.each do |t_tag|
|
tags.each do |t_tag|
|
||||||
content = t_tag.tag.content
|
content = t_tag.tag.content
|
||||||
description = t_tag.description -%>
|
description = t_tag.description -%>
|
||||||
<%= content_tag('a', content, :class => 'tag', :title => description) %>
|
<%= content_tag('a', content, :class => 'tag', :title => description) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= content_tag('a', 'css', :class => 'tag') %>
|
<%= content_tag('a', 'css', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'web_browser', :class => 'tag') %>
|
<%= content_tag('a', 'web_browser', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'development', :class => 'tag') %>
|
<%= content_tag('a', 'development', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'client', :class => 'tag') %>
|
<%= content_tag('a', 'client', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'web', :class => 'tag') %>
|
<%= content_tag('a', 'web', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'xhtml', :class => 'tag') %>
|
<%= content_tag('a', 'xhtml', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'tabbed', :class => 'tag') %>
|
<%= content_tag('a', 'tabbed', :class => 'tag') %>
|
||||||
<%= content_tag('a', 'and more') %>
|
<%= content_tag('a', 'and more') %>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in new issue