Skip to content
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

Fix "Show 0 more" on inline people lists #4253

Closed
wants to merge 17 commits into from

Conversation

jonxuxu
Copy link
Member

@jonxuxu jonxuxu commented Dec 10, 2018

Fixes #2151

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/reviewers for help, in a comment below

This PR should fix the error of a toggle that says "show 0 more"
image
I increased the index at which toggle would appear.

I'm unable to test this on localhost as this page https://publiclab.org/w/power-tags#Inline+power+tags seems to be hosted on a database.

@jonxuxu jonxuxu changed the title Code Issues 490 Pull requests 59 Projects 6 Wiki Insights Fix "Show 0 more" on inline people lists Fix "Show 0 more" on inline people lists Dec 10, 2018
@plotsbot
Copy link
Collaborator

1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
2 Messages
📖 @JonathanXu1 Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

@SidharthBansal
Copy link
Member

Can you please explain why was it happening?

@SidharthBansal
Copy link
Member

Please take the task on the dashboard, and tell us the link here we will approve it if your solution works.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 10, 2018

<% users.each_with_index do |user, index| %>
<% if index > 9 %>
<tr class="hide">
<% else %>
<tr>
<% end %>
<td class="username"><a href="/profile/<%= user.username %>"><%= user.username %></a> <%=user.new_contributor %></td>
</tr>
<% if index == 10 %>
<tr class="show-all">
<td><a>Show <%= users.length - 10 %> more <b class="caret"></b></a></td>
<td></td>
<td></td>
<td></td>
</tr>
<% end %>
<% end %>

As you can see on line 21, the comparative used to be <% if index == 9%>
This would cause the show X more tag to show when there on the 10th listing. However if there are only 10 listings, it would say show 0 more.

@jonxuxu
Copy link
Member Author

jonxuxu commented Dec 10, 2018

@SidharthBansal could I get a link to the task? Don't think I can find it

@SidharthBansal
Copy link
Member

SidharthBansal commented Dec 10, 2018 via email

@jywarren
Copy link
Member

jywarren commented Dec 10, 2018 via email

@SidharthBansal
Copy link
Member

@JonathanXu1 do you need any help here?

@SidharthBansal
Copy link
Member

As the person is inactive for more than a month, I am closing the PR. In case you want to push changes please feel free to open a new PR OR reopen this PR and add additional changes to it.
Thanks for contributing on Public Lab
@jywarren @gauravano

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.

Fix "Show 0 more" on inline people lists
4 participants