Files
nairobi/app/views/topics/show.html.erb
Javi Martín 8b13daad95 Add and apply rules for multi-line hashes
For the HashAlignment rule, we're using the default `key` style (keys
are aligned and values aren't) instead of the `table` style (both keys
and values are aligned) because, even if we used both in the
application, we used the `key` style a lot more. Furthermore, the
`table` style looks strange in places where there are both very long and
very short keys and sometimes we weren't even consistent with the
`table` style, aligning some keys without aligning other keys.

Ideally we could align hashes to "either key or table", so developers
can decide whether keeping the symmetry of the code is worth it in a
case-per-case basis, but Rubocop doesn't allow this option.
2023-08-18 14:56:16 +02:00

49 lines
1.7 KiB
Plaintext

<div class="topic-show">
<div class="row margin-bottom">
<div class="small-12 medium-9 column">
<%= back_link_to community_path(@community), t("community.show.back",
community: community_text(@community),
proposal: community_title(@community)) %>
<h1><%= @topic.title %></h1>
<div class="topic-info margin-bottom">
<%= render "/shared/author_info", resource: @topic %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= l(@topic.created_at.to_date) %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new(
@topic.comments_count,
url: community_topic_path(@community, @topic, anchor: "comments")
) %>
</div>
<br>
<p><%= @topic.description %></p>
</div>
<% if @topic.author == current_user %>
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t("community.show.author") %></h2>
<%= link_to t("community.show.topic.edit"),
edit_community_topic_path(@community.id, @topic),
class: "button hollow expanded" %>
<%= link_to t("community.show.topic.destroy"),
community_topic_path(@community.id, @topic),
method: :delete,
class: "button hollow expanded alert" %>
</aside>
<% end %>
</div>
<div class="tabs-content" data-tabs-content="topics-tabs">
<%= render "topics/filter_subnav" %>
<div class="tabs-panel is-active" id="tab-comments">
<%= render "topics/comments" %>
</div>
</div>
</div>