My views improved. Own screenshots view added

This commit is contained in:
Christoph Haas 2021-03-09 22:43:50 +01:00
parent 15b58548cc
commit 0207d6b392
7 changed files with 93 additions and 39 deletions

View file

@ -0,0 +1,28 @@
= render partial: 'menu'
h1 Screenshots uploaded by you
= render(partial: 'packages/paginator', locals: {items: @screenshots})
- if @screenshots
table
thead
tr
th Uploaded
th Package
th Screenshot
tbody
- @screenshots.each do |ss|
tr
td #{time_ago_in_words ss.created_at} ago
td
= link_to ss.package.name, ss.package
td
- if ss.package
.image
/ This leads to an N+1 SQL query for each image. Ideas for optimization welcome.
img src=ss.simage_url(:thumb)
/ = link_to ss.id, package_path(ss.package, highlight: ss.id)
- else
p You haven't uploaded any screenshots yet.