1、 网站中的搜索几乎都没有搜索后的提示语,这里应该加提示语,提示重新搜索。

2、	竞赛—关注 参与项目 用户反馈 这行应该去掉。
4. 去掉竞赛参与项目页面中”参与了竞赛”的 a 标签。
5.竞赛侧边栏显示方式的统一。
6. 解决竞赛侧边栏关注部分不显示头像的bug.修复侧边栏参与者部分没有参与者也不会显示提示的bug。
7. 增加竞赛中关注一栏的”more”链接。
7. 重构竞赛layouts代码。
This commit is contained in:
nieguanghui 2013-12-19 19:54:39 +08:00
parent 7068359e9e
commit 2db1067158
11 changed files with 102 additions and 125 deletions

View File

@ -1378,6 +1378,39 @@ module ApplicationHelper
html.html_safe html.html_safe
end end
#display bid project
def show_more_bid_project?(bid)
if bid.projects.where('is_public = 1').count > 12
return true
else
return false
end
end
def show_bid_project(bid)
html = ''
if bid.projects.where('is_public = 1').count == 0
html << (content_tag "p", l(:label_no_bid_project), :class => "font_lighter")
else
bid.projects.where('is_public = 1').take(12).each do |project|
html << (link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar")
end
end
html.html_safe
end
def show_bid_fans_picture(obj)
html = ''
if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_project_no_follow))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end
html.html_safe
end
#display fans picture #display fans picture
def show_more_fans?(obj) def show_more_fans?(obj)
if obj.watcher_users.count > 12 if obj.watcher_users.count > 12
@ -1389,23 +1422,19 @@ module ApplicationHelper
def show_fans_picture(obj) def show_fans_picture(obj)
html = '' html = ''
count = 0
if obj.watcher_users.count == 0 if obj.watcher_users.count == 0
html << (content_tag "span", l(:label_no_current_fans)) html << (content_tag "span", l(:label_no_current_fans))
else
obj.watcher_users.take(12).each do |user|
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => user.name)
end
end end
for user in obj.watcher_users
html << (link_to image_tag(url_to_avatar(user), :class => "avatar"), user_path(user), :class => "avatar", :title => "#{user.show_name}")
count = count + 1
if count >= 12
break
end
end
html.html_safe html.html_safe
end end
# added by bai # added by bai
def show_more_participate?(obj) def show_more_participate?(obj)
if obj.join_in_contests.count > 0 if obj.join_in_contests.count > 12
return true return true
else else
return false return false
@ -1427,6 +1456,7 @@ module ApplicationHelper
end end
html.html_safe html.html_safe
end end
#end #end
# add by huang # add by huang

View File

@ -32,15 +32,15 @@
<td colspan="2" valign="top" width="50%"><strong> <td colspan="2" valign="top" width="50%"><strong>
<%= link_to(b_project.project.name, project_path(b_project.project)) %> <%= link_to(b_project.project.name, project_path(b_project.project)) %>
</strong><a class="font_lighter"> </strong><span class="font_lighter">
<% if @bid.reward_type == 2 %> <% if @bid.reward_type == 2 %>
<%= l(:label_join_contest)%> <%= l(:label_joined_contest)%>
<% end %> <% end %>
<% if @bid.reward_type == 1 %> <% if @bid.reward_type == 1 %>
<%= l(:label_join_bidding)%> <%= l(:label_join_bidding)%>
<% end %> <% end %>
</a> </span>
</td> </td>
<!-- 如果需求到期 并且是该需求的管理员 --> <!-- 如果需求到期 并且是该需求的管理员 -->

View File

@ -30,7 +30,7 @@
</div> </div>
<!-- end --> <!-- end -->
<%= sort_contest(@s_state)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" > <!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px"> <ul style="margin-right:0px">
@ -45,9 +45,13 @@
</li> --> </li> -->
<!-- </ul> <!-- </ul>
</div> --> </div> -->
<% if @bids.size > 0%>
<%= sort_contest(@s_state)%>
<div id="bid-show"> <div id="bid-show">
<%= render :partial => 'contest_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> <%= render :partial => 'contest_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div> </div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %>

View File

@ -27,27 +27,12 @@
</table> </table>
<% end %> <% end %>
</div> </div>
<!-- end --> <% if @bids.size > 0 %>
<%= sort_bid(@s_state, @project_type)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %></li>
<li>
<%= link_to l(:label_sort_by_active), calls_path(:bid_sort_type => '1') %>
</li>
<!-- <li>
<%= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
</li> -->
<!-- </ul>
</div> -->
<div id="bid-show"> <div id="bid-show">
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %> <%= sort_bid(@s_state, @project_type)%>
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>
</div> </div>
<% else %>
<%= render :partial => "layouts/no_content"%>
<% end %>

View File

@ -1,5 +1,5 @@
<div class="inf_user_image"> <div class="inf_user_image">
<% for user in @users %> <% for user in @bid.watcher_users %>
<ul class="list_watch"><li> <ul class="list_watch"><li>
<table width="660px" border="0" align="center"> <table width="660px" border="0" align="center">
<tr> <tr>

View File

@ -24,5 +24,8 @@
</tr> </tr>
</table> </table>
</div> </div>
<% if @forums.size > 0 %>
<%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %> <%= render :partial => 'forums/forum_list', :locals => {:forums => @forums} %>
<% else %>
<%= render :partial => "layouts/no_content" %>
<% end %>

View File

@ -0,0 +1,10 @@
<div>
<p>没有搜索到相关的内容!</p>
<dl>
<dt><h3><strong>建议您 </strong></h3></dt>
<dd>重新设置搜索关键词</dd>
<dd>不要使用太长的关键词</dd>
<dd>不要使用特殊符号,如"^&%$#@*%"等</dd>
<dd>清除关键词之间的空格</dd>
</dl>
</div>

View File

@ -21,20 +21,19 @@
<div id="wrapper3"> <div id="wrapper3">
<%=render :partial => 'layouts/base_header'%> <%=render :partial => 'layouts/base_header'%>
<div id="main" class=""> <div id="main" class="">
<!-- added by bai --> <!-- added by bai -->
<div class="top-content"> <div class="top-content">
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"">创新竞赛社区</td> <td class="info_font" style="width: 240px; color: #15bccf">创新竞赛社区</td>
<td style="width: 430px; color: #15bccf""><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="project-search"> <div class="project-search">
<%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'reward_type', @bid.reward_type %> <%= hidden_field_tag 'reward_type', @bid.reward_type %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
@ -46,9 +45,7 @@
</tr> </tr>
</table> </table>
</div> </div>
<!-- end --> <!-- end -->
<div id="sidebar"> <div id="sidebar">
<div class="main_context"> <div class="main_context">
<div class="spaceleft"> <div class="spaceleft">
@ -71,17 +68,14 @@
</tr> </tr>
</table> </table>
<!-- added by bai 增加了竞赛的配置 --> <!-- added by bai 增加了竞赛的配置 -->
<% if User.current.logged? %>
<%if User.current.logged? %>
<% if @bid.author.id == User.current.id %> <% if @bid.author.id == User.current.id %>
<%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %>
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
</table> </table>
</div> </div>
<!-- added by bai 增加参与人和参与项目的数量显示 --> <!-- added by bai 增加参与人和参与项目的数量显示 -->
<div class="user_fans"> <div class="user_fans">
<table width="240" border="0"> <table width="240" border="0">
@ -98,7 +92,6 @@
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<!-- end --> <!-- end -->
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<tr> <tr>
@ -112,20 +105,13 @@
<td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td> <td><%= l(:label_limit_time) %> : <%= @bid.deadline%></td>
</tr> </tr>
</table> </table>
<div>
<%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
<%= link_to l(:label_bidding_project)+"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>&nbsp;
<%= link_to l(:label_x_bids_responses, :count => @bid.commit)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
<!--description--> <!--description-->
<div class="inf_user_context"> <div class="inf_user_context">
<div class="font_title_left"> <div class="font_title_left">
<%= l(:label_project_overview) %> <%= l(:label_project_overview) %>
</div> </div>
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<% if @bid.description.size>0 %> <% if @bid.description.size>0 %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
@ -145,7 +131,6 @@
</div> </div>
<!--tags--> <!--tags-->
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div> <div class="user_underline"></div>
<table style="font-family:微软雅黑"> <table style="font-family:微软雅黑">
<tr> <tr>
@ -154,24 +139,20 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="user_fans"> <div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong> <strong><%= l(:label_x_followers, :count => @bid.watcher_users.count) %></strong>
<% if show_more_fans?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%></span>
<% end %>
</div> </div>
<div class="user_underline"></div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <td style="padding-top: 5px">
<% if @bid.watcher_users.size>0 && @bid.watcher_users.count<13%> <%= show_bid_fans_picture(@bid)%>
<% for user in @bid.watcher_users%>
<%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ), user_path(user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter"><%= l(:label_project_no_follow) %></p>
<% end%>
</td> </td>
</tr> </tr>
</table> </table>
@ -179,33 +160,24 @@
</div> </div>
<!-- participate --> <!-- participate -->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left">
<strong><%= l(:label_bidding_project) %></strong>
<span style="display:inline-block;font-size: 13px; float:right; margin-bottom: -4px;"><%= link_to "更多>>", :controller => 'bids', :action => 'show_project'%>
</div>
<div class="user_underline"></div> <div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_bidding_project) %></strong>
<% if show_more_bid_project?(@bid) %>
<span style="display:inline-block; font-size: 12px; float:right; margin-bottom: -4px;"><%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%></span>
<% end %>
</div>
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <td style="padding-top: 5px">
<% if @bid.projects.size<0%> <%= show_bid_project(@bid) %>
<p class="font_lighter"><%= l(:label_no_bid_project) %></p> </td>
<%else%>
<% for project in objCut12(@bid.projects.where('is_public=1')) %>
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %>
<% end%>
<% end %>
</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- end --> <!-- end -->
@ -215,9 +187,9 @@
<div class="font_title_left"> <div class="font_title_left">
<strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong> <strong><%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %></strong>
<% if show_more_participate?(@bid) %> <% if show_more_participate?(@bid) %>
<div style="font-size: 11px; display: inline; float: right; margin-top: 5px; margin-right: 20px" > <span style="font-size: 12px; display: inline; float: right;" >
<%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%> <%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%>
</div> </span>
<% end %> <% end %>
</div> </div>
<div class="left_wf"> <div class="left_wf">
@ -228,8 +200,8 @@
</table> </table>
</div> </div>
</div> </div>
</div>
</div>
<div id="content"> <div id="content">
<% if display_main_menu?(@bid) %> <% if display_main_menu?(@bid) %>
<div class="tabs_new"> <div class="tabs_new">

View File

@ -1,36 +1,6 @@
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %> <% end %>
<!-- <%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px">
<% if params[:project_type] == '0'%>
<%= l(:label_project_plural)%>
</span></td>
<td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% else %>
<%= l(:label_new_course)%>
</span></td>
<% if User.current.user_extensions.identity == 0 %>
<td valign="center"><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% end %>
<% end %>
<td align="right">
<div class="project-search">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type]%>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
</div></td>
</tr>
</table>
</div>
<%end%> -->
<div class="top-content"> <div class="top-content">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %> <%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<% if params[:project_type] == "1" %> <% if params[:project_type] == "1" %>
@ -85,10 +55,13 @@
<% end %> <% end %>
</div> </div>
<% if @projects.size == 0 %>
<%= render :partial => 'layouts/no_content'%>
<% else %>
<div id="projects-index"> <div id="projects-index">
<%= render_project_hierarchy(@projects)%> <%= render_project_hierarchy(@projects)%>
</div> </div>
<% end %>
<div class="pagination"> <div class="pagination">
<ul> <ul>

View File

@ -119,7 +119,7 @@
<% end -%> <% end -%>
<% end -%> <% end -%>
<% else %> <% else %>
<div style="height: 60px; margin-left: auto; margin-right: auto; color:#6c5524; background-color: #; vertical-align: center;">如果没有搜到希望的结果,请清除用户姓和名之间的空格,或者重新输入搜索关键词!</div> <%= render :partial => "layouts/no_content"%>
<% end %> <% end %>
</div> </div>
<div class="pagination"> <div class="pagination">

View File

@ -878,7 +878,7 @@ zh:
label_age: 提交时间 label_age: 提交时间
label_change_properties: 修改属性 label_change_properties: 修改属性
label_general: 一般 label_general: 一般
label_more: 更多 label_more: 更多>>
label_scm: SCM label_scm: SCM
label_plugins: 插件 label_plugins: 插件
label_ldap_authentication: LDAP 认证 label_ldap_authentication: LDAP 认证
@ -1749,7 +1749,7 @@ zh:
label_project_module_forums: 公共贴吧 label_project_module_forums: 公共贴吧
label_memo_locked: 帖子已被锁定 label_memo_locked: 帖子已被锁定
label_downloads_list: 进入附件列表 label_downloads_list: 进入附件列表
label_join_contest: 参与了竞赛 label_joined_contest: 参与了竞赛
label_contest_user: 参赛人: label_contest_user: 参赛人:
label_contest_reason: 参赛宣言: label_contest_reason: 参赛宣言:
label_notification: 通知 label_notification: 通知