From 163fe97e6fc2022d723a034333d22aafef97d8b0 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Sat, 3 Aug 2013 22:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=8F=98=E4=BA=86=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=9A=84=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=9A=84=E7=95=99=E8=A8=80=E6=A1=86=E5=92=8C?= =?UTF-8?q?=E5=BA=94=E6=A0=87=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 4 +- app/views/bids/_new.html.erb | 10 +++-- app/views/bids/_new_bid.html.erb | 42 +++++++++++++++++++ app/views/bids/index.html.erb | 22 ++++++---- app/views/bids/new_bid.html.erb | 14 ------- app/views/bids/show_project.html.erb | 17 +++++--- app/views/layouts/base_bids.html.erb | 2 +- config/locales/zh.yml | 1 + .../stylesheets/application.css | 26 ++++++++++++ 9 files changed, 102 insertions(+), 36 deletions(-) create mode 100644 app/views/bids/_new_bid.html.erb delete mode 100644 app/views/bids/new_bid.html.erb diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 10b282710..846956106 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -62,8 +62,8 @@ class BidsController < ApplicationController end def create - if params[:user_message].size>0 - message = params[:user_message][:message] + if params[:bid_message].size>0 + message = params[:bid_message][:message] @bid.add_jour(User.current, message) # if a_message.size > 5 # @message = a_message[-5, 5] diff --git a/app/views/bids/_new.html.erb b/app/views/bids/_new.html.erb index c6ab08a4a..9585f0131 100644 --- a/app/views/bids/_new.html.erb +++ b/app/views/bids/_new.html.erb @@ -1,13 +1,15 @@ -<%= form_for('user_message', :remote => true, :method => :post, +<%= form_for('bid_message', :remote => true, :method => :post, :url => {:controller => 'bids', :action => 'create', :bid_id => bid, :sta => sta}) do |f|%> - +
- - + +
<%= f.text_area 'message', :rows => 4, :cols => 65, :value => "我要反馈", :required => true, :style => "resize: none;" %>
<%= f.text_area 'message', :rows => 4, :cols => 65, :value => "我要反馈", :required => true, :style => "resize: none;", :class => 'noline'%>
+
<%= submit_tag l(:button_leave_meassge), :name => nil %> <%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('user_message_message');", :type => 'button' %>
diff --git a/app/views/bids/_new_bid.html.erb b/app/views/bids/_new_bid.html.erb new file mode 100644 index 000000000..2ec149e19 --- /dev/null +++ b/app/views/bids/_new_bid.html.erb @@ -0,0 +1,42 @@ + +<%= form_tag({:controller => 'bids', +:action => 'index', +:remote => true, +:method => :post, +:id => 'new-bid-form'}) do %> +<%= error_messages_for 'bid' %> + + + + + + + + + + + + + + + + + + + + + + +
<%= text_field_tag 'bid_title', "为你的需求起个名字~~", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_title')"%>
<%= text_area_tag 'bid_description', "说出你的需求>找到威客来帮你>支付担保金让威客开始工作 >验收付款并评价", :class => 'noline', :required => true, :style => "resize: none;", :rows => 8, + :onfocus => "clearInfo('bid_description')" %>
<%= text_field_tag 'bid_budget', "支付担保金额", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_budget')"%>
<%= text_field_tag 'bid_deadline', "投资时限 yyyy-mm-dd", :class => 'noline', :required => true, :onfocus => "clearInfo('bid_deadline')"%>
+ + + + +
<%= submit_tag l(:button_new_bid) %>
+<%end%> \ No newline at end of file diff --git a/app/views/bids/index.html.erb b/app/views/bids/index.html.erb index 0cb206d03..0ae6754e7 100644 --- a/app/views/bids/index.html.erb +++ b/app/views/bids/index.html.erb @@ -1,13 +1,18 @@ -
- <%= link_to("新建需求", {:controller => 'bids', :action => 'new_bid'}, :class => 'icon icon-add', :style => "margin-right: 100px;") %> + - - + +
需求列表
+ +
需求列表 +
+ <%= toggle_link l(:button_bidding), 'put-bid-form', {:focus => 'project_id'} %> +
<% @bids.each do |bid|%> - +
@@ -40,5 +45,4 @@
<%= link_to image_tag(url_to_avatar(bid.author), :class => 'avatar'), :class => "avatar" %> @@ -20,9 +25,9 @@ - - - + + +
悬赏:¥<%= bid.budget%>(<%= bid.biding_projects.count%>)应标(<%= bid.commit %>)反馈(<%= bid.watcher_users.count%>)关注(<%= link_to bid.biding_projects.count, project_for_bid_path(bid)%>)应标(<%= link_to bid.commit, respond_path(bid)%>)反馈(<%= link_to bid.watcher_users.count, respond_path(bid)%>)关注
<%= format_time bid.created_at %>
- <% end %> diff --git a/app/views/bids/new_bid.html.erb b/app/views/bids/new_bid.html.erb deleted file mode 100644 index bfda90733..000000000 --- a/app/views/bids/new_bid.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -
-<%= form_tag({:controller => 'bids', - :action => 'index', - :remote => true, - :method => :post, - :id => 'new-bid-form'}) do %> -

需求名称:<%= text_field_tag 'bid_title' %>

-

需求描述:

-

<%= text_area_tag 'bid_description' %>

-

投资预算:<%= text_field_tag 'bid_budget' %>

-

投资时限:<%= text_field_tag 'bid_deadline' %>

- <%= submit_tag l(:button_submit) %> - <%end%> -
diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index 8a5d13f99..7f06cd1b7 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -1,28 +1,33 @@
- <%= toggle_link "我要应标", 'put-bid-form', {:focus => 'project_id'} %> + <%= toggle_link l(:button_bidding), 'put-bid-form', {:focus => 'project_id'} %>
- +
应标项目(<%= @bidding_project.count%>)应标项目(<%= @bidding_project.count%>)
<%= render :partial => 'project_list', :locals => {:bidding_project => @bidding_project} %> diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index 94d1de53b..3c8289168 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -38,7 +38,7 @@ <%= h @bid.name %> - <%= watcher_link(@bid, User.current) %> + <%= watcher_link(@bid, User.current) %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 1cd32883d..78c932470 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1149,4 +1149,5 @@ zh: label_user_response: 用户反馈 label_bidding_project: 应标项目 button_bidding: 我要应标 + button_new_bid: 发布需求 diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index f98cfc003..e24540d32 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -1549,4 +1549,30 @@ a.bid_user { font-family:微软雅黑; color:#acaeb1; font-size:12px; +} +input[type='text'].noline { + border-style: none; + border-color: white; + border-width: medium; + font-size: 16px; + color: #ACAEB1; + padding: 10px 0px; + width: 100%; +} +.noline { + border-style: none; + border-color: white; + border-width: medium; + font-size: 16px; + color: #ACAEB1; + padding: 10px 0px; + width: 100%; +} +.grayline{ + border-color: #ACAEB1; + border-width: 1px; +} +div.tableline{ + height: 1px; + background-color: #ACAEB1; } \ No newline at end of file