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:
JC 2016-12-05 14:06:38 +01:00
parent 09fc59d54b
commit b698046e1e
7 changed files with 41 additions and 22 deletions

View file

@ -7,28 +7,36 @@ function init_default_data_block() {
$('.default_data_block #dossier .carret-down').toggle();
$('.default_data_block .title').click(function () {
toggle_default_data_bloc(this, 400);
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);
var messages_block = $(this).parents().closest('.default_data_block').find('.title')
toggle_default_data_bloc(messages_block, 400);
});
$('.default_data_block.default_visible').each(function() {
toggle_default_data_bloc($(this).find('.title'), 0);
toggle_default_data_bloc($(this).find('.title'), 0);
});
function toggle_default_data_bloc(element, duration){
var block = $(element).parents('.show-block');
if (block.attr('id') == 'messages') {
block.children('.last-commentaire').toggle();
$(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
}
function toggle_default_data_bloc(element, duration) {
var block = $(element).parents('.show-block');
if (block.attr('id') == 'messages') {
block.children('.last-commentaire').toggle();
$(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
}
block.children('.body').slideToggle(duration);
block.children('.body').slideToggle(duration);
block.find('.carret-right').toggle();
block.find('.carret-down').toggle();
block.find('.carret-right').toggle();
block.find('.carret-down').toggle();
}
}

View file

@ -175,3 +175,10 @@
.button_navbar:hover, .button-navbar-action:hover {
text-decoration: none;
}
#credentials {
display: none;
width: initial;
padding: 10px;
left: -130px;
}

View file

@ -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"

View file

@ -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"

View file

@ -0,0 +1,3 @@
%div.dropdown-menu#credentials
= @current_gestionnaire.email if @current_gestionnaire
= @current_user.email if @current_user

View file

@ -3,14 +3,17 @@
-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'
-unless Features.unified_login
= link_to "Accompagnateur", '/gestionnaires/sign_in', :class => 'btn btn-md'
= link_to "Accompagnateur", '/gestionnaires/sign_in', :class => 'btn btn-md'

View file

@ -1,10 +1,8 @@
-if current_user.loged_in_with_france_connect?
- if current_user.loged_in_with_france_connect?
%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'
- else
= link_to "", "/users/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"