- Добро пожаловать на эту небольшую борду. Сейчас тут только три треда и одна доска, но скоро будет больше.
- Чтобы выбрать тред воспользуйтесь полем ниже, после выбора нажмите кнопку "Обновить" дабы перейти в этот тред.
- Вы можете отправлять сообщения в открытый тред и прикреплять к сообщению картинки.
- Ведите себя хорошо.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/app/SingleThread/boards.component.ts b/src/app/SingleThread/boards.component.ts
deleted file mode 100644
index 2e62cea..0000000
--- a/src/app/SingleThread/boards.component.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Component, Input, OnInit } from '@angular/core';
-import { ApiChatService } from '../services/api-chat.service';
-import { SinglePost } from '../models/post'
-import * as vars from '../var/api'
-import {ActivatedRoute} from "@angular/router";
-import {setDisplayedThread} from "../var/api";
-
-@Component({
- selector: 'app-SingleThread',
- templateUrl: `./boards.component.html`,
- styleUrls: [`./boards.component.css`]
-})
-export class BoardsComponent implements OnInit {
- command: string = "";
- response: any;
- postsToShow: SinglePost[] = []
- boardName:string = 'b';
- displayed_thread_number = vars.displayed_thread;
- showGuide: boolean = false;
-
- constructor(
- public apiChatService: ApiChatService,
- private activatedRoute:ActivatedRoute
- ){
-
- }
- refreshPosts(boardName: string , threadId:number) {
- this.apiChatService.getPosts(boardName, threadId).subscribe(response => {
- this.postsToShow = response
- vars.setDisplayedThread(this.displayed_thread_number);
- })
- }
-
- ngOnInit(): void {
- var threadId = this.activatedRoute.snapshot.queryParamMap.get('thread');
- if(threadId != null)
- {
- this.displayed_thread_number = parseInt(threadId);
- vars.setDisplayedThread(this.displayed_thread_number);
- }
- this.apiChatService.getPosts('postgres', this.displayed_thread_number).subscribe(response => {
- this.postsToShow = response
- })
- }
-
-
-}
-
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 5272f87..c9f72e8 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -5,16 +5,16 @@ import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
-import { HomeComponent } from './home/home.component';
-import { AboutComponent } from './about/about.component';
-import { BoardsComponent } from './SingleThread/boards.component';
-import { NotFoundComponent } from './not-found/not-found.component';
+import { HomeComponent } from './pages/home/home.component';
+import { AboutComponent } from './pages/about/about.component';
+import { BoardsComponent } from './pages/SingleThread/boards.component';
+import { NotFoundComponent } from './pages/not-found/not-found.component';
import { ApiChatService } from './services/api-chat.service';
import { FormsModule } from '@angular/forms';
-import { SendPostComponent } from './send-post/send-post.component';
-import { PostComponent } from './SingleThread/post/post.component'
-import { ThreadsComponent } from './BoardThreads/threads.component';
-import { OPComponent } from './BoardThreads/op/op.component';
+import { SendPostComponent } from './pages/send-post/send-post.component';
+import { PostComponent } from './pages/SingleThread/post/post.component'
+import { ThreadsComponent } from './pages/BoardThreads/threads.component';
+import { OPComponent } from './pages/BoardThreads/op/op.component';
const appRoutes: Routes = [
{ path: '', component: HomeComponent },
diff --git a/src/app/var/api.ts b/src/app/const/api.ts
similarity index 87%
rename from src/app/var/api.ts
rename to src/app/const/api.ts
index dbbd11c..61dc6c0 100644
--- a/src/app/var/api.ts
+++ b/src/app/const/api.ts
@@ -1,9 +1,6 @@
export const api_endpoint: string = 'http://api.vdk2ch.ru:5000/';
//export const api_endpoint: string = 'http://localhost:7141/';
-export var displayed_thread: number;
-export function setDisplayedThread(toset:number){
- displayed_thread = toset;
-};
+
const ALERT_SHOW_TIME = 5000;
const showAlert = (message:string, color:string) => {
diff --git a/src/app/BoardThreads/op/op.component.css b/src/app/pages/BoardThreads/op/op.component.css
similarity index 100%
rename from src/app/BoardThreads/op/op.component.css
rename to src/app/pages/BoardThreads/op/op.component.css
diff --git a/src/app/BoardThreads/op/op.component.html b/src/app/pages/BoardThreads/op/op.component.html
similarity index 100%
rename from src/app/BoardThreads/op/op.component.html
rename to src/app/pages/BoardThreads/op/op.component.html
diff --git a/src/app/BoardThreads/op/op.component.spec.ts b/src/app/pages/BoardThreads/op/op.component.spec.ts
similarity index 100%
rename from src/app/BoardThreads/op/op.component.spec.ts
rename to src/app/pages/BoardThreads/op/op.component.spec.ts
diff --git a/src/app/BoardThreads/op/op.component.ts b/src/app/pages/BoardThreads/op/op.component.ts
similarity index 85%
rename from src/app/BoardThreads/op/op.component.ts
rename to src/app/pages/BoardThreads/op/op.component.ts
index ca61e2b..ec0cbc1 100644
--- a/src/app/BoardThreads/op/op.component.ts
+++ b/src/app/pages/BoardThreads/op/op.component.ts
@@ -1,5 +1,5 @@
import {Component, Input, OnInit} from '@angular/core';
-import { SinglePost } from '../../models/post';
+import { SinglePost } from '../../../models/post';
@Component({
selector: 'op-single',
diff --git a/src/app/BoardThreads/threads.component.css b/src/app/pages/BoardThreads/threads.component.css
similarity index 100%
rename from src/app/BoardThreads/threads.component.css
rename to src/app/pages/BoardThreads/threads.component.css
diff --git a/src/app/BoardThreads/threads.component.html b/src/app/pages/BoardThreads/threads.component.html
similarity index 100%
rename from src/app/BoardThreads/threads.component.html
rename to src/app/pages/BoardThreads/threads.component.html
diff --git a/src/app/BoardThreads/threads.component.spec.ts b/src/app/pages/BoardThreads/threads.component.spec.ts
similarity index 100%
rename from src/app/BoardThreads/threads.component.spec.ts
rename to src/app/pages/BoardThreads/threads.component.spec.ts
diff --git a/src/app/BoardThreads/threads.component.ts b/src/app/pages/BoardThreads/threads.component.ts
similarity index 73%
rename from src/app/BoardThreads/threads.component.ts
rename to src/app/pages/BoardThreads/threads.component.ts
index d0701d9..f1e2751 100644
--- a/src/app/BoardThreads/threads.component.ts
+++ b/src/app/pages/BoardThreads/threads.component.ts
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
-import * as vars from "../var/api";
-import {SinglePost} from "../models/post";
-import {ApiChatService} from "../services/api-chat.service";
+import {SinglePost} from "../../models/post";
+import {ApiChatService} from "../../services/api-chat.service";
@Component({
selector: 'app-BoardThreads',
@@ -14,7 +13,6 @@ export class ThreadsComponent implements OnInit {
command: string = "";
response: any;
opsToShow: SinglePost[] = []
- displayed_thread_number = vars.displayed_thread;
showGuide: boolean = false;
constructor(public apiChatService: ApiChatService) {
@@ -23,7 +21,6 @@ export class ThreadsComponent implements OnInit {
refreshOPs(boardName: string) {
this.apiChatService.getThreads(boardName).subscribe(response => {
this.opsToShow = response
- vars.setDisplayedThread(this.displayed_thread_number);
})
}
diff --git a/src/app/SingleThread/boards.component.css b/src/app/pages/SingleThread/boards.component.css
similarity index 100%
rename from src/app/SingleThread/boards.component.css
rename to src/app/pages/SingleThread/boards.component.css
diff --git a/src/app/pages/SingleThread/boards.component.html b/src/app/pages/SingleThread/boards.component.html
new file mode 100644
index 0000000..a09a066
--- /dev/null
+++ b/src/app/pages/SingleThread/boards.component.html
@@ -0,0 +1,21 @@
+