This commit is contained in:
alrom8 2019-11-19 09:01:30 +01:00
commit 2261bd2406
46 changed files with 1483 additions and 346 deletions

View File

@ -30,7 +30,11 @@
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-css.min.js"
]
},
"configurations": {
"production": {

127
package-lock.json generated
View File

@ -126,9 +126,9 @@
}
},
"@angular/animations": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-8.2.1.tgz",
"integrity": "sha512-+E2KWj798sgby1hnC2LmK380jCZ7JLcxs5X4pM+kwJzS4T8spPTBecHRqz19C2Ea4AOSou4S1Oxs/4CCmVnj2w==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-8.2.13.tgz",
"integrity": "sha512-ZE4UZsQ6HDW1ZIj9tL45PVosCcG4Ke7ihV7eWCE1VgLZKDDxTOPbLf1UeEiszUYptMLGH3eGMNBKo85mOlkH8w==",
"requires": {
"tslib": "^1.9.0"
}
@ -183,17 +183,17 @@
}
},
"@angular/common": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-8.2.1.tgz",
"integrity": "sha512-CVewkkFswELDQ1qx2G7m2pj0IqDbSIY6O6wZtNvYCDrLXRVDwSXcQsjNP1pSWuD37dHT/nifimchfLiVuisPyg==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-8.2.13.tgz",
"integrity": "sha512-I9cTcjUi88L+Mb/a/ZzUrdDcn3YgFFK9LubxaPjAfr6+G7IZ//MY5HuvG8Y41yKprXVVvQCbQ1yQD+GGRSCkaA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-8.2.1.tgz",
"integrity": "sha512-kOGNh0K4k7vEIMLlEyG1A+UxPOIMp2b3IT0vBq5isRjXxGzEnahyBYtXwGI7G6ox+OoNKy1OZOPaK473fcO8zg==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-8.2.13.tgz",
"integrity": "sha512-u2NWCvEn4SjbMvn2PG6sYcf+rR5u3aYMv3/mNQ9k+2UmCIu3yJrcuCzebjo5SdlDVqKD2vzbyMZnr8VB9OcceQ==",
"requires": {
"tslib": "^1.9.0"
}
@ -974,17 +974,17 @@
}
},
"@angular/core": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-8.2.1.tgz",
"integrity": "sha512-BMyLo/iOZ/eRR25CggWT3cexzfOnoey13NPeqYRtsO5dQUeVQPT1RH/bIWZ6yIPFSlBm6zUi/QqE1rjDautK5A==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-8.2.13.tgz",
"integrity": "sha512-W8HN0lUQV4Sq85l17nhRIXeIfcw1ZdpgGm6to98pl0y9l/1srfzWfTnofuwCJC7gedt5AMrYJGUaNiDbByosFw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/forms": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-8.2.1.tgz",
"integrity": "sha512-KcB652QBup+VWKDZICtpznr0a+v82oG0BowWetfkMgZAQj655uEMkkEtCTnfWnft4MLYlRr9ZoxQXc575TcZmA==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-8.2.13.tgz",
"integrity": "sha512-l7lHD4kbWK70KY0Xp4IpSa106ZzSgPMwRYMFKd9qhYaJ7v0Y7Shh7Z/ZDCOP730maj9WULnpy5X4eeozWXgvgg==",
"requires": {
"tslib": "^1.9.0"
}
@ -996,25 +996,25 @@
"dev": true
},
"@angular/platform-browser": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-8.2.1.tgz",
"integrity": "sha512-mzaXsHNTN3lBu3+H02GrRRu8Zo5R4GQiAb+MKdqiQMJ8hjnAmKJTYIVEbEnk/dJYbMZWvhxRGLmRIcntpYF38g==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-8.2.13.tgz",
"integrity": "sha512-1lPbeLQIbbafjq9ul3IA8s2fMJ/EXeMJ74ouTolVXoPPur9ZPRLX9FqBAO1K4QzkAWhRlyf6qIC+mDZfJILwZw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/platform-browser-dynamic": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.2.1.tgz",
"integrity": "sha512-9tdpvEXFCgbMUeyVvIklyDPyg39cRN6MOrQihObAoBKOkcko9MKJIxDPCv8o/5FBrlBcu0VhREPK56aVD0g6UQ==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-8.2.13.tgz",
"integrity": "sha512-KP5psUKujAO8jZKHi6LRC+N7hE/epiGOhYZxdher1sCi81sYoZmqrEWkVZ4VKhov/4aC409CocDXcF7nmHV8tg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/router": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-8.2.1.tgz",
"integrity": "sha512-CIhwBmRoVaZmfvGjuUomiyWn7OdHqzKbHq0poI3jlNJZCmzuBicYFctjCeqG6L2BIN0eVuJUJNeQ0OrcicP52w==",
"version": "8.2.13",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-8.2.13.tgz",
"integrity": "sha512-9CqnachtdASnEmRMtrG/R3c5nDCjjlCU4n0W/xt5+LlveyuUVvAT/CFUC38km4Df3lIvqap8mSpxzGaEzCL+wQ==",
"requires": {
"tslib": "^1.9.0"
}
@ -1266,6 +1266,11 @@
"@types/jasmine": "*"
}
},
"@types/marked": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.6.5.tgz",
"integrity": "sha512-6kBKf64aVfx93UJrcyEZ+OBM5nGv4RLsI6sR1Ar34bpgvGVRoyTgpxn4ZmtxOM5aDTAaaznYuYUH8bUX3Nk3YA=="
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@ -2620,6 +2625,17 @@
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true
},
"clipboard": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
"integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
"optional": true,
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"cliui": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
@ -2752,8 +2768,7 @@
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"dev": true
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ=="
},
"commondir": {
"version": "1.0.1",
@ -3254,6 +3269,12 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"dev": true
},
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
"optional": true
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@ -4313,6 +4334,15 @@
}
}
},
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"optional": true,
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz",
@ -6263,6 +6293,14 @@
"source-map-support": "^0.5.5"
}
},
"katex": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.11.1.tgz",
"integrity": "sha512-5oANDICCTX0NqYIyAiFCCwjQ7ERu3DQG2JFHLbYOf+fXaMoH8eg/zOq5WSYJsKMi/QebW+Eh3gSM+oss1H/bww==",
"requires": {
"commander": "^2.19.0"
}
},
"killable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz",
@ -6546,6 +6584,11 @@
"object-visit": "^1.0.0"
}
},
"marked": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
},
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -6950,6 +6993,18 @@
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"dev": true
},
"ngx-markdown": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/ngx-markdown/-/ngx-markdown-8.2.1.tgz",
"integrity": "sha512-59LG8rEoOwDsZyyJckp+QDnW/c5wMaRpNkb6TWktlBVTfQKyAYHr6BuSskVbZ4y8nsj54UQg0CDFLBOfUiqOwA==",
"requires": {
"@types/marked": "^0.6.5",
"katex": "^0.11.1",
"marked": "^0.7.0",
"prismjs": "^1.16.0",
"tslib": "^1.9.0"
}
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -7810,6 +7865,14 @@
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
"dev": true
},
"prismjs": {
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.17.1.tgz",
"integrity": "sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==",
"requires": {
"clipboard": "^2.0.0"
}
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@ -8595,6 +8658,12 @@
"ajv-keywords": "^3.1.0"
}
},
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
"optional": true
},
"select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@ -9727,6 +9796,12 @@
"setimmediate": "^1.0.4"
}
},
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"optional": true
},
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",

View File

@ -23,6 +23,7 @@
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"chart.js": "^2.8.0",
"ngx-markdown": "^8.2.1",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"

View File

@ -1,25 +1,25 @@
<header style="text-align:center">
<a [routerLink]="'home'" class="home_link" aria-roledescription="home">
<h1>
<span class="logo_first">Frama</span>
<span class="logo_second">date</span>
</h1>
<a [routerLink]="'home'" class="home_link" aria-roledescription="home">
<h1>
<span class="logo_first">Frama</span>
<span class="logo_second">date</span>
</h1>
</a>
<div id="translate_example">
<div class="lang-choices">
<button class="btn btn-info" (click)="switchLanguage('en')">en</button>
<button class="btn btn-info" (click)="switchLanguage('fr')">fr</button>
</div>
</a>
<div id="translate_example">
<div class="lang-choices">
<button class="btn btn-info" (click)="switchLanguage('en')">en</button>
<button class="btn btn-info" (click)="switchLanguage('fr')">fr</button>
</div>
<h1 i18n>{{"Title"|translate}}</h1>
<div>
{{"Intro"|translate:user}}
</div>
</div>
<div>
{{"Intro"|translate:user}}
</div>
</div>
</header>
<framadate-navigation></framadate-navigation>
<main>
<router-outlet></router-outlet>
<router-outlet></router-outlet>
</main>
<framadate-debugger></framadate-debugger>

View File

@ -1,5 +1,5 @@
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {LOCALE_ID, NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
@ -27,7 +27,9 @@ import {VotingGraphComponent} from './pages/voting-graph/voting-graph.component'
import {VotingChoiceComponent} from './pages/voting-choice/voting-choice.component';
import {PasswordComponent} from './pages/password/password.component';
import {HomeComponent} from './pages/home/home.component';
import {VoteChoiceComponent} from './vote-choice/vote-choice.component';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import { MarkdownModule } from 'ngx-markdown';
import {
MissingTranslationHandler,
MissingTranslationHandlerParams,
@ -73,12 +75,14 @@ export function HttpLoaderFactory(http: HttpClient) {
PasswordComponent,
HomeComponent,
PollGraphicComponent,
VoteChoiceComponent,
],
imports: [
CommonModule,
BrowserModule,
AppRoutingModule,
MarkdownModule.forRoot(),
TranslateModule.forRoot({
missingTranslationHandler: {
provide: MissingTranslationHandler,

View File

@ -5,6 +5,25 @@ export interface DateOption {
literal: string;
}
export const timeOfDay = [{literal: 'matin'},
{literal: 'midi'},
{literal: 'après-midi'},
{literal: 'soirée'}];
export const defaultDates = [
{
literal: `${new Date().getDate()}-${new Date().getMonth()}-${new Date().getFullYear()}`,
timeList: [{literal: 'matin'}, {literal: 'midi'}, {literal: 'soir'}]
},
{
literal: `${new Date().getDate() + 1}-${new Date().getMonth()}-${new Date().getFullYear()}`,
timeList: [{literal: 'matin'}, {literal: 'midi'}, {literal: 'soir'}]
},
{
literal: `${new Date().getDate() + 2}-${new Date().getMonth()}-${new Date().getFullYear()}`,
timeList: [{literal: 'matin'}, {literal: 'midi'}, {literal: 'soir'}]
}
];
/**
* configuration of the poll, add new fields at will
*/
@ -17,8 +36,9 @@ export class PollConfig {
myName = '';
visibility = 'link_only';
// date specific poll
allowSeveralHours = false;
dateList: DateOption[] = [];
allowSeveralHours = 'true';
dateList: DateOption[] = defaultDates; // sets of days as strings
timeList: DateOption[] = timeOfDay; // ranges of time expressed as strings
answers: any = [{
id: 0,
text: 'réponse de démo 1'

View File

@ -9,6 +9,7 @@ import { CreateOrRetrieveComponent } from "../pages/create-or-retrieve/create-or
import { BaseComponent } from "../pages/base-page/base.component";
import { HomeComponent } from "../pages/home/home.component";
import { PollGraphicComponent } from '../poll-graphic/poll-graphic.component';
import {VoteChoiceComponent} from "../vote-choice/vote-choice.component";
/**
* each step in the form is a component
@ -26,4 +27,5 @@ export const Routes = [
{ path: "step/resume", component: ResumeComponent },
{ path: "step/end", component: EndConfirmationComponent },
{ path: "graphic/:poll", component: PollGraphicComponent },
{ path: 'votechoice', component: VoteChoiceComponent}
];

View File

@ -1,36 +1,68 @@
<div class="well debug">
<strong>
<h2 i18n>
infos de debug
</h2>
<span class="demo">
{{"config.demo"|translate}}
</span>
</strong>
<ul>
<li>
étape actuelle {{config.step}} / {{config.stepMax}}
</li>
<li>
formulaire valide : {{formIsValid}}
</li>
<li>
type de formulaire: {{config.pollType}}
</li>
<li>
config:
<pre>
{{config|json}}
</pre>
</li>
</ul>
<strong>
<h2 i18n>
infos de debug
</h2>
<span class="demo">
{{"config.demo"|translate}}
</span>
</strong>
<ul>
<li>
étape actuelle {{config.step}} / {{config.stepMax}}
</li>
<li>
formulaire valide : {{formIsValid}}
</li>
<li>
type de formulaire: {{config.pollType}}
</li>
<li>
config:
<pre>
{{config|json}}
</pre>
</li>
</ul>
</div>
<span i18n>
Choix cornélien syncronisé:
</span>
<!-- todo: factoriser les boutons-->
<button
class="btn"
(click)="config.set('pollType' , 'classic')"
[class.active]="config.pollType == 'classic'"
[disabled]="!formIsValid"
class="btn btn--primary next"
>
<span i18n>
sondage classique
</span>
<span *ngIf="config.pollType == 'classic'">
[x]
</span>
</button>
<button
(click)="selectOption('pollType' ,'dates')"
[class.active]="config.pollType == 'dates'"
[disabled]="!formIsValid"
class="btn btn--primary next"
>
<span i18n>
sondage spécial date
</span>
<span *ngIf="config.pollType == 'dates'">
[x]
</span>
</button>
<button
class="btn btn--primary"
i18n
(click)="config.sendForm()"
>
Envoyer le formulaire
Envoyer le formulaire
</button>

View File

@ -1,31 +1,41 @@
<div class="answers">
<h1 i18n>
Choisir les propositions
</h1>
<h1 i18n>
Choisir les propositions
</h1>
<p class="subtitle" i18n>
vous pouvez utiliser la syntaxe markdown
Vous pouvez utiliser la syntaxe markdown
</p>
<ol>
<li #answers *ngFor="let answer of config.answers; index as i;trackBy trackFunction"
class="answer-item">
<input
[(ngModel)]="answer.text"
class="answer"
placeholder="réponse"
type="text"
class="answer"
[(ngModel)]="answer.text"
placeholder="réponse"
>
<button (click)="config.answers.splice(i,1)">X</button>
</li>
</ol>
<button
class="btn btn--primary btn--outline"
(click)="addAnswer()"
class="btn-outline btn-block"
i18n>
Ajouter
i18n
>
Ajouter une proposition
</button>
<a [routerLink]="'/step/resume'" class="btn btn-block" i18n>Voyons ce que ça donne</a>
<br>
<button
[routerLink]="'/step/resume'"
class="btn btn--primary"
i18n
>
Voyons ce que ça donne
</button>
<a class="prev" i18n>
Retour
</a>
</div>

View File

@ -1,4 +1,4 @@
<h1>Ce composant est celui de base pour les pages</h1>
<a [routerLink]="'/step/end'" class="btn btn-block" i18n="@@confirm">
{{"config.perfect"|translate}}
{{"config.perfect"|translate}}
</a>

View File

@ -1,54 +1,55 @@
<section class="creation">
<h1>
{{"creation.title"|translate}}
</h1>
<p
class="description"
i18n
>
{{"config.title"|translate}}
</p>
<div class="btn-next">
<a
[routerLink]="'/home'"
>
<h1>
{{"creation.title"|translate}}
</h1>
<p
class="description"
i18n
>
{{"config.title"|translate}}
</p>
<div class="btn-next">
<a
[routerLink]="'/home'"
>
<span
class="text"
i18n
>
class="text"
i18n
>
{{"config.letsgo"|translate}}
</span>
<span class="icon right">
<span class="icon right">
>
</span>
</a>
</div>
</a>
</div>
</section>
<section class="recuperation">
<h1>
{{"config.find_my_polls"|translate}}
</h1>
<form
action="https://framadate.org/find_polls.php"
method="post"
>
<label
class="description"
for="email"
i18n
>
{{"config.find_helper"|translate}} :
</label>
<input
type="email"
name="mail"
id="email"
autofocus="autofocus"
/>
<input
type="submit"
class="btn btn-block"
i18n-value="'config.find_button'|translate"
/>
</form>
<h1>
{{"config.find_my_polls"|translate}}
</h1>
<form
action="https://framadate.org/find_polls.php"
method="post"
>
<label
class="description"
for="email"
i18n
>
{{"config.find_helper"|translate}} :
</label>
<input
type="email"
name="mail"
id="email"
autofocus="autofocus"
/>
<input
type="submit"
class="btn btn-block"
i18n-value="'config.find_button'|translate"
/>
</form>
</section>

View File

@ -7,15 +7,15 @@
<span i18n>
Je souhaite mettre des créneaux horaires
</span>
<select
name="multi_hours"
id="multi_hours"
[(ngModel)]="config.allowSeveralHours"
>
<option value="true">{{"dates.multiple.different"|translate}}</option>
<option value="false">{{"dates.multiple.identical"|translate}}</option>
</select>
<span i18n>
<select
name="multi_hours"
id="multi_hours"
[(ngModel)]="config.allowSeveralHours"
>
<option value="true">{{"dates.multiple.different"|translate}}</option>
<option value="false">{{"dates.multiple.identical"|translate}}</option>
</select>
<span i18n>
pour chaque journée
</span>
</label>
@ -24,27 +24,88 @@
<button
class="btn btn-primary"
(click)="addDate()"
i18n
id="add_date_button"
>
{{"dates.add"|translate}}
</button>
<button
class="btn btn-primary"
(click)="addtime()"
id="add_time_button"
>
{{"dates.addTime"|translate}}
</button>
<button
class="btn btn-warning"
(click)="emptyAll()"
id="empty_button"
>{{"dates.empty"|translate}}
</button>
<div class="dates-list">
{{config.dateList.length}}
<span i18n>
{{"dates.count_dates"|translate}}
</span>
<span>
{{"dates.count_dates"|translate}}
</span>
<div
class="identical-dates"
*ngIf="'false'==config.allowSeveralHours"
>
<div
class="time-choice"
*ngFor="let choice of config.timeList; index as id"
>
<input
type="text"
name="timeChoices_{{id}}"
[(ngModel)]="choice.literal"
>
<button (click)="config.timeList.splice(id, 1)">X</button>
</div>
</div>
<hr>
<span>
{{"dates.count_dates"|translate}}
</span>
<div
*ngFor="let choice of config.dateList; index as id"
class="date-choice"
>
<input
type="text"
name="dateChoices[]"
name="dateChoices_{{id}}"
[(ngModel)]="choice.literal"
>
<button (click)="config.dateList.splice(id, 1)">X</button>
<button
class="btn btn-warning"
(click)="config.dateList.splice(id, 1)"
>X
</button>
<button
class="btn btn-primary"
(click)="addTimetoDate(choice, id)"
> Ajouter un choix d'heure
</button>
<div
class="several-times"
*ngIf="'true'==config.allowSeveralHours"
>
<div
class="time-choice"
*ngFor="let time of choice.timeList; index as idTime"
>
<input
type="text"
name="dateTime_{{id}}_Choices_{{idTime}}"
[(ngModel)]="time.literal"
>
<button
class="btn btn-warning"
(click)="config.timeList.splice(idTime, 1)"
>X
</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,7 @@
.several-times {
padding-left: 1em;
input {
margin-right: 1em;
}
}

View File

@ -1,4 +1,4 @@
import {Component, OnInit} from '@angular/core';
import {ChangeDetectorRef, Component, OnInit} from '@angular/core';
import {ConfigService} from '../../config.service';
import {BaseComponent} from '../base-page/base.component';
@ -8,7 +8,7 @@ import {BaseComponent} from '../base-page/base.component';
styleUrls: ['./dates.component.scss']
})
export class DatesComponent extends BaseComponent implements OnInit {
constructor(public config: ConfigService) {
constructor(public config: ConfigService, private cd: ChangeDetectorRef) {
super(config);
}
@ -16,6 +16,33 @@ export class DatesComponent extends BaseComponent implements OnInit {
}
addDate() {
this.config.dateList.push({ literal: '' });
this.config.dateList.push({literal: ''});
}
addtime() {
this.config.timeList.push({literal: ''});
}
/**
* add a time period to a specific date choice,
* focus on the new input
* @param config
* @param id
*/
addTimetoDate(config: any, id: number) {
config.timeList.push({literal: ''});
let selector = '[ng-reflect-name="dateTime_' + id + '_Choices_' + (config.timeList.length - 1) + '"]';
console.log('selector', selector);
this.cd.detectChanges();
const elem = document.querySelector(selector);
if (elem) {
//this.elem.focus();
}
}
emptyAll() {
this.config.dateList.forEach(element => {
element.literal = '';
});
}
}

View File

@ -1,6 +1,6 @@
<h1 i18n>
{{"resume.title"|translate}}
{{"resume.title"|translate}}
</h1>
<h2 i18n>{{"resume.admins"|translate}}</h2>
<h2 i18n>{{"resume.users"|translate}}</h2>
<h2 i18n>{{"resume.link_mail"|translate}}</h2>
<h2 i18n>{{"resume.links_mail"|translate}}</h2>

View File

@ -1,86 +1,93 @@
<div class="description">
<router-outlet></router-outlet>
<h1 i18n>
{{"creation.title"|translate}}
</h1>
<span
class="pre-selector"
i18n
>
{{"creation.want"|translate}}
</span>
<select
id="selector"
name="selector"
autofocus="autofocus"
[(ngModel)]="config.pollType"
>
<option value="dates">
{{"creation.kind.date"|translate}}
</option>
<option value="classic">
{{"creation.kind.classic"|translate}}
</option>
</select>
<router-outlet></router-outlet>
<h1 i18n>
{{"creation.title"|translate}}
</h1>
<span
class="pre-selector"
i18n
>
{{"creation.want"|translate}}
</span>
<select
id="selector"
name="selector"
autofocus="autofocus"
[(ngModel)]="config.pollType"
>
<option value="dates">
{{"creation.kind.date"|translate}}
</option>
<option value="classic">
{{"creation.kind.classic"|translate}}
</option>
</select>
<span class="post-selector">
</span>
<div>
<span class="post-selector">
</span>
<label
for="poll_title"
class="title-label"
i18n
>
{{"creation.choose_title"|translate}}
</label>
<input
type="text"
id="poll_title"
name="poll_title"
placeholder="titre"
[(ngModel)]="config.title"
>
<div>
</div>
<div>
<label for="my_name">
{{"creation.name"|translate}} :
</label>
<input
type="text"
name="my_name"
id="my_name"
placeholder="mon nom"
[(ngModel)]="config.myName"
>
</div>
<div>
<label
for="poll_title"
class="title-label"
i18n
>
{{"creation.choose_title"|translate}}
</label>
<input
type="text"
id="poll_title"
name="poll_title"
placeholder="{{'creation.choose_title_placeholder'|translate}}"
[(ngModel)]="config.title"
>
</div>
<label
for="poll_description"
class="title-label"
i18n
>
{{"creation.description"|translate}}
</label>
<textarea
id="poll_description"
name="poll_description"
[(ngModel)]="config.description"
placeholder="description"
cols="50"
lines="5"
></textarea>
<div>
<label for="my_name">
{{"creation.name"|translate}} :
</label>
<input
type="text"
name="my_name"
id="my_name"
placeholder="{{'creation.name_placeholder'|translate}}"
[(ngModel)]="config.myName"
>
</div>
</div>
<div>
<label
for="poll_description"
class="title-label"
i18n
>
{{"creation.description"|translate}}
</label>
<textarea
id="poll_description"
name="poll_description"
[(ngModel)]="config.description"
placeholder="description"
cols="50"
lines="5"
></textarea>
</div>
<a
<button
[routerLink]="'/step/answers'"
class="btn btn-block"
i18n
>
Continuer
</a>
<hr>
</button>
<a
[routerLink]="'/step/answers'"
class="prev"
i18n
>
Retour
</a>
<hr>
</div>

View File

@ -1,4 +1,262 @@
<h1>page de démo</h1>
<p>cette étape est en cours de développement. <br> S'inspirer de la page de Home pour réaliser d'autres pages
</p>
<a [routerLink]="'/step/end'" class="btn btn-block" i18n="@@confirm">C'est parfait!</a>
<a [routerLink]="'/step/end'" class="btn btn--primary" i18n="@@confirm">C'est parfait!</a>
<h1>Atoms</h1>
<section>
<article>
<h2>Headings</h2>
<h1>Ceci est un h1</h1>
<h2>Ceci est un h2</h2>
<h3>Ceci est un h3</h3>
</article>
<article>
<h2>Links</h2>
<div>
<a [routerLink]="'/home'" class="next">
<span class="text" i18n>
C'est parti !
</span>
</a>
</div>
<div>
<a [routerLink]="'/home'" class="prev">
<span class="text" i18n>
C'est parti !
</span>
</a>
</div>
</article>
<article>
<h2>Buttons</h2>
<button type="submit" class="btn btn--primary">
primary - default
</button>
<br>
<button type="submit" class="btn btn--primary btn--small">
primary - small
</button>
<br>
<a href="#" class="btn btn--primary btn--outline">
primary - outline - default
</a>
<br>
<button type="submit" class="btn btn--primary btn--outline btn--small">
primary - outline - small
</button>
<br>
<input type="submit" class="btn btn--alert" value="alert - default">
<br>
<button type="submit" class="btn btn--alert btn--small">
alert - small
</button>
<br>
<button type="submit" class="btn btn--alert btn--outline">
alert - outline - default
</button>
<br>
<button type="submit" class="btn btn--alert btn--outline btn--small">
alert - outline - small
</button>
<br><br>
<button type="submit" class="btn btn--primary btn--full">
primary - full
</button>
<button type="submit" class="btn btn--primary btn--outline btn--full">
primary - outline - full
</button>
<button type="submit" class="btn btn--alert btn--full">
alert - full
</button>
<button type="submit" class="btn btn--alert btn--outline btn--full">
alert - outline - full
</button>
</article>
<article>
<h2>Forms element</h2>
<h3>Labels</h3>
<label for="">Un label pour les labelliser tous</label>
<h3>Input text</h3>
<input type="text" name="" id=""><br>
<input type="text" name="" id="" value="texte">
<h3>Input email</h3>
<input type="email" name="" id=""><br>
<input type="email" name="" id="" value="adresse@email.com">
<h3>Input password</h3>
<input type="password" name="" id=""><br>
<input type="password" name="" id="" value="password">
<h3>Input date</h3>
<input type="date" name="" id=""><br>
<input type="date" name="" id="" value="1985-11-23">
<h3>Select</h3>
<select name="" id="">
<option value="">
1
</option>
<option value="">
2
</option>
<option value="">
3
</option>
</select>
<h3>Textarea</h3>
<textarea name="" id="" cols="30" rows="10"></textarea>
</article>
<article>
<h2>Paragraphs</h2>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Magnam perspiciatis minus libero error dolores.
Corrupti repellat vero repellendus reiciendis assumenda minus. Nobis, quaerat ut nihil minima sed animi
delectus beatae!</p>
</article>
<article>
<h2>Lists</h2>
<h3>Unordered list</h3>
<ul>
<li>
plop
</li>
<li>
plop
</li>
<li>
plop
</li>
</ul>
<h3>Ordered list</h3>
<ol>
<li>
plop
</li>
<li>
plop
</li>
<li>
plop
</li>
</ol>
</article>
<article>
<h2>Images</h2>
<img src="http://placekitten.com/200/300" alt="">
</article>
</section>
<section>
<h1>Molecules</h1>
<framadate-vote-choice></framadate-vote-choice>
<article>
<h2>Useful classes</h2>
<h3>Align right</h3>
<div class="align-right">
<a [routerLink]="'/home'" class="next">
<span class="text" i18n>
C'est parti !
</span>
</a>
</div>
</article>
<article>
<h2>Label + input text</h2>
<label for="test-text">Ceci est un label un peu long mais pas trop</label>
<input type="text" name="test-text" id="test-text">
</article>
<article>
<h2>Label + select</h2>
<label for="test-select">Ceci est un label un peu long mais pas trop</label>
<select name="test-select" id="test-select">
<option value="">
1
</option>
<option value="">
2
</option>
<option value="">
3
</option>
</select>
</article>
<article>
<h2>Input text with info</h2>
<a href="https://sketch.cloud/s/00A80/a/MAl5q7">like here</a>
</article>
<article>
<h2>Commentaries</h2>
</article>
</section>
<section>
<h1>Components</h1>
<article>
<h2>Images list</h2>
<a href="https://sketch.cloud/s/00A80/a/bQA9wj">that</a>
</article>
<article>
<h2>Calendar</h2>
</article>
<article>
<h2>Modale</h2>
</article>
<article>
<h2>Way to vote</h2>
<a href="https://sketch.cloud/s/00A80/a/Ol0598">that</a>
</article>
<article>
<h2>Voted</h2>
<a href="https://sketch.cloud/s/00A80/a/OlJZo2">that</a>
</article>
<article>
<h2>Graphics</h2>
<a href="https://sketch.cloud/s/00A80/a/megprw">that</a>
</article>
</section>

View File

@ -0,0 +1,22 @@
@charset "UTF-8";
section {
&:not(:last-of-type) {
border-bottom: 6px solid #000;
}
& + & {
margin-top: 3rem;
}
}
article {
padding: 2rem 0;
border-top: 3px solid #ffb92c;
h3 {
&:not(:first-of-type) {
margin-top: 2rem;
}
}
}

View File

@ -1,6 +1,6 @@
<!--ceci est la popup pour ajouter une image-->
<h1 i18n>
Images
Images
</h1>
<a [routerLink]="'/step/visibility'" class="btn btn-block">ok</a>
<a [routerLink]="'/step/visibility'" class="btn btn--primary">ok</a>

View File

@ -1,10 +1,10 @@
<h1 i18n>
Résumé avant validation
Résumé avant validation
</h1>
<section>
TODO
<pre>
{{config |json}}
</pre>
<div markdown *ngFor="let questions of config.answers">
{{questions.id+1}}. {{questions.text}}
</div>
<button [routerLink]="'/step/answers'" class="btn btn-info">Retour</button>
</section>
<a [routerLink]="'/step/end'" class="btn btn-block" i18n="@@confirm">C'est parfait!</a>
<button [routerLink]="'/step/end'" class="btn btn--primary" i18n="@@confirm">C'est parfait!</button>

View File

@ -1,14 +1,14 @@
<h1 i18n>
{{"visibility.title"|translate}}
{{"visibility.title"|translate}}
</h1>
<h1 i18n>
{{"visibility.votes"|translate}}
{{"visibility.votes"|translate}}
</h1>
<h1 i18n>
{{"visibility.archiving"|translate}}
{{"visibility.archiving"|translate}}
</h1>
<h1 i18n>
{{"visibility.access"|translate}}
{{"visibility.access"|translate}}
</h1>
<a [routerLink]="'/step/end'" class="btn btn-block" i18n="@@confirm">C'est parfait!</a>
<a [routerLink]="'/step/end'" class="btn btn--primary" i18n="@@confirm">C'est parfait!</a>

View File

@ -0,0 +1,85 @@
<div class="choicebox"><!-- add .choicebox--active to most voted -->
<div class="choicebox__subject">
<!-- TEXT CASE --><!--
<p class="choicebox__txt">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nulla nobis nam culpa !
</p>
--><!-- TEXT CASE -->
<!-- IMG CASE --><!--
<img class="choicebox__img" src="https://picsum.photos/200" alt="">
--><!-- IMG CASE -->
<!-- DATE CASE -->
<div class="choicebox__date" *ngIf="choice.date">
{{choice.date | date:'EEE'}} <span class="choicebox__day">{{choice.date | date:'dd'}}</span> {{choice.date | date:'LLL'}}
</div>
<div class="choicebox__hour">
08:00
</div>
<!-- DATE CASE -->
</div>
<div class="choicebox__actions">
<!-- show only the yes check if the config is set to simpleAnswer -->
<!-- add .choicebox__btn--active to selected <button> -->
<button class="choicebox__btn choicebox__btn--yes" type="button">
<img src="../../assets/img/check.svg" (click)="setAnswserTo('yes')" alt="">
</button>
<button class="choicebox__btn choicebox__btn--maybe" type="button">
<img src="../../assets/img/check-2.svg" (click)="setAnswserTo('maybe')" alt="" *ngIf="!choice.simpleAnswer">
</button>
<button class="choicebox__btn choicebox__btn--no" type="button">
<img src="../../assets/img/croix.svg" (click)="setAnswserTo('no')" alt="" *ngIf=