style of advanced page

This commit is contained in:
Tykayn 2022-03-01 15:38:04 +01:00 committed by tykayn
parent c3433440d7
commit 1f04f12f1e
9 changed files with 176 additions and 136 deletions

View File

@ -1,8 +1,8 @@
<form [formGroup]="form" class="form-advanced-config">
<div class="rounded-block max_count_of_answers">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.limit_title' | translate }}
</h3>
</h2>
<div *ngIf="form.value.hasMaxCountOfAnswers">
<label for="maxCountOfAnswers">
{{ 'advanced.limit_label' | translate }}
@ -10,7 +10,6 @@
<input
#maxCountOfAnswers
id="maxCountOfAnswers"
matInput
type="number"
formControlName="maxCountOfAnswers"
required
@ -18,28 +17,18 @@
</div>
</div>
<div class="rounded-block">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.custom_link' | translate }}
</h3>
</h2>
<label for="custom_url">
{{ 'advanced.custom_label' | translate }}
</label>
<p class="description small-text">
{{ 'advanced.custom_desc' | translate }}
</p>
<br />
<div class="domain-custom-box">
<div class="domain">{{ domain_url }}</div>
<input
class="inline-input"
#custom_url
matInput
id="custom_url"
placeholder="Url"
formControlName="custom_url"
required
/>
<input class="inline-input" #custom_url id="custom_url" formControlName="custom_url" required />
</div>
<button
*ngIf="form.controls.custom_url.value && display_regen_slug"
@ -49,16 +38,15 @@
<i class="fa fa-recycle"></i> régénérer
</button>
</div>
<br />
<div class="rounded-block">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.password_title' | translate }}
</h3>
<p>
{{ 'advanced.password_title' | translate }}
</p>
</h2>
<div class="password-box">
<label for="password_first">
{{ 'advanced.password_label' | translate }}
</label>
<input
id="password_first"
[type]="displayClearPassword ? 'text' : 'password'"
@ -67,6 +55,7 @@
/>
<button
class="button"
*ngIf="display_password_clear_button"
[ngClass]="{ 'is-primary': displayClearPassword, 'is-info': !displayClearPassword }"
(click)="displayClearPassword = !displayClearPassword"
>
@ -74,16 +63,19 @@
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
</button>
<label for="password_repeat">
{{ 'advanced.password_label_repeat' | translate }}
</label>
<input
#password
id="password"
matInput
id="password_repeat"
[type]="displayClearPassword ? 'text' : 'password'"
formControlName="password_repeat"
required
/>
<button
class="button"
*ngIf="display_password_clear_button"
[ngClass]="{ 'is-primary': displayClearPassword, 'is-info': !displayClearPassword }"
(click)="displayClearPassword = !displayClearPassword"
>
@ -91,14 +83,17 @@
<i class="fa fa-eye" *ngIf="!displayClearPassword"></i>
<i class="fa fa-eye-slash" *ngIf="displayClearPassword"></i>
</button>
<div class="pass-validation" *ngIf="form.value.password == form.value.password_repeat">
<div
class="pass-validation"
*ngIf="form.value.password.length && form.value.password == form.value.password_repeat"
>
<p class="pass-validation-text">
<img class="icon" aria-hidden="true" src="assets/icons/check-grey-round.svg" />
{{ 'advanced.password_validation_ok' | translate }}
</p>
</div>
<div class="visibility_password_results">
<label for="areResultsPublic" class="aside-label">
<label for="areResultsPublic" class="aside-label" id="label_areResultsPublic">
<input type="checkbox" formControlName="areResultsPublic" id="areResultsPublic" />
<span class="label-text">
{{ 'advanced.password_display_without' | translate }}
@ -108,43 +103,62 @@
</div>
</div>
<div class="rounded-block permissions-modification">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.allowances_title' | translate }}
</h3>
</h2>
<div class="choice">
<label for="self_can_change_answers">
{{ 'advanced.allowances_own' | translate }}
<label for="self_can_change_answers" class="aside-label">
<input type="radio" formControlName="whoCanChangeAnswers" value="self" id="self_can_change_answers" />
<span class="label-text">
{{ 'advanced.allowances_own' | translate }}
</span>
</label>
<input type="radio" formControlName="whoCanChangeAnswers" value="self" id="self_can_change_answers" />
</div>
<div class="choice">
<label for="everybody_can_change_answers">
{{ 'advanced.allowances_all' | translate }}
<label for="everybody_can_change_answers" class="aside-label">
<input
type="radio"
formControlName="whoCanChangeAnswers"
value="everybody"
id="everybody_can_change_answers"
/>
<span class="label-text">
{{ 'advanced.allowances_all' | translate }}
</span>
</label>
</div>
<div class="choice">
<label for="none_can_change_answers" class="aside-label">
<input type="radio" formControlName="whoCanChangeAnswers" value="none" id="none_can_change_answers" />
<span class="label-text">
{{ 'advanced.allowances_none' | translate }}
</span>
</label>
<input
type="radio"
formControlName="whoCanChangeAnswers"
value="everybody"
id="everybody_can_change_answers"
/>
</div>
<hr />
<div class="choice">
<label for="none_can_change_answers">
{{ 'advanced.allowances_none' | translate }}
<label for="creator_can_change_answers" class="aside-label" id="label_creator_can_change_answers">
<input
type="radio"
formControlName="whoCanChangeAnswers"
value="creator"
id="creator_can_change_answers"
/>
<span class="label-text">
{{ 'advanced.allowances_creator' | translate }}
</span>
</label>
<input type="radio" formControlName="whoCanChangeAnswers" value="none" id="none_can_change_answers" />
</div>
</div>
<div class="rounded-block notifications">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.notifications_title' | translate }}
</h3>
</h2>
<p>
{{ 'advanced.notifications_description' | translate }}
</p>
<div class="choice">
<label for="areResultsPublic" class="aside-label">
<label for="areResultsPublic" class="notifications-description aside-label">
<input
type="checkbox"
formControlName="isOwnerNotifiedByEmailOnNewComment"
@ -156,7 +170,7 @@
</label>
</div>
<div class="choice">
<label for="areResultsPublic" class="aside-label">
<label for="isOwnerNotifiedByEmailOnNewVote" class="aside-label areResultsPublic">
<input
type="checkbox"
formControlName="isOwnerNotifiedByEmailOnNewVote"
@ -179,7 +193,6 @@
<input
#expiresDaysDelay
id="expiresDaysDelay"
matInput
type="number"
formControlName="expiresDaysDelay"
required
@ -187,58 +200,54 @@
</div>
<div class="rounded-box"></div>
<div class="rounded-box">
<h3 class="title is-3">
<h2 class="title-advanced">
{{ 'advanced.password_title' | translate }}
</h3>
</h2>
<mat-checkbox class="is-not-flex" formControlName="isProtectedByPassword">
{{ 'advanced.password_label' | translate }}
</mat-checkbox>
</div>
<h3 class="title is-3">
<h2 class="title-advanced">
<i class="fa fa-envelope-open"></i>
Notifications
</h3>
</h2>
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewVote">
Vous recevrez un mail à chaque nouvelle participation
</mat-checkbox>
<br />
<mat-checkbox class="is-not-flex" formControlName="isOwnerNotifiedByEmailOnNewComment">
Vous recevrez un mail à chaque nouveau commentaire
</mat-checkbox>
<div class="proposed-answers">
<h3 class="title is-3">
<h2 class="title-advanced">
<i class="fa fa-check-square"></i>
Réponses proposées
</h3>
</h2>
<mat-checkbox class="is-not-flex" formControlName="isYesAnswerAvailable">
La réponse « oui » sera disponible
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_YES.svg" />
</mat-checkbox>
<br />
<mat-checkbox class="is-not-flex" formControlName="isMaybeAnswerAvailable">
La réponse « peut-être » sera disponible
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_MAYBE.svg" />
</mat-checkbox>
<br />
<mat-checkbox class="is-not-flex" formControlName="isNoAnswerAvailable">
La réponse « non » sera disponible
<img class="image is-24x24 pull-right" src="assets/img/icon_voter_NO.svg" />
</mat-checkbox>
</div>
<h3 class="title is-3">
<h2 class="title-advanced">
<i class="fa fa-user-secret"></i>
Restrictions visiteurs
</h3>
</h2>
<mat-checkbox class="is-not-flex" formControlName="allowComments">
Autoriser les commentaires
</mat-checkbox>
<mat-checkbox class="is-not-flex" formControlName="hideResults">
Cacher les résultats au public
</mat-checkbox>
<br />
<mat-checkbox class="is-not-flex" formControlName="hasMaxCountOfAnswers">
Nombre de réponses limitées à ce nombre.
</mat-checkbox>
@ -283,9 +292,9 @@
</p>
</fieldset>
<div class="rounded-block propose_expire_input" *ngIf="environment.propose_expire_input">
<h3 class="title is-3">
<h2 class="title-advanced">
Saisissez la date de fin de votre sondage
</h3>
</h2>
<p>
Par défaut votre sondage prendra fin {{ environment.expiresDaysDelay }} jours après le dernier jour
sélectionné dans vos propositions

View File

@ -1,67 +1,49 @@
@import '../../../../../styles/variables';
.mat-checkbox {
img {
margin-left: 1em;
.form-advanced-config {
label {
margin: 4px 0;
font-weight: bold;
font-size: 14px;
line-height: 16px;
}
}
.aside-label {
min-height: 1.5rem;
width: 100%;
display: inline-block;
margin-left: 0.5em;
line-height: 2.5rem;
img,
input {
float: left;
min-height: 1.5rem;
margin-right: 1rem;
input,
textarea {
margin-top: 0.5em;
width: 100%;
}
margin-bottom: 0.5rem;
}
input,
textarea {
margin-top: 0.5em;
margin-bottom: 1.5em;
width: 100%;
&[type='checkbox'] {
width: 1.5rem;
height: 1.5rem;
border-radius: 0.5rem;
border: solid 1px $font_color;
float: left;
}
+ label {
height: 1.5rem;
width: 90%;
display: inline-block;
margin-left: 0.5em;
float: left;
clear: right;
}
}
.domain-custom-box {
border-radius: 3px;
height: 1.5em;
width: 100%;
display: block;
padding: 0;
margin: 0 0 1rem;
.domain {
border: solid 1px #eee;
padding: 0.5rem;
float: left;
width: 40%;
background: #ddd;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
#maxCountOfAnswers {
margin-bottom: 0;
}
.inline-input {
border: solid 1px #ddd !important;
.domain-custom-box {
border-radius: 3px;
height: 2.7rem;
width: 100%;
display: block;
padding: 0;
margin: 0;
border: 1px solid #4e4c59;
background: #fff;
.domain {
border: solid 1px #eee;
border-radius: 0;
padding-left: 1rem;
line-height: 2.5rem;
text-align: left;
float: left;
min-width: 40%;
max-width: 45%;
background: #ddd;
height: 2.55rem;
overflow: hidden;
text-overflow: ellipsis;
color: #767486;
}
}
#custom_url {
padding: 0.5rem;
display: inline-block;
background: #fff;
@ -69,20 +51,57 @@ textarea {
float: left;
width: 59%;
line-height: 1.5rem;
overflow: hidden;
text-overflow: ellipsis;
border: 0 !important;
}
.title-advanced {
font-size: 20px !important;
line-height: 23px !important;
color: $secondary_color;
margin-bottom: 1rem;
}
.password-box {
label {
margin-left: 0;
}
}
}
.permissions-modification {
.pass-validation-text {
color: #767486;
line-height: 1.25rem;
font-size: 12px;
margin-bottom: 1rem;
img {
margin-right: 1rem;
float: left;
}
}
.aside-label {
line-height: 1.25rem;
min-height: 2.5rem;
input {
height: 1.5rem;
width: 1.5rem;
margin-right: 1rem;
margin-top: 0;
float: left;
clear: left;
}
label {
float: right;
width: 90%;
.label-text {
line-height: 1.5rem;
margin-left: 0;
float: left;
width: 85%;
}
&#label_areResultsPublic,
&#label_none_can_change_answers,
&.areResultsPublic {
margin-bottom: -1rem !important;
}
}
.pass-validation-text {
@extend .aside-label;
line-height: 1.6rem;
#label_creator_can_change_answers {
margin-top: 1rem;
}

View File

@ -18,7 +18,8 @@ export class AdvancedConfigComponent implements OnInit {
@Input()
public form: FormGroup;
domain_url: string;
display_regen_slug: boolean = false;
display_regen_slug: boolean = environment.display_regen_slug;
display_password_clear_button: boolean = environment.display_password_clear_button;
constructor(public pollService: PollService) {}
ngOnInit(): void {

View File

@ -1,10 +1,10 @@
<app-stepper [step_current]="5" [step_max]="pollService.step_max"></app-stepper>
<div class="step">
<div class="step step-five">
<div class="min-height">
<section class="supplement">
<app-errors-list [form]="pollService.form"></app-errors-list>
<div class="advanced-config">
<h1 class="title is-3">
<h1 class="title-step title is-1">
{{ 'advanced.title' | translate }}
</h1>
<p class="decription">

View File

@ -1,5 +1,13 @@
@import '../../../../../../styles/variables';
.advanced-config {
margin-bottom: 2em;
.step-five {
.title-step {
font-weight: bold;
font-size: 32px;
line-height: 37px;
margin-bottom: 1rem !important;
}
.decription {
margin-bottom: 2rem;
}
}

View File

@ -148,9 +148,9 @@
"password_validation_ok": "Vos mots de passe sont identiques",
"password_display_without": "Les résultats sont visibles sans mot de passe",
"allowances_title": "Permissions",
"allowances_all": "Tou·te·s les sondé·e·s peuvent modifier tous les votes",
"allowances_own": "Chaque sondé·e peut modifier son propre vote",
"allowances_none": "Aucun vote ne peut être modifié",
"allowances_all": "Tou·te·s les sondé·e·s peuvent modifier tous les votes",
"allowances_creator": "Seul·e le ou la créateur·rice du sondage peut voir les résultats",
"notifications_title": "Notifications",
"notifications_vote": "Recevoir un e-mail à chaque participation",

View File

@ -34,6 +34,8 @@ export const environment = {
display_header_create_button: false,
display_menu_creation: false,
display_routes: false,
display_password_clear_button: false,
display_regen_slug: false,
enable_colored_weekend_days: false,
expiresDaysDelay: 30,
frontDomain: productionBaseUrl,

View File

@ -33,6 +33,8 @@ export const environment = {
creation_display_proposals_time_slices: false,
creation_email_is_required: true,
display_header_create_button: false,
display_password_clear_button: false,
display_regen_slug: false,
display_menu_creation: false,
display_routes: false, // demo paths to test polls
enable_colored_weekend_days: false, // color differently the weekend days

View File

@ -44,7 +44,7 @@ input,
select,
.select {
font-size: 1rem !important;
line-height: 1.25rem;
line-height: 40px;
border: solid 1px $font-color !important;
border-radius: 4px;
@extend .clickable;
@ -58,8 +58,7 @@ input,
select,
textarea {
@extend .clickable;
margin-bottom: 1rem;
padding: 0.25rem;
padding: 0.25rem 0.25rem 0.25rem 1rem;
&:active,
&:focus,