Skip to content

Commit 6fcfcdf

Browse files
authored
Merge pull request #1227 from codidact/0valt/1072/move-start-comment-thread-down
Move 'start new comment thread' button under listed threads
2 parents a1db28a + 6fdbfa1 commit 6fcfcdf

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

app/assets/stylesheets/comments.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@
6565
font-style: italic;
6666
}
6767

68+
.post--comments-header {
69+
align-items: center;
70+
display: flex;
71+
justify-content: space-between;
72+
margin-bottom: 0.75rem;
73+
}
74+
75+
.post--comments-container {
76+
margin-bottom: 1rem;
77+
}
78+
6879
.post--comments-thread.is-inline {
6980
padding: 0.5rem 0.25rem;
7081
display: flex;
@@ -139,7 +150,7 @@
139150
.new-thread-modal {
140151
box-shadow: 0 3px 5px -2px #eee;
141152
border: 1px solid #d0d9dd;
142-
margin-top: 10px;
153+
margin-top: 1rem;
143154
padding: 0.7em;
144155
display: none;
145156
}

app/views/posts/_expanded.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,11 @@
462462
<% public_count = comment_threads.count %>
463463
<% available_count = current_user&.has_post_privilege?('flag_curate', post) ?
464464
post.comment_threads.count : post.comment_threads.publicly_available.count %>
465+
<div class="post--comments-header">
465466
<h4 class="has-margin-0">
466467
<%= pluralize(public_count, 'comment thread') %>
467468
</h4>
468469
<% if user_signed_in? %>
469-
<a class="button is-outlined is-small js-new-thread-link" data-post="<%= post.id %>" role="button">
470-
<i class="fas fa-fw fa-plus"></i> Start new comment thread
471-
</a>
472470
<% if CommentThread.post_followed?(post, current_user) %>
473471
<%= link_to follow_post_comments_path(post_id: post.id), method: :post,
474472
class: "button is-muted is-outlined is-small",
@@ -487,6 +485,7 @@
487485
<% end %>
488486
<% end %>
489487
<% end %>
488+
</div>
490489
<div class="post--comments-container" role="list">
491490
<%= render 'comments/post', comment_threads: comment_threads.first(5) %>
492491
</div>
@@ -510,6 +509,9 @@
510509
<p class="has-color-red-500"><i class="fa fa-lock"></i> Comments have been disabled on this post, but as a moderator you are exempt from that block.</p>
511510
<% end %>
512511
<% end %>
512+
<a class="button is-outlined is-small js-new-thread-link" data-post="<%= post.id %>" role="button">
513+
<i class="fas fa-fw fa-plus"></i> Start new comment thread
514+
</a>
513515
<%= render 'comments/new_thread_modal', post: post %>
514516
<% end %>
515517
</div>

0 commit comments

Comments
 (0)