show.html.erb 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <main class="main main--article"
  2. data-base-path='<%= custom_path_if_needed help_answer_path(@category, @object, locale: '{locale}'), @knowledge_base %>'
  3. data-available-locales='<%= @object_locales.map(&:locale).join(',') %>'>
  4. <article class="article">
  5. <div class="container">
  6. <h1>
  7. <%= @object.translation.title %>
  8. </h1>
  9. <div class="article-content">
  10. <%= prepare_rich_text(@object.translation.content.body_with_urls).html_safe %>
  11. </div>
  12. <% if (attachments = @object.attachments_sorted) && attachments.present? %>
  13. <div class="attachments article-accessories">
  14. <%= icon 'paperclip' %>
  15. <div class="article-accessories-title"><%= zt('Attached Files') %></div>
  16. <% attachments.each do |attachment| %>
  17. <%= link_to custom_path_if_needed(attachment_path(attachment), @knowledge_base), class: 'attachment', download: true do %>
  18. <span class="attachment-name u-highlight"><%= attachment.filename %></span>
  19. <div class="attachment-size">404kb</div>
  20. <% end %>
  21. <% end %>
  22. </div>
  23. <% end %>
  24. <% if (tags = @object.tag_list) && tags.present? %>
  25. <div class="tags article-accessories">
  26. <%= icon 'hashtag' %>
  27. <div class="article-accessories-title"><%= zt('Tags') %></div>
  28. <div class="tags-content">
  29. <% tags.each do |tag| %>
  30. <%= link_to tag, custom_path_if_needed(help_tag_path(tag, locale: params[:locale]), @knowledge_base), class: 'tag' %>
  31. <% end %>
  32. </div>
  33. </div>
  34. <% end %>
  35. <% if @object.visible? %>
  36. <div class="article-meta">
  37. <%= raw zt 'Published %s', human_time_tag([@object.published_at, @object.translation.updated_at].max) %>
  38. </div>
  39. <% end %>
  40. </div>
  41. </article>
  42. </main>