Merge branch 'master' of git.workaround.org:chaas/debshots
This commit is contained in:
parent
396f3a7751
commit
2189f8cc81
4 changed files with 9 additions and 32 deletions
|
|
@ -35,7 +35,7 @@ class PackagesController < ApplicationController
|
|||
|
||||
# Save the images already if they are valid.
|
||||
# params[:screenshot][:image].each do |img|
|
||||
successful_upload_count = 0
|
||||
# successful_upload_count = 0
|
||||
|
||||
params[:file].each do |img|
|
||||
new_screenshot = @package.screenshots.new(image: img)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
' You are about to upload a screenshot for the #{@package.name}
|
||||
' package. Thanks for your contribution.
|
||||
|
||||
= form_tag(upload_image_path, multipart: true)
|
||||
= form_for :screenshot, url: upload_image_path, html: { multipart: true, id: 'file-form' } do |f|
|
||||
|
||||
.row
|
||||
.small-6.columns
|
||||
|
|
@ -33,21 +33,6 @@
|
|||
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')
|
||||
|
||||
// <<<<<<< HEAD
|
||||
= form_for :screenshot, url: upload_image_path, html: { multipart: true, id: 'file-form' } do |f|
|
||||
|
||||
/ = form_tag(upload_image_path, multipart: true, id: 'file-form')
|
||||
|
||||
.row
|
||||
.small-6.columns
|
||||
/ input.hidden-inputfile type="file" name="image" id="file" multiple=true
|
||||
= f.file_field :image, id: 'file', multiple: true, class: 'hidden-inputfile'
|
||||
label for="file"
|
||||
a.button id="file-select-button"
|
||||
= fa_stacked_icon "image", base: "circle-thin"
|
||||
span id="file-label"
|
||||
' Select screenshot files
|
||||
// =======
|
||||
// = render partial: 'packages/grid_thumbnail', locals: { pkg: pkg }
|
||||
|
||||
//- else
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ DB_HOST=localhost
|
|||
#DB_HOST=torf
|
||||
|
||||
echo Getting screenshot files
|
||||
rsync -v --size-only root@screenshots.debian.net:/home/debshots/debshots-screenshots.tar /tmp
|
||||
|
||||
echo Getting PostgreSQL dump
|
||||
rsync -v --size-only root@screenshots.debian.net:/home/debshots/debshots.sql /tmp
|
||||
rsync -av debshots@roy.workaround.org:debshots/public/screenshots/ public/screenshots/
|
||||
|
||||
echo Dropping existing database
|
||||
set +e
|
||||
|
|
@ -24,18 +21,13 @@ psql -h $DB_HOST postgres debshots -c 'create database debshots owner debshots'
|
|||
psql -h $DB_HOST postgres debshots -c 'create database debshots_dev owner debshots'
|
||||
psql -h $DB_HOST postgres debshots -c 'create database debshots_test owner debshots'
|
||||
|
||||
echo Getting PostgreSQL dump
|
||||
ssh root@roy.workaround.org 'pg_dump debshots' > /tmp/debshots.sql
|
||||
|
||||
echo Restoring PostgreSQL dump
|
||||
psql -h $DB_HOST debshots debshots < /tmp/debshots.sql
|
||||
psql -h $DB_HOST debshots_dev debshots < /tmp/debshots.sql
|
||||
psql -h $DB_HOST debshots_test debshots < /tmp/debshots.sql
|
||||
|
||||
echo Unpacking screenshots tarball
|
||||
#cd ../public
|
||||
#cd $IMAGE_DEST
|
||||
tar -C $IMAGE_DEST -xf /tmp/debshots-screenshots.tar
|
||||
#mv public/live/screenshots/approved public/screenshots
|
||||
#rm -r public/live
|
||||
ln -fs public/live/screenshots/approved public/screenshots
|
||||
|
||||
rake db:migrate
|
||||
bundle exec rake db:migrate
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ Debshots::Application.routes.draw do
|
|||
get 'package/:name' => 'packages#details', as: :package, name: /[^\/]+/
|
||||
get 'package_reviews/:name' => 'packages#reviews', as: :package_reviews, name: /[^\/]+/
|
||||
get 'upload', to: redirect('/packages'), as: :upload_legacy # legacy upload form
|
||||
post 'uploadfile' => 'packages#legacy_uploadfile'
|
||||
get 'upload/:name' => 'packages#upload', as: :upload
|
||||
post 'uploadfile' => 'packages#legacy_uploadfile', name: /[^\/]+/
|
||||
get 'upload/:name' => 'packages#upload', as: :upload, name: /[^\/]+/
|
||||
post 'upload_image/:name' => 'packages#upload_image', as: :upload_image, name: /[^\/]+/
|
||||
# TODO: "get" is probably the wrong method to delete a screenshot
|
||||
get 'delete_screenshot/:id' => 'packages#delete_screenshot', as: :delete_screenshot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue