forked from tykayn/funky-framadate-front
⚡ menu to nav on poll display - #64
This commit is contained in:
parent
195259bb72
commit
d2c726012b
@ -1,28 +1,70 @@
|
|||||||
<div class="poll" >
|
<div class="poll" >
|
||||||
|
<nav class='sections-nav' >
|
||||||
|
<ul >
|
||||||
|
<li ><a href='#title' >{{config.currentPoll.data.title}}</a ></li >
|
||||||
|
<li ><a href='#graph' >Graphique</a ></li >
|
||||||
|
<li >
|
||||||
|
<a href='#comments' >
|
||||||
|
<i class='fa fa-comments' ></i >
|
||||||
|
<span
|
||||||
|
*ngIf='config.currentPoll && config.currentPoll.comments'
|
||||||
|
class='comments-count' >
|
||||||
|
{{config.currentPoll.comments.length}}
|
||||||
|
</span >
|
||||||
|
commentaires</a >
|
||||||
|
</li >
|
||||||
|
</ul >
|
||||||
|
</nav >
|
||||||
<div class='heading' >
|
<div class='heading' >
|
||||||
<div class='col-xs-6' >
|
<div class='col-xs-6' >
|
||||||
<h1 >{{pollConfigFetched.data.title}}</h1 >
|
<h1 id='title' >{{config.currentPoll.data.title}}</h1 >
|
||||||
<p >{{pollConfigFetched.data.description}}</p >
|
<p >{{config.currentPoll.data.description}}</p >
|
||||||
<span class="creationDate" >
|
<span class="creationDate" >
|
||||||
Créé le {{pollConfigFetched.data.creationDate.date}}
|
Créé le {{config.currentPoll.data.creationDate.date}}
|
||||||
</span >
|
</span >
|
||||||
<span class="expiracyDate" >
|
<span class="expiracyDate" >
|
||||||
Expire le {{pollConfigFetched.data.expiracyDate.date}}
|
Expire le {{config.currentPoll.data.expiracyDate.date}}
|
||||||
</span >
|
</span >
|
||||||
<div class="votants" >
|
<div class="votants" >
|
||||||
<i class='fa fa-users' ></i >
|
<i class='fa fa-users' ></i >
|
||||||
{{pollConfigFetched.stacks.length}} votants,
|
{{config.currentPoll.stacks.length}} votants,
|
||||||
{{pollConfigFetched.choices.length}} choix,
|
{{config.currentPoll.choices.length}} choix,
|
||||||
</div >
|
</div >
|
||||||
</div >
|
</div >
|
||||||
<div class='col-xs-6' >
|
<div
|
||||||
|
*ngIf='config.isAdmin'
|
||||||
|
class='col-xs-6 admin-actions' >
|
||||||
<button
|
<button
|
||||||
class='btn btn--primary btn--outline btn--full'
|
class='btn btn--primary btn--outline btn--full'
|
||||||
*ngIf='config.isAdmin'
|
|
||||||
(click)='config.todo()' >
|
(click)='config.todo()' >
|
||||||
<i class='fa fa-pencil' ></i >
|
<i class='fa fa-pencil' ></i >
|
||||||
Je veux modifier le vote de quelqu'un
|
Je veux modifier le vote de quelqu'un
|
||||||
</button >
|
</button >
|
||||||
|
<button
|
||||||
|
(click)='config.deleteComments()'
|
||||||
|
class='btn btn--danger btn--outline' >
|
||||||
|
<i class='fa fa-comments-o' ></i >
|
||||||
|
Supprimer tous les commentaires
|
||||||
|
</button >
|
||||||
|
<button
|
||||||
|
(click)='config.deleteVotes()'
|
||||||
|
class='btn btn--danger btn--outline' >
|
||||||
|
<i class='fa fa-stack' ></i >
|
||||||
|
Supprimer tous les votes
|
||||||
|
</button >
|
||||||
|
<button
|
||||||
|
(click)='config.deletePoll()'
|
||||||
|
class='btn btn--danger btn--outline' >
|
||||||
|
<i class='fa fa-trash' ></i >
|
||||||
|
Supprimer ce sondage entièrement
|
||||||
|
</button >
|
||||||
|
<button
|
||||||
|
(click)='config.checkIfSlugIsUniqueInDatabase()'
|
||||||
|
class='btn btn--primary btn--outline' >
|
||||||
|
<i class='fa fa-file-text' ></i >
|
||||||
|
vérifier la disponibilité de l'url personnalisée
|
||||||
|
</button >
|
||||||
|
|
||||||
</div >
|
</div >
|
||||||
</div >
|
</div >
|
||||||
@ -36,9 +78,15 @@
|
|||||||
id="name"
|
id="name"
|
||||||
[(ngModel)]="config.myName" >
|
[(ngModel)]="config.myName" >
|
||||||
</section >
|
</section >
|
||||||
<div class="list-of-choices" >
|
<div
|
||||||
<div *ngFor="let choice of pollConfigFetched.choices" >
|
*ngIf='config.currentPoll'
|
||||||
<framadate-vote-choice [choice]="choice" ></framadate-vote-choice >
|
class="list-of-choices" >
|
||||||
|
<div *ngFor="let choice of config.currentPoll.choices" >
|
||||||
|
|
||||||
|
<framadate-vote-choice
|
||||||
|
[choice]="choice"
|
||||||
|
[pollIsSpecialDate]="config.currentPoll.data.kind == 'date'"
|
||||||
|
[simpleAnswer]="config.currentPoll.data.allowedAnswers == ['yes']" ></framadate-vote-choice >
|
||||||
</div >
|
</div >
|
||||||
</div >
|
</div >
|
||||||
<button
|
<button
|
||||||
@ -46,9 +94,14 @@
|
|||||||
(click)='config.addVote()' >
|
(click)='config.addVote()' >
|
||||||
<i class='fa fa-paper-plane' ></i > Envoyer
|
<i class='fa fa-paper-plane' ></i > Envoyer
|
||||||
</button >
|
</button >
|
||||||
<framadate-voting-graph ></framadate-voting-graph >
|
<div id='graph' >
|
||||||
<framadate-voting-summary ></framadate-voting-summary >
|
|
||||||
<div class="comments" >
|
<!--<framadate-voting-graph ></framadate-voting-graph >-->
|
||||||
|
</div >
|
||||||
|
<!--<framadate-voting-summary ></framadate-voting-summary >-->
|
||||||
|
<div
|
||||||
|
class="comments"
|
||||||
|
id='comments' >
|
||||||
<h2 class="margin-top-x7" >Laisser un commentaire</h2 >
|
<h2 class="margin-top-x7" >Laisser un commentaire</h2 >
|
||||||
<label for="crname" >Votre nom :</label >
|
<label for="crname" >Votre nom :</label >
|
||||||
<input
|
<input
|
||||||
@ -75,8 +128,7 @@
|
|||||||
(click)='config.addComment()' >
|
(click)='config.addComment()' >
|
||||||
<framadate-voting-comment
|
<framadate-voting-comment
|
||||||
[comment]="c"
|
[comment]="c"
|
||||||
*ngFor="let c of comments" >
|
*ngFor="let c of comments " >
|
||||||
|
|
||||||
</framadate-voting-comment >
|
</framadate-voting-comment >
|
||||||
</div >
|
</div >
|
||||||
<div class="sharing" >
|
<div class="sharing" >
|
||||||
|
@ -11,7 +11,6 @@ import {ActivatedRoute} from "@angular/router";
|
|||||||
})
|
})
|
||||||
export class PollDisplayComponent extends BaseComponent implements OnInit {
|
export class PollDisplayComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
pollConfigFetched;
|
|
||||||
comments = mockComments;
|
comments = mockComments;
|
||||||
|
|
||||||
constructor(public config: ConfigService,
|
constructor(public config: ConfigService,
|
||||||
@ -20,7 +19,7 @@ export class PollDisplayComponent extends BaseComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.pollConfigFetched = this.config.currentPoll;
|
this.config.currentPoll;
|
||||||
|
|
||||||
// fetch poll with its ID or slug.
|
// fetch poll with its ID or slug.
|
||||||
const id = this.activeRoute.snapshot.params.poll;
|
const id = this.activeRoute.snapshot.params.poll;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user