显示部分数据
This commit is contained in:
parent
6dc692bb6a
commit
1f83ca612b
|
@ -18,7 +18,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
module WelcomeHelper
|
module WelcomeHelper
|
||||||
include ProjectsHelper
|
|
||||||
|
|
||||||
def newbieTopiclist
|
def newbieTopiclist
|
||||||
find_all_topic_by_board_id
|
find_all_topic_by_board_id
|
||||||
|
@ -36,7 +35,19 @@ module WelcomeHelper
|
||||||
def find_all_hot_project
|
def find_all_hot_project
|
||||||
sort_project_by_hot
|
sort_project_by_hot
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_all_hot_course
|
||||||
|
sort_course_by_hot
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_all_hot_bid
|
||||||
|
sort_bid_by_hot
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_all_hot_contest
|
||||||
|
sort_contest_by_hot
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def search_project
|
def search_project
|
||||||
|
@ -57,4 +68,40 @@ module WelcomeHelper
|
||||||
def find_project_by_board board
|
def find_project_by_board board
|
||||||
Project.find_by_id(board.project_id)
|
Project.find_by_id(board.project_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sort_project_by_hot
|
||||||
|
return sort_project_by_hot_rails 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_course_by_hot
|
||||||
|
return sort_project_by_hot_rails 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_bid_by_hot
|
||||||
|
return sort_bid_by_hot_rails 1
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_contest_by_hot
|
||||||
|
return sort_bid_by_hot_rails 2
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_project_by_hot_rails project_type
|
||||||
|
limit = 10
|
||||||
|
project_type == 0 ? Project.find_by_sql("
|
||||||
|
SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
||||||
|
FROM projects AS p RIGHT OUTER JOIN (
|
||||||
|
SELECT project_id,grade FROM project_statuses
|
||||||
|
WHERE project_type = #{project_type} ORDER BY grade DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||||
|
: Project.find_by_sql("
|
||||||
|
SELECT p.id, p.name, p.description, p.identifier, t.project_id
|
||||||
|
FROM projects AS p RIGHT OUTER JOIN (
|
||||||
|
SELECT project_id,grade FROM project_statuses
|
||||||
|
WHERE project_type = #{project_type} ORDER BY course_ac_para DESC LIMIT #{limit} ) AS t ON p.id = t.project_id ")
|
||||||
|
end
|
||||||
|
|
||||||
|
def sort_bid_by_hot_rails reward_type
|
||||||
|
limit = 10
|
||||||
|
Bid.visible.where('reward_type = ?', reward_type).reorder('bids.commit desc').limit(limit).all
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
<div class="left" style="float: left; height: 445px;">
|
<div class="left" style="float: left; height: 445px;">
|
||||||
<ul class="welcome-message-list" style="width: 90%;">
|
<ul class="welcome-message-list" style="width: 90%;">
|
||||||
<h3 style="">论坛热帖</h3>
|
<h3 style="">论坛热帖</h3>
|
||||||
<div class="welcome-box-list">
|
<div class="welcome-box-list">
|
||||||
|
@ -145,8 +145,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="right" style="float: right; margin-right: -80px; height: 445px;">
|
<div class="right" style="float: right; margin-right: -80px; height: 445px;">
|
||||||
|
|
||||||
<ul class="user-welcome-message-list" style="width: 80%; margin-top: 80px;">
|
<ul class="user-welcome-message-list" style="width: 80%; margin-top: 80px;">
|
||||||
<h3 style="margin-left: -5px;">用户动态</h3>
|
<h3 style="margin-left: -5px;">用户动态</h3>
|
||||||
<div class="user-message-box-list">
|
<div class="user-message-box-list">
|
||||||
|
@ -200,7 +199,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||||
<h2>热门项目</h2>
|
<h2>热门项目</h2>
|
||||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||||
<li class="current">
|
<li class="current">
|
||||||
<a class="" href="javascript:void(0);">今日</a>
|
<a class="" href="javascript:void(0);">今日</a>
|
||||||
|
@ -214,53 +213,25 @@
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<li style="background-image:none;">
|
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[5]) %>
|
||||||
<p class="layout">
|
<li style="background-image:none;">
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tfs/" title="tfs">DIV布局测试</a>
|
<p class="layout">
|
||||||
</p>
|
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||||
<p class="layout-1" >
|
</p>
|
||||||
<span class="d-p-project-intro">给大家一个版本库,路径为trustie2@10.0.47.245:/home/trustie2密码是http://10.0.47.245/trustie21234</span>
|
<p class="layout-1" >
|
||||||
</p>
|
<span class="d-p-project-intro"><%= project.description %></span>
|
||||||
<!-- <span>更新于</span><span style="color: blue">5天前</span> -->
|
</p>
|
||||||
</li>
|
<!-- <p class="layout">
|
||||||
<li>
|
<span><%= project.members.count%></span>
|
||||||
<p class="layout">
|
</p> -->
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/javatwx/" title="javatwx">javatwx</a>
|
</li>
|
||||||
</p>
|
<% end %>
|
||||||
<p class="layout-1">
|
</ul>
|
||||||
<span class="d-p-project-intro">javamall</span>
|
</div>
|
||||||
</p>
|
</div>
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/sz_digital_ocean/" title="sz_digital_ocean">sz_digital_ocean</a>
|
|
||||||
</p>
|
|
||||||
<p class="layout-1">
|
|
||||||
<span class="d-p-project-intro">sz_digital_ocean</span>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/android_1/" title="android_1">android_1</a>
|
|
||||||
</p>
|
|
||||||
<p class="layout-1">
|
|
||||||
<span class="d-p-project-intro">android study</span>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tair/" title="tair">tair</a>
|
|
||||||
</p>
|
|
||||||
<p class="layout-1">
|
|
||||||
<span class="d-p-project-intro">Tair is a distributed, high performance key/value storage sy...</span>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||||
<h2>热门竞赛</h2>
|
<h2>热门竞赛</h2>
|
||||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||||
<li class="current">
|
<li class="current">
|
||||||
<a class="" href="javascript:void(0);">今日</a>
|
<a class="" href="javascript:void(0);">今日</a>
|
||||||
|
@ -272,71 +243,27 @@
|
||||||
<a class="" href="javascript:void(0);">本月</a>
|
<a class="" href="javascript:void(0);">本月</a>
|
||||||
</li>
|
</li>
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
|
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<p class="layout">
|
||||||
|
<%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{contest.name}")%>
|
||||||
|
</p>
|
||||||
|
<p class="layout-1" >
|
||||||
|
<span class="d-p-project-intro"><%= contest.description %></span>
|
||||||
|
</p>
|
||||||
|
<!-- <p style="margin-top: -10px;">
|
||||||
|
<span><%= contest.created_on %></span>
|
||||||
|
</p> -->
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<li style="background-image:none;" >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tfs/" title="tfs">tfs</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">TFS(Taobao FileSystem)是一个高可扩展、高可用、高性能、面向互联网服务的分布式文件系统,其设计目标是...</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/javatwx/" title="javatwx">javatwx</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">javamall</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/sz_digital_ocean/" title="sz_digital_ocean">sz_digital_ocean</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">sz_digital_ocean</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/android_1/" title="android_1">android_1</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">android study</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tair/" title="tair">tair</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">Tair is a distributed, high performance key/value storage sy...</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" >
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" >
|
||||||
<h2>最新众包</h2>
|
<h2>最新众包</h2>
|
||||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||||
<li class="current">
|
<li class="current">
|
||||||
<a class="" href="javascript:void(0);">今日</a>
|
<a class="" href="javascript:void(0);">今日</a>
|
||||||
|
@ -348,71 +275,24 @@
|
||||||
<a class="" href="javascript:void(0);">本月</a>
|
<a class="" href="javascript:void(0);">本月</a>
|
||||||
</li>
|
</li>
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
|
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<p class="layout">
|
||||||
<li style="background-image:none;" >
|
<%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{bid.name}")%>
|
||||||
<p class="layout">
|
</p>
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tfs/" title="tfs">tfs</a>
|
<p class="layout-1" >
|
||||||
|
<span class="d-p-project-intro"><%= bid.description %></span>
|
||||||
</p>
|
</p>
|
||||||
<p class="layout">
|
</li>
|
||||||
<span class="d-p-project-intro">TFS(Taobao FileSystem)是一个高可扩展、高可用、高性能、面向互联网服务的分布式文件系统,其设计目标是...</span>
|
<% end %>
|
||||||
|
</ul>
|
||||||
</p>
|
</div>
|
||||||
</li>
|
</div>
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/javatwx/" title="javatwx">javatwx</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">javamall</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/sz_digital_ocean/" title="sz_digital_ocean">sz_digital_ocean</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">sz_digital_ocean</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/android_1/" title="android_1">android_1</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">android study</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tair/" title="tair">tair</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">Tair is a distributed, high performance key/value storage sy...</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||||
<h2>热门课程</h2>
|
<h2>热门课程</h2>
|
||||||
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
<!-- <ul class="d-p-index-hdright d-p-project-bytime ks-switchable-nav">
|
||||||
<li class="current">
|
<li class="current">
|
||||||
<a class="" href="javascript:void(0);">今日</a>
|
<a class="" href="javascript:void(0);">今日</a>
|
||||||
|
@ -426,65 +306,21 @@
|
||||||
</ul> -->
|
</ul> -->
|
||||||
<div class="d-p-projectlist-box">
|
<div class="d-p-projectlist-box">
|
||||||
<ul class="d-p-projectlist">
|
<ul class="d-p-projectlist">
|
||||||
<li style="background-image:none;" >
|
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||||
<p class="layout">
|
<li style="background-image:none;">
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tfs/" title="tfs">tfs</a>
|
<p class="layout">
|
||||||
|
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :target => "_blank", :title => "#{project.name}")%>
|
||||||
</p>
|
</p>
|
||||||
<p class="layout">
|
<p class="layout-1" >
|
||||||
<span class="d-p-project-intro">TFS(Taobao FileSystem)是一个高可扩展、高可用、高性能、面向互联网服务的分布式文件系统,其设计目标是...</span>
|
<span class="d-p-project-intro"><%= project.description %></span>
|
||||||
|
</p>
|
||||||
</p>
|
</li>
|
||||||
</li>
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<li >
|
<div class="clr"></div>
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/javatwx/" title="javatwx">javatwx</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">javamall</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/sz_digital_ocean/" title="sz_digital_ocean">sz_digital_ocean</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">sz_digital_ocean</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/android_1/" title="android_1">android_1</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">android study</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li >
|
|
||||||
<p class="layout">
|
|
||||||
<a target="_blank" class="d-g-blue d-p-project-name" href="/p/tair/" title="tair">tair</a>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<p class="layout">
|
|
||||||
<span class="d-p-project-intro">Tair is a distributed, high performance key/value storage sy...</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clr"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -593,6 +593,7 @@ ul.tool li{list-style-type:none;
|
||||||
.welcome_right{
|
.welcome_right{
|
||||||
float:right;
|
float:right;
|
||||||
width: 49%;
|
width: 49%;
|
||||||
|
padding-left: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inf_user_motto{
|
.inf_user_motto{
|
||||||
|
|
Loading…
Reference in New Issue