Skip to content

Commit 4f3cfba

Browse files
authored
Merge pull request #1165 from apinf/feature/catalogue-toggle-sort-filter-bar
Feature/catalogue toggle sort filter bar
2 parents e244246 + 98cbb3f commit 4f3cfba

File tree

17 files changed

+281
-130
lines changed

17 files changed

+281
-130
lines changed

apis/logo/view/client/view.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.view-api-logo {
22
width: 50px;
3+
height: 50px;
34
border-radius: 50%;
45
}

apis/server/methods/bookmarks.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,5 @@ Meteor.methods({
88
// Set average rating value for current API Backend
99
apiBackend.setBookmarkCount();
1010
});
11-
},
12-
setApiBackendBookmarkCount (apiBackendId) {
13-
// Get API Backend
14-
const apiBackend = ApiBackends.findOne(apiBackendId);
15-
16-
// Update the API Backend bookmark count
17-
apiBackend.setBookmarkCount();
1811
}
1912
});

bookmarks/client/bookmarks.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

bookmarks/client/bookmarks.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

bookmarks/client/favourite.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template name="favourite">
2-
{{#if isBookmarked}}
2+
{{ # if isBookmarked }}
33
<i class="fa fa-bookmark bookmark bookmarked"></i>
4-
{{else}}
4+
{{ else }}
55
<i class="fa fa-bookmark-o bookmark"></i>
6-
{{/if}}
6+
{{ / if }}
77
</template>

bookmarks/client/favourite.less

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import "/client/style/bootstrap-variables.less";
2+
3+
.bookmark-default {
4+
color: @gray;
5+
}
6+
7+
.bookmark {
8+
cursor: pointer;
9+
}
10+
11+
.bookmarked {
12+
cursor: pointer;
13+
color: @brand-primary;
14+
}

bookmarks/routes.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

bookmarks/server/methods.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ Meteor.methods({
3838
ApiBookmarks.insert(userBookmarks);
3939
}
4040

41-
// Update the API Backend bookmark count
42-
Meteor.call("setApiBackendBookmarkCount", backendId);
43-
4441
return apiIds;
4542
}
4643
});

catalogue/client/catalogue.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#sort-options-select {
2+
padding-left: 0;
3+
}
4+
5+
.nav-center {
6+
padding-left: 1em;
7+
}
8+
9+
.sort-filter-toolbar {
10+
padding-left: 0;
11+
}
12+
13+
.sort-filter-toolbar-title {
14+
margin-left: 0;
15+
}

catalogue/client/catalogue.html

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,71 @@
11
<template name="catalogue">
2-
{{#if Template.subscriptionsReady }}
3-
{{> catalogueTable apiBackends=apiBackends }}
4-
{{else}}
5-
{{> spinner }}
6-
{{/if}}
2+
<h3>{{_ "catalogue_Title"}}</h3>
3+
<nav id="catalogue-toolbar" class="navbar navbar-default">
4+
<div class="container-fluid">
5+
<!-- Brand and toggle get grouped for better mobile display -->
6+
<div class="navbar-header">
7+
<button
8+
type="button"
9+
class="navbar-toggle collapsed"
10+
data-toggle="collapse"
11+
data-target="#bs-example-navbar-collapse-1"
12+
aria-expanded="false">
13+
<span class="sr-only">Toggle toolbar</span>
14+
<span class="icon-bar"></span>
15+
<span class="icon-bar"></span>
16+
<span class="icon-bar"></span>
17+
</button>
18+
</div>
19+
20+
<!-- Collect the nav links, forms, and other content for toggling -->
21+
<div class="collapse navbar-collapse sort-filter-toolbar" id="bs-example-navbar-collapse-1">
22+
{{# if currentUser }}
23+
<div class="nav navbar-nav">
24+
<div class="btn-group navbar-btn" role="group" aria-label="Filter options" data-toggle="buttons">
25+
<label class="btn btn-default active">
26+
<input type="radio" name="filter-options" id="show-all" value="all">
27+
{{_ "catalogue_FilterButtons_Show_All"}}
28+
</label>
29+
<label class="btn btn-default">
30+
<input type="radio" name="filter-options" id="my-apis" value="my-apis">
31+
{{_ "catalogue_FilterButtons_My_APIs"}}
32+
</label>
33+
<label class="btn btn-default">
34+
<input type="radio" name="filter-options" id="my-bookmarks" value="my-bookmarks">
35+
{{_ "catalogue_FilterButtons_My_Bookmarks"}}
36+
</label>
37+
</div>
38+
</div>
39+
{{/if}}
40+
<div class="nav navbar-nav navbar-right">
41+
<div class="btn-group navbar-btn" role="group" aria-label="View mode" data-toggle="buttons">
42+
<label class="btn btn-default toolbar-tooltip active" title="Grid">
43+
<input type="radio" name="view-mode" id="grid-mode" value="grid">
44+
<i class="fa fa-th-large" aria-hidden="true"></i>
45+
</label>
46+
<label class="btn btn-default toolbar-tooltip" title="Table">
47+
<input type="radio" name="view-mode" id="table-mode" value="table">
48+
<i class="fa fa-table" aria-hidden="true"></i>
49+
</label>
50+
</div>
51+
</div>
52+
</div><!-- /.navbar-collapse -->
53+
</div><!-- /.container-fluid -->
54+
</nav>
55+
<!-- if viewMode is table, show table -->
56+
{{# if gridViewMode }}
57+
{{# if Template.subscriptionsReady }}
58+
{{> catalogueGrid apiBackends=apiBackends }}
59+
{{else}}
60+
{{> spinner }}
61+
{{/if}}
62+
{{/ if }}
63+
<!-- if viewMode is table, show table -->
64+
{{# if tableViewMode }}
65+
{{# if Template.subscriptionsReady }}
66+
{{> catalogueTable apiBackends=apiBackends }}
67+
{{else}}
68+
{{> spinner }}
69+
{{/if}}
70+
{{/ if }}
771
</template>

0 commit comments

Comments
 (0)