Dammit… I can't remember what I changed and why

This commit is contained in:
Christoph Haas 2018-05-06 19:07:41 +02:00
parent 09b0df40f7
commit dd7527691e
20 changed files with 579 additions and 319 deletions

View file

@ -1,4 +1,6 @@
/ = link_to 'Back', :back, class: 'button small'
/ If images were just uploaded then show upload success/errors
/ in a callout.
= render 'receive_upload'
.row.packagepage
.small-12.columns
@ -10,7 +12,7 @@
- if screenshots_visible_to_user(@package).count > 0
- screenshots_visible_to_user(@package).each do |screenshot|
.row.listview
.text-center
/ .text-center
a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
- if screenshot.description
@ -26,22 +28,9 @@
- if user_signed_in? and current_user.is_admin?
= render(partial: 'admin_dropdown', locals: {screenshot: screenshot})
// or does the screenshot belong to the user (determined by session cookie)
- elsif screenshot.uploaderhash == session[:token]
/ = render(partial: 'user_dropdown', locals: {screenshot: screenshot})
/ Ask the user to add a description if not yet done
- if screenshot.description.blank?
.imgcaption
p Please add a brief description of this screenshot:
= form_tag(update_screenshot_description_path(screenshot.package.name, screenshot.id))
.input-group
= text_field_tag 'description', nil, class: 'input-group-field', maxlength: 80
.input-group-button
=submit_tag 'Save', class: 'button success'
/ Offer to delete the screenshot
a.button.small.alert[
href=delete_screenshot_path(screenshot.id)
onclick="return confirm('Really delete your screenshot again?');"
] Delete your screenshot
- 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?
// TODO: Move to a seperate page with a form