diff --git a/frontend/app/admin/admin.component.html b/frontend/app/admin/admin.component.html index a355eb82..b8f7e3a1 100644 --- a/frontend/app/admin/admin.component.html +++ b/frontend/app/admin/admin.component.html @@ -1,9 +1,12 @@ <app-frame> - <md-card> - <md-card-title>User management</md-card-title> - <md-card-content> - - <button md-button (click)="addUser()">+ add user</button> - </md-card-content> - </md-card> + <div class="container"> + <div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title">User management</h3> + </div> + <div class="panel-body"> + <button class="button button-primary" (click)="addUser()">+ add user</button> + </div> + </div> + </div> </app-frame> diff --git a/frontend/app/admin/admin.component.ts b/frontend/app/admin/admin.component.ts index 90d9ce63..bab5c71c 100644 --- a/frontend/app/admin/admin.component.ts +++ b/frontend/app/admin/admin.component.ts @@ -3,16 +3,13 @@ import {Component, OnInit} from 'angular2/core'; import {AuthenticationService} from "../model/network/authentication.service.ts"; import {Router} from "angular2/router"; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; -import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; import {FrameComponent} from "../frame/frame.component"; @Component({ selector: 'admin', templateUrl: 'app/admin/admin.component.html', styleUrls:['app/admin/admin.component.css'], - directives:[MATERIAL_DIRECTIVES, FrameComponent], - providers:[MATERIAL_BROWSER_PROVIDERS] + directives:[FrameComponent] }) export class AdminComponent implements OnInit{ constructor(private _authService: AuthenticationService, private _router: Router) { diff --git a/frontend/app/admin/newuser/new.user.admin.component.ts b/frontend/app/admin/newuser/new.user.admin.component.ts index 1111808a..ede34669 100644 --- a/frontend/app/admin/newuser/new.user.admin.component.ts +++ b/frontend/app/admin/newuser/new.user.admin.component.ts @@ -1,16 +1,13 @@ import {Component} from 'angular2/core'; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; -import {MdDialogRef} from "ng2-material/components/dialog/dialog_ref"; @Component({ selector: 'admin-new-user', templateUrl: 'app/admin/newuser/new.user.admin.component.html', - styleUrls:['app/admin/newuser/new.user.admin.component.css'], - directives:[MATERIAL_DIRECTIVES] + styleUrls:['app/admin/newuser/new.user.admin.component.css'] }) export class NewUserComponent{ - constructor(private dialog: MdDialogRef) { + constructor() { } } diff --git a/frontend/app/app.component.ts b/frontend/app/app.component.ts index d2c8d554..48b1ce68 100644 --- a/frontend/app/app.component.ts +++ b/frontend/app/app.component.ts @@ -10,9 +10,7 @@ import {User} from "../../common/entities/User"; import {Router} from "angular2/router"; import {HTTP_PROVIDERS} from "angular2/http"; import {UserService} from "./model/network/user.service.ts"; -import {GalleryService} from "./gallery/gallery.service"; -import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; -import {ViewportHelper} from "ng2-material/core/util/viewport"; +import {GalleryService} from "./gallery/gallery.service"; import {AdminComponent} from "./admin/admin.component"; @@ -25,9 +23,7 @@ import {AdminComponent} from "./admin/admin.component"; ROUTER_PROVIDERS, UserService, GalleryService, - AuthenticationService,MATERIAL_BROWSER_PROVIDERS,ViewportHelper - - ] + AuthenticationService] }) @RouteConfig([ { diff --git a/frontend/app/frame/frame.component.html b/frontend/app/frame/frame.component.html index 26cb95a4..44d164ef 100644 --- a/frontend/app/frame/frame.component.html +++ b/frontend/app/frame/frame.component.html @@ -1,59 +1,21 @@ -<md-sidenav-container layout="row"> - - <md-sidenav name="menu" align="left" layout="column"> - <md-toolbar class="md-theme-light"> - <h1 class="md-toolbar-tools">PiGallery2</h1> - </md-toolbar> - <md-content layout-padding> - <button md-raised-button [routerLink]="['Gallery',{directory: '/'}]" class="md-primary"> - Gallery +<nav class="navbar navbar-inverse navbar-static-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" + aria-expanded="false" aria-controls="navbar"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> </button> - <button md-raised-button [routerLink]="['Admin']" class="md-primary"> - Admin - </button> - </md-content> - </md-sidenav> - - <!-- <div layout="column" style="height: 100vh; overflow-y: hidden;"> - <md-toolbar mdScrollShrink> - <div class="md-toolbar-tools"> - <button md-button class="md-icon-button md-primary" aria-label="Settings" (click)="showSideNav()"> - <i md-icon>more_vert</i> - </button> - <h3> - <span>PiGallery2</span> - </h3> - <span flex></span> - </div> - </md-toolbar> - - <ng-content></ng-content> - </div>--> - <md-content felx> - <nav class="navbar navbar-inverse navbar-static-top"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand" href="#">Project name</a> - </div> - <div id="navbar" class="collapse navbar-collapse"> - <ul class="nav navbar-nav"> - <li class="active"><a href="#">Gallery</a></li> - </ul> - </div><!--/.nav-collapse --> - </div> - </nav> - - <div class="container" style="width: 100%; padding:0px"> - - - <ng-content></ng-content> - - </div><!-- /.container --> - </md-content > -</md-sidenav-container> \ No newline at end of file + <a class="navbar-brand" href="#"><img src="icon_inv.png" style="max-height: 26px; display: inline;"/> PiGallery2</a> + </div> + <div id="navbar" class="collapse navbar-collapse"> + <ul class="nav navbar-nav"> + <li class="active"><a [routerLink]="['Gallery',{directory: '/'}]">Gallery</a></li> + <li><a [routerLink]="['Admin']">Admin</a></li> + </ul> + </div><!--/.nav-collapse --> + </div> +</nav> +<ng-content></ng-content> \ No newline at end of file diff --git a/frontend/app/frame/frame.component.ts b/frontend/app/frame/frame.component.ts index c5158806..a9f71ae8 100644 --- a/frontend/app/frame/frame.component.ts +++ b/frontend/app/frame/frame.component.ts @@ -1,25 +1,18 @@ ///<reference path="../../browser.d.ts"/> import {Component, ViewEncapsulation} from 'angular2/core'; -import {Router, RouterLink} from "angular2/router"; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; -import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; -import {ViewportHelper} from "ng2-material/all"; -import {SidenavService} from "ng2-material/all"; +import {RouterLink} from "angular2/router"; @Component({ selector: 'app-frame', templateUrl: 'app/frame/frame.component.html', - directives:[RouterLink,MATERIAL_DIRECTIVES], - providers: [SidenavService], + directives:[RouterLink], encapsulation: ViewEncapsulation.Emulated }) export class FrameComponent { - constructor( private _router: Router, public sidenav: SidenavService) { + constructor() { } - public showSideNav(){ - this.sidenav.show("menu"); - } + } diff --git a/frontend/app/gallery/directory/directory.gallery.component.ts b/frontend/app/gallery/directory/directory.gallery.component.ts index 9fe0ec25..a676d463 100644 --- a/frontend/app/gallery/directory/directory.gallery.component.ts +++ b/frontend/app/gallery/directory/directory.gallery.component.ts @@ -4,15 +4,11 @@ import {Component, Input, OnInit} from 'angular2/core'; import {Directory} from "../../../../common/entities/Directory"; import {RouterLink} from "angular2/router"; import {Utils} from "../../../../common/Utils"; -import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; -import {ViewportHelper} from "ng2-material/all"; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; @Component({ selector: 'gallery-directory', templateUrl: 'app/gallery/directory/directory.gallery.component.html', - directives:[RouterLink,MATERIAL_DIRECTIVES], - providers:[MATERIAL_BROWSER_PROVIDERS, ViewportHelper] + directives:[RouterLink], }) export class GalleryDirectoryComponent{ @Input() directory: Directory; diff --git a/frontend/app/gallery/gallery.component.html b/frontend/app/gallery/gallery.component.html index 9c0e378b..c7bc3f16 100644 --- a/frontend/app/gallery/gallery.component.html +++ b/frontend/app/gallery/gallery.component.html @@ -1,8 +1,9 @@ -<gallery-lightbox #lightbox></gallery-lightbox> +<gallery-lightbox #lightbox></gallery-lightbox> <app-frame> + <div class="container" style="width: 100%; padding:0"> <div *ngIf="currentDirectory" *ngFor="let directory of currentDirectory.directories"> <gallery-directory *ngIf="directory" [directory]="directory"></gallery-directory> </div> - <gallery-grid [directory]="currentDirectory" [lightbox]="lightbox" ></gallery-grid> - + <gallery-grid [directory]="currentDirectory" [lightbox]="lightbox"></gallery-grid> + </div> </app-frame> \ No newline at end of file diff --git a/frontend/app/gallery/gallery.component.ts b/frontend/app/gallery/gallery.component.ts index 3999bdab..f3102466 100644 --- a/frontend/app/gallery/gallery.component.ts +++ b/frontend/app/gallery/gallery.component.ts @@ -8,7 +8,6 @@ import {Directory} from "../../../common/entities/Directory"; import {Message} from "../../../common/entities/Message"; import {GalleryDirectoryComponent} from "./directory/directory.gallery.component"; import {GalleryGridComponent} from "./grid/grid.gallery.component"; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; import {FrameComponent} from "../frame/frame.component"; import {GalleryLightboxComponent} from "./lightbox/lightbox.gallery.component"; @@ -19,8 +18,7 @@ import {GalleryLightboxComponent} from "./lightbox/lightbox.gallery.component"; directives:[GalleryGridComponent, GalleryDirectoryComponent, GalleryLightboxComponent, - FrameComponent, - MATERIAL_DIRECTIVES] + FrameComponent] }) export class GalleryComponent implements OnInit{ diff --git a/frontend/app/login/login.component.html b/frontend/app/login/login.component.html index f0563d95..9c89e100 100644 --- a/frontend/app/login/login.component.html +++ b/frontend/app/login/login.component.html @@ -1,26 +1,13 @@ - - -<md-content class="md-padding" layout="row" layout-wrap layout-align="center start"> - <div flex-gt-lg="25" flex="50" flex-xs="100" layout="column"> - <md-card> - <md-card-title>Login</md-card-title> - <md-card-content> - <form (ngSubmit)="onSubmit()" #LoginForm="ngForm"> - <md-input-container class="md-block" flex-gt-sm> - <label>Username (or e-mail)</label> - <input md-input type="text" [(value)]="loginCredential.username" - ngControl="name" #name="ngForm" required > - </md-input-container> - <md-input-container class="md-block" flex-gt-sm> - <label>Password</label> - <input md-input type="password" [(value)]="loginCredential.password" - ngControl="password" #name="ngForm" required> - </md-input-container> - </form> - </md-card-content> - <md-card-actions layout="row" layout-align="end center"> - <button md-button [disabled]="!LoginForm.form.valid" (click)="onLogin()">LOGIN</button> - </md-card-actions> - </md-card> +<div class="container"> + <div class="col-sm-offset-3 col-sm-6 col-lg-4 col-lg-offset-4"> + <form class="form-signin" (ngSubmit)="onSubmit()" #LoginForm="ngForm"> + <h2 class="form-signin-heading">Please sign in</h2> + <input type="email" class="form-control" placeholder="Email address" autofocus + [(value)]="loginCredential.username" ngControl="name" #name="ngForm" required> + <input type="password" class="form-control" placeholder="Password" + [(value)]="loginCredential.password" ngControl="password" #name="ngForm" required> + <br/> + <button class="btn btn-lg btn-primary btn-block" [disabled]="!LoginForm.form.valid" (click)="onLogin()">Sign in</button> + </form> </div> -</md-content> +</div> <!-- /container --> diff --git a/frontend/app/login/login.component.ts b/frontend/app/login/login.component.ts index 0353c17e..70dffcf6 100644 --- a/frontend/app/login/login.component.ts +++ b/frontend/app/login/login.component.ts @@ -3,18 +3,14 @@ import {Component, OnInit} from 'angular2/core'; import {LoginCredential} from '../../../common/entities/LoginCredential'; import {AuthenticationService} from "../model/network/authentication.service.ts"; -import {Router} from "angular2/router"; -import {MATERIAL_DIRECTIVES} from "ng2-material/all"; -import {FORM_DIRECTIVES} from "angular2/common"; -import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; -import {ViewportHelper} from "ng2-material/all"; +import {Router} from "angular2/router"; +import {FORM_DIRECTIVES} from "angular2/common"; @Component({ selector: 'login', templateUrl: 'app/login/login.component.html', styleUrls:['app/login/login.component.css'], - directives:[MATERIAL_DIRECTIVES,FORM_DIRECTIVES], - providers:[MATERIAL_BROWSER_PROVIDERS, ViewportHelper] + directives:[FORM_DIRECTIVES] }) export class LoginComponent implements OnInit{ loginCredential: LoginCredential; diff --git a/frontend/icon_inv.png b/frontend/icon_inv.png new file mode 100644 index 00000000..32d122dc Binary files /dev/null and b/frontend/icon_inv.png differ diff --git a/frontend/index.ejs b/frontend/index.ejs index 1c7151a7..4a023843 100644 --- a/frontend/index.ejs +++ b/frontend/index.ejs @@ -6,7 +6,9 @@ <title>PiGallery2</title> <link rel="shortcut icon" href="icon.png"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> + <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" + integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" + crossorigin="anonymous"> <body > diff --git a/package.json b/package.json index 490d071b..72ee3157 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "mongoose": "^4.4.14", "morgan": "^1.7.0", "ng2-cookies": "^0.1.5", - "ng2-material": "^0.3.7", "optimist": "^0.6.1", "rxjs": "5.0.0-beta.6", "ts-loader": "^0.8.2",