diff --git a/app/controllers/manager/gestionnaires_controller.rb b/app/controllers/manager/gestionnaires_controller.rb index 859bf2749..408e788de 100644 --- a/app/controllers/manager/gestionnaires_controller.rb +++ b/app/controllers/manager/gestionnaires_controller.rb @@ -1,4 +1,10 @@ module Manager class GestionnairesController < Manager::ApplicationController + def reinvite + gestionnaire = Gestionnaire.find(params[:id]) + gestionnaire.invite! + flash[:notice] = "Gestionnaire réinvité." + redirect_to manager_gestionnaire_path(gestionnaire) + end end end diff --git a/app/views/manager/gestionnaires/show.html.erb b/app/views/manager/gestionnaires/show.html.erb new file mode 100644 index 000000000..9a2c8324f --- /dev/null +++ b/app/views/manager/gestionnaires/show.html.erb @@ -0,0 +1,54 @@ +<%# +# Show + +This view is the template for the show page. +It renders the attributes of a resource, +as well as a link to its edit page. + +## Local variables: + +- `page`: + An instance of [Administrate::Page::Show][1]. + Contains methods for accessing the resource to be displayed on the page, + as well as helpers for describing how each attribute of the resource + should be displayed. + +[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Show +%> + +<% content_for(:title) { t("administrate.actions.show_resource", name: page.page_title) } %> +<% gestionnaire = page.resource %> + + + +
+
+ <% page.attributes.each do |attribute| %> +
+ <%= t( + "helpers.label.#{resource_name}.#{attribute.name}", + default: attribute.name.titleize, + ) %> +
+ +
<%= render_field attribute %>
+ <% end %> +
+
diff --git a/config/routes.rb b/config/routes.rb index a6816f131..27fe8ede9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,7 +12,10 @@ Rails.application.routes.draw do end resources :users, only: [:index, :show] - resources :gestionnaires, only: [:index, :show] + resources :gestionnaires, only: [:index, :show] do + post 'reinvite', on: :member + end + resources :dossiers, only: [:show] resources :demandes, only: [:index]