Show Moderate link in topbar. Add menu icons.
This commit is contained in:
parent
117239ee87
commit
ec43f47f92
3 changed files with 25 additions and 7 deletions
|
|
@ -15,7 +15,8 @@ class MyController < ApplicationController
|
||||||
|
|
||||||
def moderate_list
|
def moderate_list
|
||||||
# First package with pending screenshots
|
# First package with pending screenshots
|
||||||
@packages = Package.joins(:screenshots).where('screenshots.approved=false or screenshots.markedfordelete=true').distinct(:name)
|
# @packages = Package.joins(:screenshots).where('screenshots.approved=false or screenshots.markedfordelete=true').distinct(:name)
|
||||||
|
@packages = Package.need_moderation
|
||||||
|
|
||||||
# # # List of screenshots that were reported (to be removed)
|
# # # List of screenshots that were reported (to be removed)
|
||||||
# # @reported_screenshots = Screenshot.where(markedfordelete: true)
|
# # @reported_screenshots = Screenshot.where(markedfordelete: true)
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,12 @@ class Package < ApplicationRecord
|
||||||
where(id: subselect )
|
where(id: subselect )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return a list of packages that have screenshots to be moderated
|
||||||
|
def self.need_moderation
|
||||||
|
Package.joins(:screenshots).where('screenshots.approved=false or screenshots.markedfordelete=true').distinct(:name)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Return a query of all packages that have screenshots
|
# Return a query of all packages that have screenshots
|
||||||
def self.without_screenshots
|
def self.without_screenshots
|
||||||
# Query for all packages who's ID does not appear in a screenshot's "package_id" field
|
# Query for all packages who's ID does not appear in a screenshot's "package_id" field
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,18 @@ nav.top-bar
|
||||||
/ .top-bar-right
|
/ .top-bar-right
|
||||||
/ ul.menu
|
/ ul.menu
|
||||||
li.menu-text class=('active' if controller_name=='welcome' and action_name=='home')
|
li.menu-text class=('active' if controller_name=='welcome' and action_name=='home')
|
||||||
a href="/" Home
|
a href="/"
|
||||||
|
i.fa.fa-home
|
||||||
|
span< Home
|
||||||
li.menu-text class=('active' if controller_name=='packages' and request.fullpath != packages_without_path)
|
li.menu-text class=('active' if controller_name=='packages' and request.fullpath != packages_without_path)
|
||||||
a href="/packages" Browse
|
a href="/packages"
|
||||||
|
i.fa.fa-camera
|
||||||
|
span< Browse
|
||||||
/ TODO: highlights the "Browse" tab (even) when you click on Upload
|
/ TODO: highlights the "Browse" tab (even) when you click on Upload
|
||||||
li.menu-text class=('active' if request.fullpath == packages_without_path)
|
li.menu-text class=('active' if request.fullpath == packages_without_path)
|
||||||
=link_to 'Upload', :packages_without
|
=link_to :packages_without
|
||||||
|
i.fa.fa-upload
|
||||||
|
span< Upload
|
||||||
//li.has-dropdown
|
//li.has-dropdown
|
||||||
//a href="#" Distributions
|
//a href="#" Distributions
|
||||||
//ul.dropdown
|
//ul.dropdown
|
||||||
|
|
@ -31,11 +37,16 @@ nav.top-bar
|
||||||
//li
|
//li
|
||||||
//a href="#" Ubuntu
|
//a href="#" Ubuntu
|
||||||
li.menu-text class=('active' if controller_name=='welcome' and action_name=='about')
|
li.menu-text class=('active' if controller_name=='welcome' and action_name=='about')
|
||||||
a href="/about" About/Privacy
|
a href="/about"
|
||||||
|
i.fa.fa-info-circle
|
||||||
|
span< About/Privacy
|
||||||
// TODO: Check correct classes in Zurb/Foundation for top bar!
|
// TODO: Check correct classes in Zurb/Foundation for top bar!
|
||||||
/- if user_signed_in? and current_user.is_admin?
|
- if user_signed_in? and current_user.is_admin? and Package.need_moderation.any?
|
||||||
li.menu-text
|
li.menu-text
|
||||||
ul.menu.dropdown data-dropdown-menu=true
|
=link_to url_for(Package.need_moderation.first)
|
||||||
|
i.fa.fa-thumbs-up
|
||||||
|
span< Moderate
|
||||||
|
/ul.menu.dropdown data-dropdown-menu=true
|
||||||
li
|
li
|
||||||
a href='#' Admin
|
a href='#' Admin
|
||||||
ul.menu
|
ul.menu
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue