Remove “avec_lien” helpers now that Procedure.path cannot be nil
This commit is contained in:
parent
8fa630d2bb
commit
b9968b76b0
7 changed files with 13 additions and 22 deletions
|
@ -25,7 +25,7 @@ class AdminController < ApplicationController
|
|||
end
|
||||
|
||||
def reset_procedure
|
||||
if @procedure.brouillon_avec_lien?
|
||||
if @procedure.brouillon?
|
||||
@procedure.reset!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ module NewAdministrateur
|
|||
end
|
||||
|
||||
def reset_procedure
|
||||
if @procedure.brouillon_avec_lien?
|
||||
if @procedure.brouillon?
|
||||
@procedure.reset!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
module ProcedureHelper
|
||||
def procedure_lien(procedure)
|
||||
if procedure.path.present?
|
||||
if procedure.brouillon_avec_lien?
|
||||
commencer_test_url(path: procedure.path)
|
||||
else
|
||||
commencer_url(path: procedure.path)
|
||||
end
|
||||
if procedure.brouillon?
|
||||
commencer_test_url(path: procedure.path)
|
||||
else
|
||||
commencer_url(path: procedure.path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -133,11 +133,6 @@ class Procedure < ApplicationRecord
|
|||
!archivee?
|
||||
end
|
||||
|
||||
# This method is needed for transition. Eventually this will be the same as brouillon?.
|
||||
def brouillon_avec_lien?
|
||||
brouillon? && path.present?
|
||||
end
|
||||
|
||||
def publiee_ou_archivee?
|
||||
publiee? || archivee?
|
||||
end
|
||||
|
|
|
@ -24,12 +24,10 @@ class ProcedureSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def link
|
||||
if object.path.present?
|
||||
if object.brouillon_avec_lien?
|
||||
commencer_test_url(path: object.path)
|
||||
else
|
||||
commencer_url(path: object.path)
|
||||
end
|
||||
if object.brouillon?
|
||||
commencer_test_url(path: object.path)
|
||||
else
|
||||
commencer_url(path: object.path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
.lien-demarche
|
||||
%h3
|
||||
- if @procedure.brouillon_avec_lien?
|
||||
- if @procedure.brouillon?
|
||||
Test et publication
|
||||
- else
|
||||
Publication
|
||||
|
@ -58,7 +58,7 @@
|
|||
%br
|
||||
%br
|
||||
Attention, diffusez toujours le <strong>lien complet</strong> affiché ci-dessus, et non pas un lien générique vers demarches-simplifiees.fr. Ne dites pas non plus aux usagers de se rendre sur le site générique demarches-simplifiees.fr, donnez-leur toujours le lien complet.
|
||||
- elsif @procedure.brouillon_avec_lien?
|
||||
- elsif @procedure.brouillon?
|
||||
- if @procedure.missing_steps.empty?
|
||||
%p
|
||||
Cette démarche est actuellement <strong>en test</strong>,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#procedure-list
|
||||
%a#onglet-infos{ href: url_for(admin_procedure_path(@procedure)) }
|
||||
.procedure-list-element{ class: ('active' if active == 'Informations') }
|
||||
- if @procedure.brouillon_avec_lien?
|
||||
- if @procedure.brouillon?
|
||||
Test et publication
|
||||
- else
|
||||
Publication
|
||||
|
|
Loading…
Reference in a new issue