forked from Volontaria/Website-Volontaria
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor activities page to use a calendar
- Loading branch information
1 parent
019e44f
commit 96bce7e
Showing
15 changed files
with
1,004 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/app/components/my-benevolometre/my-benevolometre.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="my-benevolometre"> | ||
<div class="my-benevolometre__legend"> | ||
<div class="my-benevolometre__legend__title" | ||
*ngFor="let part of parts" | ||
[style.width.%]="part.percentage"> | ||
{{ part.totalPercentage }}% | ||
</div> | ||
</div> | ||
<div class="my-benevolometre__body"> | ||
<div class="my-benevolometre__body__part" | ||
*ngFor="let part of parts" | ||
[style.background]="part.color" | ||
[style.width.%]="part.percentage"> | ||
<div class="my-benevolometre__body__part__head" | ||
*ngIf="part.totalPercentage < 100" | ||
[style.background]="part.color"> | ||
</div> | ||
<div class="my-benevolometre__body__part__hover"> | ||
{{ part.title }} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="my-benevolometre__name"> | ||
Taux de complétion de la page horaire | ||
</div> | ||
</div> |
63 changes: 63 additions & 0 deletions
63
src/app/components/my-benevolometre/my-benevolometre.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@import "../../../assets/scss/theme"; | ||
|
||
.my-benevolometre { | ||
&__legend { | ||
padding: 0 2px; | ||
display: flex; | ||
justify-content: flex-start; | ||
|
||
&__title { | ||
border-right: 2px solid $main-border; | ||
text-align: right; | ||
padding-right: 5px; | ||
} | ||
} | ||
|
||
&__body { | ||
position: relative; | ||
|
||
border: 4px solid $main-border; | ||
border-radius: 3px; | ||
width: 100%; | ||
height: 28px; | ||
|
||
display: flex; | ||
justify-content: flex-start; | ||
|
||
&__part { | ||
height: 100%; | ||
|
||
&__head { | ||
position: relative; | ||
left: 97%; | ||
height: 100%; | ||
width: 16px; | ||
border-radius: 0 50% 50% 0; | ||
} | ||
|
||
&__hover { | ||
position: absolute; | ||
left: 0; | ||
top: 45px; | ||
width: 100%; | ||
color: $color-info-text; | ||
background-color: $color-info-background; | ||
border: 2px solid $color-info-border; | ||
border-top: none; | ||
padding: 10px; | ||
display: none; | ||
} | ||
|
||
&:hover { | ||
.my-benevolometre__body__part__hover { | ||
display: block; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&__name { | ||
font-size: 12px; | ||
text-align: right; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/app/components/my-benevolometre/my-benevolometre.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-my-benevolometre', | ||
templateUrl: './my-benevolometre.component.html', | ||
styleUrls: ['./my-benevolometre.component.scss'] | ||
}) | ||
export class MyBenevolometreComponent implements OnInit { | ||
|
||
@Input() parts: any; | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
let total = 0; | ||
for (const part of this.parts) { | ||
part.totalPercentage = part.percentage + total; | ||
total += part.percentage; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.