File tree Expand file tree Collapse file tree
src/components/elections-stats Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 </div >
1515 </div >
1616 </div >
17+ <div class =" flex flex-col pb-12" >
18+ <h2 class =" mb-2 text-center text-2xl font-semibold" >
19+ Total votes for each position
20+ </h2 >
21+ <div class =" flex flex-wrap items-center justify-center gap-x-12" >
22+ <div
23+ v-for =" stat in sabbStats"
24+ :key =" stat.title"
25+ class =" flex h-36 w-56 flex-col items-center justify-center p-4 text-center"
26+ >
27+ <div class =" flex h-2/4 items-center justify-center" >
28+ <h2 class =" line-clamp-3 text-xl font-semibold" >{{ stat.title }}</h2 >
29+ </div >
30+ <div class =" text-voice-orange h-2/4 text-5xl font-bold" >
31+ {{ stat.data }}
32+ </div >
33+ </div >
34+ </div >
35+ </div >
1736 <ElectionsGraph
1837 v-for =" graph in graphs"
1938 :key =" graph.title"
@@ -66,6 +85,10 @@ export default {
6685 type: Boolean ,
6786 default: false ,
6887 },
88+ sabbaticalStats: {
89+ type: Boolean ,
90+ default: false ,
91+ },
6992 minimumMembers: {
7093 type: Number ,
7194 default: 15 ,
@@ -85,6 +108,7 @@ export default {
85108 selected: [],
86109 graphs: [],
87110 stats: [],
111+ sabbStats: [],
88112 mediumThreshold: 200 ,
89113 largeThreshold: 400 ,
90114 };
@@ -114,6 +138,16 @@ export default {
114138 data: response .data .unique_voters ,
115139 });
116140 }
141+ if (self .sabbaticalStats || self .all ) {
142+ for (const election of response .data .elections ) {
143+ if (election .id != " 2441" ) {
144+ self .sabbStats .push ({
145+ title: election .name ,
146+ data: election .total_votes ,
147+ });
148+ }
149+ }
150+ }
117151 if (self .sports || self .all ) {
118152 self .processData (
119153 response .data .activities_subcats ,
You can’t perform that action at this time.
0 commit comments