Merge
This commit is contained in:
parent
42447edeaa
commit
ec726ed62a
3 changed files with 12 additions and 7 deletions
|
|
@ -61,13 +61,13 @@ class PackagesController < ApplicationController
|
|||
#new_screenshot.image = params[:image]
|
||||
|
||||
#render text: "File has been uploaded successfully"
|
||||
redirect_to upload_package_by_name_path
|
||||
redirect_to package_path
|
||||
end
|
||||
|
||||
def delete_screenshot
|
||||
@screenshot = Screenshot.find_by(id: params[:id])
|
||||
@screenshot.destroy
|
||||
|
||||
redirect_to upload_package_by_name_path
|
||||
redirect_to package_path
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,12 +18,17 @@
|
|||
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
|
||||
// TODO: Enable button only if admin or uploader
|
||||
a.button.tiny.alert[
|
||||
href=delete_screenshot_path(@package.name, screenshot.id)
|
||||
onclick="return confirm('Really delete the screenshot?');"
|
||||
] Delete screenshot
|
||||
|
||||
// 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_tag(upload_image_path, multipart: true)
|
||||
= file_field_tag('image')
|
||||
= submit_tag
|
||||
|
||||
= form_for :screenshot, url: upload_image_path, html: { multipart: true } do |f|
|
||||
= f.label :image, 'Upload new screenshot'
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
= 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
|
||||
//a.button.radius.expand href=upload_package_by_name_path(name: @package.name)
|
||||
//' Click or drag a PNG screenshot file here
|
||||
.small-6.columns
|
||||
' Form
|
||||
- @package.screenshots.each do |screenshot|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue