Upload page fixed for multi-uploads. Beautification.

This commit is contained in:
Christoph Haas 2016-10-30 13:02:41 +01:00
parent 4aa0ddcaeb
commit 0b5f158dd0
2 changed files with 28 additions and 25 deletions

View file

@ -33,7 +33,7 @@ class PackagesController < ApplicationController
successful_upload_count = 0 successful_upload_count = 0
params[:screenshot][:image].each do |img| params[:file].each do |img|
new_screenshot = @package.screenshots.new(image: img) new_screenshot = @package.screenshots.new(image: img)
# Check if the image was valid # Check if the image was valid

View file

@ -7,8 +7,25 @@
p p
' You are about to upload a screenshot for the #{@package.name} ' You are about to upload a screenshot for the #{@package.name}
' package. Thanks for your contribution. ' package. Thanks for your contribution.
- if @package.screenshots.any?
= form_tag(upload_image_path, multipart: true)
.row
.small-6.columns
input.hidden-inputfile type="file" name="file[]" id="file" multiple=true
label for="file"
a.button id="file-select-button"
= fa_stacked_icon "image", base: "circle-thin"
span id="file-label"
' Select screenshot file(s)
.small-6.columns
button.button type="submit" id="file-submit"
= fa_stacked_icon "upload", base: "circle-thin"
' Start upload
p p
- if @package.screenshots.any?
' Just for your information - these screenshots have already been uploaded. ' Just for your information - these screenshots have already been uploaded.
.small-up-1.medium-up-3.large-up-4.grid-thumbnails .small-up-1.medium-up-3.large-up-4.grid-thumbnails
@ -19,23 +36,9 @@
// = render partial: 'packages/grid_thumbnail', locals: { pkg: pkg } // = render partial: 'packages/grid_thumbnail', locals: { pkg: pkg }
- else - else
' There are no screenshots yet for #{@package.name}. ' There are no screenshots yet for #{@package.name}. Your upload will
' be the first.
= form_tag(upload_image_path, multipart: true)
.row
.small-6.columns
input.hidden-inputfile type="file" name="file" id="file" multiple=true
label for="file"
a.button id="file-select-button"
= fa_stacked_icon "image", base: "circle-thin"
span id="file-label"
' Select screenshot files
.small-6.columns
button.button type="submit" id="file-submit"
= fa_stacked_icon "upload", base: "circle-thin"
' Start upload
.small-5.columns.bigpanel .small-5.columns.bigpanel