Fixed controller that received uploads

This commit is contained in:
Christoph Haas 2017-08-14 19:07:57 +02:00
parent 88b4189731
commit ccd590cfc3

View file

@ -0,0 +1,59 @@
/ This page only gets displayed if there was invalid uploads.
/ Otherwise the user gets redirected to the upload_review page directly.
.row
h1 Some images feel wrong…
.row
p
' Thanks for your upload. Just wanted to let you know that
' these images were not accepted:
ul
- @invalid_images.each do |image|
li
' #{image.image_file_name} (#{image.errors[:image].join(' and the image ')})
- if @valid_images.any?
p
' But do not worry. #{pluralize(@valid_images.length, 'screenshot')} seems good.
' Let us take a look at them.
p
a.button href=package_path Okay
/
/ = form_for :screenshot, url: upload_review2_path do |f|
/
/ p 'Please check the images and add
/ ' short one-line descriptions that describe each of the images.
/
/ - @valid_images.each do |screenshot|
/
/ .row
/
/ .small-4.columns
/ a.black.fancybox href=screenshot.image.url(:large, timestamp: false) title='Uploaded image'
/ = image_tag(screenshot.image.url(:large, timestamp: false), alt: 'Uploaded image')
/ .small-8.columns
/ em Your file name:
/ p
/ = screenshot.image_file_name
/
/ em Description:
/ p
/ = text_field_tag "description-#{screenshot.id}"
/
/ em Delete this image?
/ p
/ = check_box "delete-#{screenshot.id}", "Delete this image"
/
/ .row
/ button.button type="submit" id="file-submit"
/ = fa_stacked_icon "check", base: "circle-thin"
/ ' Done
/
/ - else
/ .row
/ a.button href=upload_path Back to upload form