Merge pull request #4366 from emanuelschuetze/fixes

several fixes and improvements
This commit is contained in:
Emanuel Schütze 2019-02-18 17:25:54 +01:00 committed by GitHub
commit f09a39a3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 61 deletions

View File

@ -35,5 +35,5 @@
} }
mat-toolbar.multi-select { mat-toolbar.multi-select {
background-color: #757575; background-color: #757575 !important;
} }

View File

@ -1,7 +1,9 @@
<div id="container" [osResized]="resizeSubject" [ngStyle]="containerStyle" #container> <div id="container" [osResized]="resizeSubject" [ngStyle]="containerStyle" #container>
<div id="projector" [ngStyle]="projectorStyle"> <div id="projector" [ngStyle]="projectorStyle">
<div id="header" [ngStyle]="headerFooterStyle" *ngIf="enableHeaderAndFooter"> <div id="header" [ngStyle]="headerFooterStyle" *ngIf="enableHeaderAndFooter">
<!-- TODO: Logo <img *ngIf="enableLogo" id="logo"> --> <!-- projector logo -->
<os-logo *ngIf="enableLogo" inputAction="logo_projector_main" class="projector-logo-main"> </os-logo>
<div *ngIf="enableTitle" id="eventdata"> <div *ngIf="enableTitle" id="eventdata">
<div <div
*ngIf="eventName" *ngIf="eventName"

View File

@ -21,12 +21,12 @@
margin-bottom: 20px; margin-bottom: 20px;
z-index: 1; z-index: 1;
#logo { .projector-logo-main {
height: 50px;
padding-left: 50px; padding-left: 50px;
padding-top: 10px; padding-top: 10px;
height: 50px;
margin-right: 25px;
float: left; float: left;
display: flex;
} }
#eventdata { #eventdata {

View File

@ -157,20 +157,33 @@ export class ProjectorComponent extends BaseComponent implements OnDestroy {
super(titleService, translate); super(titleService, translate);
// Get all important config variables. // Get all important config variables.
// enable header/footer
this.configService this.configService
.get<boolean>('projector_enable_header_footer') .get<boolean>('projector_enable_header_footer')
.subscribe(val => (this.enableHeaderAndFooter = val)); .subscribe(val => (this.enableHeaderAndFooter = val));
this.configService.get<boolean>('projector_enable_title').subscribe(val => (this.enableTitle = val)); this.configService.get<boolean>('projector_enable_title').subscribe(val => (this.enableTitle = val));
// projector colors
this.configService this.configService
.get<string>('projector_header_fontcolor') .get<string>('projector_header_fontcolor')
.subscribe(val => (this.headerFooterStyle.color = val)); .subscribe(val => (this.headerFooterStyle.color = val));
this.configService this.configService
.get<string>('projector_header_backgroundcolor') .get<string>('projector_header_backgroundcolor')
.subscribe(val => (this.headerFooterStyle['background-color'] = val)); .subscribe(val => (this.headerFooterStyle['background-color'] = val));
this.configService.get<boolean>('projector_enable_logo').subscribe(val => (this.enableLogo = val));
this.configService this.configService
.get<string>('projector_background_color') .get<string>('projector_background_color')
.subscribe(val => (this.projectorStyle['background-color'] = val)); .subscribe(val => (this.projectorStyle['background-color'] = val));
// projector logo / background-image
this.configService.get<boolean>('projector_enable_logo').subscribe(val => (this.enableLogo = val));
this.configService.get<{ path?: string }>('logo_projector_header').subscribe(val => {
if (val && val.path) {
this.headerFooterStyle['background-image'] = "url('" + val.path + "')";
}
});
// event data
this.configService.get<string>('general_event_name').subscribe(val => (this.eventName = val)); this.configService.get<string>('general_event_name').subscribe(val => (this.eventName = val));
this.configService.get<string>('general_event_description').subscribe(val => (this.eventDescription = val)); this.configService.get<string>('general_event_description').subscribe(val => (this.eventDescription = val));
this.configService.get<string>('general_event_date').subscribe(val => (this.eventDate = val)); this.configService.get<string>('general_event_date').subscribe(val => (this.eventDate = val));

View File

@ -48,7 +48,6 @@
*ngIf="user" *ngIf="user"
(keydown)="onKeyDown($event)" (keydown)="onKeyDown($event)"
> >
<!-- <h3 translate>Personal Data</h3> -->
<div *ngIf="isAllowed('seeName')"> <div *ngIf="isAllowed('seeName')">
<!-- Title --> <!-- Title -->
<mat-form-field <mat-form-field
@ -107,7 +106,7 @@
</mat-form-field> </mat-form-field>
<!-- Gender --> <!-- Gender -->
<mat-form-field class="form25 force-min-with" *ngIf="user.gender || editUser"> <mat-form-field class="form25 force-min-with" *ngIf="user.gender || (editUser && isAllowed('manage'))">
<mat-select placeholder="{{ 'Gender' | translate }}" formControlName="gender"> <mat-select placeholder="{{ 'Gender' | translate }}" formControlName="gender">
<mat-option>-</mat-option> <mat-option>-</mat-option>
<mat-option *ngFor="let gender of genderList" [value]="gender">{{ gender | translate }}</mat-option> <mat-option *ngFor="let gender of genderList" [value]="gender">{{ gender | translate }}</mat-option>

View File

@ -124,7 +124,7 @@
<mat-icon>cloud_upload</mat-icon> <mat-icon>cloud_upload</mat-icon>
<span translate>Import</span><span>&nbsp;...</span> <span translate>Import</span><span>&nbsp;...</span>
</button> </button>
</div>
<div *ngIf="isMultiSelect"> <div *ngIf="isMultiSelect">
<button mat-menu-item (click)="selectAll()"> <button mat-menu-item (click)="selectAll()">
<mat-icon>done_all</mat-icon> <mat-icon>done_all</mat-icon>
@ -192,7 +192,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</mat-menu> </mat-menu>
</mat-drawer-container> </mat-drawer-container>

View File

@ -16,6 +16,7 @@ from django.contrib.sites.shortcuts import get_current_site
from django.core import mail from django.core import mail
from django.core.exceptions import ValidationError as DjangoValidationError from django.core.exceptions import ValidationError as DjangoValidationError
from django.db import transaction from django.db import transaction
from django.http.request import QueryDict
from django.utils.encoding import force_bytes, force_text from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
@ -114,6 +115,7 @@ class UserViewSet(ModelViewSet):
self.permission_denied(request) self.permission_denied(request)
# This is a hack to make request.data mutable. Otherwise fields can not be deleted. # This is a hack to make request.data mutable. Otherwise fields can not be deleted.
if isinstance(request.data, QueryDict):
request.data._mutable = True request.data._mutable = True
# Remove fields that the user is not allowed to change. # Remove fields that the user is not allowed to change.
# The list() is required because we want to use del inside the loop. # The list() is required because we want to use del inside the loop.