Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into bugfix/#733-notification-created-when-uni…
Browse files Browse the repository at this point in the history
…t-hidden
  • Loading branch information
PatrickSkowronek authored May 28, 2018
2 parents 01f88bf + bbb7957 commit 3747c71
Show file tree
Hide file tree
Showing 62 changed files with 860 additions and 357 deletions.
2 changes: 1 addition & 1 deletion api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/webFrontend/src/app/about/about.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>About</h1>
<h1>{{ 'common.about' | translate }}</h1>

<app-general-info></app-general-info>

Expand Down
8 changes: 4 additions & 4 deletions app/webFrontend/src/app/admin/admin.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h1>Administration</h1>
<h1>{{ 'common.administration' | translate }}</h1>
<mat-toolbar>
<mat-toolbar-row>
<button mat-button routerLink="/admin/users">
<span>Users</span>
<span>{{ 'common.users' | translate }}</span>
</button>
<button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'imprint', header: 'Imprint'}" mat-button>
<span>Imprint</span>
<span>{{ 'common.imprint' | translate }}</span>
</button>
<button mat-button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'infoBox', header: 'InfoBox'}">
<span>InfoBox</span>
<span>{{ 'common.infobox' | translate }}</span>
</button>
</mat-toolbar-row>
</mat-toolbar>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h2>Users</h2>
<h2>{{ 'common.users' | translate }}</h2>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>E-Mail</th>
<th>Role</th>
<th>Actions</th>
<th>{{ 'common.name' | translate }}</th>
<th>{{ 'common.email' | translate }}</th>
<th>{{ 'common.role' | translate}}</th>
<th>{{ 'common.actions' | translate }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -20,10 +20,10 @@ <h2>Users</h2>
</mat-select>
</td>
<td>
<button mat-icon-button (click)="editUser(i)">
<button [matTooltip]="'user.editUser' | translate" mat-icon-button (click)="editUser(i)">
<mat-icon>edit</mat-icon>
</button>
<button mat-icon-button (click)="deleteUser(i)">
<button [matTooltip]="'user.deleteUser' | translate" mat-icon-button (click)="deleteUser(i)">
<mat-icon>delete</mat-icon>
</button>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="form-group" formGroupName="profile">
<mat-form-field>
<input matInput formControlName="lastName"
[placeholder]="'common.profile.lastName'|translate"/>
[placeholder]="'common.profileDetails.lastName'|translate"/>
<div *ngIf="resendActivationForm.get('profile').get('lastName').touched">
<small *ngIf="resendActivationForm.get('profile').get('lastName').hasError('required')"
class="text-danger">
Expand All @@ -36,7 +36,7 @@

<div>
<mat-form-field>
<input matInput formControlName="uid" [placeholder]="'common.profile.uid'|translate"/>
<input matInput formControlName="uid" [placeholder]="'common.profileDetails.uid' | translate"/>
<div *ngIf="resendActivationForm.controls.uid.touched">
<small *ngIf="resendActivationForm.controls.uid.hasError('required')" class="text-danger">
{{'common.validation.required'|translate}}
Expand Down Expand Up @@ -69,7 +69,7 @@

<div *ngIf="formError" class="text-danger" id="resendActivationFormError">{{formError}}</div>

<button mat-raised-button color="primary" type="submit"
<button [matTooltip]="'auth.resendActivation.tooltipResendAction' | translate" mat-raised-button color="primary" type="submit"
[disabled]="loading || !resendActivationForm?.valid">{{'common.send'|translate}}
</button>
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<p class="center">{{status}}</p>
<p class="center" [hidden]="!success">You can now follow <a routerLink="/login">this link</a> and use your account.</p>
<p class="center" [hidden]="!success">{{ 'activation.text.pleaseClick' | translate }}
<a routerLink="/login">{{ 'common.here' | translate}}</a> {{ 'activation.text.toUseYourAccount' | translate}}.</p>
2 changes: 1 addition & 1 deletion app/webFrontend/src/app/auth/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[disabled]="loading">
{{'common.login'|translate}}
</button>
<button mat-raised-button type="button" routerLink="/reset" routerLinkActive="active">
<button mat-raised-button [matTooltip]="'auth.tooltip.ForgotPassword' | translate" type="button" routerLink="/reset" routerLinkActive="active">
{{'auth.forgotPassword'|translate}}
</button>
</form>
Expand Down
8 changes: 4 additions & 4 deletions app/webFrontend/src/app/auth/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="form-group" formGroupName="profile">
<mat-form-field>
<input matInput formControlName="firstName"
[placeholder]="'common.profile.firstName'|translate" maxlength="64"/>
[placeholder]="'common.profileDetails.firstName'|translate" maxlength="64"/>
<div *ngIf="registerForm.get('profile').get('firstName').touched">
<small *ngIf="registerForm.get('profile').get('firstName').hasError('required')"
class="text-danger">
Expand All @@ -39,7 +39,7 @@
</mat-form-field>
<mat-form-field>
<input matInput formControlName="lastName"
[placeholder]="'common.profile.lastName'|translate" maxlength="64"/>
[placeholder]="'common.profileDetails.lastName'|translate" maxlength="64"/>
<div *ngIf="registerForm.get('profile').get('lastName').touched">
<small *ngIf="registerForm.get('profile').get('lastName').hasError('required')"
class="text-danger">
Expand Down Expand Up @@ -78,7 +78,7 @@

<div *ngIf="role == 'student'">
<mat-form-field>
<input matInput formControlName="uid" [placeholder]="'common.profile.uid'|translate"/>
<input matInput formControlName="uid" [placeholder]="'common.profileDetails.uid'|translate"/>
<div *ngIf="registerForm.controls.uid.touched">
<small *ngIf="uidError" class="text-danger">{{uidError}}</small>
<small *ngIf="registerForm.controls.uid.hasError('validateMatriculationNumber')" class="text-danger">
Expand All @@ -90,7 +90,7 @@

<app-password-input [form]="registerForm"></app-password-input>

<button mat-raised-button color="primary" type="submit"
<button [matTooltip]="'auth.registration.tooltipRegister' | translate" mat-raised-button color="primary" type="submit"
[disabled]="loading || !registerForm?.valid">{{'common.register'|translate}}
</button>
</form>
Expand Down
8 changes: 4 additions & 4 deletions app/webFrontend/src/app/auth/reset/reset.component.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<mat-card *ngIf="hasToken === false" class="reset-card">
<mat-card-header>
<mat-card-title><h1>Request password reset</h1></mat-card-title>
<mat-card-title><h1>{{ 'auth.resetPassword.requestReset' | translate }}</h1></mat-card-title>
</mat-card-header>

<mat-card-content>
<form name="form" (ngSubmit)="requestReset()" [formGroup]="resetForm">
<mat-form-field>
<input matInput formControlName="email" placeholder="Mail address">
<input matInput formControlName="email" [placeholder]="'common.email' | translate">
</mat-form-field>

<button mat-raised-button color="primary" class="mat-button" type="submit" [disabled]="loading">Submit</button>
<button mat-raised-button color="primary" [matTooltip]="'auth.tooltipResetPass' | translate" class="mat-button" type="submit" [disabled]="loading">{{ 'auth.resetPassword.requestReset' | translate }}</button>
<br>
</form>
</mat-card-content>
Expand All @@ -24,7 +24,7 @@

<app-password-input [form]="resetForm"></app-password-input>

<button mat-raised-button color="primary" type="submit" [disabled]="loading">Reset</button>
<button mat-raised-button [matTooltip]="'auth.tooltip.resetPassword' | translate" color="primary" type="submit" [disabled]="loading">{{ 'auth.resetPassword.reset' | translate }}</button>
</form>
</mat-card-content>
</mat-card>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


<div class="courses" *ngIf="expand">
<p class="subtitle" *ngIf="!courses.length">No courses added yet.</p>
<p class="subtitle" *ngIf="!courses.length">{{ 'course.text.noCourses' | translate }}</p>
<app-course *ngFor="let course of courses" [course]="course" (onLeave)="leaveCallback($event)" (onEnroll)="enrollCallback($event)"></app-course>
</div>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="course-header">
<button mat-icon-button color="primary" (click)="openDownloadDialog()" class="download-button">
<mat-icon aria-label="Download Units" mat-tooltip="Download Units">get_app</mat-icon>
<button mat-icon-button color="primary" [matTooltip]="'course.tooltip.download' | translate" (click)="openDownloadDialog()" class="download-button">
<mat-icon>get_app</mat-icon>
</button>
<h1>{{course?.name}}</h1>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h4 mat-line>{{file.name}}</h4>
<span class="spacer"></span>
<span class="lightgray"> {{unitDesc}} </span>
<mat-checkbox *ngIf="!this.showDL" [(ngModel)]="chkbox" (change)="emitEvent()" class="chkbox"></mat-checkbox>
<button mat-icon-button color="primary" *ngIf="this.showDL" class="dlButton" (click)="this.downloadFile()" matTooltip="Download this Unit">
<button mat-icon-button color="primary" *ngIf="this.showDL" class="dlButton" (click)="this.downloadFile()" matTooltip="{{ common.tooltipDownloadUnit | translate}}">
<mat-icon>file_download</mat-icon>
</button>
</mat-list-item>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="course-header">
<h1>Edit course</h1>
<h1>{{ 'course.text.editCourse' | translate }}</h1>
<a mat-button [routerLink]="['/course', id]" target="_blank" class="md-raised md-primary course-link">
<mat-icon>open_in_new</mat-icon>
Go to course
{{ 'course.text.goToCourse' | translate }}
</a>
</div>

Expand Down
25 changes: 15 additions & 10 deletions app/webFrontend/src/app/course/course-edit/course-edit.component.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {TitleService} from '../../shared/services/title.service';
import {TranslateService} from '@ngx-translate/core';

@Component({
selector: 'app-course-edit',
templateUrl: './course-edit.component.html',
styleUrls: ['./course-edit.component.scss']
})
export class CourseEditComponent implements OnInit {
export class CourseEditComponent {

id: string;
tabs = [
{ path: '.', label: 'General' },
{ path: 'content', label: 'Content' },
{ path: 'media', label: 'Media' },
{ path: 'members', label: 'Members' },
{ path: 'teachers', label: 'Teachers' },
];
tabs = [];

constructor(private route: ActivatedRoute,
private titleService: TitleService) {
private titleService: TitleService,
private translate: TranslateService) {
this.route.params.subscribe(params => {
this.id = params['id'];
});
}

ngOnInit() {
this.titleService.setTitle('Edit Course');
}
const lang = localStorage.getItem('lang') || this.translate.getBrowserLang() || this.translate.getDefaultLang();
this.translate.use(lang);

this.translate.get(['common.content', 'common.general', 'common.media', 'common.members', 'common.teachers']).subscribe((t: string) => {
this.tabs.push({ path: '.', label: t['common.general'] });
this.tabs.push({ path: 'content', label: t['common.content'] });
this.tabs.push({ path: 'media', label: t['common.media'] });
this.tabs.push({ path: 'members', label: t['common.members'] });
this.tabs.push({ path: 'teachers', label: t['common.teachers'] });
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</app-lecture-edit>
</div>

<p *ngIf="!course.lectures.length">No lectures added yet.</p>
<p *ngIf="!course.lectures.length">{{ 'lecture.text.noLecture' | translate }}</p>

<app-lecture-form *ngIf="isInMode('lecture', 'create')" (onSubmit)="createLecture($event)" [onCancel]="closeAddLecture"
actionLabel="Add"></app-lecture-form>
Expand All @@ -17,13 +17,13 @@

<app-mat-fab-menu class="fab" [open]="fabOpen" [onClick]="onFabClick"
[disabled]="isInMode('lecture', 'create') || isInMode('lecture', 'edit') || isInMode('unit', 'create') || isInMode('unit', 'edit')"
fabTooltip="Add content">
<div *ngIf="isLectureOpen()" (click)="onImportUnit()">Import unit</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('task')">Add tasks</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('file')">Add files</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('code-kata')">Add code-kata</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('video')">Add videos</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('free-text')">Add free text</div>
<div (click)="onImportLecture()">Import lecture</div>
<div (click)="onAddLecture()">Add lecture</div>
[fabTooltip]="'unit.addContent' | translate">
<div *ngIf="isLectureOpen()" (click)="onImportUnit()">{{ 'unit.import' | translate }}</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('task')">{{ 'unit.addTasks' | translate }}</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('file')">{{ 'unit.addFiles' | translate }}</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('code-kata')">{{ 'unit.addCodeKata' | translate }}</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('video')">{{ 'unit.addVideos' | translate }}</div>
<div *ngIf="isLectureOpen()" (click)="onAddUnit('free-text')">{{ 'unit.addFreeText' | translate }}</div>
<div (click)="onImportLecture()">{{ 'lecture.text.import' | translate }}</div>
<div (click)="onAddLecture()">{{ 'lecture.text.add' | translate }}</div>
</app-mat-fab-menu>
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ <h2>{{lecture.name}}</h2>
<mat-menu #lectureMenu="matMenu">
<button mat-menu-item (click)="onEditLecture(lecture)">
<mat-icon>edit</mat-icon>
Edit
{{ 'common.edit' | translate }}
</button>
<button mat-menu-item (click)="exportLecture(lecture)">
<mat-icon>file_download</mat-icon>
Export
{{ 'common.export' | translate }}
</button>
<button mat-menu-item (click)="duplicateLecture(lecture)">
<mat-icon>content_copy</mat-icon>
Duplicate
{{ 'common.duplicate' | translate }}
</button>
<button mat-menu-item (click)="deleteLecture(lecture)">
<mat-icon>delete</mat-icon>
Delete
{{ 'common.delete' | translate }}
</button>
</mat-menu>
</div>
Expand All @@ -47,20 +47,20 @@ <h2>{{lecture.name}}</h2>
<span class="unit-type">{{ unit.__t }}</span>
<span class="unit-date">{{ unit.updatedAt | date:"y-MM-dd" }}</span>
<span class="unit-actions">
<button mat-icon-button matTooltip="Edit" (click)="onEditUnit(unit)">
<button mat-icon-button (click)="onEditUnit(unit)">
<mat-icon>edit</mat-icon>
</button>
<button class="unit-menu-button" mat-icon-button [matMenuTriggerFor]="unitMenu">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #unitMenu="matMenu">
<button mat-icon-button matTooltip="Delete" (click)="deleteUnit(unit)">
<button mat-icon-button [matTooltip]="'lecture.tooltip.delete' | translate" (click)="deleteUnit(unit)">
<mat-icon>delete</mat-icon>
</button>
<button mat-icon-button matTooltip="Duplicate" (click)="duplicateUnit(unit)">
<button mat-icon-button [matTooltip]="'lecture.tooltip.duplicate' | translate" (click)="duplicateUnit(unit)">
<mat-icon>content_copy</mat-icon>
</button>
<button mat-icon-button matTooltip="Export" (click)="onExportUnit(unit)">
<button mat-icon-button [matTooltip]="'lecture.tooltip.download' | translate" (click)="onExportUnit(unit)">
<mat-icon>file_download</mat-icon>
</button>
</mat-menu>
Expand All @@ -77,7 +77,7 @@ <h2>{{lecture.name}}</h2>
</app-unit-form>
</div>

<p *ngIf="!lecture.units.length">No units added yet.</p>
<p *ngIf="!lecture.units.length">{{ 'lecture.noUnits' | translate}}</p>
</div>

<app-unit-form *ngIf="getDataForKey('unit-create-mode') && getDataForKey('unit-create-type')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

<!-- Multi-Select button area -->
<div class="btn__area">
<button class="text-fit" mat-raised-button matTooltip="Upload file"
<button class="text-fit" mat-raised-button [matTooltip]="'file.tooltip.uploadFile' | translate"
(click)="addFile()">
<mat-icon>add</mat-icon>
</button>
<!--<button class="text-fit" mat-raised-button matTooltip="Select all" (click)="selectAll()">-->
<!--<mat-icon>select_all</mat-icon>-->
<!--</button>-->
<button [disabled]="selectedFiles.length <= 1"
class="text-fit" mat-raised-button matTooltip="Remove file"
class="text-fit" mat-raised-button [matTooltip]="'file.text.fileRemove' | translate"
color="warn"
(click)="removeSelectedFile()">
<mat-icon>delete</mat-icon>
Expand Down Expand Up @@ -87,7 +87,7 @@
</mat-card>
</ng-container>
<p *ngIf="currentFolder?.files.length === 0">
No Files so far.
{{ 'file.text.noFiles' | translate }}
</p>
</div>
</div>
Expand Down
Loading

0 comments on commit 3747c71

Please sign in to comment.