Skip to content

Commit a4d692a

Browse files
committed
minor cleanup of the thread rename updates
1 parent 03f5b82 commit a4d692a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/views/comment_threads/_expanded.html.erb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
thread : CommentThread to display
99
%>
1010

11+
<% can_only_rename = current_user&.can_rename?(thread) && !current_user&.privilege?('flag_curate') %>
1112
<% max_shown_comments = 5 %>
1213
<% comment_id ||= defined?(comment_id) ? comment_id : nil %>
1314
<% pingable = thread.pingable %>
@@ -38,10 +39,10 @@
3839
<a href="<%= comment_thread_path(thread.id) %>" class="widget--header-link">show thread</a>
3940
<a href="javascript:void(0)" class="js-collapse-thread widget--header-link">collapse</a>
4041
<% end %>
41-
<% if current_user&.can_rename?(thread) && !current_user&.privilege?('flag_curate') %>
42+
<% if can_only_rename %>
4243
<a href="javascript:void(0)"
43-
class="widget--header-link"
44-
data-modal=".js--rename-thread-<%= thread.id %>"
44+
class="widget--header-link"
45+
data-modal=".js--rename-thread-<%= thread.id %>"
4546
role="button"
4647
aria-label="Rename thread">
4748
<i class="fas fa-pen fa-fw"></i> rename
@@ -116,7 +117,7 @@
116117
<% end %>
117118
<% end %>
118119

119-
<% if current_user&.can_rename?(thread) %>
120+
<% if can_only_rename %>
120121
<%= render 'comments/rename_thread_modal', thread: thread %>
121122
<% end %>
122123

0 commit comments

Comments
 (0)