Skip to content

Commit

Permalink
Merge branch 'master' into report-as-spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Waishnav authored Aug 6, 2024
2 parents a8ed0cb + 734f8a4 commit d49d94f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/controllers/simple_discussion/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ def is_moderator_or_owner?(object)
end
helper_method :is_moderator_or_owner?

def is_owner?(object)
object.user == current_user
end
helper_method :is_owner?

def is_moderator?
current_user&.moderator?
current_user.respond_to?(:moderator?) && current_user.moderator?
end
helper_method :is_moderator?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="user-avatar mr-2" ><img src="<%= gravatar_url_for(forum_post.user.email, size: 30) %>" alt="avatar of user" ></div>
<div class="details d-flex flex-column justify-content-between">
<p class="title"><%= forum_post.user.name %> <%= forum_user_badge(forum_post.user) %>
<% if is_moderator_or_owner?(forum_post) %>(You)<% end %>
<% if is_owner?(forum_post) %>(You)<% end %>
</p>
<p class="subtitle"><%= t('on') %> &nbsp;<%= forum_post.created_at.strftime("%b %d, %Y") %></p>
</div>
Expand Down
1 change: 0 additions & 1 deletion app/views/simple_discussion/forum_threads/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
</div>
</div>


<div class="d-flex mb-4">
<div class="thread-details-custom">
<%= t("created_by") %> <%= @forum_thread.user.name %><%= time_ago_in_words(@forum_thread.created_at) %> <%= t("ago") %>
Expand Down

0 comments on commit d49d94f

Please sign in to comment.