Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wahlen
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue 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
Ömer Kinik
Wahlen
Commits
cd80ba4f
Commit
cd80ba4f
authored
1 year ago
by
Ömer Kinik
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
f31d415d
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
vote_results.html
+126
-0
126 additions, 0 deletions
vote_results.html
with
126 additions
and
0 deletions
vote_results.html
0 → 100644
+
126
−
0
View file @
cd80ba4f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Vote results
</title>
<script
src=
"https://unpkg.com/vue@next"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"
></script>
<!-- import for vuetify-->
<link
href=
"https://cdn.jsdelivr.net/npm/vuetify@latest/dist/vuetify.min.css"
rel=
"stylesheet"
>
<script
src=
"https://cdn.jsdelivr.net/npm/vuetify@latest"
></script>
<style>
.progress-container
{
background-color
:
#e0e0e0
;
margin-bottom
:
20px
;
padding
:
5px
;
box-sizing
:
border-box
;
}
.progress-bar
{
max-width
:
90%
;
height
:
24px
;
background-color
:
#4caf50
;
color
:
white
;
}
</style>
</head>
<body>
<div
id=
"app"
>
<v-app>
<v-card
melevation=
"1"
max-width=
"1200"
style=
"margin-top: 35px; margin-left: 50px;"
>
<v-card-title
class=
"py-5 font-weight-black"
style=
"font-size: 35px;"
>
Vote results
</v-card-title>
<div
class=
"progress-container"
v-for=
"person in persons"
>
{{ person.person.firstName }} {{ person.person.lastName }} - {{ getPercentage(person.Stimmzahl) }}%
<div
class=
"progress-bar"
:style=
"{width: getPercentage(person.Stimmzahl) + '%'}"
>
</div>
</div>
</v-card>
<v-container>
<v-bottom-navigation
grow
>
<v-btn
@
click=
"goToPage('index.html')"
>
Create a person
</v-btn>
<v-btn
@
click=
"goToPage('vote.html')"
>
Vote
</v-btn>
<v-btn
@
click=
"goToPage('vote_results.html')"
>
Vote results
</v-btn>
</v-bottom-navigation>
</v-container>
</v-app>
</div>
<script>
const
vuetify
=
Vuetify
.
createVuetify
();
let
app
=
Vue
.
createApp
({
data
()
{
return
{
persons
:
[],
voteLimit
:
0
}
},
methods
:
{
async
getVoteLimit
()
{
const
response
=
await
axios
.
get
(
'
http://127.0.0.1:8000/vote
'
)
const
data
=
response
.
data
let
sum
=
0
for
(
person
of
data
)
{
sum
+=
person
.
Stimmzahl
}
this
.
voteLimit
=
sum
},
async
getPersons
()
{
const
response
=
await
axios
.
get
(
'
http://127.0.0.1:8000/vote
'
)
this
.
persons
=
response
.
data
},
getPercentage
(
stimmzahl
)
{
return
((
stimmzahl
/
this
.
voteLimit
)
*
100
).
toFixed
(
1
)
},
goToPage
(
page
)
{
window
.
location
.
href
=
page
;
}
},
mounted
()
{
this
.
getVoteLimit
()
this
.
getPersons
()
}
})
app
.
use
(
vuetify
);
app
.
mount
(
'
#app
'
)
</script>
</body>
</html>
\ No newline at end of file
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