-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from CodeURJC-DAW-2022-23/feat/top-list-page
Feat: top list page
- Loading branch information
Showing
26 changed files
with
774 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,3 +161,4 @@ Webpack/* | |
*.iml | ||
*.ipr | ||
.metals/metals.lock.db | ||
.metals/metals.mv.db |
10 changes: 10 additions & 0 deletions
10
back/src/main/java/net/daw/alist/controllers/SPAController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package net.daw.alist.controllers; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
public class SPAController { | ||
@GetMapping({"/new/**/{path:[^\\.]*}", "/{path:new[^\\.]*}"}) | ||
public String redirect() { | ||
return "forward:/new/index.html"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { User } from "./user.model"; | ||
|
||
export interface Comment { | ||
id?: number; | ||
author: User; | ||
id: number; | ||
imageID: number; | ||
authorName: string; | ||
date: Date; | ||
content: string; | ||
imagePath: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
front/src/app/post/components/comment/comment-form/CommentForm.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface CommentForm { | ||
username: string; | ||
content: string; | ||
date: Date; | ||
} |
147 changes: 147 additions & 0 deletions
147
front/src/app/post/components/comment/comment-form/comment-form.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
img { | ||
object-fit: cover; | ||
} | ||
|
||
.commentTitle { | ||
color: black; | ||
margin: auto; | ||
padding-left: 1em; | ||
padding-right: 1em; | ||
} | ||
|
||
.commentBox { | ||
background-color: white; | ||
} | ||
|
||
.commentSection { | ||
background-color: white; | ||
border-radius: var(--bs-border-radius); | ||
padding-top: 1rem; | ||
padding-bottom: 1rem; | ||
} | ||
|
||
.post, | ||
.commentSection, | ||
.comment { | ||
width: 95%; | ||
margin: auto; | ||
} | ||
|
||
.postInfo { | ||
border-top-left-radius: var(--bs-border-radius); | ||
border-top-right-radius: var(--bs-border-radius); | ||
} | ||
|
||
.writeComment, | ||
.comment { | ||
background-color: white; | ||
border-bottom-style: solid; | ||
border-width: 1px; | ||
border-color: rgb(224, 224, 224); | ||
} | ||
|
||
.form-control { | ||
margin: auto; | ||
width: 90%; | ||
} | ||
|
||
.own-comment-image { | ||
margin: auto; | ||
margin-right: 0.25em; | ||
} | ||
|
||
.topName { | ||
font-weight: 600; | ||
} | ||
|
||
.comment-image { | ||
margin-top: 0.1em; | ||
} | ||
|
||
.commentBox { | ||
margin: auto; | ||
} | ||
|
||
.OP { | ||
color: black; | ||
font-weight: 600; | ||
font-size: 25px; | ||
} | ||
|
||
.username { | ||
color: black; | ||
font-weight: 600; | ||
font-size: 20px; | ||
} | ||
|
||
h6 { | ||
color: grey; | ||
} | ||
|
||
input[type='text'] { | ||
min-height: 7em; | ||
word-wrap: break-word; | ||
word-break: break-all; | ||
} | ||
|
||
.list-group li + li { | ||
margin-top: 1rem; | ||
} | ||
|
||
.list-group ol li { | ||
padding: 0.5em; | ||
font-size: 20px; | ||
font-weight: 600; | ||
text-align: left; | ||
} | ||
|
||
.list-group ol { | ||
width: 75%; | ||
list-style-position: inside; | ||
} | ||
|
||
.text-left { | ||
margin: 0; | ||
} | ||
|
||
.profileImg { | ||
margin-left: 1em; | ||
} | ||
|
||
.itemWrapper { | ||
border-radius: 10px; | ||
border: solid 3px; | ||
border-color: #69c0a1; | ||
} | ||
|
||
.topic { | ||
color: gray; | ||
text-decoration: none; | ||
} | ||
|
||
.topic:hover { | ||
color: black; | ||
} | ||
|
||
.topic, | ||
.upvoteIcon, | ||
.downvoteIcon, | ||
.shareIcon { | ||
cursor: pointer; | ||
} | ||
|
||
.commentTitle { | ||
border-bottom-style: solid; | ||
border-width: 1px; | ||
border-color: rgb(224, 224, 224); | ||
} | ||
|
||
@media only screen and (min-width: 768px) { | ||
/* For desktop: */ | ||
.post, | ||
.commentSection, | ||
.comment { | ||
width: 40%; | ||
margin: auto; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
front/src/app/post/components/comment/comment-form/comment-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<form [formGroup]="commentForm" (ngSubmit)="onSubmit()"> | ||
<div class="writeComment p-3"> | ||
<div class="alert alert-info" role="info" *ngIf="commentCreated"> | ||
Comment posted successfully | ||
</div> | ||
<div class="d-flex flex-row"> | ||
<img [src]="fetchUserImage()" alt="pfp" width="40" height="40" class="own-comment-image rounded-circle flex-shrink-0"> | ||
<textarea [(ngModel)]="content" formControlName="content" | ||
class="commentBox form-control ml-1 shadow-none textarea" placeholder="Write a comment..." | ||
name="commentContent"></textarea> | ||
</div> | ||
<div class="mt-2 d-flex justify-content-center"> | ||
<button class="btn btn-primary btn-sm shadow-none" type="submit" [disabled]="commentForm.invalid">Post comment</button> | ||
</div> | ||
</div> | ||
</form> |
23 changes: 23 additions & 0 deletions
23
front/src/app/post/components/comment/comment-form/comment-form.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CommentFormComponent } from './comment-form.component'; | ||
|
||
describe('CommentFormComponent', () => { | ||
let component: CommentFormComponent; | ||
let fixture: ComponentFixture<CommentFormComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ CommentFormComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(CommentFormComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.