Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ELC_elections
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gestion-des-assemblees
ELC_elections
Commits
4a72e4f6
Commit
4a72e4f6
authored
4 years ago
by
Alexis POYEN
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "In flow open details"
parent
9d136e21
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/components/visualization/results-section.js
+25
-8
25 additions, 8 deletions
web/components/visualization/results-section.js
with
25 additions
and
8 deletions
web/components/visualization/results-section.js
+
25
−
8
View file @
4a72e4f6
...
@@ -3,6 +3,7 @@ import * as Auth from "/services/auth/auth.js";
...
@@ -3,6 +3,7 @@ import * as Auth from "/services/auth/auth.js";
import
*
as
results
from
"
/services/election/calculate-election-generic.js
"
;
import
*
as
results
from
"
/services/election/calculate-election-generic.js
"
;
import
*
as
PartyModel
from
"
/services/model/party-model.js
"
;
import
*
as
PartyModel
from
"
/services/model/party-model.js
"
;
import
*
as
CandidateListModel
from
"
/services/model/candidateList-model.js
"
;
import
*
as
CandidateListModel
from
"
/services/model/candidateList-model.js
"
;
import
*
as
AreaModel
from
"
/services/model/area-model.js
"
;
import
*
as
Scroller
from
"
/services/common/scroller.js
"
;
import
*
as
Scroller
from
"
/services/common/scroller.js
"
;
export
async
function
mount
(
where
,
round
)
{
export
async
function
mount
(
where
,
round
)
{
...
@@ -15,11 +16,13 @@ class ResultComponent {
...
@@ -15,11 +16,13 @@ class ResultComponent {
this
.
round
=
round
;
this
.
round
=
round
;
this
.
PartyModel
=
PartyModel
.
getPartyModel
();
this
.
PartyModel
=
PartyModel
.
getPartyModel
();
this
.
CandidateListModel
=
CandidateListModel
.
getCandidateListModel
();
this
.
CandidateListModel
=
CandidateListModel
.
getCandidateListModel
();
this
.
AreaModel
=
AreaModel
.
getAreaModel
();
}
}
async
mount
(
where
)
{
async
mount
(
where
)
{
this
.
PartyModel
.
current_user
=
await
Auth
.
GetUser
();
this
.
PartyModel
.
current_user
=
await
Auth
.
GetUser
();
this
.
CandidateListModel
.
current_user
=
await
Auth
.
GetUser
();
this
.
CandidateListModel
.
current_user
=
await
Auth
.
GetUser
();
this
.
AreaModel
.
current_user
=
await
Auth
.
GetUser
();
const
mountpoint
=
where
;
const
mountpoint
=
where
;
document
.
getElementById
(
mountpoint
).
innerHTML
=
/* HTML */
`
document
.
getElementById
(
mountpoint
).
innerHTML
=
/* HTML */
`
<div class="tabs is-boxed is-toggle is-fullwidth">
<div class="tabs is-boxed is-toggle is-fullwidth">
...
@@ -120,13 +123,27 @@ class ResultComponent {
...
@@ -120,13 +123,27 @@ class ResultComponent {
}
}
resultFlowTemplate
(
zone
)
{
resultFlowTemplate
(
zone
)
{
return
/* HTML */
`<div class="card-list card-no-hover">
let
html
=
document
.
createElement
(
"
div
"
);
html
.
classList
=
"
card-list card-no-hover
"
;
html
.
innerHTML
=
/* HTML */
`
<div class="card-content">
<div class="card-content">
<div id="flow-content-
${
zone
.
ID
}
" class="content">
<div id="flow-content-
${
zone
.
ID
}
" class="content">
<h5 class="title is-5">
${
zone
.
Name
}
</h5>
<h5 class="title is-5">
${
zone
.
Name
}
</h5>
</div>
</div>
</div>
</div>
</div>`
;
`
;
html
.
addEventListener
(
"
click
"
,
async
()
=>
{
if
(
this
.
zone
==
"
sections
"
)
{
let
area
=
await
this
.
AreaModel
.
getArea
(
zone
.
AreaID
);
this
.
refreshSections
(
area
);
document
.
getElementById
(
"
select-sections
"
).
value
=
zone
.
ID
;
document
.
getElementById
(
"
select-areas
"
).
value
=
zone
.
AreaID
;
}
else
{
document
.
getElementById
(
"
select-areas
"
).
value
=
zone
.
ID
;
}
this
.
displayZoneResults
(
zone
);
});
return
html
;
}
}
progressBarTemplate
(
candidateList
,
color
,
electedsNumber
)
{
progressBarTemplate
(
candidateList
,
color
,
electedsNumber
)
{
...
@@ -312,9 +329,9 @@ class ResultComponent {
...
@@ -312,9 +329,9 @@ class ResultComponent {
for
(
let
j
in
this
.
results
.
areasResults
)
{
for
(
let
j
in
this
.
results
.
areasResults
)
{
let
area
=
this
.
results
.
areasResults
[
j
];
let
area
=
this
.
results
.
areasResults
[
j
];
if
(
area
.
status
===
this
.
filter
)
{
if
(
area
.
status
===
this
.
filter
)
{
document
.
getElementById
(
document
"
news-flow
"
.
getElementById
(
"
news-flow
"
)
).
innerHTML
+=
this
.
resultFlowTemplate
(
area
);
.
appendChild
(
this
.
resultFlowTemplate
(
area
)
)
;
for
(
let
i
in
area
.
candidateLists
)
{
for
(
let
i
in
area
.
candidateLists
)
{
let
party
=
await
this
.
PartyModel
.
getParty
(
let
party
=
await
this
.
PartyModel
.
getParty
(
...
@@ -344,9 +361,9 @@ class ResultComponent {
...
@@ -344,9 +361,9 @@ class ResultComponent {
for
(
let
j
in
sections
)
{
for
(
let
j
in
sections
)
{
let
section
=
sections
[
j
];
let
section
=
sections
[
j
];
if
(
section
.
status
===
this
.
filter
)
{
if
(
section
.
status
===
this
.
filter
)
{
document
.
getElementById
(
document
"
news-flow
"
.
getElementById
(
"
news-flow
"
)
).
innerHTML
+=
this
.
resultFlowTemplate
(
section
);
.
appendChild
(
this
.
resultFlowTemplate
(
section
)
)
;
for
(
let
i
in
section
.
candidateLists
)
{
for
(
let
i
in
section
.
candidateLists
)
{
let
party
=
await
this
.
PartyModel
.
getParty
(
let
party
=
await
this
.
PartyModel
.
getParty
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment