link function

This commit is contained in:
Tykayn 2021-04-30 16:12:02 +02:00 committed by tykayn
parent bfdb18b316
commit b2ee8ec668
6 changed files with 16 additions and 18 deletions

View File

@ -64,10 +64,11 @@ export class Poll {
constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {} constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {}
public getAdministrationUrl(): string { public getAdministrationUrl(): string {
return `${environment.api.baseHref}/administration/polls/${this.custom_url}`; return `${environment.frontDomain}/poll/admin/${this.admin_key}`;
} }
public getParticipationUrl(): string { public getParticipationUrl(): string {
return `${environment.api.baseHref}/participation/polls/${this.custom_url}`; // TODO handle pass access
return `${environment.frontDomain}/poll/${this.custom_url}/consultation`;
} }
} }

View File

@ -26,8 +26,7 @@
> >
<i class="fa fa-close"></i> <i class="fa fa-close"></i>
</button> </button>
</div>
<div class="column">
<p> <p>
<label for="creatorPseudo"> <label for="creatorPseudo">
<span> <span>

View File

@ -28,10 +28,10 @@
<p> <p>
Pour accéder au sondage et à tous ses paramètres : Pour accéder au sondage et à tous ses paramètres :
<a href="{{ poll.custom_url }}">{{ poll.custom_url }} </a> <a href="{{ poll.getAdministrationUrl() }}">{{ poll.getAdministrationUrl() }} </a>
</p> </p>
<app-copy-text [textToCopy]="window.location.href + 'poll/admin/' + poll.admin_key + ''"></app-copy-text> <app-copy-text [textToCopy]="poll.getAdministrationUrl()"></app-copy-text>
<a [href]="window.location.href + 'poll/admin/' + poll.admin_key + ''"> <a [href]="poll.getAdministrationUrl()">
Voir le sondage coté administrateur·ice Voir le sondage coté administrateur·ice
</a> </a>
<p class="note"> <p class="note">
@ -42,17 +42,11 @@
<section class="public"> <section class="public">
<h2 i18n>{{ 'resume.users' | translate }}</h2> <h2 i18n>{{ 'resume.users' | translate }}</h2>
<p> <p>
Pour accéder au sondage : Pour modifier le sondage :
<a href="{{ window.location.href + 'poll/' + poll.custom_url + 'consultation' }}" <a href="{{ poll.getAdministrationUrl() }}">{{ poll.getAdministrationUrl() }} </a>
>{{ window.location.href + 'poll/' + poll.custom_url + 'consultation' }}
</a>
</p> </p>
<app-copy-text <app-copy-text [textToCopy]="poll.getAdministrationUrl()"></app-copy-text>
[textToCopy]="window.location.href + 'poll/' + poll.custom_url + '/consultation'" <a href="{{ poll.getAdministrationUrl() }}"> <i class="fa fa-pencil"></i> Modifier le sondage </a>
></app-copy-text>
<a href="{{ window.location.href + 'poll/' + poll.custom_url + 'consultation' }}">
Voir le sondage
</a>
</section> </section>
<section class="mail"> <section class="mail">
<h2 i18n>{{ 'resume.links_mail' | translate }}</h2> <h2 i18n>{{ 'resume.links_mail' | translate }}</h2>
@ -66,7 +60,7 @@
Envoyer les liens du sondage Envoyer les liens du sondage
</button> </button>
<a href="{{ poll.custom_url }}"> <a href="{{ poll.custom_url }}">
Voir le sondage Voir le sondage côté public
</a> </a>
</section> </section>

View File

@ -1,6 +1,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { PollService } from '../../../core/services/poll.service'; import { PollService } from '../../../core/services/poll.service';
import { Poll } from '../../../core/models/poll.model'; import { Poll } from '../../../core/models/poll.model';
import { environment } from 'src/environments/environment';
@Component({ @Component({
selector: 'app-success', selector: 'app-success',
@ -11,6 +12,7 @@ export class SuccessComponent implements OnInit {
@Input() poll: Poll; @Input() poll: Poll;
mailToRecieve: string; mailToRecieve: string;
window: any = window; window: any = window;
environment = environment;
constructor(private pollService: PollService) {} constructor(private pollService: PollService) {}

View File

@ -11,6 +11,7 @@ const apiV1 = {
}; };
export const environment = { export const environment = {
frontDomain: 'https://framadate-api.cipherbliss.com',
production: true, production: true,
display_routes: true, display_routes: true,
autofill: true, autofill: true,

View File

@ -18,6 +18,7 @@ const apiV1 = {
}; };
export const environment = { export const environment = {
frontDomain: 'https://framadate-api.cipherbliss.com',
production: false, production: false,
display_routes: true, display_routes: true,
autofill: true, autofill: true,