Show procedure link in manager view
This commit is contained in:
parent
bfed4dfb91
commit
ee5a3852b5
3 changed files with 13 additions and 0 deletions
|
@ -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,
|
||||
|
|
7
app/fields/procedure_link_field.rb
Normal file
7
app/fields/procedure_link_field.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require "administrate/field/base"
|
||||
|
||||
class ProcedureLinkField < Administrate::Field::Base
|
||||
def name
|
||||
"Lien procédure"
|
||||
end
|
||||
end
|
4
app/views/fields/procedure_link_field/_show.html.haml
Normal file
4
app/views/fields/procedure_link_field/_show.html.haml
Normal 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
|
Loading…
Reference in a new issue