This commit is contained in:
nieguanghui 2013-12-11 16:14:51 +08:00
parent f7a6798b73
commit c27528ffb7
4 changed files with 156 additions and 29 deletions

View File

@ -52,7 +52,7 @@ module WelcomeHelper
end
def topic_last_time topic
return topic.event_datetime if ( !(topic.methods.to_s =~ %r[last_reply]) && topic.last_reply.nil? )
return topic.event_datetime if ( !(topic.methods.to_s =~ %r[last_reply]) || topic.last_reply.nil? )
topic.last_reply.event_datetime
end

View File

@ -123,38 +123,105 @@
// var id=$(this).attr('id');
// alert(id);
// });
// $(function(){
// $(".welcome-box-list-new").hide();
// $("#hot-topic").bind("click", function(){
// $(".welcome-box-list-new").hide();
// $(".welcome-box-list").show();
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// });
// $("#new-topic").css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
//
// $("#new-topic").bind("click", function(){
// $(".welcome-box-list").hide();
// $(".welcome-box-list-new").show();
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// });
// $("#hot-topic").css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
//
// });
// // $("#panel h5.head").bind("mouseout", function(){
// // $(this).next().fadeOut();
// // });
// })
// $(function(){
// $("#new-topic").hover(function(){
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// }),
// $(this).css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
// $("#hot-topic").hover(function(){
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// }),
// $(this).css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
// })
</script>
<!-- <style>
<style>
.forum-topic li{
float: left;
}
</style> -->
</style>
<!-- info display block -->
<%= stylesheet_link_tag 'welcome' %>
<div class="body_resize">
<div class="left" style="float: left; height: 445px; width: 50%;">
<ul class="welcome-message-list" style="width: 90%; ">
<div class="forum-topic">
<ul>
<li>
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>论坛动态</strong></h3>
</li>
<!-- <li>
<h4>最新帖子</h4>
<div class="forum-topic" style="height: 25px;">
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>论坛动态</strong></h3>
<!-- <ul class="inner-content">
<li>
<a href="#" id="hot-topic">最热帖子</a>
</li>
<li>
<h4>最热帖子</h4>
<a href="#" id="new-topic">最新帖子</a>
</li>
<li>
<h4>更多主题</h4>
</li> -->
</ul>
<a href="#">更多主题</a>
</li>
</ul> -->
</div>
<div class="welcome-box-list">
<!-- <div class="welcome-box-list">
<% find_hot_forum_topics.each do |topic|%>
<li class="message-brief-intro" style="min-height: 25px;">
<div style="display: inline-block; width: 100%;">
@ -170,6 +237,24 @@
</div>
</li>
<% end %>
</div> -->
<div class="welcome-box-list-new">
<% find_new_forum_topics.each do |topic|%>
<li class="message-brief-intro" style="min-height: 25px;">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; 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;"%>
</span>
<br>
<span style="margin-left: 20px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><!-- <%=l(:field_updated_on)%> --><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 5px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%>发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to topic.replies_count, topic.event_url %>)</span>
</div>
</li>
<% end %>
</div>
</ul>
</div>

View File

@ -43,37 +43,37 @@ zh:
distance_in_words:
half_a_minute: "半分钟"
less_than_x_seconds:
one: "秒内"
one: "1秒内"
other: "少于 %{count} 秒"
x_seconds:
one: "秒"
one: "1秒"
other: "%{count} 秒"
less_than_x_minutes:
one: "分钟内"
one: "1分钟内"
other: "少于 %{count} 分钟"
x_minutes:
one: "分钟"
one: "1分钟"
other: "%{count} 分钟"
about_x_hours:
one: "大约小时"
one: "大约1小时"
other: "大约 %{count} 小时"
x_hours:
one: "1 小时"
other: "%{count} 小时"
x_days:
one: "天"
one: "1天"
other: "%{count} 天"
about_x_months:
one: "大约个月"
one: "大约1个月"
other: "大约 %{count} 个月"
x_months:
one: "个月"
one: "1个月"
other: "%{count} 个月"
about_x_years:
one: "大约年"
one: "大约1年"
other: "大约 %{count} 年"
over_x_years:
one: "超过年"
one: "超过1年"
other: "超过 %{count} 年"
almost_x_years:
one: "将近 1 年"

View File

@ -88,6 +88,7 @@ ul.welcome-message-list{
border-bottom: 1.5px solid rgb(21, 165, 200);
padding: 2px;
margin-left: 10px;
font-size: 16px;
}
/*鍚勭鍒楄〃鏄剧ず*/
.d-p-index-box{
@ -103,14 +104,15 @@ ul.welcome-message-list{
color: #999999;
}
.d-p-index-box h3{
height: 35px;
line-height: 35px;
height: 25px;
line-height: 25px;
background-color: rgb(252, 252, 252);
color: green;
/*text-indent: 8px;*/
margin: 0;
padding: 0;
padding: 0px;
display: block;
font-size: 16px;
/*font-size: 1em;*/
border-top: none;
border-bottom: 1px solid rgb(21, 165, 200);
@ -265,4 +267,44 @@ div#tooltip::after {
}
.inner-content {
position: absolute;
margin-top: -32px;
margin-left: 230px;
}
.inner-content li {
float: left;
list-style-type: none;
white-space: nowrap;
margin-right: 0px;
background: none repeat scroll 0% 0% rgb(255, 255, 255);
position: relative;
margin-bottom: -1px;
/*padding-left: 6px;
padding-right: 6px;*/
}
.inner-content a:link, .inner-content a:visited{
margin-right: 0.2em;
padding: 0.1em 0.2em 0.1em 0.2em;
color: #A62020;
background-color: #FCE6EA;
text-decoration: none;
border-top: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF:
border-bottom: 1px solid #717171;
border-right: 1px solid #717171;
}
.inner-content a:hover{
border-top: 1px solid #717171;
border-left: 1px solid #717171;
border-bottom: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
}
{
border-top: 1px solid #717171;
border-left: 1px solid #717171;
border-bottom: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
}