Package page uses imgcard style just like the grid view

This commit is contained in:
Christoph Haas 2020-11-03 00:28:31 +01:00
parent 206a828a38
commit ff1bad3f33

View file

@ -11,22 +11,36 @@
.small-7.medium-7.cell .small-7.medium-7.cell
/ Left column contains images / Left column contains images
- if @screenshots.length > 0
= render(partial: 'packages/paginator', locals: {items: @screenshots}) = render(partial: 'packages/paginator', locals: {items: @screenshots})
.grid-x.grid-margin-x.medium-up-1.large-up-2 data-equalizer=true data-equalize-on="medium"
- if @screenshots.count > 0 - @screenshots.all.each do |screenshot|
.grid-x.grid-margin-y.grid-margin-x.align-middle .cell.pkgcard data-equalizer-watch=true
a.black href =url_for(screenshot.simage_url(:large)) rel='fancybox-thumb' title=screenshot.caption data-fancybox='gallery' data-caption=screenshot_caption(screenshot)
- @screenshots.each_with_index do |screenshot, idx| .image
.small-12.medium-6.cell = small_img(screenshot, cls: '')
.margin-bottom-3 .text
= render(partial:'small_image', locals: {screenshot: screenshot}) = screenshot.caption
// Has the unmoderated screenshot been uploaded by the current user? // Has the unmoderated screenshot been uploaded by the current user?
- if screenshot_uploaded_by_current_user?(screenshot) - if screenshot_uploaded_by_current_user?(screenshot)
span.label.warning .text
| Uploaded by you span.label.secondary
' Uploaded by you
- unless screenshot.approved - unless screenshot.approved
| (but not moderated yet) ' (but not moderated yet)
// Is the user an admin?
// or does the screenshot belong to the user (determined by session cookie)
- if current_user && current_user.is_admin?
hr
.text
span.label.secondary
' Status:
= screenshot.adminstatus
= render(partial: 'admin_buttons', locals: {screenshot: screenshot})
/ - elsif user_signed_in? and screenshot.user == current_user
/ = render(partial: 'user_dropdown', locals: {screenshot: screenshot})
// Second paginator at the bottom so the user does not have to scroll up again // Second paginator at the bottom so the user does not have to scroll up again
= render(partial: 'packages/paginator', locals: {items: @screenshots}) = render(partial: 'packages/paginator', locals: {items: @screenshots})
@ -38,11 +52,6 @@
/ tt / tt
/ = screenshot.inspect / = screenshot.inspect
// Is the user an admin?
// TODO: fix dropdowns do not enforce javascript
// or does the screenshot belong to the user (determined by session cookie)
/ - elsif user_signed_in? and screenshot.user == current_user
/ = render(partial: 'user_dropdown', locals: {screenshot: screenshot})
// or is the user not related to the screenshot and the screenshot is public? // or is the user not related to the screenshot and the screenshot is public?