Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
agenda-libre-quebec
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
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
agenda-libre-quebec
Validations
208fe781
Valider
208fe781
rédigé
il y a 7 ans
par
echarp
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Stats can be filtered using the regions selector at the top
parent
7e188aa5
Aucune branche associée trouvée
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/stats_controller.rb
+22
-8
22 ajouts, 8 suppressions
app/controllers/stats_controller.rb
app/views/stats/index.html.haml
+5
-5
5 ajouts, 5 suppressions
app/views/stats/index.html.haml
avec
27 ajouts
et
13 suppressions
app/controllers/stats_controller.rb
+
22
−
8
Voir le fichier @
208fe781
# Generate statistics, around events, by date or place
class
StatsController
<
ApplicationController
before_action
:set_temporal
,
:set_local
,
only:
[
:index
]
has_scope
:region
,
:locality
,
:tag
,
:daylimit
,
:year
has_scope
:near
,
type: :hash
,
using:
%i[location distance]
before_action
:set_events
,
:counts
,
:temporal
,
:local
,
only:
[
:index
]
private
def
set_temporal
@years
=
Event
.
group
(
year_grouping
).
count
@months
=
Event
.
group
(
year_grouping
,
month_grouping
).
count
def
counts
@events_count
=
@events
.
count
@events_um_count
=
apply_scopes
(
Event
.
unmoderated
).
count
@orgas_count
=
apply_scopes
(
Orga
).
moderated
.
count
@orgas_um_count
=
apply_scopes
(
Orga
.
unmoderated
).
count
end
def
temporal
@years
=
@events
.
group
(
year_grouping
).
count
@months
=
@events
.
group
(
year_grouping
,
month_grouping
).
count
end
def
local
@regions
=
@events
.
joins
(
:region
).
group
(
:region_id
,
year_grouping
).
count
@city_events
=
@events
.
group
(
:city
).
having
(
'count(city) > 3'
)
.
order
(
'count(city) desc'
).
count
end
def
set_local
@regions
=
Event
.
joins
(
:region
).
group
(
:region_id
,
year_grouping
).
count
@city_events
=
Event
.
group
(
:city
).
having
(
'count(city) > 3'
)
.
order
(
'count(city) desc'
).
count
def
set_events
@events
=
apply_scopes
Event
.
moderated
end
def
year_grouping
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
app/views/stats/index.html.haml
+
5
−
5
Voir le fichier @
208fe781
...
...
@@ -4,16 +4,16 @@
%dl
%dt
=
t
'.allEvents'
%dd
.quantity
=
number_with_delimiter
E
vent
.
moderated
.
count
%dd
.quantity
=
number_with_delimiter
@e
vent
s_
count
%dt
=
t
'.awaitingModeration'
%dd
.quantity
=
number_with_delimiter
E
vent
.
unmoderated
.
count
%dd
.quantity
=
number_with_delimiter
@e
vent
s_um_
count
%dt
=
t
'.allOrgas'
%dd
.quantity
=
number_with_delimiter
Orga
.
moderated
.
count
%dd
.quantity
=
number_with_delimiter
@orgas_
count
%dt
=
t
'.awaitingModeration'
%dd
.quantity
=
number_with_delimiter
O
rga
.
unmoderated
.
count
%dd
.quantity
=
number_with_delimiter
@o
rga
s_um_
count
%h3
%em
.fa.fa-calendar
...
...
@@ -68,7 +68,7 @@
-
@years
.
each
do
|
year
|
%td
.quantity
-
total
+=
@regions
[[
region
.
id
,
year
[
0
]]]
||
0
=
link_to
root_path
(
year:
"
#{
year
[
0
]
}
"
,
region:
region
.
id
)
do
=
link_to
root_path
(
year:
year
[
0
]
.
to_s
,
region:
region
.
id
)
do
=
number_with_delimiter
@regions
[[
region
.
id
,
year
[
0
]]]
%th
.quantity.total
=
number_with_delimiter
total
%td
.sparkline
/
...
...
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