aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/app
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-14 22:16:43 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-14 22:16:43 +0100
commit98b01bac2c2c4536aa97d826b61516657f4d15f5 (patch)
tree75fe2d75f1c58c6897127f03cfb7d8b654545227 /client/angular/app
parentdc8bc31be517a53e8fbe7100cfe45cd73f596de0 (diff)
downloadPeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.gz
PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.zst
PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.zip
Angular 2 : draft 2
Diffstat (limited to 'client/angular/app')
-rw-r--r--client/angular/app/app.component.html14
-rw-r--r--client/angular/app/app.component.scss6
-rw-r--r--client/angular/app/app.component.ts17
3 files changed, 32 insertions, 5 deletions
diff --git a/client/angular/app/app.component.html b/client/angular/app/app.component.html
index 590efa0d6..af41f8686 100644
--- a/client/angular/app/app.component.html
+++ b/client/angular/app/app.component.html
@@ -1,5 +1,19 @@
1<div class="container"> 1<div class="container">
2 2
3 <header class="row">
4 <div class="col-md-2">
5 <h4>PeerTube</h4>
6 </div>
7
8 <div class="col-md-8">
9 <input
10 type="text" id="search_video" name="search_video" class="form-control" placeholder="Search a video..."
11 #search (keyup.enter)="doSearch(search.value)"
12 >
13 </div>
14 </header>
15
16
3 <div class="row"> 17 <div class="row">
4 18
5 <menu class="col-md-2"> 19 <menu class="col-md-2">
diff --git a/client/angular/app/app.component.scss b/client/angular/app/app.component.scss
index 03ecba8f2..346460a31 100644
--- a/client/angular/app/app.component.scss
+++ b/client/angular/app/app.component.scss
@@ -1,3 +1,9 @@
1header div {
2 height: 50px;
3 line-height: 25px;
4 margin-bottom: 30px;
5}
6
1menu { 7menu {
2 min-height: 300px; 8 min-height: 300px;
3 height: 100%; 9 height: 100%;
diff --git a/client/angular/app/app.component.ts b/client/angular/app/app.component.ts
index 3d41183f2..cb961a3c8 100644
--- a/client/angular/app/app.component.ts
+++ b/client/angular/app/app.component.ts
@@ -1,6 +1,6 @@
1import { Component, ElementRef } from 'angular2/core'; 1import { Component, ElementRef } from 'angular2/core';
2import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router'; 2import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from 'angular2/router';
3import {HTTP_PROVIDERS} from 'angular2/http'; 3import { HTTP_PROVIDERS } from 'angular2/http';
4 4
5import { VideosAddComponent } from '../videos/components/add/videos-add.component'; 5import { VideosAddComponent } from '../videos/components/add/videos-add.component';
6import { VideosListComponent } from '../videos/components/list/videos-list.component'; 6import { VideosListComponent } from '../videos/components/list/videos-list.component';
@@ -36,15 +36,22 @@ import { FriendsService } from '../friends/services/friends.service';
36}) 36})
37 37
38export class AppComponent { 38export class AppComponent {
39 constructor(private _friendsService: FriendsService) {} 39 constructor(private _friendsService: FriendsService, private _router: Router) {}
40
41 doSearch(search: string) {
42 if (search !== '') {
43 this._router.navigate(['VideosList', { search: search }]);
44 } else {
45 this._router.navigate(['VideosList']);
46 }
47 }
40 48
41 makeFriends() { 49 makeFriends() {
42 this._friendsService.makeFriends().subscribe( 50 this._friendsService.makeFriends().subscribe(
43 status => { 51 status => {
44 if (status === 409) { 52 if (status === 409) {
45 alert('Already made friends!'); 53 alert('Already made friends!');
46 } 54 } else {
47 else {
48 alert('Made friends!'); 55 alert('Made friends!');
49 } 56 }
50 }, 57 },