screenshot.adminstatus added, debug info removed from admin dropdown

This commit is contained in:
Christoph Haas 2016-06-06 15:55:38 +02:00
parent 3da2f68938
commit b30794884f
3 changed files with 19 additions and 4 deletions

View file

@ -63,6 +63,7 @@ class Screenshot < ActiveRecord::Base
"live/screenshots/approved/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png"
end
# Long status text for public users
def status
text = 'This image '
@ -79,6 +80,17 @@ class Screenshot < ActiveRecord::Base
return text
end
# Short status text for admins
def adminstatus
if self.markedfordelete
'Removal requested'
elsif self.approved
'Public'
else
'Waiting for approval'
end
end
# Return the number of screenshots that need to be approved
def self.unapproved
self.where(approved: false)

View file

@ -13,7 +13,8 @@
onclick="return confirm('Really delete the screenshot?');"
] Delete screenshot
p Status: #{screenshot.status}
p Uploader IP=#{screenshot.uploaderip}
p Uploader Token=#{session[:token]}
p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
p Status: #{screenshot.adminstatus}
/ p Uploader IP=#{screenshot.uploaderip}
/ p Uploader Token=#{session[:token]}
/ p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
p Uploaded #{screenshot.age_days}

View file

@ -12,6 +12,8 @@
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 user_signed_in?
em.imgcaption =screenshot.adminstatus
// Is the user an admin?
- if user_signed_in?