Added moderation, report and approval buttons for admins, uploaders and anonymous people
This commit is contained in:
parent
014a840493
commit
9bb9cf1f5d
5 changed files with 43 additions and 10 deletions
|
|
@ -13,12 +13,16 @@
|
|||
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
|
||||
.imgcaption =screenshot.caption
|
||||
|
||||
// TODO: Show information only if admin
|
||||
- if user_signed_in?
|
||||
// Button that reveals a dropdown/modal for admins
|
||||
= render(partial: 'admin_dropdown', locals: {screenshot: screenshot})
|
||||
- elsif screenshot.uploaderhash == session[:token]
|
||||
= render(partial: 'user_dropdown', locals: {screenshot: screenshot})
|
||||
// Is the user an admin?
|
||||
- if user_signed_in?
|
||||
= render(partial: 'admin_dropdown', locals: {screenshot: screenshot})
|
||||
// or does the screenshot belong to the user (determined by session cookie)
|
||||
- elsif screenshot.uploaderhash == session[:token]
|
||||
= render(partial: 'user_dropdown', locals: {screenshot: screenshot})
|
||||
// or is the user not related to the screenshot and the screenshot is public?
|
||||
- elsif screenshot.approved
|
||||
= render(partial: 'report_dropdown', locals: {screenshot: screenshot})
|
||||
|
||||
|
||||
// Anonymous users can see their own screenshots
|
||||
/ - if not screenshot.approved
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue