hide nav on creation, stepper bar color 🎨

This commit is contained in:
Tykayn 2021-11-29 13:00:01 +01:00 committed by tykayn
parent 61214b5e0d
commit 60d0678cb7
10 changed files with 31 additions and 20 deletions

View File

@ -5,7 +5,11 @@
<mat-sidenav-content>
<div id="big_container" [class]="themeClass">
<app-header [appTitle]="appTitle" [appLogo]="appLogo"></app-header>
<app-header
*ngIf="onHomePage || environment.display_menu_creation"
[appTitle]="appTitle"
[appLogo]="appLogo"
></app-header>
<div [class.container]="!onHomePage">
<main [@routeAnimations]="prepareRoute(outlet)">
<router-outlet #outlet></router-outlet>

View File

@ -72,7 +72,7 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
this.onHomePage = evt.url === '/';
let mainelem = this.document.querySelector('#big_container main');
let mainelem = this.document.querySelector('#big_container');
console.log('mainelem', mainelem);
window.scrollTo(0, mainelem.offsetTop);
});

View File

@ -114,7 +114,7 @@ export class PollService implements Resolve<Poll> {
public createFormGroup() {
let minlengthValidation = environment.production ? 12 : 0;
let form = this.fb.group({
title: ['mon titre de sondage', [Validators.required, Validators.minLength(minlengthValidation)]],
title: ['', [Validators.required, Validators.minLength(minlengthValidation)]],
creatorPseudo: ['', [Validators.required]],
created_at: [new Date(), [Validators.required]],
creatorEmail: ['', [Validators.required]],
@ -126,7 +126,6 @@ export class PollService implements Resolve<Poll> {
whoCanChangeAnswers: ['', [Validators.required]],
isAboutDate: [true, [Validators.required]],
expiresDaysDelay: [environment.expiresDaysDelay, []],
maxCountOfAnswers: [300, []],
isZeroKnoledge: [false, [Validators.required]],
isProtectedByPassword: [false, [Validators.required]],
isOwnerNotifiedByEmailOnNewVote: [true, [Validators.required]],
@ -137,6 +136,7 @@ export class PollService implements Resolve<Poll> {
isMaybeAnswerAvailable: [true, [Validators.required]],
isNoAnswerAvailable: [true, [Validators.required]],
allowComments: [true, [Validators.required]],
maxCountOfAnswers: [300, []],
hasMaxCountOfAnswers: [300, [Validators.required]],
useVoterUniqueLink: [false, [Validators.required]],
voterEmailList: ['', []],
@ -153,7 +153,7 @@ export class PollService implements Resolve<Poll> {
*/
public patchFormDefaultValues() {
this.form.patchValue({
title: 'mon titre de sondage',
title: 'Mon titre de sondage',
description: '',
custom_url: this.uuidService.getUUID(),
creatorPseudo: '',

View File

@ -1,7 +1,4 @@
@import '../../../../styles/variables';
.admin-form {
padding: 1em;
}
textarea {
border: solid 1px $border-color;

View File

@ -1,5 +1,5 @@
<section class="creation-stepper" id="creation_stepper">
<div class="shortcuts" *ngIf="show_shortcuts">
<div class="shortcuts" *ngIf="environment.showStepperShortcuts">
<a
class="shortcut"
href="#"
@ -51,17 +51,17 @@
>
</div>
<div class="step-info">
<h2 classs="title is-2" *ngIf="pollService.step_current == 1">
<h2 classs="step-title-poll" *ngIf="pollService.step_current == 1">
{{ 'creation.title' | translate }}
</h2>
<h2 class="title is-3" *ngIf="pollService.step_current > 1">
<h2 class="step-title-poll" *ngIf="pollService.step_current > 1">
<span class="poll-title">
{{ pollService.form.value.title }}
</span>
</h2>
<div class="columns">
<div class="column">
<h3 class="title is-2">Étape {{ step_current }} sur {{ step_max }}</h3>
<h3 class="step-counter-text">Étape {{ step_current }} sur {{ step_max }}</h3>
</div>
<div class="column is-narrow has-text-right">
<a class="shortcut cancel-button" (click)="cancelDialog()">

View File

@ -1,11 +1,16 @@
@import '../../../../styles/variables';
.step-info {
.title.step-title-poll {
font-size: 0.85rem;
color: $border-color;
}
}
.step-bar-container {
margin: 1em 0;
height: 0.6em;
display: inline-block;
min-width: 1px;
background: $border-color !important;
background: $d-grey !important;
width: 100%;
}
.step-bar-progress {

View File

@ -14,6 +14,7 @@ export class StepperComponent {
public step_current: number = 1;
@Input()
public step_max: number = 5;
public environment = environment;
public show_shortcuts = environment.showStepperShortcuts;
constructor(
public pollService: PollService,

View File

@ -19,13 +19,14 @@ export const environment = {
production: true,
display_routes: false,
showDemoWarning: false,
autofill_creation: true,
display_menu_creation: false,
autofill_creation: false,
autofill_participation: false,
advanced_options_display: false,
autofill_default_timeslices: false,
autoSendNewPoll: false,
interval_days_default: 7,
showStepperShortcuts: true,
showStepperShortcuts: false,
expiresDaysDelay: 60,
maxCountOfAnswers: 300,
appTitle: 'FramaDate',

View File

@ -11,13 +11,14 @@ export const environment = {
frontDomain: 'http://127.0.0.1:4200',
production: false,
display_routes: false, // demo paths to test polls
autofill_creation: true,
display_menu_creation: false,
autofill_creation: false,
advanced_options_display: false,
autofill_participation: false,
autofill_default_timeslices: false,
showDemoWarning: false,
autoSendNewPoll: false,
showStepperShortcuts: true,
showStepperShortcuts: false,
interval_days_default: 7,
expiresDaysDelay: 60,
maxCountOfAnswers: 300,

View File

@ -176,8 +176,10 @@ mat-checkbox {
}
.admin-form {
max-width: 800px;
margin: 0 auto;
.step {
max-width: 800px;
margin: 0 auto;
}
}
.fa {