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-padding: 1rem;
$dropdown-border: 1px solid $medium-gray; $dropdown-border: 1px solid $medium-gray;
$dropdown-font-size: 1rem; $dropdown-font-size: 1rem;
$dropdown-width: 300px; // $dropdown-width: 300px;
$dropdown-width: 400px;
$dropdown-radius: $global-radius; $dropdown-radius: $global-radius;
$dropdown-sizes: ( $dropdown-sizes: (
tiny: 100px, 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" "live/screenshots/approved/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png"
end end
def status def status
text = 'This image ' text = 'This image '

View file

@ -7,27 +7,26 @@
- if @package.screenshots.count > 0 - if @package.screenshots.count > 0
- @package.screenshots.each do |screenshot| - @package.screenshots.each do |screenshot|
.row.listview .row.listview
.small-12.columns.text-center .small-12.columns
a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption .text-center
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption) a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
.imgcaption =screenshot.caption = image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
.imgcaption =screenshot.caption
// TODO: Show information only if admin // TODO: Show information only if admin
- if user_signed_in? - if user_signed_in?
// TODO: Enable button only if admin or uploader // 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[ a.button.tiny.alert[
href=delete_screenshot_path(@package.name, screenshot.id) href=delete_screenshot_path(@package.name, screenshot.id)
onclick="return confirm('Really delete the screenshot?');" onclick="return confirm('Really delete the screenshot?');"
] Delete screenshot ] Delete screenshot
.callout.primary
p.subtitle Administrative information p Uploader IP=#{screenshot.uploaderip}
p Uploader IP=#{screenshot.uploaderip} p Uploaded #{screenshot.age_days} (#{screenshot.uploaddatetime})
/ p Token=#{screenshot.uploaderhash} p Status: #{screenshot.status}
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}
- else - else
.row.listview .row.listview