Skip to content

Commit 5d88756

Browse files
Bgreen23Pat Mellon
authored and
Pat Mellon
committed
GitHub Stars Sort Button
Add sort button to hub This commit adds sort to hub, hub researcher, and hub developer model pages
1 parent cf93607 commit 5d88756

7 files changed

+44
-29
lines changed

_includes/hub_developer_tags_and_cards.html

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{% include hub_icons.html left-icon="full-hub-icon-selected.svg" right-icon="compact-hub-icon.svg" index-url="developer-models" compact-url="developer-models/compact" %}
1212

1313
{% endif %}
14+
15+
{% include hub_sort.html %}
16+
1417
</div>
1518

1619
{% include hub_search.html %}

_includes/hub_researcher_tags_and_cards.html

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{% include hub_icons.html left-icon="full-hub-icon-selected.svg" right-icon="compact-hub-icon.svg" index-url="research-models" compact-url="research-models/compact" %}
1212

1313
{% endif %}
14+
15+
{% include hub_sort.html %}
16+
1417
</div>
1518

1619
{% include hub_search.html %}

_includes/hub_sort.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<a id="dropdownSortLeft" data-toggle="dropdown" data-target="#dropdownSortMenuLeft" >
2+
Sort <img src="{{ site.baseurl }}/assets/images/filter-arrow.svg">
3+
</a>
4+
5+
<div class="dropdown-menu sort-menu" id="dropdownSortMenuLeft">
6+
<div class="hub-filter-menu">
7+
<ul>
8+
<li>
9+
<a class= "hub-filter" id="sortLowLeft">Lowest</a>
10+
</li>
11+
12+
<li>
13+
<a class= "hub-filter" id="sortHighLeft">Highest</a>
14+
</li>
15+
</ul>
16+
</div>
17+
</div>

_sass/compact.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@
6868

6969
.compact-hub-icon {
7070
margin-left: 0.5rem;
71+
margin-right: rem(50px);
7172
&:hover {
72-
cursor: pointer;
73+
cursor: pointer;
7374
}
7475
}
7576

_sass/hub-search.scss

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
}
1919
}
2020

21+
.hub #hub-search-icon {
22+
@media (max-width: 480px) {
23+
margin-top: 1rem;
24+
}
25+
}
26+
2127
#hub-search-icon {
2228
background-image: url($baseurl + "/assets/images/search-icon.svg");
2329
color: transparent;

_sass/hub.scss

+10-9
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159

160160
#hub-icons {
161161
height: 2rem;
162+
@media (max-width: 480px) {
163+
position: initial;
164+
padding-left: 0;
165+
padding-top: 1rem;
166+
}
162167
}
163168

164169
.hub.hub-detail .main-content-wrapper {
@@ -287,15 +292,12 @@
287292
position: absolute;
288293
}
289294

290-
.hub #dropdownSort, #dropdownSortLeft {
291-
margin-left: rem(100px);
295+
.hub .sort-menu {
296+
left: 0;
292297
}
293298

294-
.hub .sort-menu {
295-
left: 63%;
296-
@include desktop {
297-
left: 25%;
298-
}
299+
.hub-index .sort-menu {
300+
left: 23%;
299301
}
300302

301303
.hub .research-hub-title,
@@ -540,8 +542,7 @@
540542
}
541543

542544
.hub .hub-tags-container {
543-
width: 40%;
544-
545+
width: 60%;
545546
&.active {
546547
width: 0;
547548
}

hub/hub.html

+3-19
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,10 @@ <h3 class="research-hub-sub-title">Explore and extend models<br> from the latest
3232

3333
<nav class="navbar navbar-expand-lg navbar-light research-menu col-12">
3434
{% include hub_model_tags.html category="researchers" %}
35-
{% include hub_search.html %}
36-
<!--
37-
<a id="dropdownSortLeft" data-toggle="dropdown" data-target="#dropdownSortMenuLeft" >
38-
Sort <img src="{{ site.baseurl }}/assets/images/filter-arrow.svg">
39-
</a>
40-
41-
<div class="dropdown-menu sort-menu" id="dropdownSortMenuLeft">
42-
<div class="hub-filter-menu">
43-
<ul>
44-
<li>
45-
<a class= "hub-filter" id="sortLowLeft">Lowest</a>
46-
</li>
47-
48-
<li>
49-
<a class= "hub-filter" id="sortHighLeft">Highest</a>
50-
</li>
51-
</ul>
52-
</div>
35+
<div id="hub-icons" class="hub-select-container col-5">
36+
{% include hub_sort.html %}
5337
</div>
54-
-->
38+
{% include hub_search.html %}
5539
</nav>
5640

5741
<hr class="hub-divider">

0 commit comments

Comments
 (0)