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)