Skip to content

Commit a3a3055

Browse files
committed
make reply editable to admin
1 parent a398687 commit a3a3055

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

public/stylesheets/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ body {
6262
#manage_topic {
6363
padding: 10px;
6464
}
65+
#manage_topic a {
66+
text-decoration: none;
67+
margin-right: 0.5em;
68+
}
6569
#sidebar .panel {
6670
background: hsla(0, 0%, 100%, 1);
6771
font-size: 13px;
@@ -367,7 +371,6 @@ a.user_avatar:hover {
367371
height: 40px;
368372
}
369373
.user_icon {
370-
margin-right: 7px;
371374
opacity: 0.4;
372375
}
373376
.user_icon:hover {
@@ -423,6 +426,9 @@ a.user_avatar:hover {
423426
float: right;
424427
margin-left: 20px;
425428
}
429+
.user_action a {
430+
text-decoration: none;
431+
}
426432
.reply_content {
427433
padding-left: 50px;
428434
color: #333;

views/reply/reply.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<a class="reply_time" href="#<%- reply._id %>"><%= reply.friendly_create_at %></a>
1111
</div>
1212
<div class='user_action'>
13-
<% if (locals.current_user && current_user._id.toString() == reply.author._id.toString()) { %>
13+
<% if ( current_user.is_admin ||
14+
(locals.current_user && current_user._id.toString() == reply.author._id.toString())
15+
) { %>
1416
<a href='/reply/<%- reply._id %>/edit' class='edit_reply_btn'>
1517
<img class='user_icon' src="<%- config.site_static_host %>/public/images/doc_edit_icon&16.png" title='编辑' />
1618
</a>

views/reply/reply2.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<a class="reply_time" href="#<%- reply2._id %>"><%= reply2.friendly_create_at %></a>
1010
</div>
1111
<div class='user_action'>
12-
<% if (locals.current_user && current_user._id.toString() == reply2.author._id.toString()) { %>
12+
<% if ( current_user.is_admin ||
13+
(locals.current_user && current_user._id.toString() == reply2.author._id.toString())
14+
) { %>
1315
<a href='/reply/<%- reply2._id %>/edit' class='edit_reply_btn'>
1416
<img class='user_icon' src="<%- config.site_static_host %>/public/images/doc_edit_icon&16.png" title='编辑' />
1517
</a>

0 commit comments

Comments
 (0)