screenshot.adminstatus added, debug info removed from admin dropdown
This commit is contained in:
parent
3da2f68938
commit
b30794884f
3 changed files with 19 additions and 4 deletions
|
|
@ -63,6 +63,7 @@ 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
|
||||||
|
|
||||||
|
# Long status text for public users
|
||||||
def status
|
def status
|
||||||
text = 'This image '
|
text = 'This image '
|
||||||
|
|
||||||
|
|
@ -79,6 +80,17 @@ class Screenshot < ActiveRecord::Base
|
||||||
return text
|
return text
|
||||||
end
|
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
|
# Return the number of screenshots that need to be approved
|
||||||
def self.unapproved
|
def self.unapproved
|
||||||
self.where(approved: false)
|
self.where(approved: false)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
onclick="return confirm('Really delete the screenshot?');"
|
onclick="return confirm('Really delete the screenshot?');"
|
||||||
] Delete screenshot
|
] Delete screenshot
|
||||||
|
|
||||||
p Status: #{screenshot.status}
|
p Status: #{screenshot.adminstatus}
|
||||||
p Uploader IP=#{screenshot.uploaderip}
|
/ p Uploader IP=#{screenshot.uploaderip}
|
||||||
p Uploader Token=#{session[:token]}
|
/ p Uploader Token=#{session[:token]}
|
||||||
p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
|
/ p Uploaded #{screenshot.age_days} (#{screenshot.created_at})
|
||||||
|
p Uploaded #{screenshot.age_days}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
|
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)
|
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
|
||||||
.imgcaption =screenshot.caption
|
.imgcaption =screenshot.caption
|
||||||
|
- if user_signed_in?
|
||||||
|
em.imgcaption =screenshot.adminstatus
|
||||||
|
|
||||||
// Is the user an admin?
|
// Is the user an admin?
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue