Merge branch 'master' of bitbucket.org:signum/debshots

Conflicts:
	app/views/packages/upload.slim
This commit is contained in:
Christoph Haas 2015-02-10 09:16:34 +01:00
commit 18edade734
18 changed files with 199 additions and 55 deletions

View file

@ -2,7 +2,9 @@
a.black href=package_path(name: pkg.name)
div.grid-thumbnail
- if pkg.screenshots.any?
img src=pkg.screenshots[0].url('small')
// TODO: smarter search for the beste screenshot instead of taking the first one
- screenshot = pkg.screenshots.first
= image_tag(screenshot.image.url(:thumb, timestamp: false), alt: screenshot.caption)
- else
img.screenshot src="/images/dummy/no-screenshots-upload-one.svg"
div

View file

@ -13,12 +13,25 @@
p.subtitle = @package.description
ul.small-block-grid-1.medium-block-grid-2.large-block-grid-2
- for screenshot in @package.screenshots
- @package.screenshots.each do |screenshot|
li
a.black.fancybox href=screenshot.url('large') rel='fancybox-thumb' title=screenshot.caption
img src=screenshot.url('large')
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)
.imgcaption =screenshot.caption
// Upload image
li
//a.button.radius.expand href=upload_package_by_name_path(name: @package.name) Upload a new screenshot
//= form_for @package, :url => upload_image_path, :html => { :multipart => true } do |form|
//= form.file_field :image
= form_for :screenshot, url: upload_image_path, html: { multipart: true } do |f|
= f.label :image, 'Upload new screenshot'
= f.file_field :image, id: 'fileupload', multiple: true
= f.submit 'Save'
//- raise
// TODO: Enable comments in a later version
// = partial '/package/comments'
@ -35,7 +48,19 @@
' The goal of Icedove is to produce a cross platform standalone mail
' application using the XUL user interface language.
a.button.radius.expand href=upload_package_by_name_path(name: @package.name) Upload a new screenshot
//a.button.radius.expand href=upload_package_by_name_path(name: @package.name) Upload a new screenshot
javascript:
$(function () {
$('#fileupload').fileupload({
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo(document.body);
});
}
});
});
// TODO: Enable comment form
//javascript:

View file

@ -20,8 +20,10 @@
=pkg.name
' >
- if pkg.screenshots.any?
a.black.fancybox title=pkg.screenshots.first.caption rel=pkg.id href=pkg.screenshots.first.url('large')
img.screenshot src=pkg.screenshots.first.url('large')
// TODO: smarter search for the beste screenshot instead of taking the first one
- screenshot = pkg.screenshots.first
a.black.fancybox title=screenshot.caption rel=pkg.id href=screenshot.image.url(:large, timestamp: false)
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
- if pkg.screenshots.length > 1
a.black href=package_path(name: pkg.name)
.text-center More screenshots…

View file

@ -4,11 +4,19 @@
p.subtitle = @package.description
.row.packagepage
.small-8.columns
.small-12.medium-7.large-8.columns
// First row contains the upload form
.row
.small-6.columns
input id="fileupload" type="file" name="files[]" data-url=upload_image_path(name: @package.name) multiple=true
//input id="fileupload" type="file" name="files[]" data-url=upload_image_path(name: @package.name) multiple=true
//= form_for @new_screenshot, :url => upload_image_path, :html => { :multipart => true } do |form|
// = form.file_field :image
// = form.submit 'Save'
= form_tag(upload_image_path, multipart: true)
= file_field_tag('image')
= submit_tag
a.button.radius.expand href=upload_package_by_name_path(name: @package.name)
' Click or drag a PNG screenshot file here
.small-6.columns
@ -17,8 +25,19 @@
.row
img src=screenshot.url('large')
- puts @package.screenshots
- @package.screenshots.each do |screenshot|
.listview
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)
// .imgcaption
// => screenshot.caption
// - if screenshot.uploader
// | (Uploaded by
// =< screenshot.uploader
// | )
.small-4.columns
.small-12.medium-5.large-4.columns
.bigpanel
p Thanks for uploading more screenshots. Please note:
ul

View file

@ -31,7 +31,7 @@ div.row
// TODO: load actual newest upload and cache it
// TODO: link to the package page
a.black href=package_path(@newest_uploaded_package.name)
img src=@newest_uploaded_package.screenshots[0].image_url('large')
img src=@newest_uploaded_package.screenshots.first.image.url(:large, timestamp: false)
p
strong
=@newest_uploaded_package.name
@ -43,7 +43,7 @@ div.row
// TODO: load actual most popular package and highest-rated screenshot and cache it
// TODO: link to the package page
a.black href=package_path(@most_popular_package.name)
img src=@most_popular_package.screenshots[0].image_url('large')
img src=@most_popular_package.screenshots.first.image.url(:large, timestamp: false)
p
strong
=@most_popular_package.name