Upload page fixed for multi-uploads. Beautification.
This commit is contained in:
parent
4aa0ddcaeb
commit
0b5f158dd0
2 changed files with 28 additions and 25 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -7,35 +7,38 @@
|
||||||
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?
|
|
||||||
p
|
= 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
|
||||||
|
- 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
|
||||||
- @package.screenshots.all.each do |ss|
|
- @package.screenshots.all.each do |ss|
|
||||||
a.black.fancybox href=ss.image.url(:large, timestamp: false) rel='fancybox-thumb' title=ss.caption
|
a.black.fancybox href=ss.image.url(:large, timestamp: false) rel='fancybox-thumb' title=ss.caption
|
||||||
= image_tag(ss.image.url(:thumb, timestamp: false), alt: ss.caption, class: 'thumbnail')
|
= image_tag(ss.image.url(:thumb, timestamp: false), alt: ss.caption, class: 'thumbnail')
|
||||||
|
|
||||||
// = 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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue