display de sondage de démo

This commit is contained in:
tykayn 2021-04-24 12:31:34 +02:00 committed by Baptiste Lemoine
parent 6cb32cb2e1
commit 21aa634ce5
7 changed files with 56 additions and 32 deletions

View File

@ -26,5 +26,34 @@
canal Matrix canal Matrix
</a> </a>
</p> </p>
<div class="demo" *ngIf="!env.production">
Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de
date-poll-api.
<button class="btn is-primary" [routerLink]="['/poll/aujourdhui-ou-demain/consultation']">
consulter le sondage
<strong>
aujourdhui-ou-demain
</strong>
</button>
<button class="btn is-primary" [routerLink]="['/poll/citron/hash/consultation']">
<strong>
citron
</strong>
</button>
<button class="btn is-primary" [routerLink]="['/poll/dessin-anime/consultation']">
<strong>
dessin-anime
</strong>
</button>
<button class="btn is-primary" routerLink="/poll/citron/consultation/9199bdd9e0d4b29deafbf3463c0727fc">
consulter le sondage
<strong>
citron
</strong>
avec son hash md5 de mot de passe intégré
</button>
</div>
</div> </div>
</footer> </footer>

View File

@ -13,28 +13,7 @@
| translate | translate
}} }}
</blockquote> </blockquote>
<div class="demo" *ngIf="!env.production">
Environnement de développement: voici des liens de démonstration issus des fixtures Doctrine de
date-poll-api.
<button class="btn is-primary" [routerLink]="['/poll/aujourdhui-ou-demain/consultation']">
consulter le sondage
<strong>
aujourdhui-ou-demain
</strong>
</button>
<button
class="btn is-primary"
routerLink="/poll/citron/consultation/9199bdd9e0d4b29deafbf3463c0727fc"
>
consulter le sondage
<strong>
citron
</strong>
avec son hash md5 de mot de passe intégré
</button>
</div>
<img src="assets/img/undraw_group_selfie_ijc6.svg" alt="image WIP" /> <img src="assets/img/undraw_group_selfie_ijc6.svg" alt="image WIP" />
</div> </div>
<div class="columns"> <div class="columns">

View File

@ -120,6 +120,8 @@ export class ApiService {
// TODO: this interceptor should be avoided if backends returns the good object // TODO: this interceptor should be avoided if backends returns the good object
const adapterInterceptor: number = this.axiosInstance.interceptors.response.use( const adapterInterceptor: number = this.axiosInstance.interceptors.response.use(
(response: AxiosResponse): AxiosResponse => { (response: AxiosResponse): AxiosResponse => {
console.log('response', response);
if (response.data['poll']) { if (response.data['poll']) {
// response from cipherbliss backend, actually used by oldstuffModule // response from cipherbliss backend, actually used by oldstuffModule
response.data = response.data['poll']; response.data = response.data['poll'];

View File

@ -12,6 +12,13 @@
<p class="card-header-title">{{ poll.title }}</p> <p class="card-header-title">{{ poll.title }}</p>
<!-- <p class="card-header-icon">author : {{ poll.owner?.pseudo }}</p>--> <!-- <p class="card-header-icon">author : {{ poll.owner?.pseudo }}</p>-->
</header> </header>
<button
class="btn is-info"
(click)="isCompactMode = !isCompactMode"
[ngClass]="{ 'is-primary': isCompactMode, 'is-default': !isCompactMode }"
>
changer d'affichage
</button>
<div class="card-content"> <div class="card-content">
<div class="content"> <div class="content">
<p>{{ poll.description }}</p> <p>{{ poll.description }}</p>
@ -28,12 +35,13 @@
</div> </div>
</div> </div>
<footer class="card-footer" *ngIf="!isArchived"> <footer class="card-footer" *ngIf="!isArchived">
<a routerLink="{{ '../../../poll/' + poll.slug + '/participation' }}" class="card-footer-item"> TODO links
Participer <!-- <a routerLink="{{ '../../../poll/' + poll.slug + '/participation' }}" class="card-footer-item">-->
</a> <!-- Participer-->
<a routerLink="{{ '../../../poll/' + poll.slug + '/administration' }}" class="card-footer-item"> <!-- </a>-->
Administrer <!-- <a routerLink="{{ '../../../poll/' + poll.slug + '/administration' }}" class="card-footer-item">-->
</a> <!-- Administrer-->
<!-- </a>-->
</footer> </footer>
</div> </div>
</div> </div>

View File

@ -36,6 +36,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
console.log('params', params); console.log('params', params);
this.pollSlug = params.get('slug'); this.pollSlug = params.get('slug');
this.passHash = params.get('hash'); this.passHash = params.get('hash');
console.log('hash, slug', this.passHash, this.pollSlug);
if (this.passHash) { if (this.passHash) {
this.pollService.loadPollBySlugWithPasswordHash(this.pollSlug, this.passHash); this.pollService.loadPollBySlugWithPasswordHash(this.pollSlug, this.passHash);
} else { } else {

View File

@ -1,17 +1,20 @@
<div class="box" *ngFor="let choice of poll.choices"> <div class="box" *ngFor="let choice of poll.choices">
<div class="columns is-vcentered is-mobile"> <div class="columns is-vcentered is-mobile">
<div class="column"> <div class="column">
<label class="label">{{ choice.label }}</label> <label class="label">{{ choice.name }}</label>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div class="buttons has-addons is-right" (click)="openModal(choice)"> <div class="buttons has-addons is-right" (click)="openModal(choice)">
<button class="button is-white"> <button class="button is-white">
<img class="image is-24x24" src="../../../assets/img/icon_voter_YES.svg" /> <img class="image is-24x24" src="../../../assets/img/icon_voter_YES.svg" />
{{ choice.counts.get(answerEnum.YES) }}
<span class="counter" *ngIf="choice.counts">
{{ choice.counts.get(answerEnum.YES) }}
</span>
</button> </button>
<button class="button is-white" *ngIf="poll.configuration.isMaybeAnswerAvailable"> <button class="button is-white" *ngIf="poll.allowed_answers.indexOf('maybe') !== -1">
<img class="image is-24x24" src="../../../assets/img/icon_voter_MAYBE.svg" /> <img class="image is-24x24" src="../../../assets/img/icon_voter_MAYBE.svg" />
{{ choice.counts.get(answerEnum.MAYBE) }} <!-- {{ choice.counts.get(answerEnum.MAYBE) }}-->
</button> </button>
</div> </div>
</div> </div>

View File

@ -18,7 +18,9 @@ export class PollResultsCompactComponent implements OnInit {
constructor(private modalService: ModalService) {} constructor(private modalService: ModalService) {}
ngOnInit(): void {} ngOnInit(): void {
console.log('this.poll', this.poll);
}
public openModal(choice: Choice): void { public openModal(choice: Choice): void {
const config: MatDialogConfig<Choice> = { data: choice }; const config: MatDialogConfig<Choice> = { data: choice };