FactorioMods/app/views/mods/index.html.haml

53 lines
2.0 KiB
Plaintext

- index_title
= render partial: 'filter_bar'
- unless current_page? '/'
= render partial: 'mods_filters_list'
- if @query
.info-box= t('.search_notice')
.mods-index
- @mods.each do |mod|
.mod
.mod-thumbnail<
%a.mod-thumbnail-link{href: mod_url(mod)}
= mod_img(mod, :thumbnail)
.mod-info-container
%h2.mod-title
= link_to mod.name, mod, class: 'highlight-query'
= admin_edit_link(mod)
.mod-subtitle
- mod.categories.each do |category|
= category_tag_link category
.mod-summary.highlight-query= mod.summary
.mod-links
- if mod.forum_url.present?
- if mod.forum_post
%a.mod-link{href: mod.forum_url, title: "#{mod.forum_post.views_count} views and #{mod.forum_post.comments_count} comments on the official Factorio forum"}
#{mod.forum_post.views_count}<abbr title="Views">V</abbr> / #{mod.forum_post.comments_count}<abbr title="Comments">C</abbr>
= icon 'comments'
- else
%a.mod-link{href: mod.forum_url, title: 'Post on the official Factorio forum'}
Forum
= icon 'comments'
- if mod.latest_version.present? and mod.latest_version.released_at.present?
%span.mod-link{title: "#{mod.latest_version.released_at.to_s(:rfc822)} - Date of the latest version of this mod"}
= mod_date mod.latest_version.released_at
= icon 'history'
- if mod.game_versions_string.present?
%span.mod-link(title='Last Factorio version this mod works with')
= "v#{mod.game_versions_string}"
= icon 'cog'
%span.mod-link{title: 'The awesome person behind this mod'}
- if mod.author
= link_to mod.author_name, mod.author
- else
= link_to mod.author_name, user_url(mod.author_name)
= icon 'user'
-# %a.mod-link.mod-official-site{href: '#'}
-# Official mod site
= render partial: 'download_button', locals: { mod: mod }
= paginate @mods