Show procedure link in manager view

This commit is contained in:
Paul Chavard 2018-03-29 17:16:06 +02:00
parent bfed4dfb91
commit ee5a3852b5
3 changed files with 13 additions and 0 deletions

View file

@ -10,6 +10,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
ATTRIBUTE_TYPES = {
types_de_piece_justificative: TypesDePieceJustificativeCollectionField,
types_de_champ: TypesDeChampCollectionField,
path: ProcedureLinkField,
dossiers: Field::HasMany,
procedure_path: Field::HasOne,
administrateur: Field::BelongsTo,
@ -47,6 +48,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
# an array of attributes that will be displayed on the model's show page.
SHOW_PAGE_ATTRIBUTES = [
:id,
:path,
:administrateur,
:libelle,
:description,

View file

@ -0,0 +1,7 @@
require "administrate/field/base"
class ProcedureLinkField < Administrate::Field::Base
def name
"Lien procédure"
end
end

View file

@ -0,0 +1,4 @@
- if field.data.present?
= link_to "/commencer/#{field.data}", commencer_url(procedure_path: field.data), target: '_blank'
- else
Plus en ligne