From 383a840c50ca8f6df19677e93357e9dc6c0e043c Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 9 Oct 2020 12:48:13 +0200 Subject: Enable switching Agent Switching current Agent can help with roles and resource access. Go to your dashboard by clicking the avatar. Select agent and hit "Select" --- app/views/application/_user_info.html.erb | 4 ++-- app/views/welcome/dashboard.html.erb | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb index 3220c89..be3b6c5 100644 --- a/app/views/application/_user_info.html.erb +++ b/app/views/application/_user_info.html.erb @@ -3,11 +3,11 @@ <% if current_user.present? %> <%= image_tag current_user.avatar_url, alt: current_user.username %> <% else %> diff --git a/app/views/welcome/dashboard.html.erb b/app/views/welcome/dashboard.html.erb index 8880434..242fc58 100644 --- a/app/views/welcome/dashboard.html.erb +++ b/app/views/welcome/dashboard.html.erb @@ -1,6 +1,12 @@

Welcome <%= h current_user.name %>!

-

Current Agent: <%= current_agent&.name %>

+

Mes Agents

+ +

<%= form_for current_agent, url: '/my/current_agent', method: :patch do |f| %> + En cours : <%= f.submit('select') %> + <%= f.select(:id, options_for_select(current_user.agents.map { |a| [a.name, a.id] }), selected: current_agent.id) %> +<% end %>

+

Global Count

-- cgit v1.2.3