From 255205696bcf8778088404348bdd0b748649f0b3 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Mon, 20 Jan 2020 13:38:57 +0100 Subject: [PATCH] :zap: modal to display url --- src/app/app.module.ts | 2 ++ src/app/config/PollConfig.ts | 7 ++-- src/app/pages/answers/answers.component.html | 36 +++++++++++++++++++ src/app/pages/answers/answers.component.scss | 8 +++++ src/app/pages/answers/answers.component.ts | 10 ++++-- .../poll-display/poll-display.component.html | 12 ++++--- src/app/services/config.service.ts | 3 +- 7 files changed, 67 insertions(+), 11 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d80bc976..50b1a455 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -52,6 +52,7 @@ import {ResettableInputDirective} from './ui/directives/resettable-input.directi import {ClipboardModule} from "ngx-clipboard"; import {ErasableInputComponent} from './ui/erasable-input/erasable-input.component'; import {ConfirmDialogModule} from 'primeng/confirmdialog'; +import {DialogModule} from 'primeng/dialog'; export class MyMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams) { @@ -102,6 +103,7 @@ export function HttpLoaderFactory(http: HttpClient) { ClipboardModule, CommonModule, BrowserModule, + DialogModule, BrowserAnimationsModule, AppRoutingModule, ToastModule, diff --git a/src/app/config/PollConfig.ts b/src/app/config/PollConfig.ts index 7a930227..c47403e2 100644 --- a/src/app/config/PollConfig.ts +++ b/src/app/config/PollConfig.ts @@ -32,17 +32,17 @@ export const defaultDates = [ export const defaultAnswers = [{ id: 0, text: 'réponse de démo 1', - pictureUrl: '', + url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574', }, { id: 1, text: 'réponse 2', - pictureUrl: '', + url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574', }, { id: 2, text: 'la réponse D', - pictureUrl: '', + url: 'https://mastodon.cipherbliss.com/system/media_attachments/files/001/439/118/original/6fcf149bd902841b.png?1579471574', }]; /** @@ -58,6 +58,7 @@ export class PollConfig { description = 'ma description'; myName = 'mon pseudo'; myComment = 'wouah trop bien framadate!'; + isAdmin: boolean = false; myEmail: string = ""; // date specific poll, we have the choice to setup different hours (timeList) for all possible dates (dateList), or use the same hours for all dates allowSeveralHours = 'false'; diff --git a/src/app/pages/answers/answers.component.html b/src/app/pages/answers/answers.component.html index 31ed686f..af4539ba 100644 --- a/src/app/pages/answers/answers.component.html +++ b/src/app/pages/answers/answers.component.html @@ -20,6 +20,42 @@ (click)='showModalForPictureOfAnswer(answer)' > + + + + {{answer.text}} + + +
+ + +
+ + +
+ +
- + + Je veux modifier le vote de quelqu'un + +
diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts index 8ee235a5..8dff28fa 100644 --- a/src/app/services/config.service.ts +++ b/src/app/services/config.service.ts @@ -275,7 +275,8 @@ export class ConfigService extends PollConfig { * @param config */ createPollFromConfig(config: any) { - this.http.post(`${this.baseHref}/poll`, this.makeHeaders({config: config})) + this.http.post(`${this.baseHref}/poll`, + this.makeHeaders({config: config})) .subscribe((res: any) => { // redirect to the page to administrate the new poll this.messageService.add({severity: 'success', summary: 'Sondage Créé',});