Skip to content

Ecosystem sort #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2020
Merged

Ecosystem sort #37

merged 1 commit into from
Jun 11, 2020

Conversation

Bgreen23
Copy link

@Bgreen23 Bgreen23 commented Jun 3, 2020

This PR adds functionality to sort Ecosystem cards by Github Stars Count

@Bgreen23 Bgreen23 marked this pull request as ready for review June 4, 2020 13:25
@Bgreen23 Bgreen23 requested a review from patmellon June 4, 2020 13:25
assets/main.scss Outdated
@@ -29,6 +28,7 @@ $baseurl:"{{ site.baseurl }}";
@import "cookie-banner";
@import "hub";
@import "hub-search";
@import "ecosystem";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you accidentally deleted the ecosystem file and then re-added it.

Comment on lines 1 to 14
var filterScript = $("script[src*=ecosystem-sort]");
var listId = filterScript.attr("list-id");

var ecosystemList =new List("ecosystem-index-cards", {
valueNames: ['github-stars-count']
});

$("#sortLow").on("click", function() {
ecosystemList.sort("github-stars-count", { order: "asc" });
});

$("#sortHigh").on("click", function() {
ecosystemList.sort("github-stars-count", { order: "desc" });
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code probably isn't necessary since you already added the sort functionality to the github-stars branch. You should be able to add the sorting script by referencing the filter-hub-tags.js script. Take a look at the bottom of hub.html for an example. It might be sort of janky to test because the sorting code is on that other branch and not merged into site yet, but you can just copy it and paste into your branch to test.

@Bgreen23 Bgreen23 requested a review from patmellon June 5, 2020 12:37
.ecosystem #dropdownSort, #dropdownSortLeft {
margin-left: 0;
}
.ecosystem-filter-menu {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - Can you add a space above ecosystem-filter-menu?

<script star-count-call-date="ecosystemStarCountCallDate" star-count-data="ecosystemStarCountData" src="{{ site.baseurl }}/assets/github-stars.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
<script list-id="ecosystem-index-cards" display-count="100" pagination="false" src="{{ site.baseurl }}/assets/filter-hub-tags.js"></script>
<script src="{{ site.baseurl }}/assets/hub-sort.js"></script>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this hub-sort script since the sorting will be coming from filter-hub-tags.

@Bgreen23 Bgreen23 requested a review from patmellon June 5, 2020 13:54
@Bgreen23 Bgreen23 requested a review from patmellon June 9, 2020 14:46
Comment on lines 415 to 419
.ecosystem, #dropdownSort, #dropdownSortLeft {
margin-left: 0 !important;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to use !important if you put #dropdownSort and #dropdownSortLeft within an ecosystem block. Then those 2 IDs will only apply to the ecosystem page.

This commit adds sort to ecosystem
@Bgreen23 Bgreen23 merged commit f93c603 into ecosystem-stars Jun 11, 2020
patmellon pushed a commit that referenced this pull request Jul 13, 2020
This commit adds sort to Ecosystem
patmellon pushed a commit that referenced this pull request Jul 17, 2020
This commit adds sort to Ecosystem
@Bgreen23 Bgreen23 deleted the ecosystem-sort branch August 13, 2020 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants