Add the brouillons scope on Procedure
This commit is contained in:
parent
fc2540649f
commit
89feb6cdf7
3 changed files with 3 additions and 2 deletions
|
@ -26,7 +26,7 @@ class Admin::ProceduresController < AdminController
|
|||
|
||||
def draft
|
||||
@procedures = smart_listing_create :procedures,
|
||||
current_administrateur.procedures.not_published.not_archived.order(created_at: :desc),
|
||||
current_administrateur.procedures.brouillons.order(created_at: :desc),
|
||||
partial: "admin/procedures/list",
|
||||
array: true
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ class Procedure < ActiveRecord::Base
|
|||
mount_uploader :logo, ProcedureLogoUploader
|
||||
|
||||
default_scope { where(hidden_at: nil) }
|
||||
scope :brouillons, -> { not_published.not_archived }
|
||||
scope :publiees, -> { where.not(published_at: nil).where(archived_at: nil) }
|
||||
scope :publiee_ou_archivee, -> { where.not(published_at: nil) }
|
||||
scope :not_published, -> { where(published_at: nil) }
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
.procedure-list-element{ class: @draft_class }
|
||||
Brouillons
|
||||
.badge.progress-bar-default
|
||||
= current_administrateur.procedures.not_published.not_archived.count
|
||||
= current_administrateur.procedures.brouillons.count
|
||||
|
||||
%a#active-procedures{ :href => "#{url_for :admin_procedures}" }
|
||||
.procedure-list-element{ class: @active_class }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue