设计并调整竞赛模块的首页显示样式

This commit is contained in:
wanglinchun 2014-04-16 17:32:58 +08:00
parent 945ca3787a
commit 3a5b5bc0ce
3 changed files with 65 additions and 43 deletions

View File

@ -167,5 +167,6 @@ module ContestsHelper
end
tmp
end
end

View File

@ -98,9 +98,13 @@ module WelcomeHelper
end
def find_all_hot_contest limit=10
Contest.all.take limit
Contest.reorder("created_on DESC").all.take limit
end
def find_all_hot_softapplication limit=10
Softapplication.reorder("created_at DESC").all.take limit
end
def cal_memos_count event
return nil if event.parent_id
event.replies_count

View File

@ -93,10 +93,11 @@
</script>
<div class='top_bar'>
<div id="identifier-pannel" style="display:none">
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content">微信扫码</div>
</div>
<div class="main-content-bar">
<!--文字-->
<div class="welcome_left" >
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_contest_description) %></span>
</div>
@ -125,38 +126,46 @@
<% end %>
<!-- <div class='font_lighter' style="display: inline-block; margin-top:3px;">竞赛相关内容搜索,如竞赛题目,参赛题目,参赛人名等。</div> -->
</div>
<div style="clear: both;"></div>
</div>
</div>
<!-- <div class="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div> -->
<div style="clear:both"></div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>最新热门竞赛</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %></span>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>最新热门竞赛</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[10]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
</p>
<div class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left;">
<%= image_tag('/images/039.gif')%>
</div>
<div style="float: left; margin-left: -8px; margin-top: 5px; width: 380px;">
<%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: -8px; width: 380px;">
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.truncate(50, omission: '...')%></span>
</div><br />
<div style="padding-left: 36px; clear: left;">
<span class="font_lighter"><%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_projects.count, show_project_contest_path(contest)) %></span></strong>)</span>
<span class="font_lighter"><%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<strong><span style="font-size: 17px"><%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest)) %></span></strong>)</span>
</div>
</li>
<% end %>
</ul>
<% end; reset_cycle %>
</div>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="padding-bottom:px ;margin-left: 5px; color: #e8770d;">
<strong>问题和反馈动态</strong>
@ -167,7 +176,7 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_new_forum_topics(10).each do |topic|%>
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
<li class="message-brief-intro" style="min-height: 60px; line-height:2em; ">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
@ -184,32 +193,40 @@
</ul>
</div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>最新参赛应用</strong></h3>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>最新参赛应用</strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[10]) %>
<li style="background-image:none;">
<p class="layout">
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
:style => "margin-left: 28px;", :target => "_blank") %></span>
</p>
<p class="layout-1" >
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
</p>
<div class="d-p-projectlist">
<% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
<li style="position:relative;height:6em;" class='<%= cycle("odd", "even") %>'>
<div class="avatar-4"; style="float: left;">
<%= image_tag('/images/007.gif')%>
</div>
<div style="float: left; margin-left: -8px; margin-top: 5px; width: 380px;">
<%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
</div>
<div class='text_nowrap' style="float: left;margin:5px; margin-left: -8px; width: 380px;">
<span class='font_lighter' title =<%=softapplication.description.to_s%>><%=softapplication.description.truncate(50, omission: '...')%></span>
</div><br />
<div style="padding-left: 36px; clear: left;">
<span class="font_lighter">发布时间:<%=format_time softapplication.created_at %></span>
</div>
</li>
<% end %>
</ul>
<% end; reset_cycle %>
</div>
</div>
</div>
<div class="clr">
</div>
<br/><br/><br/><br/><br/><br/><br/>
<div style="padding-top: 40px"></div>
<div class="clearfix"></div>