Skip to content

Commit 50200cd

Browse files
committed
consolidate pagination bar for async lists (bookmarks, snippets, search results)
1 parent bfdc765 commit 50200cd

11 files changed

+31
-239
lines changed

frontend/src/app/app.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@
4545
>
4646
<i class="fas fa-cog mr-1"></i> Settings
4747
</a>
48-
<a
49-
class="list-group-item list-group-item-action bg-light"
50-
title="History"
51-
[routerLink]="['/history']"
52-
>
53-
<i class="fas fa-history mr-1"></i> History bookmarks:
54-
</a>
5548
<div *ngIf="(latestVisitedBookmarks$ | async) as latestVisitedBookmarks" class="mt-1" (mouseout)="resetHoveringLastVisited()">
49+
<a
50+
class="list-group-item list-group-item-action bg-light"
51+
title="Ctrl+H for quick access"
52+
[routerLink]="['/history']"
53+
>
54+
<i class="fas fa-history mr-1"></i> History bookmarks
55+
</a>
5656
<ng-container *ngFor="let bookmark of latestVisitedBookmarks; let i = index" class="mt-1">
5757
<span class="mt-1 mr-2 on-top">
5858
<a
@@ -76,7 +76,7 @@
7676
</div>
7777

7878
<ng-container *ngIf="(latestSearches$ | async) as latestSearches">
79-
<span class="list-group-item list-group-item-action bg-light"><i class="fa fa-search mr-1"></i> Latest searches:</span>
79+
<span class="list-group-item list-group-item-action bg-light"><i class="fa fa-search mr-1"></i> Latest searches</span>
8080
<div class="mt-1" (mouseout)="resetHoveringLastSearches()">
8181
<ng-container *ngFor="let mySearch of latestSearches; let i = index" class="mt-1">
8282
<span class="mt-1 mr-2 on-top">

frontend/src/app/public/bookmarks/homepage.component.html

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
<div class="alert alert-info mt-2">
1010
<button type="button" class="btn btn-primary btn-sm mr-2" (click)="login('feed')"><i
1111
class="fas fa-unlock"></i> Login / Register
12-
</button> to <strong>Codever</strong>
12+
</button>
13+
to <strong>Codever</strong>
1314
to see posts from your favorite topics in your feed
1415
</div>
1516
</div>
@@ -99,18 +100,13 @@
99100
to access this functionality.
100101
</div>
101102
<ng-template #isLoggedInLastVisited>
102-
<div *ngIf="(history$ | async)?.length === 0 && currentPageHistory === 1; else historyQuickAccess"
103+
<div *ngIf="(history$ | async)?.length === 0 && currentPageHistory === 1"
103104
class="tabs-headline-message mt-2 alert alert-info">
104105
<p>
105106
In <strong>History</strong> you have a list of your last visited, created or updated bookmarks. Quick access
106107
with <strong>Ctrl + H</strong>
107108
</p>
108109
</div>
109-
<ng-template #historyQuickAccess>
110-
<div class="mt-2 lead alert alert-info">
111-
<strong>Ctrl + H</strong> hot key for quick access
112-
</div>
113-
</ng-template>
114110
<app-async-bookmark-list
115111
[bookmarks$]="history$"
116112
[userData$]="userData$"
@@ -137,17 +133,12 @@
137133
to access this functionality.
138134
</div>
139135
<ng-template #isLoggedInToPin>
140-
<div *ngIf="(pinned$ | async)?.length === 0 && currentPagePinned === 1; else pinnedQuickAccess"
136+
<div *ngIf="(pinned$ | async)?.length === 0 && currentPagePinned === 1"
141137
class="tabs-headline-message mt-2 alert alert-info">
142138
Got some bookmarks you will use a lot today? Just pin it <i
143139
class="fas fa-thumbtack"></i>
144140
and it will appear in the <strong>Pinned</strong> list. Quick access with <strong>Ctrl + P</strong>
145141
</div>
146-
<ng-template #pinnedQuickAccess>
147-
<div class="mt-2 lead alert alert-info">
148-
<strong>Ctrl + P</strong> hot key for quick access
149-
</div>
150-
</ng-template>
151142
<app-async-bookmark-list
152143
[bookmarks$]="pinned$"
153144
[userData$]="userData$"

frontend/src/app/shared/async-bookmark-list/async-bookmark-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div *ngIf="(bookmarks$ | async) as bookmarks" class="mt-3">
22
<div *ngIf="showFilterBox" class="form-group has-search float-right filter-box">
33
<span class="fas fa-filter form-control-feedback"></span>
4-
<input type="search" [(ngModel)]="filterText" class="form-control" placeholder="Filter...">
4+
<input autofocus type="search" [(ngModel)]="filterText" class="form-control" placeholder="Filter...">
55
</div>
66
<div class="clear"></div>
77
<div class="mt-3" *ngFor="let bookmark of bookmarks | bookmarkFilter: filterText">

frontend/src/app/shared/async-bookmark-list/async-bookmark-list.component.scss

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,4 @@
11

2-
.title-content-separator {
3-
margin: 0 0 0.5rem 0;
4-
}
5-
6-
.header-wrapper {
7-
display: flex;
8-
justify-content: space-between;
9-
10-
.clock-wrapper {
11-
font-size: 1.4rem;
12-
margin-left: 1rem;
13-
cursor: pointer;
14-
}
15-
16-
.pinned {
17-
color: red;
18-
}
19-
}
20-
21-
.share-action {
22-
cursor: pointer;
23-
margin-top: 0.3rem;
24-
}
25-
26-
.external-link-hint {
27-
font-size: 0.6rem;
28-
margin-left: 0.2rem;
29-
}
30-
31-
.youtube-icon {
32-
color:red;
33-
margin-right: 0.5rem;
34-
cursor: pointer;
35-
}
36-
37-
.stackoverflow-icon {
38-
margin-right: 0.5rem;
39-
}
40-
41-
.isDisabled {
42-
cursor: not-allowed;
43-
opacity: 0.6;
44-
pointer-events: none;
45-
}
46-
472
.filter-box {
483
width: 30%;
494
margin-bottom: -0.5rem;

frontend/src/app/shared/async-bookmark-list/async-bookmark-list.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { TagFollowingBaseComponent } from '../tag-following-base-component/tag-f
2525
templateUrl: './async-bookmark-list.component.html',
2626
styleUrls: ['./async-bookmark-list.component.scss']
2727
})
28-
export class AsyncBookmarkListComponent extends TagFollowingBaseComponent implements OnInit, OnChanges {
28+
export class AsyncBookmarkListComponent extends TagFollowingBaseComponent implements OnInit {
2929

3030
verifyForWatchedTag: Observable<string>; // used to avoid looking in watchedTags for other tags in the html template
3131

@@ -71,13 +71,4 @@ export class AsyncBookmarkListComponent extends TagFollowingBaseComponent implem
7171

7272
ngOnInit(): void {
7373
}
74-
75-
ngOnChanges(changes: SimpleChanges): void {
76-
const page = this.route.snapshot.queryParamMap.get('page');
77-
if (page) {
78-
this.currentPage = parseInt(page, 0);
79-
} else {
80-
this.currentPage = 1;
81-
}
82-
}
8374
}

frontend/src/app/shared/async-search-result-list/async-search-result-list.component.scss

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
2-
.title-content-separator {
3-
margin: 0 0 0.5rem 0;
4-
}
5-
6-
.header-wrapper {
7-
display: flex;
8-
justify-content: space-between;
9-
10-
.clock-wrapper {
11-
font-size: 1.4rem;
12-
margin-left: 1rem;
13-
cursor: pointer;
14-
}
15-
16-
.pinned {
17-
color: red;
18-
}
19-
}
20-
21-
.share-action {
22-
cursor: pointer;
23-
margin-top: 0.3rem;
24-
}
25-
26-
.external-link-hint {
27-
font-size: 0.6rem;
28-
margin-left: 0.2rem;
29-
}
30-
31-
.youtube-icon {
32-
color:red;
33-
margin-right: 0.5rem;
34-
cursor: pointer;
35-
}
36-
37-
.stackoverflow-icon {
38-
margin-right: 0.5rem;
39-
}
40-
41-
.isDisabled {
42-
cursor: not-allowed;
43-
opacity: 0.6;
44-
pointer-events: none;
45-
}
46-
471
.filter-box {
482
width: 30%;
493
margin-bottom: -0.5rem;

frontend/src/app/shared/async-search-result-list/async-search-result-list.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Snippet } from '../../core/model/snippet';
1313
templateUrl: './async-search-result-list.component.html',
1414
styleUrls: ['./async-search-result-list.component.scss']
1515
})
16-
export class AsyncSearchResultListComponent extends TagFollowingBaseComponent implements OnInit, OnChanges {
16+
export class AsyncSearchResultListComponent extends TagFollowingBaseComponent implements OnInit {
1717

1818
verifyForWatchedTag: Observable<string>; // used to avoid looking in watchedTags for other tags in the html template
1919

@@ -58,15 +58,6 @@ export class AsyncSearchResultListComponent extends TagFollowingBaseComponent im
5858
ngOnInit(): void {
5959
}
6060

61-
ngOnChanges(changes: SimpleChanges): void {
62-
const page = this.route.snapshot.queryParamMap.get('page');
63-
if (page) {
64-
this.currentPage = parseInt(page, 0);
65-
} else {
66-
this.currentPage = 1;
67-
}
68-
}
69-
7061

7162
isBookmark(searchResult: Bookmark | Snippet) {
7263
return 'location' in searchResult;
Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +0,0 @@
1-
2-
.title-content-separator {
3-
margin: 0 0 0.5rem 0;
4-
}
5-
6-
.header-wrapper {
7-
display: flex;
8-
justify-content: space-between;
9-
10-
.clock-wrapper {
11-
font-size: 1.4rem;
12-
margin-left: 1rem;
13-
cursor: pointer;
14-
}
15-
16-
.pinned {
17-
color: red;
18-
}
19-
}
20-
21-
.share-action {
22-
cursor: pointer;
23-
margin-top: 0.3rem;
24-
}
25-
26-
.external-link-hint {
27-
font-size: 0.6rem;
28-
margin-left: 0.2rem;
29-
}
30-
31-
.youtube-icon {
32-
color:red;
33-
margin-right: 0.5rem;
34-
cursor: pointer;
35-
}
36-
37-
.stackoverflow-icon {
38-
margin-right: 0.5rem;
39-
}
40-
41-
.isDisabled {
42-
cursor: not-allowed;
43-
opacity: 0.6;
44-
pointer-events: none;
45-
}
46-
47-
.filter-box {
48-
width: 30%;
49-
margin-bottom: -0.5rem;
50-
}

frontend/src/app/shared/async-snippet-list/async-snippet-list.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Bookmark } from '../../core/model/bookmark';
99
templateUrl: './async-snippet-list.component.html',
1010
styleUrls: ['./async-snippet-list.component.scss']
1111
})
12-
export class AsyncSnippetListComponent implements OnInit, OnChanges {
12+
export class AsyncSnippetListComponent implements OnInit {
1313

1414
@Input()
1515
snippets$: Observable<Snippet[]>;
@@ -32,15 +32,6 @@ export class AsyncSnippetListComponent implements OnInit, OnChanges {
3232

3333
}
3434

35-
ngOnChanges(changes: SimpleChanges): void {
36-
const page = this.route.snapshot.queryParamMap.get('page');
37-
if (page) {
38-
this.currentPage = parseInt(page, 0);
39-
} else {
40-
this.currentPage = 1;
41-
}
42-
}
43-
4435
of(searchResult: Snippet | Bookmark) {
4536
return of(searchResult);
4637
}
Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
1-
.add-new-bookmark {
2-
margin-top: 0.3rem;
1+
.isDisabled {
2+
cursor: not-allowed;
3+
opacity: 0.6;
4+
pointer-events: none;
35
}
4-
5-
.navbar-brand {
6-
line-height:12px;
7-
padding-top:10px;
8-
9-
font-size: 25px;
10-
}
11-
12-
.navbar-brand small {
13-
font-size:11px;
14-
}
15-
16-
.app-brand {
17-
display: flex;
18-
padding-right: 15px;
19-
align-items: center;
20-
21-
.app-brand-text {
22-
margin-left: 0.5rem;
23-
}
24-
}
25-
.logo-text {
26-
font-size: smaller;
27-
margin-bottom: 10px;
28-
}
29-
30-
.logo-image {
31-
margin-top: -10px;
32-
margin-bottom: -5px;
33-
}
34-
35-
.large-displays {
36-
display: none;
37-
}
38-
39-
@media (min-width: 1400px) {
40-
.large-displays {
41-
display: block ;
42-
}
43-
}
44-
45-

0 commit comments

Comments
 (0)