From d6b9ebde9ad4aea58a533a74d13dbdfd282d1594 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Mon, 8 Aug 2016 13:34:26 +0200 Subject: [PATCH] User can access at the summary tab of comments files --- app/views/backoffice/dossiers/show.html.haml | 37 +--------------- .../dossiers/_tab_objects_dossier.html.haml | 43 +++++++++++++++++++ app/views/users/recapitulatif/show.html.haml | 5 ++- 3 files changed, 47 insertions(+), 38 deletions(-) create mode 100644 app/views/dossiers/_tab_objects_dossier.html.haml diff --git a/app/views/backoffice/dossiers/show.html.haml b/app/views/backoffice/dossiers/show.html.haml index ca83b7225..6a99e2f16 100644 --- a/app/views/backoffice/dossiers/show.html.haml +++ b/app/views/backoffice/dossiers/show.html.haml @@ -14,40 +14,5 @@ %br %div - %ul{class: "nav nav-tabs", role: "tablist"} - %li{role: "presentation", class: "active"} - %a{href: "#commentaires", 'aria-controls' => "commentaires", role: "tab", 'data-toggle' => "tab"} - Commentaires - %li{role: "presentation"} - %a{href: "#commentaires_files", 'aria-controls' => "commentaires_files", role: "tab", 'data-toggle' => "tab"} - Fichiers - %li{role: "presentation"} - %a{href: "#invites", 'aria-controls' => "invites", role: "tab", 'data-toggle' => "tab"} - Invités - %li{role: "presentation"} - %a{href: "#followers", 'aria-controls' => "followers", role: "tab", 'data-toggle' => "tab"} - Abonnés - %li{role: "presentation"} - %a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"} - Formulaire - - %div{class: "tab-content"} - %div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"} - %h3 Flux de commentaires - %br - = render partial: '/users/recapitulatif/commentaires_flux' - %div{role: "tabpanel", class: "tab-pane fade", id:"commentaires_files"} - = render partial: '/dossiers/commentaires_files' - %div{role: "tabpanel", class: "tab-pane fade", id:"invites"} - = render partial: '/dossiers/invites' - %div{role: "tabpanel", class: "tab-pane fade", id:"followers"} - = render partial: 'followers' - %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"} - %h3 Formulaire privé - - unless @champs.nil? - = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do - = render partial: '/users/description/champs' - %br - = submit_tag :Enregistrer, {class: 'btn btn-success', style: 'float: right'} - %br + = render partial: 'dossiers/tab_objects_dossier' %br \ No newline at end of file diff --git a/app/views/dossiers/_tab_objects_dossier.html.haml b/app/views/dossiers/_tab_objects_dossier.html.haml new file mode 100644 index 000000000..a478f0dbe --- /dev/null +++ b/app/views/dossiers/_tab_objects_dossier.html.haml @@ -0,0 +1,43 @@ +%ul{class: "nav nav-tabs", role: "tablist"} + %li{role: "presentation", class: "active"} + %a{href: "#commentaires", 'aria-controls' => "commentaires", role: "tab", 'data-toggle' => "tab"} + Commentaires + %li{role: "presentation"} + %a{href: "#commentaires_files", 'aria-controls' => "commentaires_files", role: "tab", 'data-toggle' => "tab"} + Fichiers + + - if gestionnaire_signed_in? + %li{role: "presentation"} + %a{href: "#invites", 'aria-controls' => "invites", role: "tab", 'data-toggle' => "tab"} + Invités + %li{role: "presentation"} + %a{href: "#followers", 'aria-controls' => "followers", role: "tab", 'data-toggle' => "tab"} + Abonnés + %li{role: "presentation"} + %a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"} + Formulaire + +%div{class: "tab-content"} + %div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"} + %h3 Flux de commentaires + %br + = render partial: '/users/recapitulatif/commentaires_flux' + %div{role: "tabpanel", class: "tab-pane fade", id:"commentaires_files"} + = render partial: '/dossiers/commentaires_files' + + - if gestionnaire_signed_in? + %div{role: "tabpanel", class: "tab-pane fade", id:"invites"} + = render partial: '/dossiers/invites' + %div{role: "tabpanel", class: "tab-pane fade", id:"followers"} + = render partial: 'followers' + %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"} + %h3 Formulaire privé + - if @champs.nil? || @champs.empty? + %br + %h4.text-primary + Pas de formulaire privé pour ce dossier + - else + = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do + = render partial: '/users/description/champs' + %br + = submit_tag :Enregistrer, {class: 'btn btn-success', style: 'float: right'} \ No newline at end of file diff --git a/app/views/users/recapitulatif/show.html.haml b/app/views/users/recapitulatif/show.html.haml index 6a998be36..4373c2abb 100644 --- a/app/views/users/recapitulatif/show.html.haml +++ b/app/views/users/recapitulatif/show.html.haml @@ -24,5 +24,6 @@ = render partial: '/dossiers/infos_dossier' -%br -= render partial: '/users/recapitulatif/commentaires_flux' \ No newline at end of file +%div + %br + = render partial: 'dossiers/tab_objects_dossier' \ No newline at end of file