publiclab / plots2

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

Create helper to generate tag cards #6199

Closed jywarren closed 5 years ago

jywarren commented 5 years ago

The tag cards on https://publiclab.org/tags can often show the same post multiple times per page. Let's do this:

  1. the tag cards could be generated by a view helper called createTagCard()
  2. the view helper could accept as a parameter an createTagCard(exclude) array of nids that we should exclude
  3. the view helper could return a list of nids that it will be displaying, which can be added to a list of nids that should be excluded from subsequent tag cards.

So the flow would look like:

exclude = []
exclude += createTagCard('balloon-mapping', exclude)
exclude += createTagCard('air-quality', exclude)

@CleverFool77 @gautamig54 what do you think of this?

jywarren commented 5 years ago

Here's the issue, by the way - duplicate appearance of nodes on my profile page demonstrates it!

image

CleverFool77 commented 5 years ago

Ohh Yes, It would be better. Besides we are using tag cards everywhere. This would decrease our load somehow.

gautamig54 commented 5 years ago

Yes, This seems like a good solution. And with the shifting of website structure to being it topic oriented, this will prove to be a great and help reduce redundancy. And not only on the tags page, this will be helpful in profile page, dashboard etc.

jywarren commented 5 years ago

Awesome!

On Sat, Aug 24, 2019 at 8:03 AM Lekhika Dugtal notifications@github.com wrote:

Ohh Yes, It would be better. Besides we are using tag cards everywhere. This would decrease our load somehow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/6199?email_source=notifications&email_token=AAAF6J5VE7E5M6XUPJFKO7DQGEPNNA5CNFSM4IPC5CG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5B6XBA#issuecomment-524544900, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF6J5XEWD4EGEDT4PY7KTQGEPNNANCNFSM4IPC5CGQ .

jywarren commented 5 years ago

Ah, the fix didn't work in profile pages but it did on /tags!