Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
parlote-facil
Validations
eaa19151
Valider
eaa19151
rédigé
il y a 13 ans
par
danielgrippi
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
remove logging statement in a before filter that performed a query
parent
63c7634f
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
app/controllers/application_controller.rb
+13
-18
13 ajouts, 18 suppressions
app/controllers/application_controller.rb
app/views/layouts/_header.html.haml
+34
-35
34 ajouts, 35 suppressions
app/views/layouts/_header.html.haml
avec
47 ajouts
et
53 suppressions
app/controllers/application_controller.rb
+
13
−
18
Voir le fichier @
eaa19151
...
...
@@ -4,28 +4,35 @@
class
ApplicationController
<
ActionController
::
Base
has_mobile_fu
protect_from_forgery
:except
=>
:receive
before_filter
:ensure_http_referer_is_set
before_filter
:set_header_data
,
:except
=>
[
:create
,
:update
]
before_filter
:set_header_data
,
:except
=>
[
:create
,
:update
,
:destroy
]
before_filter
:set_locale
before_filter
:set_git_header
if
(
AppConfig
[
:git_update
]
&&
AppConfig
[
:git_revision
])
before_filter
:which_action_and_user
prepend_before_filter
:clear_gc_stats
before_filter
:set_grammatical_gender
prepend_before_filter
:clear_gc_stats
inflection_method
:grammatical_gender
=>
:gender
helper_method
:all_aspects
,
:all_contacts_count
,
:my_contacts_count
,
:only_sharing_count
helper_method
:tags
,
:tag_followings
helper_method
:all_aspects
,
:all_contacts_count
,
:my_contacts_count
,
:only_sharing_count
,
:tag_followings
,
:tags
def
ensure_http_referer_is_set
request
.
env
[
'HTTP_REFERER'
]
||=
'/aspects'
end
# we need to do this for vanna controller. these should really be controller
# helper methods instead
def
set_header_data
if
user_signed_in?
if
request
.
format
.
html?
&&
!
params
[
:only_posts
]
@aspect
=
nil
@notification_count
=
Notification
.
for
(
current_user
,
:unread
=>
true
).
count
@unread_message_count
=
ConversationVisibility
.
sum
(
:unread
,
:conditions
=>
"person_id =
#{
current_user
.
person
.
id
}
"
)
end
...
...
@@ -69,18 +76,6 @@ class ApplicationController < ActionController::Base
headers
[
'X-Git-Revision'
]
=
AppConfig
[
:git_revision
]
end
def
which_action_and_user
str
=
"event=request_with_user controller=
#{
self
.
class
}
action=
#{
self
.
action_name
}
"
if
current_user
str
<<
"uid=
#{
current_user
.
id
}
"
str
<<
"user_created_at='
#{
current_user
.
created_at
.
to_date
.
to_s
}
' user_created_at_unix=
#{
current_user
.
created_at
.
to_i
}
"
if
current_user
.
created_at
str
<<
"user_non_pending_contact_count=
#{
current_user
.
contacts
.
size
}
user_contact_count=
#{
Contact
.
unscoped
.
where
(
:user_id
=>
current_user
.
id
).
size
}
"
else
str
<<
'uid=nil'
end
Rails
.
logger
.
info
str
end
def
set_locale
if
user_signed_in?
I18n
.
locale
=
current_user
.
language
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/views/layouts/_header.html.haml
+
34
−
35
Voir le fichier @
eaa19151
...
...
@@ -21,47 +21,46 @@
=
form_tag
(
people_path
,
:method
=>
'get'
,
:class
=>
"search_form"
)
do
=
text_field_tag
'q'
,
nil
,
:placeholder
=>
t
(
'find_people'
),
:type
=>
'search'
,
:results
=>
5
-
if
@notification_count
#nav_badges
#home_badge
.badge
=
link_to
aspects_path
,
:title
=>
t
(
'_home'
)
do
=
image_tag
'icons/home_grey.svg'
,
:height
=>
16
#nav_badges
#home_badge
.badge
=
link_to
aspects_path
,
:title
=>
t
(
'_home'
)
do
=
image_tag
'icons/home_grey.svg'
,
:height
=>
16
#contacts_badge
.badge
=
link_to
contacts_link
,
:title
=>
t
(
'_contacts'
)
do
=
image_tag
'icons/contacts_grey.svg'
,
:height
=>
16
#contacts_badge
.badge
=
link_to
contacts_link
,
:title
=>
t
(
'_contacts'
)
do
=
image_tag
'icons/contacts_grey.svg'
,
:height
=>
16
#notification_badge
.badge
=
link_to
notifications_path
,
:title
=>
new_notification_text
(
@notification_count
)
do
=
image_tag
'icons/notifications_grey.svg'
,
:height
=>
16
,
:id
=>
"notification-flag"
.badge_count
{
:class
=>
(
"hidden"
if
@notification_count
==
0
)}
=
@notification_count
#notification_badge
.badge
=
link_to
notifications_path
,
:title
=>
new_notification_text
(
@notification_count
)
do
=
image_tag
'icons/notifications_grey.svg'
,
:height
=>
16
,
:id
=>
"notification-flag"
.badge_count
{
:class
=>
(
"hidden"
if
@notification_count
==
0
)}
=
@notification_count
#message_inbox_badge
.badge
=
link_to
conversations_path
,
:title
=>
new_message_text
(
@unread_message_count
)
do
=
image_tag
'icons/mail_grey.svg'
,
:width
=>
18
.badge_count
{
:class
=>
(
"hidden"
if
@unread_message_count
==
0
)}
=
@unread_message_count
#message_inbox_badge
.badge
=
link_to
conversations_path
,
:title
=>
new_message_text
(
@unread_message_count
)
do
=
image_tag
'icons/mail_grey.svg'
,
:width
=>
18
.badge_count
{
:class
=>
(
"hidden"
if
@unread_message_count
==
0
)}
=
@unread_message_count
#notification_dropdown
.header
=
link_to
t
(
'.view_all'
),
notifications_path
,
:id
=>
"view_all_notifications"
%h4
=
t
(
'.recent_notifications'
)
.notifications
.ajax_loader
=
image_tag
(
"ajax-loader.gif"
)
#notification_dropdown
.header
=
link_to
t
(
'.view_all'
),
notifications_path
,
:id
=>
"view_all_notifications"
%h4
=
t
(
'.recent_notifications'
)
.notifications
.ajax_loader
=
image_tag
(
"ajax-loader.gif"
)
#hovercard_container
#hovercard
%img
.avatar
%h4
%a
.person
#hovercard_dropdown_container
#hovercard_container
#hovercard
%img
.avatar
%h4
%a
.person
#hovercard_dropdown_container
.hovercard_footer
.footer_container
.hashtags
.hovercard_footer
.footer_container
.hashtags
#lightbox
#lightbox-content
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter