Added Javascript confirmation upon deleting images

This commit is contained in:
Christoph Haas 2016-07-12 20:31:24 +02:00
parent bb79e109c2
commit 8bf26ea1a5
2 changed files with 3 additions and 3 deletions

View file

@ -26,13 +26,13 @@
- if screenshot.approved==false
div
/ TODO: Add a reason for the rejection to tell the user
a.button.alert.round href=delete_screenshot_path(screenshot) Reject
a.button.alert.round href=delete_screenshot_path(screenshot) onclick="return confirm('Really delete the screenshot?');" Reject
a.button.success.round href=approve_screenshot_path(screenshot) Approve
/ Existing screenshots that was requested for removal
- if screenshot.markedfordelete==true
.button-group
a.button.alert.round href=delete_screenshot_path(screenshot) Remove as requested
a.button.alert.round href=delete_screenshot_path(screenshot) onclick="return confirm('Really delete the screenshot?');" Remove as requested
a.button.success.round href=approve_screenshot_path(screenshot) Keep the screenshot

View file

@ -24,7 +24,7 @@
- @package.screenshots.each do |screenshot|
.row
img src=screenshot.image.url(:large, timestamp: false, alt: screenshot.caption)
= link_to "Delete screenshot", delete_screenshot_path(@package.name, screenshot.id)
= link_to "Delete screenshot", delete_screenshot_path(@package.name, screenshot.id), onclick: "return confirm('Really delete the screenshot?');"
// - @package.screenshots.each do |screenshot|
// .listview