diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 3156263..1dadeaa 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -11,6 +11,7 @@ import { PageNotFound } from './pages/notfound/notfound.page';
import { PageSettings } from './pages/settings/settings.page';
import { PageSubmission } from './pages/submission/submission.page';
import { PageTop } from './pages/top/top.page';
+import { PageUnavailable } from './pages/unavailable/unavailable.page';
import { PageUser } from './pages/user/user.page';
import { PageUserComments } from './pages/user/usercomments/usercomments.page';
import { PageUserEntries } from './pages/user/userentries/userentries.page';
@@ -30,7 +31,9 @@ const routes: Routes = [
{ path: 'bookmarks', component: PageBookmarks, canActivate: [ AuthenticatedGuard ] },
{ path: 'submit', component: PageSubmission, canActivate: [ AuthenticatedGuard ] },
{ path: 'login', component: PageLogin, canActivate: [ AnonymousGuard ] },
- { path: 'settings', component: PageSettings, canActivate: [ AuthenticatedGuard ] },
+ { path: 'settings', component: PageSettings, canActivate: [ AuthenticatedGuard ] },
+ { path: 'unavailable', component: PageUnavailable },
+ { path: '**', component: PageNotFound, pathMatch: 'full', canActivate: [ AuthUpdateGuard ] },
]
},
];
diff --git a/src/app/pages/comment/comment.page.html b/src/app/pages/comment/comment.page.html
index 02a4cae..081673b 100644
--- a/src/app/pages/comment/comment.page.html
+++ b/src/app/pages/comment/comment.page.html
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/src/app/pages/comment/comment.page.ts b/src/app/pages/comment/comment.page.ts
index f909cbc..16f275a 100644
--- a/src/app/pages/comment/comment.page.ts
+++ b/src/app/pages/comment/comment.page.ts
@@ -15,16 +15,14 @@ export class PageComment implements OnInit {
id: number;
comment: any;
notfound: boolean = false;
+ ignoreSubcomments : string[] = ['entry'];
constructor(private commentService: CommentService,
private route: ActivatedRoute) { }
ngOnInit(): void {
this.id = +this.route.snapshot.paramMap.get('id');
- this.refresh();
- }
- refresh() {
this.commentService.getComment(this.id).subscribe((data) => {
this.comment = data;
}, (error) => {
@@ -34,6 +32,4 @@ export class PageComment implements OnInit {
})
}
-
-
}
diff --git a/src/app/pages/entry/entry.page.html b/src/app/pages/entry/entry.page.html
index f175988..4a8a0f0 100644
--- a/src/app/pages/entry/entry.page.html
+++ b/src/app/pages/entry/entry.page.html
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/src/app/pages/unavailable/unavailable.page.ts b/src/app/pages/unavailable/unavailable.page.ts
index 81c3f88..5033268 100644
--- a/src/app/pages/unavailable/unavailable.page.ts
+++ b/src/app/pages/unavailable/unavailable.page.ts
@@ -29,7 +29,7 @@ export class PageUnavailable implements OnInit {
if (!this.targetRoute || this.targetRoute === "unavailable" || this.targetRoute === "/unavailable") {
this.location.back;
} else {
- this.router.navigate([ this.targetRoute ], { skipLocationChange: true });
+ this.router.navigate([ this.targetRoute ]);
}
}
diff --git a/src/app/pages/user/user.page.ts b/src/app/pages/user/user.page.ts
index c2432ac..9c1c4ac 100644
--- a/src/app/pages/user/user.page.ts
+++ b/src/app/pages/user/user.page.ts
@@ -24,7 +24,7 @@ export class PageUser implements OnInit {
this.userService.getUser(this.username).subscribe((data) => {
this.user = data;
}, (error) => {
- if (error.status == 404) {
+ if (error.status == 422) {
this.notfound = true;
}
})
diff --git a/src/app/pages/user/usercomments/usercomments.page.html b/src/app/pages/user/usercomments/usercomments.page.html
index 2636949..0d4aea9 100644
--- a/src/app/pages/user/usercomments/usercomments.page.html
+++ b/src/app/pages/user/usercomments/usercomments.page.html
@@ -6,27 +6,7 @@
{{'user.commentsBy' | i18n}}{{username}}
0">
-
+
diff --git a/src/app/pages/user/usercomments/usercomments.page.ts b/src/app/pages/user/usercomments/usercomments.page.ts
index c2ab8e3..7b9bdfa 100644
--- a/src/app/pages/user/usercomments/usercomments.page.ts
+++ b/src/app/pages/user/usercomments/usercomments.page.ts
@@ -14,19 +14,20 @@ export class PageUserComments implements OnInit {
username: string;
comments: any = {};
init: boolean = true;
+ ignore : string[] = ["author"];
constructor(private commentService: CommentService, private router: Router, private route: ActivatedRoute) { }
ngOnInit(): void {
this.username = this.route.snapshot.paramMap.get('username');
- this.commentService.getByUser(this.username, this.comments.number || 0, this.comments.size || 30).subscribe((data: any) => {
+ this.commentService.getByUser(this.username, this.comments.number || 0, this.comments.size || 30, this.ignore).subscribe((data: any) => {
this.comments = data;
}, (error) => { })
}
showMore() {
const oldContent: any[] = this.comments.content;
- this.commentService.getByUser(this.username, this.comments.number + 1, this.comments.size).subscribe((data) => {
+ this.commentService.getByUser(this.username, this.comments.number + 1, this.comments.size, this.ignore).subscribe((data) => {
this.comments = data;
for (let comment of this.comments.content) {
oldContent.push(comment);
diff --git a/src/app/services/comment.service.ts b/src/app/services/comment.service.ts
index 9edcd31..e6483a9 100644
--- a/src/app/services/comment.service.ts
+++ b/src/app/services/comment.service.ts
@@ -10,24 +10,24 @@ export class CommentService {
constructor(private http: HttpClient) {
}
- getRanked(target: number, page: number, size: number) {
- return this.http.get(environment.apiUrl + "/comments/" + target + "?page=" + page + "&size=" + size);
+ getRanked(target: number, page: number, size: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/" + target + "?page=" + page + "&size=" + size + "&ignore=" + ignore);
}
- getRankedByParent(target: number, parent: number, page: number, size: number) {
- return this.http.get(environment.apiUrl + "/comments/" + target + "/" + parent + "?page=" + page + "&size=" + size);
+ getRankedByParent(target: number, parent: number, page: number, size: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/" + target + "/" + parent + "?page=" + page + "&size=" + size+ "&ignore=" + ignore);
}
- getNew(target: number, page: number, size: number) {
- return this.http.get(environment.apiUrl + "/comments/new/" + target + "?page=" + page + "&size=" + size);
+ getNew(target: number, page: number, size: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/new/" + target + "?page=" + page + "&size=" + size+ "&ignore=" + ignore);
}
- getNewByParent(target: number, parent: number, page: number, size: number) {
- return this.http.get(environment.apiUrl + "/comments/new/" + target + "/" + parent + "?page=" + page + "&size=" + size);
+ getNewByParent(target: number, parent: number, page: number, size: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/new/" + target + "/" + parent + "?page=" + page + "&size=" + size+ "&ignore=" + ignore);
}
- getByUser(username: string, page: number, size: number) {
- return this.http.get(environment.apiUrl + "/comments/byuser/" + username + "?page=" + page + "&size=" + size);
+ getByUser(username: string, page: number, size: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/byuser/" + username + "?page=" + page + "&size=" + size+ "&ignore=" + ignore);
}
count(target: number) {
@@ -38,13 +38,13 @@ export class CommentService {
return this.http.get(environment.apiUrl + "/comments/count/" + target + "/" + parent);
}
- getComment(id: number) {
- return this.http.get(environment.apiUrl + "/comments/comment/" + id);
+ getComment(id: number, ignore : string[] = []) {
+ return this.http.get(environment.apiUrl + "/comments/comment/" + id + "?ignore=" + ignore);
}
- create(comment: any) {
+ create(comment: any, ignore : string[] = []) {
comment.type = 'COMMENT';
- return this.http.post(environment.apiUrl + "/comments", comment);
+ return this.http.post(environment.apiUrl + "/comments?ignore=" + ignore, comment);
}
}
\ No newline at end of file
diff --git a/src/app/services/i18n.service.ts b/src/app/services/i18n.service.ts
index e90e6aa..c1667f5 100644
--- a/src/app/services/i18n.service.ts
+++ b/src/app/services/i18n.service.ts
@@ -9,8 +9,8 @@ import { Subject } from 'rxjs';
})
export class I18nService {
- locale: string = "en";
- locales: any[] = [ "en" ];
+ locale: string = "de-informal";
+ locales: any[] = [ "de-informal", "en" ];
i18n: any;
constructor(private http: HttpClient) {
@@ -22,7 +22,7 @@ export class I18nService {
}
getLocale() {
- return this.locale || 'en';
+ return this.locale || 'de-informal';
}
setLocale(locale) {
@@ -96,7 +96,7 @@ export class I18nService {
if (args && args.length > 0) {
return key + "[" + args + "]";
}
-
+
return key;
}
diff --git a/src/app/ui/comment/comment.ui.html b/src/app/ui/comment/comment.ui.html
index 9559b5c..eb1c7e1 100644
--- a/src/app/ui/comment/comment.ui.html
+++ b/src/app/ui/comment/comment.ui.html
@@ -18,9 +18,10 @@
{{comment.created
| datef}}
- {{'comment.on' | i18n}} {{'comment.author' | i18n}}{{comment.author}}
+ {{'comment.on' | i18n}} {{comment.metadata.entry || 'entry'}}
- {{'comment.author' | i18n}}{{comment.author}}
|
{{'comment.unvote' | i18n}}
@@ -44,4 +45,4 @@
-
\ No newline at end of file
+ 0" #subcomments [target]="comment.target" [parent]="comment.id" [subcomments]="subcomments">
\ No newline at end of file
diff --git a/src/app/ui/comment/comment.ui.scss b/src/app/ui/comment/comment.ui.scss
index 9a4a9e2..b19a36e 100644
--- a/src/app/ui/comment/comment.ui.scss
+++ b/src/app/ui/comment/comment.ui.scss
@@ -1,9 +1,9 @@
-small > a {
+small a:not(.entry) {
color: inherit !important;
text-decoration: none;
}
-small > a:hover {
+small a:not(.entry):hover {
color: inherit !important;
text-decoration: underline;
}
diff --git a/src/app/ui/comment/comment.ui.ts b/src/app/ui/comment/comment.ui.ts
index 5bdff33..3d6ff9f 100644
--- a/src/app/ui/comment/comment.ui.ts
+++ b/src/app/ui/comment/comment.ui.ts
@@ -18,7 +18,9 @@ export class UiComment implements OnInit {
moderator: boolean = false;
@Input() comment: any;
@Input() change: Function;
- @ViewChild('subcomments') subcomments: UiComments;
+ @Input() ignore: string[] = [];
+ @Input() subcomments: boolean = false;
+ @ViewChild('subcomments') comments: UiComments;
constructor(private authService: AuthService, private commentService: CommentService, private voteService: VoteService,
private moderationService: ModerationService, public dialog: MatDialog) { }
@@ -33,15 +35,11 @@ export class UiComment implements OnInit {
}
}
})
-
- this.commentService.countParent(this.comment.target, this.comment.id).subscribe((data) => {
- this.comment.metadata.comments = +data;
- });
}
voteUp() {
this.voteService.voteCommentUp(this.comment.id).subscribe((result) => {
- this.commentService.getComment(this.comment.id).subscribe((data) => {
+ this.commentService.getComment(this.comment.id, this.ignore).subscribe((data) => {
this.comment = data;
})
});
@@ -49,7 +47,7 @@ export class UiComment implements OnInit {
voteDown() {
this.voteService.voteCommentDown(this.comment.id).subscribe((result) => {
- this.commentService.getComment(this.comment.id).subscribe((data) => {
+ this.commentService.getComment(this.comment.id, this.ignore).subscribe((data) => {
this.comment = data;
})
});
@@ -57,7 +55,7 @@ export class UiComment implements OnInit {
unvote() {
this.voteService.unvoteComment(this.comment.id).subscribe((result) => {
- this.commentService.getComment(this.comment.id).subscribe((data) => {
+ this.commentService.getComment(this.comment.id, this.ignore).subscribe((data) => {
this.comment = data;
})
});
@@ -68,7 +66,9 @@ export class UiComment implements OnInit {
}
replyCallback(comment): void {
- this.subcomments.addComment(comment);
+ if (this.subcomments) {
+ this.comments.addComment(comment);
+ }
this.comment.metadata.reply = false;
this.comment.metadata.comments = (this.comment.metadata.comments || 0) + 1;
}
diff --git a/src/app/ui/comments/comments.ui.html b/src/app/ui/comments/comments.ui.html
index df82ebd..0b8ebc0 100644
--- a/src/app/ui/comments/comments.ui.html
+++ b/src/app/ui/comments/comments.ui.html
@@ -3,7 +3,7 @@
-
-
- thumb_up
-
-
-
-
+
+ thumb_up
+
+
+
+ thumb_down
+
+
thumb_up
thumb_down
diff --git a/src/assets/i18n/de-informal.json b/src/assets/i18n/de-informal.json
index 9e26dfe..c5f76fc 100644
--- a/src/assets/i18n/de-informal.json
+++ b/src/assets/i18n/de-informal.json
@@ -1 +1,155 @@
-{}
\ No newline at end of file
+{
+ "bookmarks": {
+ ".": "Lesezeichen",
+ "add": "Lesezeichen hinzufügen",
+ "remove": "Lesezeichen entfernen"
+ },
+ "bstlboard": {
+ ".": "βstlβoard"
+ },
+ "cancel": "Abbrechen",
+ "comment": {
+ ".": "Kommentar",
+ "author": "von ",
+ "confirmDelete": "Bitte bestätige die Löschung des Kommentars von '{1}'!",
+ "create": "Kommentieren",
+ "delete": "Löschen?",
+ "on": "zu ",
+ "reply": "Antworten",
+ "replyHide": "Abbrechen",
+ "text": {
+ ".": "Text",
+ "error": "Text erforderlich!"
+ },
+ "unvote": "unvoten"
+ },
+ "comments": {
+ ".": "Kommentare",
+ "nothing": "Keine Kommentare bisher",
+ "showMore": "Zeige mehr Kommentare",
+ "subcomments": {
+ ".": "Unterkommentare",
+ "showMore": "Zeige mehr Unterkommentare"
+ }
+ },
+ "confirm": "Bestätigen",
+ "darkTheme": "Dunkles Thema",
+ "entries": {
+ "nothing": "Keine Beiträge bisher"
+ },
+ "entry": {
+ ".": "Beitrag",
+ "author": "von ",
+ "comment": "1 Kommentar",
+ "comments": "{0} Kommentare",
+ "confirmDelete": "Bitte bestätige die Löschung des Beitrages '{0}' von '{1}'!",
+ "delete": "Löschen?",
+ "unvote": "unvoten"
+ },
+ "entryType": {
+ "DISCUSSION": {
+ ".": "Diskussion",
+ "icon": "insert_comment"
+ },
+ "INTERN": {
+ ".": "Intern",
+ "icon": "lock"
+ },
+ "LINK": {
+ ".": "Link",
+ "icon": "link"
+ },
+ "QUESTION": {
+ ".": "Frage",
+ "icon": "contact_support"
+ }
+ },
+ "locale": {
+ "de-informal": {
+ "long": "Deutsch",
+ "short": "DE"
+ },
+ "en": {
+ "long": "english",
+ "short": "EN"
+ }
+ },
+ "login": {
+ ".": "Login",
+ "autologin": "Automatisch einloggen",
+ "external": {
+ ".": "Login",
+ "client": "mit {0} einloggen",
+ "invalid": "Login fehlgeschlagen"
+ },
+ "internal": "Login intern",
+ "invalid": "Falscher Username oder Password",
+ "keepSession": "eingeloggt bleiben"
+ },
+ "logout": "Logout",
+ "new": "Neuste",
+ "not-found": {
+ ".": "Nicht gefunden",
+ "text": "Seite nicht gefunden"
+ },
+ "paginator": {
+ "firstPage": "Erste Seite",
+ "itemsPerPage": "Einträge pro Seite:",
+ "lastPage": "Letzte Seite",
+ "nextPage": "Nächste Seite",
+ "previousPage": "Vorherige Seite",
+ "range": "Seite {0} von {1}"
+ },
+ "password": "Passwort",
+ "point": "1 Punkt",
+ "points": "{0} Punkte",
+ "service-unavailable": {
+ ".": "Dienst nicht erreichbar",
+ "retry": "Seite neu laden",
+ "support": "Support",
+ "text": "Zurzeit scheint der Dienst nicht erreichbar zu sein. Wenn diese Meldung länger besteht, melde dich beim Support!"
+ },
+ "settings": {
+ ".": "Einstellungen",
+ "about": "Über",
+ "darkTheme": "Dunkles Thema",
+ "update": "Aktualisieren",
+ "username": "Username"
+ },
+ "submission": {
+ ".": "Neuer Beitrag",
+ "create": "Beitrag erstellen",
+ "entryType": {
+ ".": "Typ",
+ "error": "Typ auswählen"
+ },
+ "info": "Neuen Beitrag erstellen",
+ "text": {
+ ".": "Text"
+ },
+ "title": {
+ ".": "Titel",
+ "error": "Titel erforderlich"
+ },
+ "url": {
+ ".": "Url",
+ "error": "Url erforderlich"
+ }
+ },
+ "top": "Top",
+ "user": {
+ ".": "User",
+ "about": "Über",
+ "comments": "Kommentare",
+ "commentsBy": "Kommentare von ",
+ "entries": "Beiträge",
+ "entriesBy": "Beiträge von ",
+ "points": "Karma",
+ "username": "User"
+ },
+ "username": "Username",
+ "vote": {
+ "down": "Negativ bewerten",
+ "up": "Positiv bewerten"
+ }
+}
\ No newline at end of file
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index 9e26dfe..8760cfe 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -1 +1,155 @@
-{}
\ No newline at end of file
+{
+ "bookmarks": {
+ ".": "bookmarks",
+ "add": "add bookmark",
+ "remove": "remove bookmark"
+ },
+ "bstlboard": {
+ ".": "βstlβoard"
+ },
+ "cancel": "cancel",
+ "comment": {
+ ".": "comment",
+ "author": "by ",
+ "confirmDelete": "Please confirm deletion of comment by '{1}'!",
+ "create": "add comment",
+ "delete": "delete?",
+ "on": "on ",
+ "reply": "reply",
+ "replyHide": "cancel reply",
+ "text": {
+ ".": "text",
+ "error": "text required!"
+ },
+ "unvote": "unvote"
+ },
+ "comments": {
+ ".": "comments",
+ "nothing": "no comments yet",
+ "showMore": "show more comments",
+ "subcomments": {
+ ".": "subcomments",
+ "showMore": "show more subcomments"
+ }
+ },
+ "confirm": "confirm",
+ "darkTheme": "dark theme",
+ "entries": {
+ "nothing": "no entries yet"
+ },
+ "entry": {
+ ".": "entry",
+ "author": "by ",
+ "comment": "1 comment",
+ "comments": "{0} comments",
+ "confirmDelete": "Please confirm deletion of entry '{0}' by '{1}'!",
+ "delete": "delete?",
+ "unvote": "unvote"
+ },
+ "entryType": {
+ "DISCUSSION": {
+ ".": "discussion",
+ "icon": "insert_comment"
+ },
+ "INTERN": {
+ ".": "intern",
+ "icon": "lock"
+ },
+ "LINK": {
+ ".": "link",
+ "icon": "link"
+ },
+ "QUESTION": {
+ ".": "question",
+ "icon": "contact_support"
+ }
+ },
+ "locale": {
+ "de-informal": {
+ "long": "Deutsch",
+ "short": "DE"
+ },
+ "en": {
+ "long": "english",
+ "short": "EN"
+ }
+ },
+ "login": {
+ ".": "login",
+ "autologin": "login automatically",
+ "external": {
+ ".": "login",
+ "client": "login with {0}",
+ "invalid": "login failed"
+ },
+ "internal": "internal login",
+ "invalid": "wrong username or password",
+ "keepSession": "stay logged in"
+ },
+ "logout": "logout",
+ "new": "new",
+ "not-found": {
+ ".": "Not found",
+ "text": "Page not found"
+ },
+ "paginator": {
+ "firstPage": "first page",
+ "itemsPerPage": "items per page:",
+ "lastPage": "last page",
+ "nextPage": "next page",
+ "previousPage": "previous page",
+ "range": "page {0} of {1}"
+ },
+ "password": "password",
+ "point": "1 point",
+ "points": "{0} points",
+ "service-unavailable": {
+ ".": "Service unavailable",
+ "retry": "Reload page",
+ "support": "Support",
+ "text": "The service seems currently unavailable. If this message appears over a longer period, please contact our support!"
+ },
+ "settings": {
+ ".": "settings",
+ "about": "about",
+ "darkTheme": "dark theme",
+ "update": "update",
+ "username": "username"
+ },
+ "submission": {
+ ".": "new entry",
+ "create": "create entry",
+ "entryType": {
+ ".": "type",
+ "error": "set type"
+ },
+ "info": "create a new entry",
+ "text": {
+ ".": "text"
+ },
+ "title": {
+ ".": "title",
+ "error": "title required"
+ },
+ "url": {
+ ".": "url",
+ "error": "url required"
+ }
+ },
+ "top": "top",
+ "user": {
+ ".": "user",
+ "about": "about",
+ "comments": "comments",
+ "commentsBy": "comments by ",
+ "entries": "entries",
+ "entriesBy": "entries by ",
+ "points": "karma",
+ "username": "user"
+ },
+ "username": "username",
+ "vote": {
+ "down": "vote down",
+ "up": "vote up"
+ }
+}
\ No newline at end of file