增加项目,需求搜索,

This commit is contained in:
nieguanghui 2013-08-06 21:43:06 +08:00
parent abe40f6581
commit df93c78490
67 changed files with 177 additions and 46 deletions

View File

@ -5,19 +5,35 @@ class BidsController < ApplicationController
helper :watchers
def index
# @requirement_title = "4"
@limit = 5
@bid_count = Bid.count
# Modified by nie
# @requirement_title = "4"
@offset, @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.offset(@offset).limit(@limit).all.reverse
@bids = @bids.offset(@offset).limit(@limit).all.reverse
else
limit = @bid_count%@limit
@bids = Bid.offset(@offset).limit(limit).all.reverse
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
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
def show

View File

@ -79,11 +79,20 @@ class ProjectsController < ApplicationController
# end
def index
#Modified by nie
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @project_count = Project.visible.count
# @project_pages = Paginator.new @project_count, @limit, params['page']
# @offset ||= @project_pages.offset
# @projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
@offset, @limit = api_offset_and_limit({:limit => 10})
@project_count = Project.visible.count
@projects = Project.visible
@projects = Project.visible.like(params[:name]) if params[:name].present?
@project_count = @projects.count
@project_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @project_pages.offset
@projects = Project.visible.offset(@offset).limit(@limit).order('lft').all
@projects = @projects.offset(@offset).limit(@limit).order('lft').all
#end
respond_to do |format|
format.html {
render :layout => 'base'

View File

@ -25,7 +25,7 @@ class Bid < ActiveRecord::Base
where(nil)
else
pattern = "%#{arg.to_s.strip.downcase}%"
where("LOWER(identifier) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern)
where("LOWER(id) LIKE :p OR LOWER(name) LIKE :p OR LOWER(description) LIKE :p", :p => pattern)
end
}

View File

@ -1,16 +1,51 @@
<!-- fq -->
<style>
input[type="submit"].bid_btn {
vertical-align: middle;
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(255, 255, 255);
background: url("../images/button/bg104.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
/*margin-right: -4px;*/
}
input[type="button"].bid_btn {
width: 60px;
height: 30px;
line-height: 18px;
font-size: 14px;
color: rgb(255, 255, 255);
background: url("../images/button/bg104.jpg") no-repeat scroll left top transparent;
padding: 0px 0px 4px 0px;
border-radius: 2px;
border: 1px solid rgb(148, 148, 148);
box-shadow: none;
text-shadow: none;
margin-top: -10px;
margin-right: -2px;
}
textarea:focus {
border: #d5dee9 1px solid;
}
</style>
<%= form_for('bid_message', :remote => true, :method => :post,
:url => {:controller => 'bids',
:action => 'create',
:bid_id => bid,
:sta => sta}) do |f|%>
<table border="0" width="525px" align="center" style="border-left: 2px solid #acaeb1; border-right: 2px solid #acaeb1;
border-top: 2px solid #acaeb1; border-bottom: 2px solid #acaeb1;">
<table border="0" width="525px" align="center" >
<tr>
<td><%= f.text_area 'message', :rows => 4, :cols => 65, :value => "我要反馈", :required => true, :style => "resize: none;", :class => 'noline'%></td>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :value => "我要反馈", :style => "resize: none;", :class => 'noline'%></td>
</tr></table>
<table border="0" width="525px" align="center">
<tr><td align="right"><%= submit_tag l(:button_leave_meassge), :name => nil %>
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('bid_message_message');", :type => 'button' %></td></tr>
<tr><td align="right"><%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'"%>
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('bid_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -30px'" %> </td></tr>
</table>
<% end %>

View File

@ -2,7 +2,15 @@
<div id="put-bid-form" style="display: none">
<%= render :partial => 'new_bid' %>
</div>
<%= form_tag(bids_path, :method => :get) do %>
<div class="project-search-block">
<span><%=l(:label_bid_plural)%></span>
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
</div>
</div>
<% end %>
<div id="bid-show">
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div>

View File

@ -2,7 +2,15 @@
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<h3><%=l(:label_project_plural)%></h3>
<%= form_tag(projects_path, :method => :get) do %>
<div class="project-search-block">
<span><%=l(:label_project_plural)%></span>
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %>
</div>
</div>
<% end %>
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>

View File

@ -65,17 +65,18 @@
<% html_title(l(:label_user_plural)) -%>
<% else %>
<div class="contextual">
<!-- <div class="contextual">
<%= link_to l(:label_user_new), new_user_path, :class => 'icon icon-add' %>
</div>
<h3><%= l(:label_user_plural)%></h3>
</div> -->
<div class="project-search-block">
<span><%= l(:label_user_plural)%></span>
<%= form_tag(users_path, :method => :get) do %>
<fieldset>
<!-- <fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend>
</legend> -->
<div class="project-search">
<label for='status'><%= l(:field_status) %>:</label>
<%= select_tag 'status', users_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
@ -87,8 +88,10 @@
<label for='name'><%= l(:label_user) %>:</label>
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= submit_tag l(:label_search), :class => "small", :name => nil %><!--Modified by young-->
</fieldset>
<!-- </fieldset> -->
<% end %>
</div>
</div>
&nbsp;
<div class="autoscroll">

View File

@ -1120,7 +1120,7 @@ zh:
field_closed_on: Closed
setting_default_projects_tracker_ids: Default trackers for new projects
label_total_time: 合计
label_create_time: 创建时间 #Customer added
label_create_time: 创建时间 #Customer addedAdded by nie
label_current_contributors: 位当前贡献者
label_lines_of_code: 行代码
label_since_last_commits: 距离上次提交时间
@ -1141,6 +1141,7 @@ zh:
label_post_on: 发表了
label_find_all_comments: 查看所有评论
label_updated_time_on: " 更新于 %{value} "
label_bid_plural: 需求
#added by liuping
button_unfollow: 取消关注
button_follow: 关注

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

BIN
public/images/button/ok.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

View File

@ -1045,7 +1045,9 @@ pre,code,.line-code
font-family:'Source Code Pro', helvetica, Arial;
}
.autoscroll {
overflow-x: visible;
}
@ -1085,10 +1087,10 @@ div.wiki-description {
}
.information {
margin-top: 0px;
margin-top: 20px;
margin-left: 607px;
float: left;
height: 108px;
height: auto;
width: 246px;
font-family: helvetica,arial,sans-serif;
color: rgb(0, 0, 0);
@ -1105,7 +1107,6 @@ a.project {
float: left;
margin-top: 0px;
width: 908px;
min-height: 120px;
height: auto;
margin-bottom: 5px;
}
@ -1126,16 +1127,16 @@ a.root {
padding-top: 10px;
padding-left: 10px;
padding-bottom: 10px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #eee;
border: 1px solid rgba(0, 0, 0, 0.05);
-webkit-border-radius: 4px;
margin-bottom: 0px;
/*background-color: #f5f5f5;*/
border-bottom: 1px solid #eee;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
/*-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);*/
}
.reviews {
@ -1194,6 +1195,10 @@ a.img-tag3{
margin-left: 10px;
}
p.stats {
margin: 0px;
}
.add-info {
float: left;
margin-top: 0px;
@ -1201,6 +1206,7 @@ a.img-tag3{
width: 908px;
margin-bottom: 5px;
}
.main-language {
float: left;
height: 18px;
@ -1208,7 +1214,12 @@ a.img-tag3{
font-size: 13px;
font-family: helvetica,arial,sans-serif;
line-height: 18px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
.licences {
float: left;
height: 18px;
@ -1255,16 +1266,16 @@ a.tag {
min-height: 20px;
height: auto;
padding: 19px 19px 6px 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #eee;
border: 1px solid rgba(0, 0, 0, 0.05);
-webkit-border-radius: 4px;
margin-bottom: 0px;
/*background-color: #f5f5f5;*/
border-bottom: 1px solid #eee;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
/*-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);*/
}
.float_right {
@ -1608,6 +1619,45 @@ div.member_content {
width: 600px;
margin-left: 40px;
}
/*
* Designed for search content
* Added by nie
*/
div.project-search-block {
margin-top: 0px;
margin-bottom: 10px;
padding: 10px;
width: 888px;
border-top 1px solid rgb(242,242,242);
border-bottom: 1px solid rgb(242, 242, 242);
margin-left: auto;
margin-right: auto;
}
div.project-search-block span {
margin-left: 0px;
font-size: 1.5em;
}
div.project-search {
display: inline-block;
float: right;
margin-right: 160px;
}
div.project-search input[type="submit"] {
width: 40px;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
color: rgb(5, 5, 5);
padding: 0px;
background: -moz-linear-gradient(center top , rgb(255, 255, 255) 0%, rgb(235, 235, 235) 50%, rgb(219, 219, 219) 50%, rgb(181, 181, 181)) repeat scroll 0% 0% transparent;
border-radius: 4px;
border: 1px solid rgb(148, 148, 148);
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2), 0px 0px 2px rgb(255, 255, 255) inset;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
cursor: pointer;
}
/*by fanqiang*/
img.avatar3 {
width: 50px;
@ -1632,13 +1682,14 @@ input[type='text'].noline {
width: 100%;
}
.noline {
border-style: none;
border-color: white;
border-width: medium;
font-size: 16px;
/*border-style: none;
border-color: white;*/
border: #d5dee9 1px solid;
font-size: 12px;
color: #ACAEB1;
padding: 10px 0px;
width: 100%;
cursor: text;
}
.grayline{
border-color: #ACAEB1;