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

Commit

Permalink
Merge pull request #781 from utetrapp/feature/#768_add_impressum_2
Browse files Browse the repository at this point in the history
Feature/#768 add impressum
  • Loading branch information
PatrickSkowronek authored Jun 14, 2018
2 parents 5a25dd3 + 4480527 commit 882a9db
Show file tree
Hide file tree
Showing 22 changed files with 156 additions and 53 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
-->

## [NEXT]
###Added
- Added more EN/DE translation [#753](https://github.com/utetrapp/geli/issues/753)

### Added
- Course Progress can now be extracted into a csv-file. [#766](https://github.com/utetrapp/geli/pull/766)
- Added more EN/DE translation [#753](https://github.com/utetrapp/geli/issues/753)
- Use i18n for new course view [#763](https://github.com/utetrapp/geli/pull/763)
- Added service for FileIcon [#607](https://github.com/utetrapp/geli/issues/607)
- Added legal notice and privacy declaration [#768](https://github.com/utetrapp/geli/issues/768)
- Add more tests notification ctrl [#772](https://github.com/utetrapp/geli/pull/772)
- Added more EN/DE translation [#753](https://github.com/utetrapp/geli/issues/753)

### Changed
- rework existing translation
Expand Down
6 changes: 3 additions & 3 deletions api/src/config/errorCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ export const errorCodes = {
}
},
save: {
couldNotSaveImprint: {
code: 'coldNotSaveImprint',
text: 'Could not save Imprint'
couldNotSaveLegalnotice: {
code: 'coldNotSaveLegalnotice',
text: 'Could not save legal notice'
}
},
query: {
Expand Down
20 changes: 10 additions & 10 deletions api/src/controllers/ConfigController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {Config} from '../models/Config';
import passportJwtMiddleware from '../security/passportJwtMiddleware';

const publicConfigs = [
new RegExp('imprint|infoBox'),
new RegExp('legalnotice|infoBox|privacy'),
new RegExp('downloadMaxFileSize')
];

Expand All @@ -32,15 +32,15 @@ export class ConfigController {
* @apiName GetConfigPublic
* @apiGroup Config
*
* @apiParam {String} id Config name (e.g. imprint).
* @apiParam {String} id Config name (e.g. legalnotice).
*
* @apiSuccess {Config} config Public config.
*
* @apiSuccessExample {json} Success-Response:
* {
* "name":"imprint",
* "name":"legalnotice",
* "updatedAt": "2018-03-20T21:04:41.696Z",
* "value":"This will show the imprint.",
* "value":"This will show the legalnotice.",
* "__v": 0,
* "createdAt": "2018-03-20T21:04:41.696Z"
* }
Expand Down Expand Up @@ -71,7 +71,7 @@ export class ConfigController {
* @apiGroup Config
* @apiPermission admin
*
* @apiParam {String} id Config name (e.g. imprint).
* @apiParam {String} id Config name (e.g. legalnotice).
* @apiParam {Object} data New data.
*
* @apiSuccess {Config} config Updated config.
Expand All @@ -93,9 +93,9 @@ export class ConfigController {
* "_doc": {
* "createdAt": "2018-03-20T21:04:41.696Z",
* "__v": 0,
* "value": "This will show the imprint.",
* "value": "This will show the legalnotice.",
* "updatedAt": "2018-03-20T21:04:41.696Z",
* "name": "imprint",
* "name": "legalnotice",
* "_id": {...}
* },
* "$init": true
Expand Down Expand Up @@ -125,15 +125,15 @@ export class ConfigController {
* @apiGroup Config
* @apiPermission admin
*
* @apiParam {String} id Config name (e.g. imprint).
* @apiParam {String} id Config name (e.g. legalnotice).
*
* @apiSuccess {Config} config Config.
*
* @apiSuccessExample {json} Success-Response:
* {
* "name":"imprint",
* "name":"legalnotice",
* "updatedAt": "2018-03-20T21:04:41.696Z",
* "value":"This will show the imprint.",
* "value":"This will show the legalnotice.",
* "__v": 0,
* "createdAt": "2018-03-20T21:04:41.696Z"
* }
Expand Down
12 changes: 6 additions & 6 deletions api/test/integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ describe('Config', () => {
res.body.name.should.be.equal('UnauthorizedError');
});

it('should pass (imprint)', async () => {
it('should pass (legalnotice)', async () => {
const res = await chai.request(app)
.get(`${BASE_URL}/public/imprint`)
.get(`${BASE_URL}/public/legalnotice`)
.catch(err => err.response);
res.status.should.be.equal(200);
res.body.name.should.be.equal('imprint');
res.body.name.should.be.equal('legalnotice');
});
});

describe(`PUT ${BASE_URL}/imprint`, () => {
describe(`PUT ${BASE_URL}/legalnotice`, () => {
it('should pass', async () => {
const admin = await FixtureUtils.getRandomAdmin();

const res = await chai.request(app)
.put(`${BASE_URL}/imprint`)
.put(`${BASE_URL}/legalnotice`)
.set('Authorization', `JWT ${JwtUtils.generateToken(admin)}`)
.send({data: '# Imprint'});
.send({data: '# Legalnotice'});
res.status.should.be.equal(200);
});
});
Expand Down
7 changes: 5 additions & 2 deletions app/webFrontend/src/app/admin/admin.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ <h1>{{ 'common.administration' | translate }}</h1>
<button mat-button routerLink="/admin/users">
<span>{{ 'common.users' | translate }}</span>
</button>
<button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'imprint', header: 'Imprint'}" mat-button>
<span>{{ 'common.imprint' | translate }}</span>
<button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'legalnotice', header: 'Legal notice'}" mat-button>
<span>{{ 'common.legalnotice' | translate }}</span>
</button>
<button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'privacy', header: 'Privacy'}" mat-button>
<span>{{ 'common.privacy' | translate }}</span>
</button>
<button mat-button [routerLink]="['/admin/markdownEdit']" [queryParams]="{type: 'infoBox', header: 'InfoBox'}">
<span>{{ 'common.infobox' | translate }}</span>
Expand Down
11 changes: 8 additions & 3 deletions app/webFrontend/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {StartComponent} from './start/start.component';
import {AboutComponent} from './about/about.component';
import {ResetComponent} from './auth/reset/reset.component';
import {RouterModule, Routes} from '@angular/router';
import {ImprintComponent} from './imprint/imprint.component';
import {LegalnoticeComponent} from './legalnotice/legalnotice.component';
import {PrivacyComponent} from './privacy/privacy.component';
import {UserSettingsComponent} from './user/user-settings/user-settings.component';
import {AuthGuardService} from './shared/services/auth-guard.service';
import {ActivationResendComponent} from './auth/activation-resend/activation-resend.component';
Expand Down Expand Up @@ -38,8 +39,12 @@ const routes: Routes = [
component: AboutComponent
},
{
path: 'imprint',
component: ImprintComponent
path: 'legalnotice',
component: LegalnoticeComponent
},
{
path: 'privacy',
component: PrivacyComponent
},
{
path: 'userSettings',
Expand Down
8 changes: 6 additions & 2 deletions app/webFrontend/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@
<mat-icon>info</mat-icon>
<span>{{ 'mainMenu.about' | translate }}</span>
</button>
<button mat-menu-item routerLink="/imprint" routerLinkActive="active">
<button mat-menu-item routerLink="/legalnotice" routerLinkActive="active">
<mat-icon>info</mat-icon>
<span>{{ 'mainMenu.imprint' | translate }}</span>
<span>{{ 'mainMenu.legalnotice' | translate }}</span>
</button>
<button mat-menu-item routerLink="/privacy" routerLinkActive="active">
<mat-icon>info</mat-icon>
<span>{{ 'mainMenu.privacy' | translate }}</span>
</button>
<button mat-menu-item *ngIf="isLoggedIn()" (click)="logout()" routerLink="" routerLinkActive="active">
<mat-icon>exit_to_app</mat-icon>
Expand Down
6 changes: 4 additions & 2 deletions app/webFrontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {AdminModule} from './admin/admin.module';
import {ReportService} from './shared/services/data/report.service';
import {TitleService} from './shared/services/title.service';
import {ThemeService} from './shared/services/theme.service';
import {ImprintModule} from './imprint/imprint.module';
import {LegalnoticeModule} from './legalnotice/legalnotice.module';
import {DataSharingService} from './shared/services/data-sharing.service';
import {NotificationModule} from './notification/notification.module';
import {HttpClient} from '@angular/common/http';
Expand All @@ -47,6 +47,7 @@ import {SnackBarService} from './shared/services/snack-bar.service';
import {UnitFormService} from './shared/services/unit-form.service';
import {UnitFactoryService} from './shared/services/unit-factory.service';
import {FileIconService} from './shared/services/file-icon.service';
import { PrivacyComponent } from './privacy/privacy.component';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
Expand All @@ -56,6 +57,7 @@ export function HttpLoaderFactory(http: HttpClient) {
@NgModule({
declarations: [
AppComponent,
PrivacyComponent,
],
imports: [
BrowserModule,
Expand All @@ -68,7 +70,7 @@ export function HttpLoaderFactory(http: HttpClient) {
AboutModule,
SharedModule,
AdminModule,
ImprintModule,
LegalnoticeModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
Expand Down
2 changes: 0 additions & 2 deletions app/webFrontend/src/app/imprint/imprint.component.html

This file was deleted.

38 changes: 38 additions & 0 deletions app/webFrontend/src/app/legalnotice/legalnotice.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- <div [innerHtml]="renderedContent"></div> -->

<h1>Impressum</h1>

<h3>Anbieter</h3>

<span>
<p>Hochschule Darmstadt – Fachbereich Informatik<br>
Haardtring 100<br>
D-64295 Darmstadt</p>
</span>

<h3>Leitung:</h3>
<p>Prof. Dr. Ute Trapp</p>


<h3>Gestaltung und Umsetzung:</h3>
<p>seit Master Projekt Systementwicklung SS 2017</p>

<h3>Inhalt</h3>
<span>
<p>Der Fachbereich Informatik ist um die Richtigkeit und Aktualität der auf dieser Internetpräsenz bereitgestellten Informationen bemüht. Der Fachbereich Informatik übernimmt jedoch keinerlei Gewähr für die Richtigkeit, Vollständigkeit und Aktualität der bereitgestellten Daten.</p>

<p>Sollten wiedererwartend doch fehlerhafte Angaben bereitgestellt werden,so übernimmt der Fachbereich Informatik keinerlei Haftung für durch die Nutzung dieser fehlerhaften Angaben enstandenen Schäden, egal ob materieller oder immaterieller Art.</p>
</span>

<h3>Links und Verweise</h3>
<span>
<p>Der Fachbereich Informatik hat keinen Einfluss auf die aktuelle oder zukünftige Gestaltung der verlinkten Internetseiten. Werden nach der Linksetzung Veränderungen an den verlinkten Inhalten vorgenommen, so distanziert sich der Fachbereich Informatik ausdrücklich von diesen Inhalten und möchte sich diese auch nicht zu Eigen machen.</p>

<p>Bei den verlinkten Internetseiten, die außerhalb des Verantwortungsbereiches des Fachbereichs Informatik liegen, würde eine Haftungsverpflichtung ausschließlich in dem Fall in Kraft treten, in dem der Fachbereich Informatik von den Inhalten Kenntnis hat und es ihm technisch möglich und zumutbar wäre, die Nutzung im Falle rechtswidriger Inhalte zu verhindern.</p>
</span>

<h3>Datenschutz</h3>
<p>Sollte auf den Internetseiten des Fachbereichs Informatik die Eingabe persönlicher Daten möglich sein, so erfolgt dies ausschliesslich auf freiwilliger Basis des Nutzers. Die dabei erfassten Daten werden ausschließlich für Verwaltungszwecke und nicht an Dritte weitergegeben.</p>

<h3>Rechtswirksamkeit</h3>
<p>Dieser Haftungsausschluss ist als Teil des Internetangebotes zu betrachten, von dem aus auf diese Seite verwiesen wurde. Sofern Teile oder einzelne Formulierungen dieses Textes der geltenden Rechtslage nicht, nicht mehr oder nicht vollständig entsprechen sollten, bleiben die übrigen Teile des Dokumentes in ihrem Inhalt und ihrer Gültigkeit davon unberührt.</p>
25 changes: 25 additions & 0 deletions app/webFrontend/src/app/legalnotice/legalnotice.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LegalnoticeComponent } from './legalnotice.component';

describe('LegalnoticeComponent', () => {
let component: LegalnoticeComponent;
let fixture: ComponentFixture<LegalnoticeComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LegalnoticeComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(LegalnoticeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import {TitleService} from '../shared/services/title.service';

@Component({
selector: 'app-imprint',
templateUrl: './imprint.component.html',
styleUrls: ['./imprint.component.scss']
templateUrl: './legalnotice.component.html',
styleUrls: ['./legalnotice.component.scss']
})
export class ImprintComponent implements OnInit {
export class LegalnoticeComponent implements OnInit {
renderedContent: string;
constructor(private imprintService: ImprintAndInfoService,
private titleService: TitleService) { }

ngOnInit() {
this.titleService.setTitle('Imprint');
this.titleService.setTitle('Legalnotice');
this.getData();
}

async getData() {
this.renderedContent = await this.imprintService.loadConfig('imprint');
this.renderedContent = await this.imprintService.loadConfig('legalnotice');
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ImprintComponent} from './imprint.component';
import {LegalnoticeComponent} from './legalnotice.component';
import {SharedModule} from '../shared/shared.module';
import {RouterModule} from '@angular/router';

Expand All @@ -11,7 +11,7 @@ import {RouterModule} from '@angular/router';
RouterModule
],
declarations: [
ImprintComponent
LegalnoticeComponent
]
})
export class ImprintModule { }
export class LegalnoticeModule { }
1 change: 1 addition & 0 deletions app/webFrontend/src/app/privacy/privacy.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div [innerHtml]="renderedContent"></div>
Empty file.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ImprintComponent } from './imprint.component';
import { PrivacyComponent } from './privacy.component';

describe('ImprintComponent', () => {
let component: ImprintComponent;
let fixture: ComponentFixture<ImprintComponent>;
describe('PrivacyComponent', () => {
let component: PrivacyComponent;
let fixture: ComponentFixture<PrivacyComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ImprintComponent ]
declarations: [ PrivacyComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ImprintComponent);
fixture = TestBed.createComponent(PrivacyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down
23 changes: 23 additions & 0 deletions app/webFrontend/src/app/privacy/privacy.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import {ImprintAndInfoService} from '../shared/services/imprint-and-info.service';
import {TitleService} from '../shared/services/title.service';

@Component({
selector: 'app-privacy',
templateUrl: './privacy.component.html',
styleUrls: ['./privacy.component.scss']
})
export class PrivacyComponent implements OnInit {
renderedContent: string;
constructor(private imprintService: ImprintAndInfoService,
private titleService: TitleService) { }

ngOnInit() {
this.titleService.setTitle('Privacy');
this.getData();
}

async getData() {
this.renderedContent = await this.imprintService.loadConfig('privacy');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class AdminMarkdownEditComponent implements OnInit {
await this.service.updateItem({_id: this.type, data: markdown});
this.snackBar.open(this.headingType + ' saved');
} catch (err) {
this.snackBar.open(errorCodes.save.couldNotSaveImprint.text);
this.snackBar.open(errorCodes.save.couldNotSaveLegalnotice.text);
}
void this.loadConfig();
}
Expand Down
Loading

0 comments on commit 882a9db

Please sign in to comment.