From 2b5b2f2449317b8aebd2d8962a930bf454d100fb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 24 Feb 2021 18:32:16 +0200 Subject: Improved semantics and simplifed some code in feed component --- src/app/components/feed/feed.component.css | 6 +-- src/app/components/feed/feed.component.html | 64 ++++++++++++++--------------- 2 files changed, 31 insertions(+), 39 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/feed/feed.component.css b/src/app/components/feed/feed.component.css index cb155c6..23a70d5 100644 --- a/src/app/components/feed/feed.component.css +++ b/src/app/components/feed/feed.component.css @@ -77,7 +77,7 @@ #top-bar { display: flex; - flex-direction: column; + flex-direction: row; width: 98%; margin: 0 auto; margin-bottom: .5em; @@ -100,10 +100,6 @@ display: none; } -#main-content { - display: flex; -} - /* Create post */ #create-post-form { diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 1a03dcc..2fece23 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -1,8 +1,8 @@ -
- -
+ +
+ + -
-
+
+ None of your friends have posted anything yet!
Try refreshing your page! -
-
+ +
-
-
-
-
+ + + + -- cgit v1.2.3 From 301e3932b64172b3f9cf055287fdfdb4a89620af Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 24 Feb 2021 18:56:32 +0200 Subject: Improved semantics and simplified some HTML of comments and posts --- .../comment-page/comment-page.component.html | 12 ++++--- src/app/components/comment/comment.component.css | 5 +-- src/app/components/comment/comment.component.html | 36 +++++++++---------- src/app/components/feed/feed.component.html | 4 +-- .../post-attachment/post-attachment.component.css | 11 +++--- .../post-attachment/post-attachment.component.html | 18 +++++----- .../components/post-page/post-page.component.html | 28 +++++++-------- src/app/components/post/post.component.html | 41 +++++++++++----------- 8 files changed, 73 insertions(+), 82 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/comment-page/comment-page.component.html b/src/app/components/comment-page/comment-page.component.html index 2d110d6..ae114da 100644 --- a/src/app/components/comment-page/comment-page.component.html +++ b/src/app/components/comment-page/comment-page.component.html @@ -1,14 +1,16 @@ -
- +
+ -
+
+
-
+
diff --git a/src/app/components/comment/comment.component.css b/src/app/components/comment/comment.component.css index d82f10e..419cbf8 100644 --- a/src/app/components/comment/comment.component.css +++ b/src/app/components/comment/comment.component.css @@ -1,5 +1,6 @@ .comment { display: flex; + flex-direction: column; width: 100%; margin: .5em auto; @@ -40,10 +41,6 @@ /* Content */ -.content { - flex: 1; -} - .message { margin: .3em 0; word-break: break-all; diff --git a/src/app/components/comment/comment.component.html b/src/app/components/comment/comment.component.html index 718e25c..e46bdb7 100644 --- a/src/app/components/comment/comment.component.html +++ b/src/app/components/comment/comment.component.html @@ -1,23 +1,21 @@ -
-
-
- -
-
- {{ user.firstName }} {{ user.lastName }} -
-
- @{{ user.userName }} -
+
+ + +
+
+ {{ user.firstName }} {{ user.lastName }} +
+
+ @{{ user.userName }}
-
- {{ comment.message }} -
-
- {{ timeCreated }} -
-
-
+ +
+ {{ comment.message }} +
+ + diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 2fece23..74657dc 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -40,9 +40,9 @@ None of your friends have posted anything yet!
Try refreshing your page! -
+
-
+
diff --git a/src/app/components/post-attachment/post-attachment.component.css b/src/app/components/post-attachment/post-attachment.component.css index 572cc99..58e8a82 100644 --- a/src/app/components/post-attachment/post-attachment.component.css +++ b/src/app/components/post-attachment/post-attachment.component.css @@ -1,6 +1,9 @@ /* Attachment */ .attachment { + width: 100%; + height: 100%; + display: flex; border: 2px solid black; border-top: 0; border-radius: 0 0 .6em .6em; @@ -9,13 +12,7 @@ margin-top: calc(-0.8em - 2px); } -.clickable { - width: 100%; - height: 100%; - display: flex; -} - -.clickable:hover { +.attachment:hover { cursor: pointer; } diff --git a/src/app/components/post-attachment/post-attachment.component.html b/src/app/components/post-attachment/post-attachment.component.html index 4d381d1..401068c 100644 --- a/src/app/components/post-attachment/post-attachment.component.html +++ b/src/app/components/post-attachment/post-attachment.component.html @@ -1,13 +1,11 @@ -
-
-
- {{ fileName }} -
-
- {{ fileType }} -
-
-
+
+ + {{ fileName }} + + + {{ fileType }} + +
diff --git a/src/app/components/post-page/post-page.component.html b/src/app/components/post-page/post-page.component.html index 8665865..b8e7e22 100644 --- a/src/app/components/post-page/post-page.component.html +++ b/src/app/components/post-page/post-page.component.html @@ -1,11 +1,13 @@ -
-
- - -
- +
+
@@ -17,21 +19,19 @@ -
+
{{ file.name ? file.name : 'Attachment' }}
-
+
-
-
- -
-
-
+
+ +
+
diff --git a/src/app/components/post/post.component.html b/src/app/components/post/post.component.html index bc0d84a..4ba4d43 100644 --- a/src/app/components/post/post.component.html +++ b/src/app/components/post/post.component.html @@ -1,8 +1,8 @@ -
-
-
+
+
+
@@ -12,38 +12,37 @@ @{{ user.userName }}
-
-
+ +
{{ post.message }} -
+
-
+
+
-
+ {{ post.comments.length }} -
+
- -
-
+ +
-
+ {{ votesNumber }} -
+ -
-
-
-
+ + +
-
+ + -- cgit v1.2.3 From d9d76c97bd76ddd503739d94f88eb15905bb4f3b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 25 Feb 2021 14:11:27 +0200 Subject: Reverted mark elements to divs, because mark has a style already --- src/app/components/feed/feed.component.html | 4 ++-- src/app/components/login/login.component.html | 4 ++-- src/app/components/register/register.component.html | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 74657dc..230c27b 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -36,10 +36,10 @@
- +
None of your friends have posted anything yet!
Try refreshing your page! - +
diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index b641fcb..9f74faa 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -8,9 +8,9 @@ - +
- +
diff --git a/src/app/components/register/register.component.html b/src/app/components/register/register.component.html index df6f6c9..0075b1d 100644 --- a/src/app/components/register/register.component.html +++ b/src/app/components/register/register.component.html @@ -10,51 +10,51 @@ - +
- +
- +
- +
- +
- +
- +
- +
- +
- +

-- cgit v1.2.3 From eab7b2108d91af1c905f795febf811d5cc404863 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 25 Feb 2021 14:38:12 +0200 Subject: Removed unnecessary variables from request subscriptions --- .../admin-panel-page/admin-panel-page.component.ts | 20 ++++++++++---------- .../comment-page/comment-page.component.ts | 7 +++---- src/app/components/feed/feed.component.ts | 9 ++++----- src/app/components/post-page/post-page.component.ts | 9 ++++----- .../profile-settings/profile-settings.component.ts | 10 +++++----- src/app/components/profile/profile.component.ts | 15 +++++---------- 6 files changed, 31 insertions(+), 39 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index 99c0721..95d69d3 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -53,7 +53,7 @@ export class AdminPanelPageComponent implements OnInit { this._router.navigate(['/login']); } }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/login']); } ); @@ -129,7 +129,7 @@ export class AdminPanelPageComponent implements OnInit { if (languageCreate !== '' && languageCreate !== null) { this._languageService.createLanguageWithSessionStorageRequest(languageCreate.trim()).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully updated languages!'); }, (err: HttpErrorResponse) => { @@ -147,7 +147,7 @@ export class AdminPanelPageComponent implements OnInit { const langId = this.availableLanguages.filter(x => x.name === updateLanguageOldName.trim())[0].id; this._languageService.putLanguageWithSessionStorageRequest(langId, updateLanguageNewName.trim()).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully updated languages!'); }, (err: HttpErrorResponse) => { @@ -164,7 +164,7 @@ export class AdminPanelPageComponent implements OnInit { const langId = this.availableLanguages.filter(x => x.name === deleteLanguageName.trim())[0].id; this._languageService.deleteLanguageWithSessionStorageRequest(langId).subscribe( - (result: object) => { + () => { this.languageModifiedSuccess('Successfully deleted language!'); }, (err: HttpErrorResponse) => { @@ -205,7 +205,7 @@ export class AdminPanelPageComponent implements OnInit { if (technologyCreate !== '' && technologyCreate !== null) { this._technologyService.createTechnologyWithSessionStorageRequest(technologyCreate.trim()).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, (err: HttpErrorResponse) => { @@ -223,7 +223,7 @@ export class AdminPanelPageComponent implements OnInit { const techId = this.availableTechnologies.filter(x => x.name === updateTechnologyOldName.trim())[0].id; this._technologyService.putTechnologyWithSessionStorageRequest(techId, updateTechnologyNewName.trim()).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully updated technologies!'); }, (err: HttpErrorResponse) => { @@ -240,7 +240,7 @@ export class AdminPanelPageComponent implements OnInit { const techId = this.availableTechnologies.filter(x => x.name === deleteTechnologyName.trim())[0].id; this._technologyService.deleteTechnologyWithSessionStorageRequest(techId).subscribe( - (result: object) => { + () => { this.technologyModifiedSuccess('Successfully deleted technology!'); }, (err: HttpErrorResponse) => { @@ -283,7 +283,7 @@ export class AdminPanelPageComponent implements OnInit { const userId: Guid = Guid.parse(deleteUser); this._userService.deleteUserRequest(userId, this._tokenService.getTokenFromSessionStorage()).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted user!'); }, (err: HttpErrorResponse) => { @@ -300,7 +300,7 @@ export class AdminPanelPageComponent implements OnInit { const postId: Guid = Guid.parse(deletePost); this._postService.deletePostRequest(postId, this._tokenService.getTokenFromSessionStorage()).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted user!'); }, (err: HttpErrorResponse) => { @@ -317,7 +317,7 @@ export class AdminPanelPageComponent implements OnInit { const commentId: Guid = Guid.parse(deleteComment); this._commentService.deleteCommentWithSessionStorage(commentId).subscribe( - (result: object) => { + () => { this.deletionSuccess('Successfully deleted comment!'); }, (err: HttpErrorResponse) => { diff --git a/src/app/components/comment-page/comment-page.component.ts b/src/app/components/comment-page/comment-page.component.ts index 045e8ea..413436e 100644 --- a/src/app/components/comment-page/comment-page.component.ts +++ b/src/app/components/comment-page/comment-page.component.ts @@ -1,4 +1,3 @@ -import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { Title } from '@angular/platform-browser'; @@ -42,7 +41,7 @@ export class CommentPageComponent implements OnInit { } this.loaded = true; }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -68,7 +67,7 @@ export class CommentPageComponent implements OnInit { if (newMessage !== '' && newMessage !== this.comment.message) { console.log(this.commentId); this._commentService.putCommentWithSessionStorageRequest(this.commentId, this.comment.postId, newMessage).subscribe( - (result: object) => { + () => { this.reloadPage(); } ); @@ -79,7 +78,7 @@ export class CommentPageComponent implements OnInit { deleteComment(): void { this._commentService.deleteCommentWithSessionStorage(this.commentId).subscribe( - (result: object) => { + () => { this.toPost(); } ); diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index b412b3c..eaa0ef1 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -4,7 +4,6 @@ import { Router } from '@angular/router'; import { User } from 'src/models/identity/user'; import { UserService } from '../../services/user.service'; import { AppConstants } from 'src/app/app-constants.module'; -import { HttpErrorResponse } from '@angular/common/http'; import { FeedService } from 'src/app/services/feed.service'; import { Post } from 'src/models/post'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; @@ -55,7 +54,7 @@ export class FeedComponent implements OnInit { Object.assign(this.user, res); this.loadFeed(); }, - (err: HttpErrorResponse) => { + () => { this.logout(); } ); @@ -67,7 +66,7 @@ export class FeedComponent implements OnInit { this.posts.push(...Object.values(result)[0]); this.finishUserLoading(); }, - (err) => { + () => { this.finishUserLoading(); } ); @@ -104,10 +103,10 @@ export class FeedComponent implements OnInit { this.dataArrived = false; this._postService.createPostWithSessionStorageRequest(postMessage, this.files).subscribe( - (result: object) => { + () => { this.goToProfile(); }, - (err: HttpErrorResponse) => { + () => { this.dataArrived = true; } ); diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index 3218a19..1ac89f4 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -1,4 +1,3 @@ -import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { Title } from '@angular/platform-browser'; @@ -53,7 +52,7 @@ export class PostPageComponent implements OnInit { this.dataArrived = true; } }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -120,7 +119,7 @@ export class PostPageComponent implements OnInit { if (newMessage === '' && newMessage !== this.post.message) { this._postService.putPostWithSessionStorageRequest(this.postId, newMessage, this.files).subscribe( - (result: object) => { + () => { this.reloadPage(); } ); @@ -139,7 +138,7 @@ export class PostPageComponent implements OnInit { const newComment = this.addCommentFormGroup.get('newComment')?.value; if (newComment !== '' && newComment !== null) { this._commentService.createCommentWithSessionStorageRequest(this.postId, newComment).subscribe( - (result: object) => { + () => { this.editPostFormGroup.reset(); this.reloadPage(); } @@ -149,7 +148,7 @@ export class PostPageComponent implements OnInit { deletePost(): void { this._postService.deletePostWithSessionStorage(this.postId).subscribe( - (result: object) => { + () => { this._router.navigate(['/profile/' + this._tokenService.getUsernameFromSessionStorageToken()]); } ); diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index a484665..f3cd4c1 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -56,7 +56,7 @@ export class ProfileSettingsComponent implements OnInit { this.isAdminUser = this.user.roles.map(x => x.name).includes(AppConstants.ADMIN_ROLE_NAME); this.finishUserLoading(); }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -89,7 +89,7 @@ export class ProfileSettingsComponent implements OnInit { this.goToProfile(); } }, - (err: HttpErrorResponse) => { + () => { this.logout(); } ); @@ -181,7 +181,7 @@ export class ProfileSettingsComponent implements OnInit { } this._userService.putProfilePictureFromSessionStorageRequest(this.newProfilePicture).subscribe( - (result: object) => { + () => { this.reloadPage(); } ); @@ -196,7 +196,7 @@ export class ProfileSettingsComponent implements OnInit { this.patchTechnologiesControl(); this._userService.putUserFromSessionStorageRequest(this.updateUserFormGroup, this.user.roles, this.user.friends).subscribe( - (result: object) => { + () => { this._successBar.showMsg('Profile updated successfully!'); }, (err: HttpErrorResponse) => { @@ -285,7 +285,7 @@ export class ProfileSettingsComponent implements OnInit { deleteAccount(): void { if (this.deleteAccountConfirm) { this._userService.deleteUserFromSessionStorageRequest().subscribe( - (res: object) => { + () => { this.logout(); }, (err: HttpErrorResponse) => { diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index bbf8585..eaa1bec 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -3,7 +3,6 @@ import { Router } from '@angular/router'; import { UserService } from 'src/app/services/user.service'; import { User } from 'src/models/identity/user'; import { AppConstants } from 'src/app/app-constants.module'; -import { HttpErrorResponse } from '@angular/common/http'; import { Location } from '@angular/common'; import { LanguageService } from 'src/app/services/language.service'; import { TechnologyService } from 'src/app/services/technology.service'; @@ -38,10 +37,6 @@ export class ProfileComponent implements OnInit { this._titleService.setTitle(this._title); } - private setDefaultUser(): void { - this.user = this._userService.getDefaultUser(); - } - ngOnInit(): void { this._urlUsername = this._router.url.substring(9); @@ -63,7 +58,7 @@ export class ProfileComponent implements OnInit { this.isAdminUser = this.user.roles.map(x => x.name).includes(AppConstants.ADMIN_ROLE_NAME); this.loadLanguages(); }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -102,7 +97,7 @@ export class ProfileComponent implements OnInit { this.userPosts.push(...resultArr); this.finishUserLoading(); }, - (err: HttpErrorResponse) => { + () => { this._currentPage = -1; this.finishUserLoading(); } @@ -126,7 +121,7 @@ export class ProfileComponent implements OnInit { } this.dataArrived = true; }, - (err: HttpErrorResponse) => { + () => { this.logout(); } ); @@ -175,10 +170,10 @@ export class ProfileComponent implements OnInit { } this._userService.putBareUserFromSessionStorageRequest(loggedInUser, this.updateFrienship.get('password')?.value).subscribe( - (resultUpdate: object) => { + () => { this.reloadPage(); }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/']); } ); -- cgit v1.2.3 From ca7e618ca3350a5cf200ae39c851b016c9088d41 Mon Sep 17 00:00:00 2001 From: transtrike Date: Thu, 25 Feb 2021 20:51:24 +0200 Subject: Footer added; Pages fucked up --- src/app/app.module.ts | 4 +- .../admin-panel-page.component.html | 154 +++++++++++--- .../comment-page/comment-page.component.html | 19 +- src/app/components/feed/feed.component.html | 71 +++++-- src/app/components/footer/footer.component.css | 20 ++ src/app/components/footer/footer.component.html | 12 ++ src/app/components/footer/footer.component.ts | 18 ++ src/app/components/login/login.component.html | 40 +++- .../components/not-found/not-found.component.html | 15 +- .../components/post-page/post-page.component.html | 63 ++++-- .../profile-settings.component.html | 234 +++++++++++++++++---- src/app/components/profile/profile.component.html | 67 ++++-- .../components/register/register.component.html | 134 ++++++++++-- src/styles.css | 103 ++++----- src/theme.scss | 14 -- 15 files changed, 755 insertions(+), 213 deletions(-) create mode 100644 src/app/components/footer/footer.component.css create mode 100644 src/app/components/footer/footer.component.html create mode 100644 src/app/components/footer/footer.component.ts delete mode 100644 src/theme.scss (limited to 'src/app/components/feed') diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1bf44ad..e331a5d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -25,6 +25,7 @@ import { CommentComponent } from './components/comment/comment.component'; import { CommentPageComponent } from './components/comment-page/comment-page.component'; import { PostAttachmentComponent } from './components/post-attachment/post-attachment.component'; import { RouterModule } from '@angular/router'; +import { FooterComponent } from './components/footer/footer.component'; @NgModule({ declarations: [ @@ -43,7 +44,8 @@ import { RouterModule } from '@angular/router'; AdminPanelPageComponent, CommentComponent, CommentPageComponent, - PostAttachmentComponent + PostAttachmentComponent, + FooterComponent ], imports: [ BrowserModule.withServerTransition({ appId: 'serverApp' }), diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.html b/src/app/components/admin-panel-page/admin-panel-page.component.html index 31f0849..0c0954a 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.html +++ b/src/app/components/admin-panel-page/admin-panel-page.component.html @@ -2,84 +2,182 @@
-
+
- -
+ +
- +
- - + +
- +
-
+
Available languages:
-
+
{{ lang.name }}
-
+
- -
+ +
- +
- - + +
- +
- -
+ +
Available technologies:
-
+
{{ tech.name }}
-
+
- -
+ +
- +
- +
- +
-
+
+
diff --git a/src/app/components/comment-page/comment-page.component.html b/src/app/components/comment-page/comment-page.component.html index ae114da..d59c956 100644 --- a/src/app/components/comment-page/comment-page.component.html +++ b/src/app/components/comment-page/comment-page.component.html @@ -2,15 +2,26 @@
-
- + +
+
diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 230c27b..7f3cb68 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -3,41 +3,81 @@
-
+
- None of your friends have posted anything yet!
+ None of your friends have posted anything yet!
Try refreshing your page!
@@ -45,4 +85,5 @@
+
diff --git a/src/app/components/footer/footer.component.css b/src/app/components/footer/footer.component.css new file mode 100644 index 0000000..b93e1f3 --- /dev/null +++ b/src/app/components/footer/footer.component.css @@ -0,0 +1,20 @@ +footer { + display: flex; + width: 100%; +} + +footer > * { + flex: 1; +} + +#version { + text-align: left; +} + +#middle-footer-message { + text-align: center; +} + +#license { + text-align: right; +} diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html new file mode 100644 index 0000000..d410597 --- /dev/null +++ b/src/app/components/footer/footer.component.html @@ -0,0 +1,12 @@ + diff --git a/src/app/components/footer/footer.component.ts b/src/app/components/footer/footer.component.ts new file mode 100644 index 0000000..e83f840 --- /dev/null +++ b/src/app/components/footer/footer.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-footer', + templateUrl: './footer.component.html', + styleUrls: ['./footer.component.css'] +}) +export class FooterComponent implements OnInit { + public version: string = "v0.1"; + public licenseUrl: string = "https://github.com/Team-Kaleidoscope/DevHive-Angular/blob/main/LICENSE"; + public organizationUrl: string = "https://github.com/Team-Kaleidoscope"; + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index 9f74faa..d4f956d 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -2,29 +2,55 @@ Login
-
+
- +
- +
- +
- +
-
+
- + + diff --git a/src/app/components/not-found/not-found.component.html b/src/app/components/not-found/not-found.component.html index 83d73ce..4588d2c 100644 --- a/src/app/components/not-found/not-found.component.html +++ b/src/app/components/not-found/not-found.component.html @@ -1,10 +1,13 @@
- - Page not found! - -
+ Page not found! +
+
diff --git a/src/app/components/post-page/post-page.component.html b/src/app/components/post-page/post-page.component.html index b8e7e22..9781c18 100644 --- a/src/app/components/post-page/post-page.component.html +++ b/src/app/components/post-page/post-page.component.html @@ -2,36 +2,75 @@
- +
-
- - - + + + +
- {{ file.name ? file.name : 'Attachment' }} -
+ {{ file.name ? file.name : "Attachment" }} +
- +
+
diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index 502697d..f5f19bd 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -3,114 +3,276 @@
-
+
-
- + +
- +
- +
-
-
+
+
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - - + + +
- +
- +
- +
Available languages:
-
+
{{ lang.name }}
- +
- +
- +
Available technologies:
-
+
{{ tech.name }}
- + -
+
- Are you sure you want to delete your account?
This is permanent! + Are you sure you want to delete your account?
This is + permanent!
- +
+
diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html index 0e5f633..0d9dc6a 100644 --- a/src/app/components/profile/profile.component.html +++ b/src/app/components/profile/profile.component.html @@ -3,25 +3,48 @@
-
+
- +
-
- {{ user.firstName }} {{ user.lastName }} -
-
- @{{ user.userName }} -
-
- -
- +
{{ user.firstName }} {{ user.lastName }}
+
@{{ user.userName }}
+ + +
+
@@ -32,9 +55,7 @@ {{ lang.name }}
-
-  None -
+
 None
Technologies: @@ -43,18 +64,18 @@ {{ tech.name }}
-
-  None -
+
 None
-
+
- {{ user.firstName }} {{ user.lastName }} hasn't posted anything yet! + {{ user.firstName }} {{ user.lastName }} hasn't posted anything + yet!
+
diff --git a/src/app/components/register/register.component.html b/src/app/components/register/register.component.html index 0075b1d..c521d44 100644 --- a/src/app/components/register/register.component.html +++ b/src/app/components/register/register.component.html @@ -2,64 +2,160 @@ Register
-
+
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - - + + +
-
+
- + + diff --git a/src/styles.css b/src/styles.css index eeb93fe..b215190 100644 --- a/src/styles.css +++ b/src/styles.css @@ -9,24 +9,27 @@ --failure: indianred; } -html, body { - height: 100%; - margin: 0; +html, +body { + height: 100%; + margin: 0; } body { font: 21px sans-serif !important; background-color: var(--bg-color); } -input:focus, button:focus { +input:focus, +button:focus { outline: 0; } -#content { /* Used for the login and register pages */ +#content { + /* Used for the login and register pages */ height: 100%; max-width: 20em; box-sizing: border-box; - border: .5em solid var(--bg-color); + border: 0.5em solid var(--bg-color); margin: 0 auto; @@ -36,10 +39,15 @@ input:focus, button:focus { flex-direction: column; } +#content > *:first-child, +#content > *:last-child { + flex: 1; +} + .rounded-border { border: 2px solid black; - border-radius: .6em; - padding: .4em; + border-radius: 0.6em; + padding: 0.4em; } .round-image { @@ -62,22 +70,23 @@ input:focus, button:focus { overflow-y: auto; } - /* Hide scrollbar for Chrome, Safari and Opera */ +/* Hide scrollbar for Chrome, Safari and Opera */ .scroll-standalone::-webkit-scrollbar { display: none; } - /* Hide scrollbar for IE, Edge and Firefox */ +/* Hide scrollbar for IE, Edge and Firefox */ .scroll-standalone { - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ } -.user-language, .user-technology { - border-radius: .4em; +.user-language, +.user-technology { + border-radius: 0.4em; background-color: lightgrey; - padding: .26em; - margin: .1em .2em; + padding: 0.26em; + margin: 0.1em 0.2em; width: fit-content; } @@ -85,10 +94,10 @@ input:focus, button:focus { .input-selection { position: relative; - margin-top: .7em; + margin-top: 0.7em; } - /* Don't show the placeholder when the label is on top +/* Don't show the placeholder when the label is on top */ .input-selection .input-field::-webkit-input-placeholder { opacity: 0; @@ -102,8 +111,8 @@ input:focus, button:focus { border-bottom: 1px solid grey; box-sizing: border-box; - margin-bottom: .5em; - padding: .4em; + margin-bottom: 0.5em; + padding: 0.4em; padding-left: 0; font-size: inherit; @@ -115,22 +124,22 @@ input:focus, button:focus { position: absolute; left: 0; - margin-top: .4em; + margin-top: 0.4em; color: grey; } - /* When hovering, typing or having typed something in an input, +/* When hovering, typing or having typed something in an input, * make the label smaller, color it and then move it up */ -.input-selection:hover > .input-field-label , -.input-selection > input:not(:placeholder-shown) + .input-field-label , +.input-selection:hover > .input-field-label, +.input-selection > input:not(:placeholder-shown) + .input-field-label, .input-selection > input:focus + .input-field-label { - font-size: .7em; + font-size: 0.7em; color: var(--focus-color); transform: translate(0, -1.2em); } - /* Show the placeholder, when you've hovered or +/* Show the placeholder, when you've hovered or * focused (typing in) on the input-field */ .input-selection:hover > .input-field::-webkit-input-placeholder, @@ -138,7 +147,7 @@ input:focus, button:focus { opacity: 1; } - /* Make the underline thicker and change it's and the cursors's +/* Make the underline thicker and change it's and the cursors's * color when hovered or focused (typing in) on the input-field */ .input-selection:hover > .input-field, @@ -149,19 +158,18 @@ input:focus, button:focus { margin-top: -1px !important; } - /* Input errors */ .input-errors { - margin-top: -.8em; - font-size: .7em; + margin-top: -0.8em; + font-size: 0.7em; position: absolute; right: 0; top: 0; } - /* Move the errors above the input when +/* Move the errors above the input when * using the site on a small screen and * add some space for them above the input */ @@ -175,7 +183,7 @@ input:focus, button:focus { } .input-errors > .error { - margin-left: .3em; + margin-left: 0.3em; } .input-field:focus ~ .input-errors > .error { @@ -194,14 +202,14 @@ input:focus, button:focus { background-color: black; border: 2px solid black; - border-radius: .4em; + border-radius: 0.4em; box-sizing: border-box; - font-size: .8em; + font-size: 0.8em; text-align: center; - margin-top: .5em; - padding: .3em; + margin-top: 0.5em; + padding: 0.3em; } .submit-btn:hover { @@ -213,7 +221,7 @@ input:focus, button:focus { .submit-btn:active { transition: 0s; - transform: scale(.9); + transform: scale(0.9); } .delete-btn:hover { @@ -227,16 +235,16 @@ input:focus, button:focus { display: flex; flex-wrap: wrap; color: gray; - font-size: .75em; - margin: 0 .3em; + font-size: 0.75em; + margin: 0 0.3em; } .form-attachment { border: 2px solid black; - border-radius: .6em; - margin-top: .2em; - margin-right: .2em; - padding: .2em; + border-radius: 0.6em; + margin-top: 0.2em; + margin-right: 0.2em; + padding: 0.2em; display: flex; align-items: center; } @@ -246,12 +254,12 @@ input:focus, button:focus { } .remove-form-attachment { - font-size: .9em; + font-size: 0.9em; color: var(--failure); background-color: white; - border-radius: .2em; - margin: 0 .2em; - padding: .2em; + border-radius: 0.2em; + margin: 0 0.2em; + padding: 0.2em; } .remove-form-attachment:hover { @@ -259,4 +267,3 @@ input:focus, button:focus { background-color: var(--failure); cursor: pointer; } - diff --git a/src/theme.scss b/src/theme.scss deleted file mode 100644 index a87ae45..0000000 --- a/src/theme.scss +++ /dev/null @@ -1,14 +0,0 @@ -// Import theming functions -@import '~@angular/material/theming'; -@import './styles.css'; -@include mat-core(); - -// Custom Angular theme - -// $my-custom-primary: mat-palette($mat-deep-purple); -// $my-custom-accent: mat-palette($mat-pink, 100, 500, A100); -// $my-custom-warn: mat-palette($mat-lime); - -// $my-custom-theme: mat-light-theme($my-custom-primary, $my-custom-accent, $my-custom-warn); - -// @include angular-material-theme($my-custom-theme); \ No newline at end of file -- cgit v1.2.3 From 6c52fd1199525a63dd5bed80a8609b96510282aa Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 4 Mar 2021 17:03:13 +0200 Subject: Made file input hide it's button part of the global styling --- src/app/components/feed/feed.component.css | 4 ---- src/app/components/profile-settings/profile-settings.component.css | 5 ----- src/styles.css | 5 +++++ 3 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/feed/feed.component.css b/src/app/components/feed/feed.component.css index 23a70d5..3d22349 100644 --- a/src/app/components/feed/feed.component.css +++ b/src/app/components/feed/feed.component.css @@ -136,10 +136,6 @@ cursor: pointer; } -#file-upload::-webkit-file-upload-button { - visibility: hidden; -} - #attachment-img { height: 1.5em; width: 1.5em; diff --git a/src/app/components/profile-settings/profile-settings.component.css b/src/app/components/profile-settings/profile-settings.component.css index a10d9c6..347c650 100644 --- a/src/app/components/profile-settings/profile-settings.component.css +++ b/src/app/components/profile-settings/profile-settings.component.css @@ -65,11 +65,6 @@ hr { cursor: pointer; } -#upload-file > input::-webkit-file-upload-button, -#upload-file > input::file-selector-button { - visibility: hidden; -} - #update-user { margin-top: 1.1em; } diff --git a/src/styles.css b/src/styles.css index ae70525..cc92d4d 100644 --- a/src/styles.css +++ b/src/styles.css @@ -24,6 +24,11 @@ button:focus { outline: 0; } +input[type=file]::-webkit-file-upload-button, +input[type=file]::file-selector-button { + visibility: hidden; +} + #content { /* Used for the login and register pages */ height: 100%; -- cgit v1.2.3 From 4b094fb29ea7eaeb58f0c29df60e55586a74db76 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 6 Mar 2021 14:29:14 +0200 Subject: Reverted footer --- src/app/app.module.ts | 4 +- .../admin-panel-page.component.html | 154 +++----------- .../comment-page/comment-page.component.html | 19 +- src/app/components/feed/feed.component.html | 71 ++----- src/app/components/footer/footer.component.css | 20 -- src/app/components/footer/footer.component.html | 12 -- src/app/components/footer/footer.component.ts | 18 -- src/app/components/login/login.component.html | 40 +--- .../components/not-found/not-found.component.html | 15 +- .../components/post-page/post-page.component.html | 63 ++---- .../profile-settings.component.html | 234 ++++----------------- src/app/components/profile/profile.component.html | 67 ++---- .../components/register/register.component.html | 134 ++---------- 13 files changed, 151 insertions(+), 700 deletions(-) delete mode 100644 src/app/components/footer/footer.component.css delete mode 100644 src/app/components/footer/footer.component.html delete mode 100644 src/app/components/footer/footer.component.ts (limited to 'src/app/components/feed') diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e331a5d..1bf44ad 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -25,7 +25,6 @@ import { CommentComponent } from './components/comment/comment.component'; import { CommentPageComponent } from './components/comment-page/comment-page.component'; import { PostAttachmentComponent } from './components/post-attachment/post-attachment.component'; import { RouterModule } from '@angular/router'; -import { FooterComponent } from './components/footer/footer.component'; @NgModule({ declarations: [ @@ -44,8 +43,7 @@ import { FooterComponent } from './components/footer/footer.component'; AdminPanelPageComponent, CommentComponent, CommentPageComponent, - PostAttachmentComponent, - FooterComponent + PostAttachmentComponent ], imports: [ BrowserModule.withServerTransition({ appId: 'serverApp' }), diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.html b/src/app/components/admin-panel-page/admin-panel-page.component.html index 0c0954a..31f0849 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.html +++ b/src/app/components/admin-panel-page/admin-panel-page.component.html @@ -2,182 +2,84 @@
-
+
- -
+ +
- +
- - + +
- +
-
+
Available languages:
-
+
{{ lang.name }}
-
+
- -
+ +
- +
- - + +
- +
- -
+ +
Available technologies:
-
+
{{ tech.name }}
-
+
- -
+ +
- +
- +
- +
-
+
-
diff --git a/src/app/components/comment-page/comment-page.component.html b/src/app/components/comment-page/comment-page.component.html index d59c956..ae114da 100644 --- a/src/app/components/comment-page/comment-page.component.html +++ b/src/app/components/comment-page/comment-page.component.html @@ -2,26 +2,15 @@
-
- + +
-
diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 7f3cb68..230c27b 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -3,81 +3,41 @@
-
+
- None of your friends have posted anything yet!
+ None of your friends have posted anything yet!
Try refreshing your page!
@@ -85,5 +45,4 @@
-
diff --git a/src/app/components/footer/footer.component.css b/src/app/components/footer/footer.component.css deleted file mode 100644 index b93e1f3..0000000 --- a/src/app/components/footer/footer.component.css +++ /dev/null @@ -1,20 +0,0 @@ -footer { - display: flex; - width: 100%; -} - -footer > * { - flex: 1; -} - -#version { - text-align: left; -} - -#middle-footer-message { - text-align: center; -} - -#license { - text-align: right; -} diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html deleted file mode 100644 index d410597..0000000 --- a/src/app/components/footer/footer.component.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/src/app/components/footer/footer.component.ts b/src/app/components/footer/footer.component.ts deleted file mode 100644 index e83f840..0000000 --- a/src/app/components/footer/footer.component.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-footer', - templateUrl: './footer.component.html', - styleUrls: ['./footer.component.css'] -}) -export class FooterComponent implements OnInit { - public version: string = "v0.1"; - public licenseUrl: string = "https://github.com/Team-Kaleidoscope/DevHive-Angular/blob/main/LICENSE"; - public organizationUrl: string = "https://github.com/Team-Kaleidoscope"; - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index d4f956d..9f74faa 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -2,55 +2,29 @@ Login
-
+
- +
- +
- +
- +
-
+
- - + diff --git a/src/app/components/not-found/not-found.component.html b/src/app/components/not-found/not-found.component.html index 4588d2c..83d73ce 100644 --- a/src/app/components/not-found/not-found.component.html +++ b/src/app/components/not-found/not-found.component.html @@ -1,13 +1,10 @@
- Page not found! -
+ + Page not found! + +
-
diff --git a/src/app/components/post-page/post-page.component.html b/src/app/components/post-page/post-page.component.html index 9781c18..b8e7e22 100644 --- a/src/app/components/post-page/post-page.component.html +++ b/src/app/components/post-page/post-page.component.html @@ -2,75 +2,36 @@
- +
-
- - - + + + +
- {{ file.name ? file.name : "Attachment" }} -
+ {{ file.name ? file.name : 'Attachment' }} +
- +
-
diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index f5f19bd..502697d 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -3,276 +3,114 @@
-
+
-
- + +
- +
- +
-
-
+
+
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - - + + +
- +
- +
- +
Available languages:
-
+
{{ lang.name }}
- +
- +
- +
Available technologies:
-
+
{{ tech.name }}
- + -
+
- Are you sure you want to delete your account?
This is - permanent! + Are you sure you want to delete your account?
This is permanent!
- +
-
diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html index 0d9dc6a..0e5f633 100644 --- a/src/app/components/profile/profile.component.html +++ b/src/app/components/profile/profile.component.html @@ -3,48 +3,25 @@
-
+
- +
-
{{ user.firstName }} {{ user.lastName }}
-
@{{ user.userName }}
-
- -
- +
+ {{ user.firstName }} {{ user.lastName }} +
+
+ @{{ user.userName }} +
+ + +
+
@@ -55,7 +32,9 @@ {{ lang.name }}
-
 None
+
+  None +
Technologies: @@ -64,18 +43,18 @@ {{ tech.name }}
-
 None
+
+  None +
-
+
- {{ user.firstName }} {{ user.lastName }} hasn't posted anything - yet! + {{ user.firstName }} {{ user.lastName }} hasn't posted anything yet!
- diff --git a/src/app/components/register/register.component.html b/src/app/components/register/register.component.html index c521d44..0075b1d 100644 --- a/src/app/components/register/register.component.html +++ b/src/app/components/register/register.component.html @@ -2,160 +2,64 @@ Register
-
+
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - + +
- +
- - - + + +
-
+
- - + -- cgit v1.2.3 From c073a058bb7e97e6a9319e88f3f7765d4a466bd0 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 08:37:10 +0200 Subject: Updated feed's subscriptions to use an observer object --- src/app/components/feed/feed.component.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index eaa0ef1..a9a042c 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -49,27 +49,27 @@ export class FeedComponent implements OnInit { fileUpload: new FormControl('') }); - this._userService.getUserFromSessionStorageRequest().subscribe( - (res: object) => { + this._userService.getUserFromSessionStorageRequest().subscribe({ + next: (res: object) => { Object.assign(this.user, res); this.loadFeed(); }, - () => { + error: () => { this.logout(); } - ); + }); } private loadFeed(): void { - this._feedService.getUserFeedFromSessionStorageRequest(this._currentPage++, this._timeLoaded, AppConstants.PAGE_SIZE).subscribe( - (result: object) => { + this._feedService.getUserFeedFromSessionStorageRequest(this._currentPage++, this._timeLoaded, AppConstants.PAGE_SIZE).subscribe({ + next: (result: object) => { this.posts.push(...Object.values(result)[0]); this.finishUserLoading(); }, - () => { + error: () => { this.finishUserLoading(); } - ); + }); } private finishUserLoading(): void { @@ -102,14 +102,14 @@ export class FeedComponent implements OnInit { const postMessage = this.createPostFormGroup.get('newPostMessage')?.value; this.dataArrived = false; - this._postService.createPostWithSessionStorageRequest(postMessage, this.files).subscribe( - () => { + this._postService.createPostWithSessionStorageRequest(postMessage, this.files).subscribe({ + next: () => { this.goToProfile(); }, - () => { + error: () => { this.dataArrived = true; } - ); + }); } onScroll(event: any): void { -- cgit v1.2.3 From 8434044dcf8cec14765aa5d96072feaa2560a823 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 09:06:08 +0200 Subject: Fixed includes (for models) of all components --- src/app/components/admin-panel-page/admin-panel-page.component.ts | 6 +++--- src/app/components/comment-page/comment-page.component.ts | 2 +- src/app/components/comment/comment.component.ts | 4 ++-- src/app/components/feed/feed.component.ts | 4 ++-- src/app/components/post-page/post-page.component.ts | 2 +- src/app/components/post/post.component.ts | 4 ++-- src/app/components/profile-settings/profile-settings.component.ts | 6 +++--- src/app/components/profile/profile.component.ts | 6 +++--- src/app/components/register/register.component.ts | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.ts b/src/app/components/admin-panel-page/admin-panel-page.component.ts index d5ecc71..9beb8bc 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.ts +++ b/src/app/components/admin-panel-page/admin-panel-page.component.ts @@ -11,9 +11,9 @@ import { PostService } from 'src/app/services/post.service'; import { TechnologyService } from 'src/app/services/technology.service'; import { TokenService } from 'src/app/services/token.service'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; -import { Language } from 'src/models/language'; -import { Technology } from 'src/models/technology'; +import { User } from 'src/models/identity/user.model'; +import { Language } from 'src/models/language.model'; +import { Technology } from 'src/models/technology.model'; import { ErrorBarComponent } from '../error-bar/error-bar.component'; import { SuccessBarComponent } from '../success-bar/success-bar.component'; diff --git a/src/app/components/comment-page/comment-page.component.ts b/src/app/components/comment-page/comment-page.component.ts index 9bbdc59..5d256bf 100644 --- a/src/app/components/comment-page/comment-page.component.ts +++ b/src/app/components/comment-page/comment-page.component.ts @@ -5,7 +5,7 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { TokenService } from 'src/app/services/token.service'; -import { Comment } from 'src/models/comment'; +import { Comment } from 'src/models/comment.model'; @Component({ selector: 'app-comment-page', diff --git a/src/app/components/comment/comment.component.ts b/src/app/components/comment/comment.component.ts index d4dd9f4..7da896d 100644 --- a/src/app/components/comment/comment.component.ts +++ b/src/app/components/comment/comment.component.ts @@ -3,8 +3,8 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { UserService } from 'src/app/services/user.service'; -import { Comment } from 'src/models/comment'; -import { User } from 'src/models/identity/user'; +import { Comment } from 'src/models/comment.model'; +import { User } from 'src/models/identity/user.model'; @Component({ selector: 'app-comment', diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index a9a042c..895bf76 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { UserService } from '../../services/user.service'; import { AppConstants } from 'src/app/app-constants.module'; import { FeedService } from 'src/app/services/feed.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { PostService } from 'src/app/services/post.service'; import { TokenService } from 'src/app/services/token.service'; diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index 7c32ce0..a60f4da 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -6,7 +6,7 @@ import { Guid } from 'guid-typescript'; import { CommentService } from 'src/app/services/comment.service'; import { PostService } from 'src/app/services/post.service'; import { TokenService } from 'src/app/services/token.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { CloudinaryService } from 'src/app/services/cloudinary.service'; @Component({ diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts index a46811d..fa5ac2f 100644 --- a/src/app/components/post/post.component.ts +++ b/src/app/components/post/post.component.ts @@ -3,8 +3,8 @@ import { Router } from '@angular/router'; import { Guid } from 'guid-typescript'; import { PostService } from 'src/app/services/post.service'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; -import { Post } from 'src/models/post'; +import { User } from 'src/models/identity/user.model'; +import { Post } from 'src/models/post.model'; @Component({ selector: 'app-post', diff --git a/src/app/components/profile-settings/profile-settings.component.ts b/src/app/components/profile-settings/profile-settings.component.ts index ba1fbb6..b856bef 100644 --- a/src/app/components/profile-settings/profile-settings.component.ts +++ b/src/app/components/profile-settings/profile-settings.component.ts @@ -6,11 +6,11 @@ import { Router } from '@angular/router'; import { LanguageService } from 'src/app/services/language.service'; import { UserService } from 'src/app/services/user.service'; import { TechnologyService } from 'src/app/services/technology.service'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { ErrorBarComponent } from '../error-bar/error-bar.component'; import { SuccessBarComponent } from '../success-bar/success-bar.component'; -import { Language } from 'src/models/language'; -import { Technology } from 'src/models/technology'; +import { Language } from 'src/models/language.model'; +import { Technology } from 'src/models/technology.model'; import { TokenService } from 'src/app/services/token.service'; import { Title } from '@angular/platform-browser'; import { AppConstants } from 'src/app/app-constants.module'; diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 73e1e96..ed17f33 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -1,16 +1,16 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { UserService } from 'src/app/services/user.service'; -import { User } from 'src/models/identity/user'; +import { User } from 'src/models/identity/user.model'; import { AppConstants } from 'src/app/app-constants.module'; import { Location } from '@angular/common'; import { LanguageService } from 'src/app/services/language.service'; import { TechnologyService } from 'src/app/services/technology.service'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { FeedService } from 'src/app/services/feed.service'; import { TokenService } from 'src/app/services/token.service'; import { Title } from '@angular/platform-browser'; -import { Friend } from 'src/models/identity/friend'; +import { Friend } from 'src/models/identity/friend.model'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; @Component({ diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts index b5800ad..07b8976 100644 --- a/src/app/components/register/register.component.ts +++ b/src/app/components/register/register.component.ts @@ -1,6 +1,6 @@ import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Title } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TokenService } from 'src/app/services/token.service'; -- cgit v1.2.3 From afe30ab78432d16c42b2f19e3bd8355e3f27a0e1 Mon Sep 17 00:00:00 2001 From: Danail Dimitrov Date: Sun, 14 Mar 2021 21:06:33 +0200 Subject: fixed rating not beeing highlighted on init and and added capability of rating to handle multiple posts --- .vs/slnx.sqlite | Bin 167936 -> 167936 bytes src/app/components/feed/feed.component.html | 4 ++-- src/app/components/post/post.component.ts | 20 ++++++++------------ src/app/components/profile/profile.component.html | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) (limited to 'src/app/components/feed') diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 8b6d17b..36ca8dd 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 230c27b..5ff2dca 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -40,8 +40,8 @@ None of your friends have posted anything yet!
Try refreshing your page! -
- +
+
diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts index 89620d7..a38d507 100644 --- a/src/app/components/post/post.component.ts +++ b/src/app/components/post/post.component.ts @@ -20,6 +20,7 @@ export class PostComponent implements OnInit { public votesNumber: number; public timeCreated: string; @Input() paramId: string; + @Input() index: number; public loggedIn = false; private voteBtns: HTMLCollectionOf; @@ -33,9 +34,7 @@ export class PostComponent implements OnInit { this._postService.getPostRequest(Guid.parse(this.paramId)).subscribe( (result: object) => { - Object.assign(this.post, result); - - console.log(this.post.postId); + Object.assign(this.post, result); this.post.fileURLs = Object.values(result)[7]; this.votesNumber = this.post.currentRating; @@ -46,17 +45,16 @@ export class PostComponent implements OnInit { this.loadUser(); } - ); - - window.addEventListener("load", () => { - this.highlightButtonsOnInit(); - }); + ); } private loadUser(): void { this._userService.getUserByUsernameRequest(this.post.creatorUsername).subscribe( (result: object) => { Object.assign(this.user, result); + + this.highlightButtonsOnInit(); + this.loaded = true; } ); @@ -123,8 +121,8 @@ export class PostComponent implements OnInit { } private changeColorOfVoteButton(isUpvoted: boolean, isDownvoted: boolean): void { - this.voteBtns.item(0)!.style.backgroundColor = (isUpvoted) ? 'lightblue' : 'white'; - this.voteBtns.item(1)!.style.backgroundColor = (isDownvoted) ? 'lightblue' : 'white'; + this.voteBtns.item(this.index * 2)!.style.backgroundColor = (isUpvoted) ? 'lightblue' : 'white'; + this.voteBtns.item((this.index * 2) + 1)!.style.backgroundColor = (isDownvoted) ? 'lightblue' : 'white'; } private highlightButtonsOnInit(): void { @@ -132,8 +130,6 @@ export class PostComponent implements OnInit { (x: object) => { const isLike: boolean = Object.values(x)[3]; - console.log(this.voteBtns); - this.changeColorOfVoteButton(isLike, !isLike); } ); diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html index 0e5f633..5c21cee 100644 --- a/src/app/components/profile/profile.component.html +++ b/src/app/components/profile/profile.component.html @@ -52,8 +52,8 @@
{{ user.firstName }} {{ user.lastName }} hasn't posted anything yet!
-
- +
+
-- cgit v1.2.3 From 5916079f20c5cd36e4092fd717c1bcc8814670f7 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 19 Mar 2021 16:07:42 +0200 Subject: Added navbar component to pages that need it --- src/app/components/admin-panel-page/admin-panel-page.component.html | 2 ++ src/app/components/comment-page/comment-page.component.html | 2 ++ src/app/components/feed/feed.component.html | 2 ++ src/app/components/post-page/post-page.component.html | 2 ++ src/app/components/profile-settings/profile-settings.component.html | 2 ++ src/app/components/profile/profile.component.html | 2 ++ 6 files changed, 12 insertions(+) (limited to 'src/app/components/feed') diff --git a/src/app/components/admin-panel-page/admin-panel-page.component.html b/src/app/components/admin-panel-page/admin-panel-page.component.html index 31f0849..96ab545 100644 --- a/src/app/components/admin-panel-page/admin-panel-page.component.html +++ b/src/app/components/admin-panel-page/admin-panel-page.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/components/comment-page/comment-page.component.html b/src/app/components/comment-page/comment-page.component.html index ae114da..1b94568 100644 --- a/src/app/components/comment-page/comment-page.component.html +++ b/src/app/components/comment-page/comment-page.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 5ff2dca..5694b09 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/components/post-page/post-page.component.html b/src/app/components/post-page/post-page.component.html index 5da8cc7..fe12177 100644 --- a/src/app/components/post-page/post-page.component.html +++ b/src/app/components/post-page/post-page.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/components/profile-settings/profile-settings.component.html b/src/app/components/profile-settings/profile-settings.component.html index 502697d..dbfc747 100644 --- a/src/app/components/profile-settings/profile-settings.component.html +++ b/src/app/components/profile-settings/profile-settings.component.html @@ -1,3 +1,5 @@ + +
diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html index 5c21cee..dede887 100644 --- a/src/app/components/profile/profile.component.html +++ b/src/app/components/profile/profile.component.html @@ -1,3 +1,5 @@ + +
-- cgit v1.2.3 From 4ff1d8194a2f2ae2a837e1d15167cd3b6b74d32f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 19 Mar 2021 18:19:53 +0200 Subject: Major redesign of feed component styling --- src/app/components/feed/feed.component.css | 171 +++------------------------- src/app/components/feed/feed.component.html | 67 +++++------ src/assets/icons/tabler-icon-paperclip.svg | 65 +++++++++++ src/styles.css | 6 +- 4 files changed, 113 insertions(+), 196 deletions(-) create mode 100644 src/assets/icons/tabler-icon-paperclip.svg (limited to 'src/app/components/feed') diff --git a/src/app/components/feed/feed.component.css b/src/app/components/feed/feed.component.css index 3d22349..baa96d5 100644 --- a/src/app/components/feed/feed.component.css +++ b/src/app/components/feed/feed.component.css @@ -1,171 +1,36 @@ -#feed-page { - height: 100%; - max-width: 40em; - box-sizing: border-box; - border: .5em solid var(--bg-color); - - margin: 0 auto; - - display: flex; -} - -@media screen and (max-width: 750px) { - #profile-bar { - display: none !important; - } - #top-bar-profile-pic { - display: initial; - } -} -@media screen and (min-width: 750px) { - #profile-bar { - display: initial; - } - #top-bar-profile-pic { - display: none !important; - } -} - -/* Content */ - -#feed-content { - flex: 1; - display: flex; - flex-direction: column; -} - -/* Profile bar */ - -#profile-bar { - width: 20%; - height: fit-content; - display: flex; - flex-direction: column; - align-items: center; - - box-sizing: border-box; - background-color: var(--bg-color); - - margin-right: .5em; - padding-bottom: 1em; - padding: .5em; - border-radius: .6em; -} - -#profile-bar-profile-pic { - width: 7em; - height: 7em; - box-sizing: border-box; - padding: .5em; -} - -#profile-bar-name { - text-align: center; -} - -#profile-bar-username { - margin: .5em 0; -} - -#profile-bar > #profile-info { - display: flex; - flex-direction: column; - align-items: center; +#create-post { + width: 100%; + margin: 1em 0; } -/* Top bar */ - -#top-bar { - display: flex; - flex-direction: row; - width: 98%; - margin: 0 auto; - margin-bottom: .5em; - box-sizing: border-box; +#new-post-message { + min-height: 1.5em; + resize: vertical; } -#top-bar-profile-pic { - height: 2.5em; - width: 2.5em; - margin-right: .5em; +#attachments-btns { + padding: 0.5em 0; } -#top-bar-profile-pic > img { - height: inherit; - width: inherit; +#attachments-btns img, .file-button > input { + height: 1.4em; + width: 1.4em; } -#top-bar-open-chat { - /* Until implemented */ - display: none; +#new-post-attachments { + margin-bottom: 0.5em; } -/* Create post */ - -#create-post-form { - width: 100%; +.file-button { position: relative; - display: flex; - flex-direction: column; - box-sizing: border-box; -} - -#form-inputs { - display: flex; -} - -#top-bar-create-post { - flex: 1; - font-size: inherit; - width: 100%; - height: 100%; - margin: 0 auto; - box-sizing: border-box; - border: 2px solid var(--bg-color); - border-radius: .6em; -} - -#file-upload { - font-size: inherit; - color: transparent; - width: 1.5em; - height: 1.5em; } -#file-upload:hover { - cursor: pointer; -} - -#attachment-img { - height: 1.5em; - width: 1.5em; +.file-button > img { position: absolute; - right: .4em; pointer-events: none; } -/* Posts */ - -#no-posts-msg { - width: 100%; - margin-top: 1em; - color: gray; - text-align: center; -} - -/* Elements, that act as buttons */ - -#profile-bar > #profile-info:hover, -#top-bar-profile-pic:hover { - cursor: pointer; -} - -/* Can't copy text from */ - -#profile-bar, -.vote { - -webkit-user-select: none; /* Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+/Edge */ - user-select: none; /* Standard */ +.file-button > input { + font-size: inherit; + color: transparent; } diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 5694b09..c5c4401 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -2,49 +2,34 @@ -
- -
- -
-
- None of your friends have posted anything yet!
- Try refreshing your page! -
-
- +
+
+
+ {{ file.name ? file.name : 'Attachment' }} +
+ ☒ +
+ + +
+
+ None of your friends have posted anything yet!
+ Try refreshing your page! +
+
+ +
diff --git a/src/assets/icons/tabler-icon-paperclip.svg b/src/assets/icons/tabler-icon-paperclip.svg new file mode 100644 index 0000000..955e6fb --- /dev/null +++ b/src/assets/icons/tabler-icon-paperclip.svg @@ -0,0 +1,65 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/styles.css b/src/styles.css index af9bbeb..b4f7539 100644 --- a/src/styles.css +++ b/src/styles.css @@ -24,16 +24,18 @@ body { background-color: var(--bg-color); } -button { +button, textarea, input { color: inherit; background: inherit; + background-color: inherit; font: inherit; padding: 0; border: none; } input:focus, -button:focus { +button:focus, +textarea:focus { outline: 0; } -- cgit v1.2.3 From da7ee0c5d640083fcce8af38730c587c4fb15395 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 19 Mar 2021 19:18:21 +0200 Subject: Fixed height of pages that were the whole window height but were also below the navbar --- src/app/components/comment-page/comment-page.component.html | 2 +- src/app/components/feed/feed.component.html | 2 +- src/app/components/navbar/navbar.component.css | 1 + src/app/components/post-page/post-page.component.html | 2 +- src/app/components/profile-settings/profile-settings.component.html | 2 +- src/app/components/profile/profile.component.html | 2 +- src/app/services/comment.service.ts | 2 +- src/styles.css | 5 +++++ 8 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/app/components/feed') diff --git a/src/app/components/comment-page/comment-page.component.html b/src/app/components/comment-page/comment-page.component.html index 1b94568..553b545 100644 --- a/src/app/components/comment-page/comment-page.component.html +++ b/src/app/components/comment-page/comment-page.component.html @@ -2,7 +2,7 @@ -
+
diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index c5c4401..a8290a1 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -2,7 +2,7 @@ -
+
diff --git a/src/app/components/navbar/navbar.component.css b/src/app/components/navbar/navbar.component.css index aa666b0..d02e928 100644 --- a/src/app/components/navbar/navbar.component.css +++ b/src/app/components/navbar/navbar.component.css @@ -1,4 +1,5 @@ #navbar { + height: var(--navbar-height); width: 100%; background-color: var(--card-bg); } diff --git a/src/app/components/post-page/post-page.component.html b/src/app/components/post-page/post-page.component.html index fe12177..ad748e3 100644 --- a/src/app/components/post-page/post-page.component.html +++ b/src/app/components/post-page/post-page.component.html @@ -2,7 +2,7 @@ -
+