增加图标显示

This commit is contained in:
nieguanghui 2013-11-28 17:22:24 +08:00
parent 5d77f2031e
commit aa4596e170
4 changed files with 52 additions and 16 deletions

View File

@ -47,6 +47,26 @@ module WelcomeHelper
def find_all_hot_contest
sort_contest_by_hot
end
def find_all_event_type event
case event.event_type
when 'news'
'新闻'
when 'issue'
'缺陷'
when 'attachment'
'附件'
when 'message'
'主题'
when 'reply'
'回复'
when 'bid'
'众包'
else
event.event_type
end
end
def time_tag_welcome(time)
text = distance_of_time_in_words(Time.now, time)
content_tag('span', text, :title => format_time(time))

View File

@ -98,16 +98,21 @@
<div class="body_resize">
<div class="left" style="float: left; height: 445px; width: 50%;">
<ul class="welcome-message-list" style="width: 90%;">
<ul class="welcome-message-list" style="width: 90%; ">
<h3 style="">论坛热帖</h3>
<div class="welcome-box-list">
<% find_hot_forum_topics.each do |topic|%>
<li class="message-brief-intro">
<span style="color:gray"><%= link_to topic.subject.truncate(30, omission: '...'), forum_memo_path(topic.forum_id,topic.id) %></span>
<li class="message-brief-intro" style="height: 25px;">
<div style="display: inline-block; float: left;">
<img src="/images/list-icon.png"></img>
</div>
<div style="display: inline-block;float: left;">
<span style="color:gray"><%= link_to topic.subject.truncate(30, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %></span>
<span style="margin-left: 10px; color: green">
<%= link_to topic.author, user_path(topic.author) %>
</span>
<span style="margin-left:10px; color:blue"><%= time_tag_welcome topic.created_at %>前</span>
</div>
</li>
<% end %>
</div>
@ -120,13 +125,13 @@
<div class="user-message-box-list">
<% find_all_activities.each do |event| %>
<li style="display: block;height:60px;">
<div class="inner-right" style="float: left; height: 100%;">
<div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div>
<div class="inner-right" style="float: right; width:88%; height: 100%;">
<span style="color: green;"><%= link_to event.event_author, user_path(event.event_author), :style => "color:green;" %></span>&nbsp;发表了<%= event.event_type %><span style="color: blue;"><%= link_to truncate(event.event_description, length: 30, omission:'...'), event.event_url %>
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
<span style="color: green;"><%= link_to event.event_author, user_path(event.event_author), :style => "color:green;" %></span>&nbsp;发表了<%= find_all_event_type event %><span style="color: blue;"><%= link_to truncate(event.event_description, length: 30, omission:'...'), event.event_url %>
</span>
<p><span><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!-- <span>评论(4)</span></p> -->
<p><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!-- <span>评论(4)</span></p> -->
</div>
</li>
<% end %>
@ -141,13 +146,19 @@
<ul class="d-p-projectlist">
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
<li style="background-image:none;">
<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 class="layout-1" >
<span class="d-p-project-intro" ><%= project.description.truncate(50, omission: '...') %></span>
</p>
<div style="float: left;">
<%= image_tag url_to_avatar(project), :class => "avatar-4" %>
</div>
<div style="float: left; margin-left: 10px; width: 360px;">
<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 class="layout-1" >
<span class="d-p-project-intro" ><%= project.description.truncate(50, omission: '...') %></span>
</p>
</div>
</li>
<% end %>
</ul>
</div>

BIN
public/images/list-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -155,7 +155,7 @@ li {
color: #999999;
background: center -1px no-repeat;
line-height: 20px;
padding: 0px 9px;
padding: 5px 5px 0px 9px;
width: 440px;
cursor: pointer;
font: 12px/1.5 tahoma,arial,\5b8b\4f53;
@ -196,8 +196,13 @@ p.layout {
height: 40px;
margin-top: 5px;
}
acronym {
text-decoration: none;
.message-brief-intro .gray{
color: gray;
}
.avatar-4 {
width: 45px;
height: 45px;
}
/*p.clr, .clr { clear:both; padding:0; margin:0; background:none;}*/