Skip to content

Commit

Permalink
Merge pull request #28 from dhlab-basel/wip/remove-googleapis
Browse files Browse the repository at this point in the history
chore: Remove Google APIs and replaced by self-hosting fonts and icons
  • Loading branch information
kilchenmann authored Jun 20, 2019
2 parents a86f17f + 5424754 commit fd14585
Show file tree
Hide file tree
Showing 41 changed files with 1,683 additions and 36 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It's a system for annotation and linkage of sources in arts and humanities.
This project was generated with
[Angular CLI](https://github.com/angular/angular-cli) version 7.0.4.

**Required version of Knora: [v8.0.0](https://github.com/dhlab-basel/Knora/releases/tag/v8.0.0)**

Developed by the [DaSCH Team](https://dasch.swiss) in Basel.

## Development server
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuirl",
"version": "1.0.0",
"version": "1.2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down Expand Up @@ -38,6 +38,7 @@
"jdnconvertiblecalendardateadapter": "^0.0.9",
"json2typescript": "^1.0.6",
"jsonld": "^1.1.0",
"material-icons": "^0.3.1",
"moment": "^2.22.2",
"openseadragon": "^2.4.0",
"rxjs": "~6.4.0",
Expand Down Expand Up @@ -70,4 +71,4 @@
"tslint": "~5.11.0",
"typescript": "3.2.4"
}
}
}
7 changes: 6 additions & 1 deletion src/app/app-global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ export class AppGlobal {
icon: 'dashboard'
},
*/
{
label: 'Dashboard',
route: '/dashboard',
icon: 'dashboard'
},
{
label: 'Your Projects',
route: '/projects',
icon: 'all_inbox'
icon: 'assignment'
},
{
label: 'Your Collections',
Expand Down
6 changes: 3 additions & 3 deletions src/app/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h4 class="mat-subheading-2">The tool is designed to work with qualitative data.
kind
of media with each other.</h4>
<mat-divider class="more-space-bottom"></mat-divider>
<a mat-raised-button [color]="'accent'" href="https://wwww.dasch.swiss/team">Please contact us</a>
<a mat-raised-button [color]="'accent'" href="https://dasch.swiss/team">Please contact us</a>
</div>

<div *ngSwitchCase="'quantitative'">
Expand Down Expand Up @@ -147,7 +147,7 @@ <h2 class="mat-title">Partner institutions</h2>
</p>
</div>
<div class="box contact">
<a mat-button href="https://www.dasch.swiss">Data and Service Center for the Humanities</a>
<a mat-button href="https://dasch.swiss">Data and Service Center for the Humanities</a>
<a mat-button href="https://www.google.com/maps/place/Bernoullistrasse+32%2C+4056+Basel">
<mat-icon>location_on</mat-icon> Bernoullistrasse 32, 4056 Basel
</a>
Expand Down Expand Up @@ -192,7 +192,7 @@ <h2 class="mat-title">Partner institutions</h2>
<!-- copyright info -->
<div class="panel no-padding">
<p class="mat-caption">
<a href="http://www.dasch.swiss">DaSCH</a> @ <a href="https://unibas.ch">University of Basel</a> &copy;
<a href="https://dasch.swiss">DaSCH</a> @ <a href="https://unibas.ch">University of Basel</a> &copy;
2018 - {{currentYear.getFullYear()}}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="mat-title">{{list.length | i18nPlural: itemPluralMapping['title']}}</
<!-- logo -->
<td class="avatar-cell">
<mat-icon mat-list-icon>
<span *ngIf="status">inbox</span>
<span *ngIf="status">assignment</span>
<span *ngIf="!status">lock</span>
</mat-icon>
<!-- QUESTION: should we show the project logo
Expand Down
7 changes: 5 additions & 2 deletions src/app/system/status/status.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<div>
- Connectio to knora <br>
- Connection to sipi
<h3>Not yet implemented! But this page will monitor some tools, showing the status...</h3>

<p>
- Connection to knora <br>
- Connection to sipi
</p>

</div>
3 changes: 2 additions & 1 deletion src/app/user/user-menu/user-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<div class="menu-content">

<mat-list class="navigation">
<mat-list-item *ngFor="let item of navigation; let i = index;" class="nav-item">
<mat-list-item *ngFor="let item of navigation; let i = index;" class="nav-item"
[class.border-bottom]="i===0">
<button mat-button [routerLink]="item.route" routerLinkActive="active-link" class="nav-item button">
<mat-icon class="prefix">{{item.icon}}</mat-icon>
<span class="label">{{item.label}}</span>
Expand Down
27 changes: 19 additions & 8 deletions src/app/user/user-menu/user-menu.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AuthenticationService } from '@knora/authentication';
import { ApiServiceError, User, UsersService } from '@knora/core';
import { User, UsersService, ApiServiceError } from '@knora/core';
import { AppGlobal } from 'src/app/app-global';
import { CacheService } from 'src/app/main/cache/cache.service';
import { MenuItem } from '../../main/declarations/menu-item';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
selector: 'app-user-menu',
Expand All @@ -21,17 +21,28 @@ export class UserMenuComponent implements OnInit {

navigation: MenuItem[];

constructor(
constructor (
private _auth: AuthenticationService,
private _usersService: UsersService,
private _cache: CacheService,
private _location: Location,
private _router: Router
) {}
) { }

ngOnInit() {
this.navigation = AppGlobal.userNav;
this.username = JSON.parse(localStorage.getItem('session')).user.name;
this.sysAdmin = JSON.parse(localStorage.getItem('session')).user.sysAdmin;

this._cache.get(this.username, this._usersService.getUserByUsername(this.username));
this._cache.get(this.username, this._usersService.getUserByUsername(this.username)).subscribe(
(result: User) => {
this.user = result;
},
(error: ApiServiceError) => {
console.error(error);
}
);
}

logout() {
Expand All @@ -41,9 +52,9 @@ export class UserMenuComponent implements OnInit {
this._cache.destroy();

// reload the page
this._router.navigateByUrl('/refresh', {skipLocationChange: true}).then(() => {
this._router.navigate([this._location.path()]);
}
this._router.navigateByUrl('/refresh', { skipLocationChange: true }).then(() => {
this._router.navigate([this._location.path()]);
}
);
}
}
12 changes: 7 additions & 5 deletions src/app/user/user.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

<div class="content-container">
<nav mat-tab-nav-bar mat-align-tabs="left" class="tab-bar" animationDuration="0ms">
<a mat-tab-link *ngFor="let link of navigation" [routerLink]="link.route" routerLinkActive="active-tab"
#rla="routerLinkActive" [active]="rla.isActive">
<mat-icon class="tab-icon">{{link.icon}}</mat-icon>
{{link.label}}
</a>
<span *ngFor="let link of navigation; let i = index">
<a mat-tab-link *ngIf="i > 0" [routerLink]="link.route" routerLinkActive="active-tab"
#rla="routerLinkActive" [active]="rla.isActive">
<mat-icon class="tab-icon">{{link.icon}}</mat-icon>
{{link.label}}
</a>
</span>
</nav>

<!-- main content: router outlet -->
Expand Down
Binary file added src/assets/fonts/roboto-v19-latin-300.eot
Binary file not shown.
Loading

0 comments on commit fd14585

Please sign in to comment.