My views improved. Own screenshots view added
This commit is contained in:
parent
15b58548cc
commit
0207d6b392
7 changed files with 93 additions and 39 deletions
28
app/views/my/screenshots.slim
Normal file
28
app/views/my/screenshots.slim
Normal 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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue