Merge pull request #745 from sgmap/display_avis_counter_on_header

Display avis counter on header
This commit is contained in:
Mathieu Magnin 2017-09-21 10:47:39 +02:00 committed by GitHub
commit 25ed44704c
6 changed files with 31 additions and 11 deletions

View file

@ -43,16 +43,6 @@
}
}
.badge {
background-color: rgba(0, 0, 0, 0.08);
padding-left: 5px;
padding-right: 5px;
border-radius: 100px;
font-weight: bold;
color: rgba(0, 0, 0, 0.6);
font-size: 14px;
}
.notifications {
top: 3px;
right: 3px;

View file

@ -0,0 +1,18 @@
@import "colors";
@import "constants";
.badge {
padding: 0 5px;
font-size: 14px;
font-weight: bold;
text-align: center;
white-space: nowrap;
border-radius: 100px;
background-color: rgba(0, 0, 0, 0.08);
vertical-align: top;
&.warning {
background-color: $orange;
color: #FFFFFF;
}
}

View file

@ -31,6 +31,7 @@
}
a {
display: inline-block;
padding: 23px $default-padding;
font-size: 18px;
color: $black;

View file

@ -14,7 +14,11 @@
= link_to "Procédures", procedures_path, class: (controller_name != 'avis') ? "active" : nil
- if current_gestionnaire.avis.count > 0
%li
= link_to "Avis", avis_index_path, class: (controller_name == 'avis') ? "active" : nil
= link_to avis_index_path, class: (controller_name == 'avis') ? "active" : nil do
Avis
- avis_counter = current_gestionnaire.avis.without_answer.count
- if avis_counter > 0
%span.badge.warning= avis_counter
%li
= link_to "Ancienne interface", backoffice_dossiers_path

View file

@ -8,6 +8,8 @@
= link_to(avis_index_path(statut: NewGestionnaire::AvisController::A_DONNER_STATUS)) do
avis à donner
%span.badge= @avis_a_donner.count
- if @avis_a_donner.any?
%span.notifications
%li{ class: (@statut == NewGestionnaire::AvisController::DONNES_STATUS) ? 'active' : nil }>
= link_to(avis_index_path(statut: NewGestionnaire::AvisController::DONNES_STATUS)) do

View file

@ -68,6 +68,11 @@
%span.label.refused .label.refused
%span.label.without-continuation .label.without-continuation
%h1 Badges
%span.badge 1
%span.badge.warning 1
%h1 Cards
.card