增加需求结束方法。
This commit is contained in:
parent
fe0845d475
commit
dcbaf1c02b
|
@ -2,9 +2,10 @@
|
||||||
class BidsController < ApplicationController
|
class BidsController < ApplicationController
|
||||||
#Added by young
|
#Added by young
|
||||||
menu_item :respond
|
menu_item :respond
|
||||||
menu_item :project, :only => :show_project
|
menu_item :project, :only => [:show_project,:show_results]
|
||||||
#Ended by young
|
#Ended by young
|
||||||
before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add, :new]
|
before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results]
|
||||||
|
before_filter :require_login,:only => [:set_reward]
|
||||||
|
|
||||||
helper :watchers
|
helper :watchers
|
||||||
def index
|
def index
|
||||||
|
@ -17,13 +18,6 @@ class BidsController < ApplicationController
|
||||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||||
|
|
||||||
@offset ||= @bid_pages.reverse_offset
|
@offset ||= @bid_pages.reverse_offset
|
||||||
#@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
|
||||||
# unless @offset == 0
|
|
||||||
# @bids = @bids.offset(@offset).limit(@limit).all.reverse
|
|
||||||
# else
|
|
||||||
# limit = @bid_count % @limit
|
|
||||||
# @bids = @bids.offset(@offset).limit(limit).all.reverse
|
|
||||||
# end
|
|
||||||
#added by nie
|
#added by nie
|
||||||
if params[:bid_sort_type].present?
|
if params[:bid_sort_type].present?
|
||||||
case params[:bid_sort_type]
|
case params[:bid_sort_type]
|
||||||
|
@ -58,20 +52,6 @@ class BidsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
# @limit = api_offset_and_limit({:limit => 5})
|
|
||||||
# @bids = Bid.visible
|
|
||||||
# @bids = @bids.like(params[:name]) if params[:name].present?
|
|
||||||
# @bid_count = @bids.count
|
|
||||||
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
|
|
||||||
# @offset ||= @bid_pages.reverse_offset
|
|
||||||
# #@bids = @bids.offset(@offset).limit(@limit).all.reverse
|
|
||||||
# unless @offset == 0
|
|
||||||
# @bids = @bid_count.offset(@offset).limit(@limit).all.reverse
|
|
||||||
# else
|
|
||||||
# limit = @bid_count%@limit
|
|
||||||
# @bids = @bid_count.offset(@offset).limit(limit).all.reverse
|
|
||||||
# end
|
|
||||||
# #end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -84,9 +64,6 @@ class BidsController < ApplicationController
|
||||||
@jour = @jours[@offset, @limit]
|
@jour = @jours[@offset, @limit]
|
||||||
@state = false
|
@state = false
|
||||||
|
|
||||||
#
|
|
||||||
# @journals = @bid.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all
|
|
||||||
# @journals.each_with_index {|j,i| j.indice = i+1}
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => 'base_bids'
|
render :layout => 'base_bids'
|
||||||
|
@ -147,12 +124,6 @@ class BidsController < ApplicationController
|
||||||
end
|
end
|
||||||
refer_user_id = params[:bid_message][:reference_user_id].to_i
|
refer_user_id = params[:bid_message][:reference_user_id].to_i
|
||||||
@bid.add_jour(User.current, message, refer_user_id)
|
@bid.add_jour(User.current, message, refer_user_id)
|
||||||
# if a_message.size > 5
|
|
||||||
# @message = a_message[-5, 5]
|
|
||||||
# else
|
|
||||||
# @message = a_message
|
|
||||||
# end
|
|
||||||
# @message_count = a_message.count
|
|
||||||
end
|
end
|
||||||
@user = @bid.author
|
@user = @bid.author
|
||||||
@jours = @bid.journals_for_messages.reverse
|
@jours = @bid.journals_for_messages.reverse
|
||||||
|
@ -221,37 +192,6 @@ class BidsController < ApplicationController
|
||||||
def new_bid
|
def new_bid
|
||||||
@bid = Bid.new
|
@bid = Bid.new
|
||||||
@bid.safe_attributes = params[:bid]
|
@bid.safe_attributes = params[:bid]
|
||||||
# if params[:bid_title]
|
|
||||||
# # if params[:bid_budget].to_s =~ /^(\d+)$|^(\d+).([0-9]{2})$/
|
|
||||||
# unless params[:bid_reward_type] == "0"
|
|
||||||
# if params[:bid_deadline].to_s =~ /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
|
|
||||||
# bid = Bid.creat_bids(params[:bid_budget], params[:bid_deadline], params[:bid_title] , params[:bid_description], params[:bid_reward_type].to_i)
|
|
||||||
# unless bid.watched_by?(User.current)
|
|
||||||
# if bid.add_watcher(User.current)
|
|
||||||
# flash[:notice] = l(:label_bid_succeed)
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# else
|
|
||||||
# flash[:error] = l(:label_wrong_date)
|
|
||||||
# end
|
|
||||||
# else
|
|
||||||
# flash[:error] = "wrong"
|
|
||||||
# end
|
|
||||||
# # else
|
|
||||||
# # flash[:error] = l(:label_wrong_budget)
|
|
||||||
# # end
|
|
||||||
# end
|
|
||||||
# @limit = 5
|
|
||||||
# @bid_count = Bid.count
|
|
||||||
# @bid_pages = Paginator.new @bid_count, @limit, params['page']
|
|
||||||
# @offset ||= @bid_pages.offset
|
|
||||||
# @bids = Bid.offset(@offset).limit(@limit).all
|
|
||||||
# respond_to do |format|
|
|
||||||
# # format.html
|
|
||||||
# format.html { redirect_to :back }
|
|
||||||
# format.js
|
|
||||||
# # format.api { render_api_ok }
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_bid
|
def create_bid
|
||||||
|
@ -300,6 +240,33 @@ class BidsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#added by william
|
||||||
|
#used to set the bidding project reward
|
||||||
|
def set_reward
|
||||||
|
@b_p = nil
|
||||||
|
@biding_project_id = nil
|
||||||
|
|
||||||
|
if params[:set_reward][:reward]
|
||||||
|
# @bid_id = params[:id]
|
||||||
|
@biding_project_id = params[:set_reward][:b_id]
|
||||||
|
@b_p = BidingProject.find_by_id(@biding_project_id)
|
||||||
|
|
||||||
|
# 把字段存进表中
|
||||||
|
@b_p.update_reward(params[:set_reward][:reward].to_s)
|
||||||
|
end
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# added by william
|
||||||
|
# used to manage the bid and end the bid
|
||||||
|
def manage
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_bid
|
def find_bid
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#enconding:utf-8
|
||||||
# fq
|
# fq
|
||||||
module BidsHelper
|
module BidsHelper
|
||||||
|
|
||||||
|
|
||||||
def render_notes(bid, journal, options={})
|
def render_notes(bid, journal, options={})
|
||||||
content = ''
|
content = ''
|
||||||
removable = User.current == journal.user || User.current == bid.author
|
removable = User.current == journal.user || User.current == bid.author
|
||||||
|
@ -37,4 +40,10 @@ module BidsHelper
|
||||||
Bid.tagged_with(tag_name).order('updated_on desc')
|
Bid.tagged_with(tag_name).order('updated_on desc')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# used to get the reward and handle the value which can be used to display in views
|
||||||
|
# added by william
|
||||||
|
def get_prize(b_project)
|
||||||
|
b_project.get_reward
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -18,7 +18,8 @@ class Bid < ActiveRecord::Base
|
||||||
# validates_presence_of :deadline, :message => 'test'
|
# validates_presence_of :deadline, :message => 'test'
|
||||||
# validates_format_of :deadline, :with =>
|
# validates_format_of :deadline, :with =>
|
||||||
validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
|
validates_format_of :deadline, :with => /^[\d]{4}[-][\d]{1,2}[-][\d]{1,2}$/
|
||||||
validates_format_of :budget, :with => /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/, :if => Proc.new { |p| p.reward_type == 1 }
|
validates_format_of :budget, :with => /^(\d+)$|^(\d+).([0-9]{2})|^(\d+).([0-9]{1})$/,
|
||||||
|
:if => Proc.new { |p| p.reward_type == 1 }
|
||||||
validates_format_of :budget, :with => /^(\d+)$|^(\d+).([0-9]{1})$/, :if => Proc.new { |p| p.reward_type == 3 }
|
validates_format_of :budget, :with => /^(\d+)$|^(\d+).([0-9]{1})$/, :if => Proc.new { |p| p.reward_type == 3 }
|
||||||
validate :validate_user
|
validate :validate_user
|
||||||
validate :validate_reward_type
|
validate :validate_reward_type
|
||||||
|
@ -99,4 +100,17 @@ class Bid < ActiveRecord::Base
|
||||||
def act_as_activity
|
def act_as_activity
|
||||||
self.acts << Activity.new(:user_id => self.author_id)
|
self.acts << Activity.new(:user_id => self.author_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# used to validate weather the user is the creater of the bid
|
||||||
|
# added by william
|
||||||
|
def validate_bid_manager(user_id)
|
||||||
|
unless user_id.nil?
|
||||||
|
if self.author_id == user_id
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
## fq
|
## fq
|
||||||
class BidingProject < ActiveRecord::Base
|
class BidingProject < ActiveRecord::Base
|
||||||
attr_accessible :bid_id, :project_id, :user_id, :description
|
attr_accessible :bid_id, :project_id, :user_id, :description,:reward
|
||||||
|
|
||||||
belongs_to :bid
|
belongs_to :bid
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
@ -20,6 +20,18 @@ class BidingProject < ActiveRecord::Base
|
||||||
:project_id => project_id, :description => description)
|
:project_id => project_id, :description => description)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# used to update the reward ,the value varies from 0,1,2,3,4,5
|
||||||
|
# added by william
|
||||||
|
def update_reward(which)
|
||||||
|
self.update_attribute(:reward,which)
|
||||||
|
end
|
||||||
|
|
||||||
|
# return the reward,the value is a type of string
|
||||||
|
# added by william
|
||||||
|
def get_reward
|
||||||
|
self.reward
|
||||||
|
end
|
||||||
|
|
||||||
def cancel_bidding
|
def cancel_bidding
|
||||||
unless self.nil?
|
unless self.nil?
|
||||||
if User.current.id == self.user_id
|
if User.current.id == self.user_id
|
||||||
|
@ -43,3 +55,5 @@ class BidingProject < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
<p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
|
<p><%= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
|
||||||
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
|
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
|
||||||
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
<%= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
|
||||||
|
|
||||||
|
<!-- 设置奖项设置的打开 关闭开关-->
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('bid_deadline')%>
|
<p><%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;", :placeholder => "#{l(:label_deadline)}" %><%= calendar_for('bid_deadline')%>
|
||||||
</p>
|
</p>
|
|
@ -1,4 +1,10 @@
|
||||||
<!-- added by fq -->
|
<!-- added by fq -->
|
||||||
|
<!--
|
||||||
|
modified by william 2012-8-30
|
||||||
|
here used to end the bid;
|
||||||
|
when the manager closed it or to the deadline.
|
||||||
|
-->
|
||||||
|
|
||||||
<table width="660px" border="0" align="center">
|
<table width="660px" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="font_lighter" style="font-size: 18px;"><%=l(:label_user_response)%></td>
|
<td class="font_lighter" style="font-size: 18px;"><%=l(:label_user_response)%></td>
|
||||||
|
|
|
@ -74,6 +74,7 @@ border-top: 1px solid #acaeb1; border-bottom: 1px solid #acaeb1; margin-top: 30p
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table id="bidding_table" border="0" width="600" style="margin-top: 10px; margin-left: 30px;">
|
<table id="bidding_table" border="0" width="600" style="margin-top: 10px; margin-left: 30px;">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right"> <%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> </td>
|
<td align="right"> <%= submit_tag l(:button_new_bid), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,51 +1,33 @@
|
||||||
<!-- fq -->
|
<!-- fq -->
|
||||||
<%= render_flash_messages %>
|
<%= render_flash_messages %>
|
||||||
<table width="1000px" border="0" style="padding-left: 15px">
|
|
||||||
|
<!-- 当需求结束时 隐藏我要参加按钮 -->
|
||||||
|
|
||||||
|
<% if @bid.deadline > Date.today %>
|
||||||
|
|
||||||
|
<table width="1000px" border="0" style="padding-left: 15px">
|
||||||
<td class="font_lighter" style="font-size: 18px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
|
<td class="font_lighter" style="font-size: 18px;"><%= l(:label_bidding_project) %>(<%= @bidding_project.count%>)</td>
|
||||||
|
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<td>
|
<td>
|
||||||
<div class='icon icon-add'>
|
<div class='icon icon-add'>
|
||||||
<%= toggle_link l(:button_bidding), 'put-bid-form' %>
|
<%= toggle_link l(:button_bidding), 'put-bid-form' %>
|
||||||
</div></td>
|
</div></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% @bidding_project.each do |b_project|%>
|
<% else %>
|
||||||
<table width="90%" border="0" align='center'>
|
|
||||||
<tr>
|
<div id='bid-over' class="font_lighter" style="font-size: 18px;" align="center">
|
||||||
<td>
|
<%= l(:label_bid_end)%>
|
||||||
<table width="660px" border="0" align='center'>
|
<div class="user_underline"></div>
|
||||||
<tr>
|
</div>
|
||||||
<td width="50px" valign="top" colspan="2" align="middle">
|
|
||||||
<div style="width: 50px; height: 50px;">
|
|
||||||
<%= link_to image_tag(url_to_avatar(b_project.project), :class => 'avatar3'), :class => "avatar" %>
|
|
||||||
</div></td>
|
|
||||||
<td width="60%" valign="top">
|
|
||||||
<table width="100%" valign="top">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" valign="top"><strong><%= link_to(b_project.project.name, project_path(b_project.project)) %></strong><a class="font_lighter"><%= l(:label_join_bidding)%></a></td>
|
|
||||||
</tr>
|
|
||||||
<tr></tr>
|
|
||||||
<tr>
|
|
||||||
<td valign="top"><%= b_project.project.description %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td valign="top"><a class="font_lighter"><%= b_project.created_at%></a></td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
<td width="30%">
|
|
||||||
<div class="bid-user-message" style="border-left: 1px solid rgb(225, 225, 225); margin-left: 20px; padding-left: 20px;">
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<td><%= l(:label_bidding_user) %><%= link_to(b_project.user.name, user_path(b_project.user)) %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason) %><%= b_project.description %></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div></td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 应标项目列表 -->
|
||||||
|
<%= render :partial=> "list_projects",:locals => {:bidding_project => @bidding_project,:bid => @bid }%>
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<% end %></td>
|
<% end %></td>
|
||||||
|
|
||||||
|
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<div class="project-search">
|
<div class="project-search">
|
||||||
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
<%= text_field_tag 'name', params[:name], :size => 30 %>
|
||||||
|
|
|
@ -16,11 +16,20 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
|
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
|
||||||
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%></span></strong></td>
|
|
||||||
|
<td><strong><%= l(:label_bids_reward_method) %>
|
||||||
|
<span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑">
|
||||||
|
<%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%>
|
||||||
|
</span></strong></td>
|
||||||
<% elsif @bid.reward_type == 2%>
|
<% elsif @bid.reward_type == 2%>
|
||||||
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= @bid.budget%></span></strong></td>
|
|
||||||
|
<td><strong><%= l(:label_bids_reward_method) %>
|
||||||
|
<span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑">
|
||||||
|
<%= @bid.budget%>
|
||||||
|
</span></strong></td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %></span></strong></td>
|
<td><strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑">
|
||||||
|
<%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %></span></strong></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
|
@ -32,11 +41,10 @@
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td style="font-size: 15px; color: rgb(0,0,0);"><%= @bid.description %></td></tr>
|
<tr><td style="font-size: 15px; color: rgb(0,0,0);"><%= @bid.description %></td></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 这里是用户的反馈输入框 -->
|
||||||
|
|
||||||
|
|
||||||
<div id="history">
|
<div id="history">
|
||||||
<%= render :partial => 'history', :locals => { :bid => @bid, :journals => @jour, :state => false} %>
|
<%= render :partial => 'history', :locals => { :bid => @bid, :journals => @jour, :state => false} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
|
<!-- 点击我要参加 参加竞标 -->
|
||||||
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
|
<div id = 'flash' style="float:left; width: 100%; display: none" ></div>
|
||||||
<div id="put-bid-form" style="display: none">
|
<div id="put-bid-form" style="display: none">
|
||||||
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
|
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add'},
|
||||||
|
@ -72,9 +73,14 @@
|
||||||
:value => "#{l(:label_bid_reason)}", :style => "resize: none;", :class => 'noline'%></td>
|
:value => "#{l(:label_bid_reason)}", :style => "resize: none;", :class => 'noline'%></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right"><%= submit_tag l(:button_add), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
|
<td align="right">
|
||||||
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
<%= submit_tag l(:button_add), :name => nil , :class => "bid_btn",
|
||||||
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %> </td>
|
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||||
|
:onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
|
||||||
|
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
|
||||||
|
:type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'",
|
||||||
|
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -82,5 +88,5 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div id='bidding_project_list'>
|
<div id='bidding_project_list'>
|
||||||
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %>
|
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project,:bid => @bid} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% content_for :sidebar do %>
|
<% content_for :sidebar do %>
|
||||||
|
|
||||||
<%= form_tag({}, :method => :get) do %>
|
<%= form_tag({}, :method => :get) do %>
|
||||||
<h3><%= l(:label_project_plural) %></h3>
|
<h3><%= l(:label_project_plural) %></h3>
|
||||||
<label for="closed"><%= check_box_tag 'closed', 1, params[:closed] %> <%= l(:label_show_closed_projects) %></label>
|
<label for="closed"><%= check_box_tag 'closed', 1, params[:closed] %> <%= l(:label_show_closed_projects) %></label>
|
||||||
|
|
|
@ -15,16 +15,23 @@
|
||||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%></td>
|
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%></td>
|
||||||
<td><table width="580px" border="0">
|
<td><table width="580px" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" valign="top"><strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong> <span class="font_lighter"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= l(:label_new_activity) %></span> <%= link_to format_activity_title(e.event_title), e.event_url %></td>
|
<td colspan="2" valign="top"><strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong> <span class="font_lighter">
|
||||||
|
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= l(:label_new_activity) %>
|
||||||
|
</span>
|
||||||
|
<%= link_to format_activity_title(e.event_title), e.event_url %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable(e.event_description) %></p></td>
|
<td colspan="2" width="580px" ><p class="font_description"><%= textilizable(e.event_description) %></p></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td align="left"><a class="font_lighter"><%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></a></td>
|
<td align="left"><a class="font_lighter">
|
||||||
|
<%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></a></td>
|
||||||
<% if e.event_type == "issue" %>
|
<% if e.event_type == "issue" %>
|
||||||
<td align="right"><span><%= link_to l(:label_find_all_comments), issue_path(e) %></span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td>
|
<td align="right"><span>
|
||||||
|
<%= link_to l(:label_find_all_comments), issue_path(e) %>
|
||||||
|
</span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
|
|
|
@ -1354,3 +1354,16 @@ zh:
|
||||||
label_projects_feedback_respond_success: 回复成功
|
label_projects_feedback_respond_success: 回复成功
|
||||||
button_projects_feedback_respond: 回复
|
button_projects_feedback_respond: 回复
|
||||||
label_projects_feedback_respond_content: 请输入回复内容
|
label_projects_feedback_respond_content: 请输入回复内容
|
||||||
|
|
||||||
|
# added by william
|
||||||
|
label_bidding_results: 应标结果
|
||||||
|
label_bid_end: 该需求已经结束!
|
||||||
|
label_special_reward: 特等奖
|
||||||
|
label_first_reward: 一等奖
|
||||||
|
label_second_reward: 二等奖
|
||||||
|
label_third_reward: 三等奖
|
||||||
|
label_excellence_reward: 优秀奖
|
||||||
|
label_comfort_reward: 入围奖
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,13 @@
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write tobthe Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
RedmineApp::Application.routes.draw do
|
RedmineApp::Application.routes.draw do
|
||||||
resources :shares
|
resources :shares
|
||||||
|
|
||||||
|
#added by william
|
||||||
get "tags/index"
|
get "tags/index"
|
||||||
|
|
||||||
get "tags/show"
|
get "tags/show"
|
||||||
|
@ -25,6 +26,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get "praise_tread/praise_plus"
|
get "praise_tread/praise_plus"
|
||||||
|
|
||||||
get "praise_tread/tread_plus"
|
get "praise_tread/tread_plus"
|
||||||
|
#end
|
||||||
|
|
||||||
root :to => 'welcome#index', :as => 'home'
|
root :to => 'welcome#index', :as => 'home'
|
||||||
|
|
||||||
|
@ -122,7 +124,6 @@ RedmineApp::Application.routes.draw do
|
||||||
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
|
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
|
||||||
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
||||||
|
|
||||||
|
|
||||||
resources :projects do
|
resources :projects do
|
||||||
member do
|
member do
|
||||||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||||
|
@ -445,6 +446,13 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
|
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
|
||||||
match 'calls/create_bid', :to => 'bids#create_bid'
|
match 'calls/create_bid', :to => 'bids#create_bid'
|
||||||
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
|
match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
|
||||||
|
match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
|
||||||
|
|
||||||
|
#added by william
|
||||||
|
# match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
|
||||||
|
# match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
|
||||||
|
match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
|
||||||
|
|
||||||
## 测试用
|
## 测试用
|
||||||
# match 'test/index', :controller => 'test', :action => 'index'
|
# match 'test/index', :controller => 'test', :action => 'index'
|
||||||
# added by young
|
# added by young
|
||||||
|
|
52
db/schema.rb
52
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20130828080407) do
|
ActiveRecord::Schema.define(:version => 20130918004629) do
|
||||||
|
|
||||||
create_table "a_user_watchers", :force => true do |t|
|
create_table "a_user_watchers", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
|
@ -77,6 +77,7 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "reward"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bids", :force => true do |t|
|
create_table "bids", :force => true do |t|
|
||||||
|
@ -89,6 +90,7 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.datetime "updated_on", :null => false
|
t.datetime "updated_on", :null => false
|
||||||
t.integer "commit"
|
t.integer "commit"
|
||||||
t.integer "reward_type"
|
t.integer "reward_type"
|
||||||
|
t.integer "homework_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "boards", :force => true do |t|
|
create_table "boards", :force => true do |t|
|
||||||
|
@ -161,6 +163,20 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
|
add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
|
||||||
add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
|
add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
|
||||||
|
|
||||||
|
create_table "courses", :force => true do |t|
|
||||||
|
t.integer "tea_id"
|
||||||
|
t.string "name"
|
||||||
|
t.integer "state"
|
||||||
|
t.string "code"
|
||||||
|
t.integer "time"
|
||||||
|
t.string "extra"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
t.string "location"
|
||||||
|
t.string "term"
|
||||||
|
t.string "string"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "custom_fields", :force => true do |t|
|
create_table "custom_fields", :force => true do |t|
|
||||||
t.string "type", :limit => 30, :default => "", :null => false
|
t.string "type", :limit => 30, :default => "", :null => false
|
||||||
t.string "name", :limit => 30, :default => "", :null => false
|
t.string "name", :limit => 30, :default => "", :null => false
|
||||||
|
@ -246,6 +262,18 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
|
|
||||||
add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
|
add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
|
||||||
|
|
||||||
|
create_table "homework_attaches", :force => true do |t|
|
||||||
|
t.integer "bid_id"
|
||||||
|
t.integer "user_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "homework_for_courses", :force => true do |t|
|
||||||
|
t.integer "project_id"
|
||||||
|
t.integer "bid_id"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "issue_categories", :force => true do |t|
|
create_table "issue_categories", :force => true do |t|
|
||||||
t.integer "project_id", :default => 0, :null => false
|
t.integer "project_id", :default => 0, :null => false
|
||||||
t.string "name", :limit => 30, :default => "", :null => false
|
t.string "name", :limit => 30, :default => "", :null => false
|
||||||
|
@ -476,6 +504,9 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "project_statuses", ["changesets_count"], :name => "index_project_statuses_on_changesets_count"
|
||||||
|
add_index "project_statuses", ["watchers_count"], :name => "index_project_statuses_on_watchers_count"
|
||||||
|
|
||||||
create_table "project_tags", :force => true do |t|
|
create_table "project_tags", :force => true do |t|
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
t.integer "tag_id"
|
t.integer "tag_id"
|
||||||
|
@ -578,6 +609,13 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "students_for_courses", :force => true do |t|
|
||||||
|
t.integer "student_id"
|
||||||
|
t.integer "course_id"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "taggings", :force => true do |t|
|
create_table "taggings", :force => true do |t|
|
||||||
t.integer "tag_id"
|
t.integer "tag_id"
|
||||||
t.integer "taggable_id"
|
t.integer "taggable_id"
|
||||||
|
@ -595,6 +633,16 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.string "name"
|
t.string "name"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "teachers", :force => true do |t|
|
||||||
|
t.string "tea_name"
|
||||||
|
t.string "location"
|
||||||
|
t.integer "couurse_time"
|
||||||
|
t.integer "course_code"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
t.string "extra"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "time_entries", :force => true do |t|
|
create_table "time_entries", :force => true do |t|
|
||||||
t.integer "project_id", :null => false
|
t.integer "project_id", :null => false
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
|
@ -645,6 +693,8 @@ ActiveRecord::Schema.define(:version => 20130828080407) do
|
||||||
t.integer "zip_code"
|
t.integer "zip_code"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "identity"
|
||||||
|
t.string "technical_title"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "user_preferences", :force => true do |t|
|
create_table "user_preferences", :force => true do |t|
|
||||||
|
|
|
@ -218,6 +218,8 @@ end
|
||||||
Redmine::MenuManager.map :bid_menu do |menu|
|
Redmine::MenuManager.map :bid_menu do |menu|
|
||||||
menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response
|
menu.push :respond, { :controller => 'bids', :action => 'show' }, :caption => :label_user_response
|
||||||
menu.push :project, { :controller => 'bids', :action => 'show_project' }, :caption => :label_bidding_project
|
menu.push :project, { :controller => 'bids', :action => 'show_project' }, :caption => :label_bidding_project
|
||||||
|
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
|
||||||
|
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
|
||||||
end
|
end
|
||||||
Redmine::MenuManager.map :application_menu do |menu|
|
Redmine::MenuManager.map :application_menu do |menu|
|
||||||
# Empty
|
# Empty
|
||||||
|
|
Loading…
Reference in New Issue