This commit is contained in:
z9hang 2014-09-04 09:46:47 +08:00
commit 05083fa679
10 changed files with 139 additions and 119 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@
/Gemfile.lock /Gemfile.lock
/lib/plugins/acts_as_versioned/test/debug.log /lib/plugins/acts_as_versioned/test/debug.log
/config/configuration.yml /config/configuration.yml
.rbenv-gemsets

View File

@ -1,4 +1,5 @@
source 'http://ruby.taobao.org' # source 'http://ruby.taobao.org'
source 'http://ruby.sdutlinux.org/'
unless RUBY_PLATFORM =~ /w32/ unless RUBY_PLATFORM =~ /w32/
# unix-like only # unix-like only

View File

@ -19,7 +19,7 @@ PATH
rails rails
GEM GEM
remote: http://ruby.taobao.org/ remote: http://ruby.sdutlinux.org/
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actionmailer (3.2.13) actionmailer (3.2.13)

View File

@ -1,5 +1,5 @@
class ContestNotificationController class ContestNotificationController < ApplicationController
def show def show
@notification = ContestNotification.find(params[:id])
end end
end end

View File

@ -110,7 +110,7 @@ class WelcomeController < ApplicationController
def contest def contest
@contest_page = FirstPage.where("page_type = 'contest'").first @contest_page = FirstPage.where("page_type = 'contest'").first
@contestNotification = ContestNotification.all.first @contest_notifications = ContestNotification.order("id desc")
end end
def search def search

View File

@ -0,0 +1,24 @@
<div class="top-content">
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf" ><%= l(:label_contest_innovate ) %></td>
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
<td rowspan="2">
</td>
<td rowspan="2" >
</td>
</tr>
<tr>
<td style="padding-left: 8px"><a href="http://contest.trustie.net/">contest.trustie.net</td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情</td>
</tr>
</table>
</div>
<!-- end -->
<div class="notification-content">
<p class="title"><%= @notification.title %></p>
<hr />
<p class="content"><%= @notification.content.html_safe %></p>
<hr />
</div>

View File

@ -21,7 +21,7 @@
<table border="0"> <table border="0">
<tr> <tr>
<td> <td>
<strong><%= l(:label_contests_reward_method) %>:&nbsp;&nbsp;<span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong> <strong><%= l(:label_contests_reward_method) %>:&nbsp;&nbsp;<span style="word-break: break-all; color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= contest.budget%></span></strong>
</td> </td>
</tr> </tr>

View File

@ -2,55 +2,52 @@
<div style="height: auto; padding-bottom: 10px"> <div style="height: auto; padding-bottom: 10px" class="softapplications-div">
<table width="100%" border="0"> <tr>
<tr style="font-size: 18px"> <td colspan="2" valign="top" width="320">
<td valign="top"><strong><%= @softapplication.name %></strong></td> </td>
<td style="font-size: 15px; padding-right: 0px" align="right"> <td>
<%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>&nbsp; <table width="100%" border="0">
<%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> <tr style="font-size: 18px">
</td> <td colspan="2" valign="top"><strong><%= @softapplication.name %></strong></td>
</tr> <td style="font-size: 15px; padding-left: 0px">
</table> <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: {confirm: '您确定要删除吗?'} if @softapplication.destroyable_by? User.current %>&nbsp;
</div> <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %>
</td>
</tr>
<tr>
<td style="width: 570px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%><%= @softapplication.app_type_name %></td>
<% contest = @softapplication.contests.first %>
<td style="width: 240px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%><%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td>
</tr>
<tr>
<td style="padding-left: 40px"><%=l(:label_attendingcontestwork_release_person)%><%= @softapplication.user.name %></td>
<td><%=l(:label_attendingcontestwork_adaptive_system)%><%= @softapplication.android_min_version_available %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<span><%=l(:label_attendingcontestwork_download)%></span>
<span>
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
</span>
</td>
<div style="height: auto; padding-bottom: 10px"> <td><%=l(:label_attendingcontestwork_developers)%><%= @softapplication.application_developers %></td>
<table width="100%" border="0"> </tr>
<tr> <tr>
<td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_type)%></td> <td style="padding-left: 40px"><%=l(:label_attendingcontestwork_average_scores)%>: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.app_type_name %></td> <td><%=l(:label_attendingcontestwork_release_time)%><%=format_time @softapplication.created_at %></td>
<% contest = @softapplication.contests.first %> </tr>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_belongs_contest)%></td> <tr>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= contest ? link_to(contest.name, show_attendingcontest_contest_path(contest)) : '尚未加入竞赛' %></td> <td style="padding-left: 40px">
</tr> <% if @project %>
<tr> <%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %>
<td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_release_person)%></td> <% end %>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.user.name %></td> </td>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_adaptive_system)%></td> </tr>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.android_min_version_available %></td> </table>
</tr> </td>
<tr> </tr>
<td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_download)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all">
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current)} %><%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
</td>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_developers)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= @softapplication.application_developers %></td>
</tr>
<tr>
<td style="width: 70px; padding-left:40px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_average_scores)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></td>
<td style="width: 70px; word-wrap: break-word; word-break: break-all"><%=l(:label_attendingcontestwork_release_time)%></td>
<td style="width: 400px; word-wrap: break-word; word-break: break-all"><%=format_time @softapplication.created_at %></td>
</tr>
<tr>
<td style="padding-left: 40px">
<% if @project %>
<%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %>
<% end %>
</td>
</tr>
</table>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
@ -59,7 +56,7 @@
<div style="font-size: 15px;"><%=l(:label_work_description)%></div> <div style="font-size: 15px;"><%=l(:label_work_description)%></div>
</strong> </strong>
<div style="padding-top: 5px; padding-left:10px"><%= @softapplication.description %></div> <div style="padding-top: 5px"><%= @softapplication.description %></div>
</div> </div>
<div class="underline-contests_one"></div> <div class="underline-contests_one"></div>
@ -82,10 +79,9 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<div style="float: left; padding-left: 100px; padding-top:35px "> <div style="float: left; padding-left: 100px; padding-top:35px " align="center">
<div style="text-align: center;"><%=l(:label_final_scores)%></div> <div><%=l(:label_final_scores)%></div>
<% score = @softapplication.average(:quality).try(:avg).try(:round, 2).to_f %> <div style="padding-top: 1px; font-size: 15px; color: blue"><%= @softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s %>分</div>
<div style="padding-top: 1px; font-size: 15px; color: blue;text-align: center;"><%= format("%.2f" , score) %>分</div>
<div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div> <div><%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %></div>
</div> </div>
<div style="float: left; padding-left: 100px; padding-top:35px;" align="center"> <div style="float: left; padding-left: 100px; padding-top:35px;" align="center">

View File

@ -190,69 +190,20 @@
</div> </div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="padding-left: 32px"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="margin-left: 5px; color: #e8770d;"> <h3 style="margin-left: 5px; color: #e8770d;">
<strong><%=l(:label_notification)%></strong> <strong><%=l(:label_notification)%></strong>
</h3> </h3>
<span style="margin-top: -20px;float: right; display: block;"><%#= link_to l(:label_more_information), forums_path %></span>
<div style="height: 167px; padding-top:6px;">
<fieldset style="padding-left: 36px; margin-left: 13px; height: 150px; width:380px; border-radius:10px;">
<div style="font-size:14px; color: #1166AD;text-align:center;word-break: break-all;word-wrap: break-word; "><strong style="margin:auto;"><%= @contestNotification.title %></strong></div>
<div class="underline-contests_four"></div>
<div id="up_zzjs">
<div id="marqueebox">
<!-- <div><span style="color: red">一等奖:</span>&nbsp<span style="color: #1166AD">消灭那怪兽</span></div>
<div><span style="color: red">二等奖:</span>&nbsp<span style="color: #1166AD">兄弟向前冲 </span></div>
<div><span style="color: red">二等奖:</span>&nbsp<span style="color: #1166AD">鸟鸟文件管理器(银河之光版)</span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">疯狂猜图</span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">愉快的定向越野 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">体能训练助手 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">迷你日记本 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">永齐飞机大战</span></div> -->
<%= @contestNotification.content.html_safe %>
</div>
</div>
<!-- 火狐 onmouseover、onmouseout无效 <marquee scrollamount=3 direction=up height=100 onmouseover=stop() onmouseout= start() >
<div><span style="color: red">一等奖:</span>&nbsp<span style="color: #1166AD">消灭那怪兽</span></div>
<div><span style="color: red">二等奖:</span>&nbsp<span style="color: #1166AD">兄弟向前冲 </span></div>
<div><span style="color: red">二等奖:</span>&nbsp<span style="color: #1166AD">鸟鸟文件管理器(银河之光版)</span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">疯狂猜图</span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">愉快的定向越野 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">体能训练助手 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">迷你日记本 </span></div>
<div><span style="color: red">三等奖:</span>&nbsp<span style="color: #1166AD">永齐飞机大战</span></div>
</marquee> -->
<script language="javascript"> <ul class="contest-notification-list">
function startmarquee(lh,speed,delay) { <% @contest_notifications.each do |notification| %>
var p=false; <li>
var t; <span class="title"><%= link_to notification.title, notification %></span>
var o=document.getElementById("marqueebox"); <span class="font_lighter content"><%= truncate(strip_tags(notification.content).gsub( '&nbsp;',' '), length:60) %></span>
o.innerHTML+=o.innerHTML; <span class="font_lighter time"><%=l(:label_release_time)%>:&nbsp;<%=format_time notification.created_at %></span>
o.style.marginTop=0; </li>
o.onmouseover=function(){p=true;} <% end %>
o.onmouseout=function(){p=false;} </ul>
function start(){
t=setInterval(scrolling,speed);
if(!p) o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
}
function scrolling(){
if(parseInt(o.style.marginTop)%lh!=0){
o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
if(Math.abs(parseInt(o.style.marginTop))>=o.scrollHeight/2) o.style.marginTop=0;
}else{
clearInterval(t);
setTimeout(start,delay);
}
}
setTimeout(start,delay);
}
startmarquee(20,40,0);
</script>
</fieldset>
</div>
</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;">

View File

@ -1377,3 +1377,50 @@ div.pagination {
right: 5%; right: 5%;
} }
/***
* contest notifications
*/
ul.contest-notification-list {
clear: both;
}
ul.contest-notification-list li{
padding: 10px;
border-bottom: 1px solid rgb(245,245,245);
display: block;
}
ul.contest-notification-list li span.time {
color: rgb(172, 174, 177);
font-size: 13px;
line-height: 25px;
}
ul.contest-notification-list li span.title {
font-size: 14px;
}
ul.contest-notification-list li span.content {
padding-top: 5px;
padding-bottom: 10px;
}
ul.contest-notification-list li span{
display: block;
}
.notification-content{
margin: 0 auto;
width: 80%;
}
.notification-content hr{
background: #eee;
}
.notification-content .title{
font-size: 15px;
}
.notification-content .content{
font-size: 13px;
}
.softapplications-div table td{
word-break: break-all;
}