#13 finished home page

Обединени
ElliottStansbury обедини 29 ревизии от ElliottStansbury/JhipsterGroupProject-Client:home във home преди 7 години

+ 1
- 1
src/main/resources/templates/error.html Целия файл

@@ -3,7 +3,7 @@
3 3
       xsi:schemaLocation="http://www.thymeleaf.org ">
4 4
 <head>
5 5
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6
-    <link rel="shortcut icon" href="${baseUrl}/favicon.ico" />
6
+    <link rel="shortcut icon" href="${baseUrl}/fa" />
7 7
     <title>Your request cannot be processed</title>
8 8
     <style>
9 9
         ::-moz-selection {

+ 1
- 1
src/main/resources/templates/mail/creationEmail.html Целия файл

@@ -3,7 +3,7 @@
3 3
     <head>
4 4
         <title th:text="#{email.activation.title}">JHipster creation</title>
5 5
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
-        <link rel="shortcut icon" th:href="@{|${baseUrl}/favicon.ico|}" />
6
+        <link rel="shortcut icon" th:href="@{|${baseUrl}/faceofbooks4.png|}" />
7 7
     </head>
8 8
     <body>
9 9
         <p th:text="#{email.activation.greeting(${user.login})}">

+ 1
- 1
src/main/webapp/404.html Целия файл

@@ -4,7 +4,7 @@
4 4
     <meta charset="utf-8">
5 5
     <title>Page Not Found</title>
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1">
7
-    <link rel="shortcut icon" href="favicon.ico" />
7
+    <link rel="shortcut icon" href="faceofbooks4.png" />
8 8
     <style>
9 9
 
10 10
         * {

+ 10
- 7
src/main/webapp/app/FaeBoo/Profile-head/profile-head.component.html Целия файл

@@ -3,19 +3,19 @@
3 3
     <div class = "friend-cont">
4 4
 
5 5
         <div class="friend-pic friend4" id = "friend7">
6
-            <img class ="friend-photo friend4" src = "../../../content/images/defaultphoto.png">
6
+            <img class ="friend-photo friend4" src = "../../../content/images/faceofbooks3.jpg">
7 7
         </div>
8 8
 
9 9
         <div class="friend-pic friend3" id = "friend5">
10
-            <img class ="friend-photo friend3" src = "../../../content/images/defaultphoto.png">
10
+            <img class ="friend-photo friend3" src = "../../../content/images/faceofbooks4.png">
11 11
         </div>
12 12
 
13 13
         <div class="friend-pic friend2" id = "friend3">
14
-            <img class ="friend-photo" src = "../../../content/images/defaultphoto.png">
14
+            <img class ="friend-photo" src = "../../../content/images/faceofbooks2.jpg">
15 15
         </div>
16 16
 
17 17
         <div class="friend-pic friend1" id = "friend1">
18
-            <img class ="friend-photo" src = "../../../content/images/defaultphoto.png">
18
+            <img class ="friend-photo" src = "../../../content/images/faceofbooks1.png">
19 19
         </div>
20 20
 
21 21
         <div class = "profile-pic">
@@ -67,13 +67,16 @@
67 67
                 <div class = "button-holder"><button class = "postBtn">Schedule</button></div>
68 68
                 <div class = "button-holder"><button class = "postBtn">Memo</button></div>
69 69
                 <div class = "button-holder"><button class = "postBtn">Photo</button></div>
70
-                <div class = "button-holder"><button class = "postBtn" (click)="submitPost();">Submit</button></div>
70
+                <div class = "button-holder"><button class = "postBtn" (click)="submitPost();loadAll();">Submit</button></div>
71 71
             </div>
72 72
 
73 73
             <p id = "msg">Create a post...</p>
74 74
         </div>
75
-
76
-
77 75
     </div>
78 76
 
77
+    <div id = "post-container">
78
+            <div *ngFor="let post of posts;trackBy: trackId" class = "single-post">
79
+                {{post.content}}
80
+            </div>
81
+    </div>
79 82
 </div>

+ 54
- 9
src/main/webapp/app/FaeBoo/Profile-head/profile-head.component.ts Целия файл

@@ -1,23 +1,64 @@
1
-import { Component } from '@angular/core';
1
+import { Component, OnInit } from '@angular/core';
2 2
 import { PostService } from 'app/entities/post';
3 3
 import { IPost } from 'app/shared/model/post.model';
4
-import { IUser } from 'app/core';
4
+import { IUser, Principal } from 'app/core';
5 5
 import { Observable } from 'rxjs';
6 6
 import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
7
+import { JhiAlertService } from 'ng-jhipster';
7 8
 
8 9
 @Component({
9 10
     selector: 'jhi-profile-head',
10 11
     templateUrl: './profile-head.component.html',
11 12
     styleUrls: ['profile-head.css']
12 13
 })
13
-export class ProfileHeadComponent {
14
+export class ProfileHeadComponent implements OnInit {
14 15
     str: string;
15 16
     post: IPost;
16 17
     user: IUser;
17 18
     isSaving: boolean;
18 19
     testPost: IPost;
20
+    posts: IPost[];
19 21
 
20
-    constructor(private postService: PostService) {}
22
+    constructor(private postService: PostService, private jhiAlertService: JhiAlertService) {}
23
+
24
+    ngOnInit() {
25
+        this.loadAll();
26
+    }
27
+
28
+    trackId(index: number, item: IPost) {
29
+        return item.id;
30
+    }
31
+
32
+    loadAll() {
33
+        this.postService.query().subscribe(
34
+            (res: HttpResponse<IPost[]>) => {
35
+                this.posts = res.body;
36
+            },
37
+            (res: HttpErrorResponse) => this.onError(res.message)
38
+        );
39
+    }
40
+
41
+    private onError(errorMessage: string) {
42
+        this.jhiAlertService.error(errorMessage, null, null);
43
+    }
44
+
45
+    getPost(): void {
46
+        console.log('2');
47
+        this.testPost = new class implements IPost {
48
+            content: string;
49
+            dislikes: number;
50
+            id: number;
51
+            likes: number;
52
+            numberOfComments: number;
53
+            owner: IUser;
54
+        }();
55
+        this.testPost.content = 'This is a test';
56
+        this.testPost.numberOfComments = 0;
57
+        this.testPost.likes = 0;
58
+        this.testPost.dislikes = 0;
59
+        this.testPost.id = 0;
60
+        // this.testPosts.push(this.testPost);
61
+    }
21 62
 
22 63
     submitPost(): void {
23 64
         this.post = new class implements IPost {
@@ -32,15 +73,19 @@ export class ProfileHeadComponent {
32 73
         this.post.dislikes = 0;
33 74
         this.post.likes = 0;
34 75
         this.post.numberOfComments = 0;
35
-        if (this.post.content.length > 1) {
36
-            this.save(this.post);
37
-        }
76
+        this.save(this.post);
77
+        this.str = '';
38 78
     }
39 79
 
40 80
     save(post: IPost) {
41 81
         this.isSaving = true;
42
-        this.subscribeToSaveResponse(this.postService.create(post));
43
-        console.log('post created');
82
+        const self = this;
83
+        this.postService
84
+            .create(post)
85
+            .toPromise()
86
+            .then(function(response) {
87
+                self.loadAll();
88
+            });
44 89
     }
45 90
 
46 91
     private subscribeToSaveResponse(result: Observable<HttpResponse<IPost>>) {

+ 20
- 0
src/main/webapp/app/FaeBoo/Profile-head/profile-head.css Целия файл

@@ -158,3 +158,23 @@ hr {
158 158
     grid-column-start: 1;
159 159
     grid-row-start: 2;
160 160
 }
161
+
162
+#post-container {
163
+    width: 65%;
164
+    min-height: 250px;
165
+    margin: auto;
166
+    padding: 10px;
167
+    box-sizing: border-box;
168
+}
169
+
170
+.single-post {
171
+    width: 100%;
172
+    min-height: 100px;
173
+    padding: 15px;
174
+    box-sizing: border-box;
175
+    color: #969a9f;
176
+    border-radius: 5px;
177
+    background-color: #e2e6eb;
178
+    margin-top: 10px;
179
+    margin-bottom: 10px;
180
+}

+ 1
- 0
src/main/webapp/app/entities/post/post.component.ts Целия файл

@@ -45,6 +45,7 @@ export class PostComponent implements OnInit, OnDestroy {
45 45
     }
46 46
 
47 47
     trackId(index: number, item: IPost) {
48
+        console.log(item);
48 49
         return item.id;
49 50
     }
50 51
 

+ 9
- 7
src/main/webapp/app/home/home.component.html Целия файл

@@ -1,11 +1,11 @@
1 1
 <div class="row">
2 2
     <div class="col-md-3">
3
-        <span class="hipster img-fluid rounded"></span>
3
+        <span class="hipster img-fluid rounded" ></span>
4 4
     </div>
5 5
     <div class="col-md-9">
6 6
 
7
-        <h1 class="display-1" jhiTranslate="home.title">Welcome to Faeboo!</h1>
8
-        <h2 class="lead" jhiTranslate="home.subtitle">This is your homepage</h2>
7
+        <h1 class="display-1" style="color:#F6AE2D" jhiTranslate="home.title">Welcome to Faeboo!</h1>
8
+        <h2 class="lead" style="color:#2F4858" jhiTranslate="home.subtitle">This is your homepage</h2>
9 9
 
10 10
         <div [ngSwitch]="isAuthenticated()">
11 11
             <div class="alert alert-success" *ngSwitchCase="true">
@@ -16,13 +16,15 @@
16 16
             <br>
17 17
             <div class="alert alert-warning" *ngSwitchCase="false">
18 18
 
19
-                <span>You can sign in by clicking</span>
20
-                <a class="alert-link" (click)="login()" >sign in</a>
19
+                <span style="color: #3e8acc">You can sign in by clicking</span>
20
+                <a class="alert-link" style="color: #3e8acc"(click)="login()" >sign in</a>
21 21
             </div>
22 22
             <div class="alert alert-warning" *ngSwitchCase="false">
23
-                <span jhiTranslate="global.messages.info.register.noaccount">You don't have an account yet?</span>&nbsp;
24
-                <a class="alert-link" routerLink="register" jhiTranslate="global.messages.info.register.link">Register a new account</a>
23
+                <span style="color: #3e8acc" jhiTranslate="global.messages.info.register.noaccount">You don't have an account yet?</span>&nbsp;
24
+                <a class="alert-link" style="color: #3e8acc" routerLink="register" jhiTranslate="global.messages.info.register.link">Register a new account</a>
25 25
             </div>
26
+
27
+            <iframe src="https://giphy.com/embed/NQZhGb4uBcVa0" width="900" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
26 28
         </div>
27 29
 
28 30
 

+ 13
- 13
src/main/webapp/app/layouts/navbar/navbar.component.html Целия файл

@@ -5,15 +5,15 @@
5 5
         </a>
6 6
         <a class="navbar-brand logo float-left" routerLink="/" (click)="collapseNavbar()">
7 7
             <span class="logo-img"></span>
8
-            <span jhiTranslate="global.title" class="navbar-title">FaeBoo</span>
8
+            <span jhiTranslate="global.title" class="navbar-title"style="color: #F6AE2D">FaeBoo</span>
9 9
     </div>
10 10
     <div class="navbar-collapse collapse" id="navbarResponsive" [ngbCollapse]="isNavbarCollapsed" [ngSwitch]="isAuthenticated()">
11 11
         <ul class="navbar-nav ml-auto">
12 12
             <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
13 13
                 <a class="nav-link" routerLink="/" (click)="collapseNavbar();trace();">
14 14
                     <span>
15
-                        <fa-icon icon="home"></fa-icon>
16
-                        <span jhiTranslate="global.menu.home">Home</span>
15
+                        <fa-icon style="color: #F6AE2D" icon="home"></fa-icon>
16
+                        <span style="color: #F6AE2D"jhiTranslate="global.menu.home">Home</span>
17 17
                     </span>
18 18
                 </a>
19 19
             </li>
@@ -21,8 +21,8 @@
21 21
             <li class="nav-item" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
22 22
                 <a class="nav-link" routerLink="/profile-head" (click)="collapseNavbar();">
23 23
                     <span>
24
-                        <fa-icon icon="home"></fa-icon>
25
-                        <span>Profile</span>
24
+                        <fa-icon style="color: #F6AE2D"icon="home"></fa-icon>
25
+                        <span style="color: #F6AE2D">Profile</span>
26 26
                     </span>
27 27
                 </a>
28 28
             </li>
@@ -31,8 +31,8 @@
31 31
             <li *ngSwitchCase="true" ngbDropdown class="nav-item dropdown pointer" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
32 32
                 <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="entity-menu">
33 33
                     <span>
34
-                        <fa-icon icon="th-list"></fa-icon>
35
-                        <span jhiTranslate="global.menu.entities.main">
34
+                        <fa-icon icon="th-list" style="color: #F6AE2D"></fa-icon>
35
+                        <span jhiTranslate="global.menu.entities.main" style="color: #F6AE2D">
36 36
                             Entities
37 37
                         </span>
38 38
                     </span>
@@ -45,7 +45,7 @@
45 45
                         </a>
46 46
                     </li>
47 47
                     <li>
48
-                        <a class="dropdown-item" routerLink="profile" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
48
+                        <a class="dropdown-item" routerLink="profile" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar();">
49 49
                             <fa-icon icon="asterisk" fixedWidth="true"></fa-icon>
50 50
                             <span jhiTranslate="global.menu.entities.profile">Profile</span>
51 51
                         </a>
@@ -92,11 +92,11 @@
92 92
             <li *jhiHasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
93 93
                 <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
94 94
                     <span>
95
-                        <fa-icon icon="user-plus"></fa-icon>
96
-                        <span jhiTranslate="global.menu.admin.main">Administration</span>
95
+                        <fa-icon style="color: #F6AE2D" icon="user-plus"></fa-icon>
96
+                        <span jhiTranslate="global.menu.admin.main" style="color: #F6AE2D">Administration</span>
97 97
                     </span>
98 98
                 </a>
99
-                <ul class="dropdown-menu" ngbDropdownMenu>
99
+                <ul class="dropdown-menu"  ngbDropdownMenu>
100 100
                     <li>
101 101
                         <a class="dropdown-item" routerLink="admin/user-management" routerLinkActive="active" (click)="collapseNavbar()">
102 102
                             <fa-icon icon="user" fixedWidth="true"></fa-icon>
@@ -164,8 +164,8 @@
164 164
             <li ngbDropdown class="nav-item dropdown pointer" placement="bottom-right" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
165 165
                 <a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="account-menu">
166 166
                   <span *ngIf="!getImageUrl()">
167
-                    <fa-icon icon="user"></fa-icon>
168
-                    <span jhiTranslate="global.menu.account.main">
167
+                    <fa-icon style="color: #F6AE2D" icon="user"></fa-icon>
168
+                    <span style="color: #F6AE2D" jhiTranslate="global.menu.account.main">
169 169
                       Account
170 170
                     </span>
171 171
                   </span>

+ 2
- 0
src/main/webapp/app/layouts/navbar/navbar.component.ts Целия файл

@@ -6,6 +6,7 @@ import { SessionStorageService } from 'ngx-webstorage';
6 6
 import { VERSION } from 'app/app.constants';
7 7
 import { JhiLanguageHelper, Principal, LoginModalService, LoginService } from 'app/core';
8 8
 import { ProfileService } from '../profiles/profile.service';
9
+import { ProfileHeadComponent } from 'app/FaeBoo/Profile-head/profile-head.component';
9 10
 
10 11
 @Component({
11 12
     selector: 'jhi-navbar',
@@ -19,6 +20,7 @@ export class NavbarComponent implements OnInit {
19 20
     swaggerEnabled: boolean;
20 21
     modalRef: NgbModalRef;
21 22
     version: string;
23
+    public profileHead: ProfileHeadComponent;
22 24
 
23 25
     constructor(
24 26
         private loginService: LoginService,

+ 5
- 1
src/main/webapp/app/layouts/navbar/navbar.scss Целия файл

@@ -7,6 +7,10 @@ Navbar
7 7
     color: #ccc;
8 8
 }
9 9
 
10
+.dropdown-item {
11
+    color: #f6ae2d;
12
+}
13
+
10 14
 .jh-navbar {
11 15
     background-color: #353d47;
12 16
     padding: 0.2em 1em;
@@ -71,7 +75,7 @@ Logo styles
71 75
             width: 70px;
72 76
             display: inline-block;
73 77
             vertical-align: middle;
74
-            background: url('../../../content/images/faceofbooks4.jpg') no-repeat center center;
78
+            background: url('../../../content/images/faceofbooks4.png') no-repeat center center;
75 79
             background-size: contain;
76 80
         }
77 81
     }

BIN
src/main/webapp/content/images/faceofbooks4.jpg Целия файл


BIN
src/main/webapp/content/images/faceofbooks4.png Целия файл


BIN
src/main/webapp/content/images/giphy.gif Целия файл


+ 1
- 1
src/main/webapp/index.html Целия файл

@@ -9,7 +9,7 @@
9 9
     <meta name="google" value="notranslate">
10 10
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
11 11
     <meta name="theme-color" content="#000000">
12
-    <link rel="shortcut icon" href="favicon.ico" />
12
+    <link rel="shortcut icon" href="faceofbooks4.png" />
13 13
     <link rel="manifest" href="manifest.webapp" />
14 14
     <link rel="stylesheet" href="content/css/loading.css">
15 15
     <!-- jhipster-needle-add-resources-to-root - JHipster will add new resources here -->