reorganize poll display page and urls in config

This commit is contained in:
Baptiste Lemoine 2020-01-16 10:45:56 +01:00
parent 52587428dd
commit 051e4d8ee4
7 changed files with 24 additions and 28 deletions

View File

@ -1,6 +1,8 @@
/** /**
* une option de date dans les sondages spéciaux * une option de date dans les sondages spéciaux
*/ */
import {environment} from "../../environments/environment";
export interface DateOption { export interface DateOption {
timeList: any; timeList: any;
literal: string; literal: string;
@ -63,8 +65,8 @@ export class PollConfig {
passwordAccess = 0; passwordAccess = 0;
password = ''; password = '';
customUrl = ''; customUrl = '';
urlPublic = 'https://framadate.org/default-url'; urlPublic = environment.baseApiHref + '/default-url';
urlAdmin = 'https://framadate.org/default-url/admin/d65es45fd45sdf45sd345f312sdf31sgfd345'; urlAdmin = environment.baseApiHref + '/default-url/admin/d65es45fd45sdf45sd345f312sdf31sgfd345';
canModifyAnswers = 1;// everybody, self, nobody (= just admin) canModifyAnswers = 1;// everybody, self, nobody (= just admin)
whoModifiesAnswers = "self";// everybody, self, nobody (= just admin) whoModifiesAnswers = "self";// everybody, self, nobody (= just admin)
whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin) whoCanChangeAnswers = 'everybody';// everybody, self, nobody (= just admin)

View File

@ -15,6 +15,7 @@ import {PollDisplayComponent} from "../pages/poll-display/poll-display.component
import {VotingComponent} from "../pages/voting/voting.component"; import {VotingComponent} from "../pages/voting/voting.component";
import {PasswordComponent} from "../pages/password/password.component"; import {PasswordComponent} from "../pages/password/password.component";
/** /**
* each step in the form is a component * each step in the form is a component
*/ */
@ -36,8 +37,8 @@ export const Routes =
{path: 'graphic/:poll', component: PollGraphicComponent}, {path: 'graphic/:poll', component: PollGraphicComponent},
{path: 'vote/poll/id/:poll', component: PollDisplayComponent}, {path: 'vote/poll/id/:poll', component: PollDisplayComponent},
{path: 'votechoice', component: VoteChoiceComponent}, {path: 'votechoice', component: VoteChoiceComponent},
{path: '**', redirectTo: '/home', pathMatch: 'full'},
{path: 'voting', component: VotingComponent}, {path: 'voting', component: VotingComponent},
{path: 'step/password', component: PasswordComponent}, {path: 'step/password', component: PasswordComponent},
{path: '**', redirectTo: '/home', pathMatch: 'full'},
] ]
; ;

View File

@ -107,7 +107,7 @@
class="input-lg" class="input-lg"
name="url" name="url"
id="url" id="url"
[(ngModel)]="config.customUrl"> [value]="baseUrl+'/'+config.customUrl">
<sub class="instructions"> <sub class="instructions">
{{"visibility.access_instructions"|translate}} {{"visibility.access_instructions"|translate}}
@ -139,7 +139,9 @@
min="8" min="8"
*ngIf="showCustomPassword" *ngIf="showCustomPassword"
[(ngModel)]="config.password"> [(ngModel)]="config.password">
<button class="btn btn--default" (click)="showCustomPassword = !showCustomPassword"> <button (click)="showCustomPassword = !showCustomPassword" [disabled]="!config.password"
class="btn btn--default">
<i class="fa fa-eye"></i>
{{"visibility.see_pass"|translate}} {{"visibility.see_pass"|translate}}
</button> </button>
</div> </div>

View File

@ -1,6 +1,7 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {BaseComponent} from '../base-page/base.component'; import {BaseComponent} from '../base-page/base.component';
import {ConfigService} from '../../services/config.service'; import {ConfigService} from '../../services/config.service';
import {environment} from "../../../environments/environment";
@Component({ @Component({
selector: 'framadate-visibility', selector: 'framadate-visibility',
@ -9,6 +10,7 @@ import {ConfigService} from '../../services/config.service';
}) })
export class VisibilityComponent extends BaseComponent implements OnInit { export class VisibilityComponent extends BaseComponent implements OnInit {
showCustomPassword = false; showCustomPassword = false;
baseUrl = environment.baseApiHref;
constructor(public config: ConfigService) { constructor(public config: ConfigService) {
super(config); super(config);

View File

@ -77,22 +77,17 @@ label {
} }
} }
form { input {
display: flex; &:not([id]) {
margin: auto; color: $dusty-orange;
flex-direction: column;
align-items: center;
justify-content: flex-start;
}
.popup { &:before {
display: flex; content: "cet input n'a pas d'attribut id, c'est mal.";
flex-direction: column; color: $violet;
z-index: 2222222222; display: block;
} padding: 1em;
}
.row { }
flex-direction: row;
} }
label { label {
@ -108,14 +103,6 @@ label {
flex-wrap: wrap; flex-wrap: wrap;
} }
.comment {
display: flex;
}
.commeny span {
flex-direction: row;
}
.cname { .cname {
padding-left: 17px; padding-left: 17px;
font-weight: bold; font-weight: bold;

View File

@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: true, production: true,
baseHref: "https://framadate-api.cipherbliss.com/",
baseApiHref: 'https://framadate-api.cipherbliss.com/api/v1' baseApiHref: 'https://framadate-api.cipherbliss.com/api/v1'
}; };

View File

@ -4,6 +4,7 @@
export const environment = { export const environment = {
production: false, production: false,
baseHref: "https://framadate-api.cipherbliss.com/",
baseApiHref: "https://framadate-api.cipherbliss.com/api/v1" baseApiHref: "https://framadate-api.cipherbliss.com/api/v1"
// baseApiHref: "http://localhost:8000/api/v1" // baseApiHref: "http://localhost:8000/api/v1"
}; };