Skip to content

Commit 7c1cba6

Browse files
committed
话题列表将节点名称显示在标题前面;
修正某些时候话题列表缺少节点的问题;
1 parent b6e7d13 commit 7c1cba6

File tree

6 files changed

+27
-15
lines changed

6 files changed

+27
-15
lines changed

app/assets/stylesheets/front.scss

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
i.fa-diamond { color: $red; }
6969
i.fa-check { color: $green; }
7070
}
71-
.node { line-height: 50px; margin-left: 18px; color: $blue; }
71+
.node { line-height: 50px; margin-left: 18px; color: #777; margin-right: 3px; }
7272
h1 {
7373
margin: 0; padding: 0; font-size: 18px; line-height: 50px;
7474
}
@@ -173,6 +173,10 @@
173173
}
174174
}
175175

176+
.topics-node {
177+
.node { display: none; }
178+
}
179+
176180
.topics {
177181
.panel-body {
178182
padding: 0 15px;
@@ -201,7 +205,16 @@
201205
font-size: 15px;
202206
margin-bottom: 0;
203207
a:link,
204-
a:visited { color: #222; font-weight: 400; line-height: 30px; }
208+
a:visited {
209+
color: #222; font-weight: 400; line-height: 30px;
210+
.node { color: #777; margin-right: 3px; }
211+
}
212+
a:active,
213+
a:hover {
214+
color: #555;
215+
.node { color: #555; }
216+
text-decoration: none;
217+
}
205218
i.fa { color: #999; margin-left: 3px; }
206219
i.fa-diamond { color: $red; }
207220
i.fa-check { color: $green; }
@@ -240,7 +253,9 @@
240253
padding: 15px;
241254
transition: all .3s;
242255
h1 {
243-
margin-top:0; font-size:24px; color:#333;text-align: left; line-height:100%; margin-bottom:8px;
256+
margin-top:0;
257+
font-size: 20px; color:#333; text-align: left; line-height:150%; margin-bottom:8px;
258+
.node { color: #777; margin-right: 3px; }
244259
i.fa-check { color: $green; font-size: 16px; }
245260
}
246261
.avatar { text-align:right; }

app/assets/stylesheets/users.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
.info { margin-top:3px; font-size:12px; color:#bbb; }
6565
.node {
6666
margin-right:5px;
67-
a { color:#444; }
67+
color: #777; margin-right: 3px;
6868
}
6969
}
7070
}

app/views/topics/_topic.html.erb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
</div>
66
<div class="infos media-body">
77
<div class="title media-heading">
8-
<%= link_to(truncate(topic.title, length: 100), topic_path(topic), title: topic.title) %>
8+
<%= link_to(topic_path(topic), title: topic.title) do %>
9+
<%= raw content_tag(:span, topic.node_name, class: 'node') %>
10+
<%= topic.title %>
11+
<% end %>
912
<% if suggest %>
1013
<i class="fa fa-angle-double-up" title="置顶"></i>
1114
<% end %>
1215
<%= topic_excellent_tag(topic) %>
1316
<%= topic_close_tag(topic) %>
1417
</div>
1518
<div class="info">
16-
<% if action_name != "node" %>
17-
<%= render_node_name(topic.node_name,topic.node_id) %>
18-
19-
<% end %>
2019
<%= user_name_tag(topic.user) %>
2120
<span class="hidden-mobile">
2221

app/views/topics/_topic_info.html.erb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<div class="panel-heading media clearfix">
22
<div class="media-body">
33
<h1 class="media-heading">
4+
<%= render_node_name(topic.node_name, topic.node_id) %>
45
<%= topic.title %>
56
<%= topic_close_tag(topic) %>
67
</h1>
78
<% content_for :header do %>
89
<div class="navbar-nav">
910
<div class="navbar-topic-title">
1011
<a href="#" class="topic-title pull-left" title="<%= topic.title %>" data-type="top">
11-
<h1><%= topic.title %><%= topic_close_tag(topic) %></h1>
12+
<h1><span class="node"><%= topic.node_name %></span> <%= topic.title %><%= topic_close_tag(topic) %></h1>
1213
</a>
13-
<span class="node"><%= topic.node_name %></span>
1414
</div>
1515
</div>
1616
<% end %>
1717
<div class="info">
18-
<%= render_node_name(topic.node_name,topic.node_id) %>
19-
·
2018
<%= user_name_tag(topic.user, data: { author: true }) %>
2119
<% if topic.team %>
2220
for <%= user_name_tag(topic.team) %>

app/views/topics/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<div class="row">
99
<div class="col-md-9">
10-
<div class="topics panel panel-default">
10+
<div class="topics topics-<%= action_name %> panel panel-default">
1111

1212
<div class="panel-body item-list">
1313
<% if @suggest_topics.present? %>

app/views/users/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<% @topics.each do |item| %>
2222
<li class="list-group-item">
2323
<div class="title">
24+
<%= render_node_name(item.node_name,item.node_id) %>
2425
<%= topic_title_tag(item) %> <%= topic_excellent_tag(item) %>
2526
</div>
2627
<div class="info">
27-
<span class="node"><%= render_node_name(item.node_name,item.node_id) %></span>
2828
<span class="counter"><%= item.likes_count %> 个赞 • <%= item.replies_count %> 条回复</span>
2929
</div>
3030
</li>

0 commit comments

Comments
 (0)