Merge pull request #1771 from tchak/procedure-link
Show procedure link in manager view
This commit is contained in:
commit
0bf389b849
3 changed files with 13 additions and 0 deletions
|
@ -10,6 +10,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
ATTRIBUTE_TYPES = {
|
ATTRIBUTE_TYPES = {
|
||||||
types_de_piece_justificative: TypesDePieceJustificativeCollectionField,
|
types_de_piece_justificative: TypesDePieceJustificativeCollectionField,
|
||||||
types_de_champ: TypesDeChampCollectionField,
|
types_de_champ: TypesDeChampCollectionField,
|
||||||
|
path: ProcedureLinkField,
|
||||||
dossiers: Field::HasMany,
|
dossiers: Field::HasMany,
|
||||||
procedure_path: Field::HasOne,
|
procedure_path: Field::HasOne,
|
||||||
administrateur: Field::BelongsTo,
|
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.
|
# an array of attributes that will be displayed on the model's show page.
|
||||||
SHOW_PAGE_ATTRIBUTES = [
|
SHOW_PAGE_ATTRIBUTES = [
|
||||||
:id,
|
:id,
|
||||||
|
:path,
|
||||||
:administrateur,
|
:administrateur,
|
||||||
:libelle,
|
:libelle,
|
||||||
:description,
|
: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