publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
957 stars 1.83k forks source link

Limitless list of articles at the events page #10309

Open DalilaBA opened 2 years ago

DalilaBA commented 2 years ago

There is a limitless list of articles at the "Recently posted events" on events page, I found that there was an old issue #5487 talking about a "show more" button, I couldn't reach the bottom to see it.

events-articles

samyaksand commented 2 years ago

Hello! Could you assign me this issue?

DalilaBA commented 2 years ago

@samyaksand go ahead

samyaksand commented 2 years ago

Also, could you add hacktoberfest-accepted tag for this issue

DalilaBA commented 2 years ago

I can't I don't have that privilege, I'm a simple contributor as you do

DalilaBA commented 2 years ago

maybe @TildaDares can help on this ?

subhangi2731 commented 2 years ago

can you please assign me this issue @TildaDares @DalilaBA I want to work on this if no one is working on this

TildaDares commented 2 years ago

Hi everyone, I think @jywarren should be the one to decide if this is a feature that should be added to the site.

KarishmaVanwari commented 2 years ago

Can I work on this issue if this feature needs to be implemented? @TildaDares @jywarren

jywarren commented 2 years ago

Hi @KarishmaVanwari we'd love that! I think the list is now limited:

https://publiclab.org/events

See these lines:

https://github.com/publiclab/plots2/blob/2895fbf25592039ab4f71f290d5a56f3fede1798/app/models/concerns/node_shared.rb#L388

https://github.com/publiclab/plots2/blob/2895fbf25592039ab4f71f290d5a56f3fede1798/app/models/concerns/node_shared.rb#L30

However, that may mean that if the total count is higher, we should add a "See all" link at the bottom. Unfortunately, I think it's relatively hard to calculate that. The limit is 24. Can we efficiently calculate if there are more than 24?

Maybe with this function?

https://github.com/publiclab/plots2/blob/2895fbf25592039ab4f71f290d5a56f3fede1798/app/models/tag.rb#L347-L353

We do use that count function in other places, so it seems OK to use:

https://github.com/publiclab/plots2/blob/2895fbf25592039ab4f71f290d5a56f3fede1798/app/controllers/tag_controller.rb#L156

Do you know which template you'd put this in? We're happy to help if not!

KarishmaVanwari commented 2 years ago

Hey @jywarren , it would be great if you could help me figure out the template. I can now work on this issue.

KarishmaVanwari commented 2 years ago

Hey @jywarren @TildaDares, could you please help me figure out which template can I put in the code?