This commit is contained in:
Tykayn 2021-05-20 14:11:30 +02:00 committed by tykayn
parent ee429e37cc
commit c95f481af9
12 changed files with 106 additions and 120 deletions

View File

@ -6,6 +6,9 @@
</a> </a>
<a class="navbar-item title is-size-1-fullhd is-size-4-touch has-text-black" routerLink="/"> <a class="navbar-item title is-size-1-fullhd is-size-4-touch has-text-black" routerLink="/">
{{ appTitle }} {{ appTitle }}
<sub>
{{ environment.appVersion }}
</sub>
</a> </a>
</div> </div>
<div class="navbar-start"> <div class="navbar-start">

View File

@ -124,7 +124,7 @@ export class ApiService {
console.log('this.baseHref', this.baseHref); console.log('this.baseHref', this.baseHref);
const headers = ApiService.makeHeaders(vote_stack); const headers = ApiService.makeHeaders(vote_stack);
console.log('headers', headers); console.log('headers', headers);
const url = `${this.baseHref}/poll/${poll.custom_url}/answer`; const url = `${this.baseHref}/vote/poll/${poll.custom_url}/answer`;
const axiosconf = { const axiosconf = {
url, url,

View File

@ -2,11 +2,14 @@
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<label for="title"> <label for="title">
{{ 'creation.choose_title' | translate }} <span>
{{ 'creation.choose_title' | translate }}
</span>
</label> </label>
<br />
<input <input
class="input" class="input"
matInput
[placeholder]="'creation.choose_title_placeholder' | translate" [placeholder]="'creation.choose_title_placeholder' | translate"
formControlName="title" formControlName="title"
id="title" id="title"
@ -15,13 +18,12 @@
#title #title
/> />
<button <button
(click)="form.patchValue({ title: '' })"
*ngIf="form.value.title"
aria-label="Clear"
mat-button mat-button
mat-icon-button *ngIf="form.value.title"
matSuffix matSuffix
maxlength="400" mat-icon-button
aria-label="Clear"
(click)="form.patchValue({ title: '' })"
> >
<i class="fa fa-close"></i> <i class="fa fa-close"></i>
</button> </button>

View File

@ -0,0 +1,4 @@
#title {
display: block;
width: 80%;
}

View File

@ -0,0 +1,5 @@
#kind {
width: 100%;
max-width: 100%;
display: block;
}

View File

@ -0,0 +1,48 @@
const backendApiUrlsInDev = {
local: 'http://tktest.lan/api/v1',
remote: 'http://tktest.lan/api/v1',
// remote: 'https://framadate-api.cipherbliss.com/api/v1',
};
const apiV1 = {
baseHref: 'http://tktest.lan/api/v1',
// baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
api_new_poll: '/poll/',
api_get_poll: '/poll/{id}',
api_new_vote_stack: '/poll/{id}/answer',
'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}',
'app.swagger': '/api/doc.json',
};
export const endpoints = {
versionToUse: 'apiV1',
version: {
apiV1,
},
baseHref: backendApiUrlsInDev.local,
endpoints: {
polls: {
name: '/poll',
choices: {
name: '/choices',
},
comments: {
name: '/comments',
},
slugs: {
name: '/slugs',
},
answers: {
name: '/answers',
},
},
users: {
name: '/users',
polls: {
name: '/polls',
sendEmail: {
name: '/send-email',
},
},
},
},
};

View File

@ -1,3 +1,6 @@
import { endpoints } from './endpoints';
import { poll_conf } from './poll_conf';
const backendApiUrlsInDev = { const backendApiUrlsInDev = {
local: '/api/v1', local: '/api/v1',
remote: 'https://framadate-api.cipherbliss.com/api/v1', remote: 'https://framadate-api.cipherbliss.com/api/v1',
@ -15,56 +18,15 @@ export const environment = {
production: true, production: true,
display_routes: true, display_routes: true,
showDemoWarning: true, showDemoWarning: true,
autofill: false, autofill: true,
autoSendNewPoll: false, autoSendNewPoll: false,
interval_days_default: 7, interval_days_default: 7,
appTitle: 'FramaDate Funky', appTitle: 'FramaDate Funky',
appVersion: '2.1.0', appVersion: '0.6.0',
appLogo: 'assets/img/logo.png', appLogo: 'assets/img/logo.png',
api: { api: endpoints,
versionToUse: 'apiV1', poll: poll_conf,
version: {
apiV1,
},
baseHref: backendApiUrlsInDev.remote,
endpoints: {
polls: {
name: '/poll',
choices: {
name: '/choices',
},
comments: {
name: '/comments',
},
slugs: {
name: '/slugs',
},
answers: {
name: '/answers',
},
},
users: {
name: '/users',
polls: {
name: '/polls',
sendEmail: {
name: '/send-email',
},
},
},
},
},
poll: {
defaultConfig: {
maxCountOfAnswers: 150,
expiresDaysDelay: 60,
expiracyAfterLastModificationInDays: 180,
whoCanChangeAnswers: 'everybody',
visibility: 'link_only',
voteChoices: 'only_yes',
},
},
localStorage: { localStorage: {
key: 'FramaSondage', key: 'FramaDateFunky',
}, },
}; };

View File

@ -2,77 +2,24 @@
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
const backendApiUrlsInDev = { import { endpoints } from './endpoints';
local: 'http://127.0.0.1:8000/api/v1', import { poll_conf } from './poll_conf';
remote: 'http://127.0.0.1:8000/api/v1',
// remote: 'https://framadate-api.cipherbliss.com/api/v1',
};
const apiV1 = {
baseHref: 'http://127.0.0.1:8000/api/v1',
// baseHref: 'https://framadate-api.cipherbliss.com/api/v1',
api_new_poll: '/poll/',
api_get_poll: '/poll/{id}',
api_new_vote_stack: '/poll/{id}/answer',
'api_test-mail-poll': '/api/v1/poll/mail/test-mail-poll/{emailChoice}',
'app.swagger': '/api/doc.json',
};
export const environment = { export const environment = {
frontDomain: 'http://127.0.0.1:8000', frontDomain: 'http://127.0.0.1:4200',
production: false, production: false,
display_routes: false, display_routes: true,
autofill: true, autofill: true,
showDemoWarning: false, showDemoWarning: false,
autoSendNewPoll: false, autoSendNewPoll: false,
interval_days_default: 7, interval_days_default: 7,
appTitle: 'FramaDate Funky', appTitle: 'FDFunky',
appVersion: '2.1.0', appVersion: '0.6.0',
appLogo: 'assets/img/logo.png', appLogo: 'assets/img/logo.png',
api: { api: endpoints,
versionToUse: 'apiV1', poll: poll_conf,
version: {
apiV1,
},
baseHref: backendApiUrlsInDev.local,
endpoints: {
polls: {
name: '/poll',
choices: {
name: '/choices',
},
comments: {
name: '/comments',
},
slugs: {
name: '/slugs',
},
answers: {
name: '/answers',
},
},
users: {
name: '/users',
polls: {
name: '/polls',
sendEmail: {
name: '/send-email',
},
},
},
},
},
poll: {
defaultConfig: {
maxCountOfAnswers: 150,
expiresDaysDelay: 60,
expiracyAfterLastModificationInDays: 180,
whoCanChangeAnswers: 'everybody',
visibility: 'link_only',
voteChoices: 'only_yes',
},
},
localStorage: { localStorage: {
key: 'FramaSondage', key: 'FramaDateFunky',
}, },
}; };
@ -83,4 +30,5 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact * This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown. * on performance if an error is thrown.
*/ */
import 'zone.js/dist/zone-error'; // Included with Angular CLI. import 'zone.js/dist/zone-error';
// Included with Angular CLI.

View File

@ -0,0 +1,10 @@
export const poll_conf = {
defaultConfig: {
maxCountOfAnswers: 150,
expiresDaysDelay: 60,
expiracyAfterLastModificationInDays: 180,
whoCanChangeAnswers: 'everybody',
visibility: 'link_only',
voteChoices: 'only_yes',
},
};

View File

@ -15,3 +15,7 @@ $input-shadow: none;
.notification { .notification {
margin: 1em 0; margin: 1em 0;
} }
.select {
display: block !important;
width: 80%;
}

View File

@ -207,7 +207,7 @@ mat-checkbox {
} }
.ng-pristine, .ng-pristine,
.ng-dirty { .ng-dirty {
border-left: blue 3px solid; //border-left: #ccc 3px solid;
padding-left: 1em; padding-left: 1em;
} }
.ng-touched.ng-invalid { .ng-touched.ng-invalid {

View File

@ -6,7 +6,7 @@
width: 45%; width: 45%;
} }
.date-choice > input:first-of-type { .date-choice > input:first-of-type {
width: 80%; width: 75%;
} }
.date-choice .btn--primary, .date-choice .btn--primary,
.several-times { .several-times {
@ -15,7 +15,7 @@
} }
.time-choice { .time-choice {
input { input {
width: 70%; width: 80%;
} }
} }
} }