Turned admin/moderation on details page into a dropdown

This commit is contained in:
Christoph Haas 2016-03-04 12:32:24 +01:00
parent 1a089c4b0a
commit 51c6c99d61
3 changed files with 17 additions and 18 deletions

View file

@ -296,7 +296,8 @@ $drilldown-background: $white;
$dropdown-padding: 1rem;
$dropdown-border: 1px solid $medium-gray;
$dropdown-font-size: 1rem;
$dropdown-width: 300px;
// $dropdown-width: 300px;
$dropdown-width: 400px;
$dropdown-radius: $global-radius;
$dropdown-sizes: (
tiny: 100px,

View file

@ -55,7 +55,6 @@ class Screenshot < ActiveRecord::Base
"live/screenshots/approved/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png"
end
def status
text = 'This image '

View file

@ -7,27 +7,26 @@
- if @package.screenshots.count > 0
- @package.screenshots.each do |screenshot|
.row.listview
.small-12.columns.text-center
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
.small-12.columns
.text-center
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: Show information only if admin
- if user_signed_in?
// TODO: Enable button only if admin or uploader
- if user_signed_in?
// Button that reveals a dropdown/modal for admins
.text-center
button.small.dropdown.warning.button type="button" data-toggle="admin-info-#{screenshot.id}"
'Admin
.dropdown-pane data-dropdown=true id="admin-info-#{screenshot.id}"
a.button.tiny.alert[
href=delete_screenshot_path(@package.name, screenshot.id)
onclick="return confirm('Really delete the screenshot?');"
] Delete screenshot
.callout.primary
p.subtitle Administrative information
p Uploader IP=#{screenshot.uploaderip}
/ p Token=#{screenshot.uploaderhash}
p Uploaded #{screenshot.age_days} (#{screenshot.uploaddatetime})
p Approved: #{screenshot.approved}
p To be removed: #{screenshot.markedfordelete}
- if screenshot.markedfordelete
' (#{screenshot.delete_reason})'
p URL: #{screenshot.image.url}
p Uploader IP=#{screenshot.uploaderip}
p Uploaded #{screenshot.age_days} (#{screenshot.uploaddatetime})
p Status: #{screenshot.status}
- else
.row.listview