Adding layout for credentials, this dropdown is shown when you pass hover sign_out button. It display email informations about the current gestionnaire/user
This commit is contained in:
parent
09fc59d54b
commit
b698046e1e
7 changed files with 41 additions and 22 deletions
|
@ -10,6 +10,14 @@ function init_default_data_block() {
|
|||
toggle_default_data_bloc(this, 400);
|
||||
});
|
||||
|
||||
$('#sign_out').hover(function () {
|
||||
$(this).find('#credentials').toggle();
|
||||
});
|
||||
|
||||
$('#sign_out').off(function () {
|
||||
$(this).find('credentials').toggle();
|
||||
});
|
||||
|
||||
$('.new-action').click(function () {
|
||||
var messages_block = $(this).parents().closest('.default_data_block').find('.title')
|
||||
toggle_default_data_bloc(messages_block, 400);
|
||||
|
|
|
@ -175,3 +175,10 @@
|
|||
.button_navbar:hover, .button-navbar-action:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#credentials {
|
||||
display: none;
|
||||
width: initial;
|
||||
padding: 10px;
|
||||
left: -130px;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
= link_to "", '/administrateurs/sign_out', method: :delete, :class => 'btn btn-md fa fa-sign-out'
|
||||
= link_to "", "/administrateurs/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
|
||||
|
|
|
@ -1 +1 @@
|
|||
= link_to "", '/gestionnaires/sign_out', method: :delete, :class => 'btn btn-md fa fa-sign-out'
|
||||
= link_to "", "/gestionnaires/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
|
||||
|
|
3
app/views/layouts/_credentials.html.haml
Normal file
3
app/views/layouts/_credentials.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
%div.dropdown-menu#credentials
|
||||
= @current_gestionnaire.email if @current_gestionnaire
|
||||
= @current_user.email if @current_user
|
|
@ -3,12 +3,15 @@
|
|||
-if user_signed_in?
|
||||
.col-lg-1.col-md-1#sign_out.no-padding
|
||||
= render partial: 'users/login_banner'
|
||||
= render partial: 'layouts/credentials'
|
||||
-elsif gestionnaire_signed_in?
|
||||
.col-lg-1.col-md-1#sign_out.no-padding
|
||||
= render partial: 'gestionnaires/login_banner'
|
||||
= render partial: 'layouts/credentials'
|
||||
-elsif administrateur_signed_in?
|
||||
.col-lg-1.col-md-1#sign_out.no-padding
|
||||
= render partial: 'administrateurs/login_banner'
|
||||
= render partial: 'layouts/credentials'
|
||||
-else
|
||||
.col-lg-1.col-md-1#sign_in
|
||||
= link_to "Connexion", '/users/sign_in', :class => 'btn btn-lg'
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
%div{ id: "fconnect-profile", "data-fc-logout-url" => '/users/sign_out" data-method="delete' }
|
||||
%a.text-info{ href: "#" }
|
||||
= "#{current_user.given_name} #{current_user.family_name}"
|
||||
|
||||
= link_to "", '/users/sign_out', method: :delete, :class => 'btn fa fa-power-off off-fc-link'
|
||||
= link_to "", "/users/sign_out", method: :delete, class: "btn fa fa-power-off off-fc-link"
|
||||
|
||||
- else
|
||||
= link_to "", '/users/sign_out', method: :delete, :class => 'btn btn-md fa fa-sign-out'
|
||||
|
||||
= link_to "", "/users/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
|
||||
|
|
Loading…
Add table
Reference in a new issue