open-life-science / open-life-science.github.io

OLS website: web presence and knowledge management for we-are-ols.org
https://we-are-ols.org
MIT License
65 stars 87 forks source link

Link from bios to OLS projects people participated to #418

Closed bebatut closed 3 months ago

bebatut commented 2 years ago

Suggested by a community member:

"When I go in projects and participants of previous OLSs, like OLS5, I can click on the project leads of each project (https://openlifesci.org/ols-5/projects-participants/), and that takes me to their bios. It'd be nice that if I am in the bios, I can see which project XY person is related to."

NPDebs commented 2 years ago

Hi @bebatut πŸ‘‹πŸΌπŸ™‚ I'm an Outreachy intern and would absolutely love to work on this issue. Thanks!

Jolah1 commented 2 years ago

Hello @bebatut My name is Jolade, I am an Outreachy applicant, I will be working on this issue. thank you.

bebatut commented 2 years ago

As defined in the OLS Outreachy contribution guide,

@NPDebs were the first one to comment here. Are you still interested to work on this issue? You are already interested in other issues. You might need to pick one

NPDebs commented 2 years ago

As defined in the OLS Outreachy contribution guide,

  • If someone else has already commented, let them try first
  • If they don’t update after three days, the issue is β€œfree” again, and you can pick it up.

@NPDebs were the first one to comment here. Are you still interested to work on this issue? You are already interested in other issues. You might need to pick one

Hi @bebatut Yeah. I was throwing darts, hoping to land as many contributions as possible! πŸ˜…

I'll take whatever you assign to me. Thank you!

bebatut commented 2 years ago

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

NPDebs commented 2 years ago

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

Alrightie. Thank you! @bebatut

NPDebs commented 2 years ago

You are already assigned to another one. Finish it and if this issue is still not assigned you could work on it later

Hi @bebatut. πŸ˜ƒ

I'm now free as a bird! Well, technically, my PRs are yet to be reviewed and merged. πŸ˜…

Can I please start working on this one while I wait? Please, please, pretty please! πŸ™πŸΌ

bebatut commented 2 years ago

Ok. I assign it to you @NPDebs

NPDebs commented 2 years ago

Thank you, @bebatut ! πŸ™ŒπŸΌπŸ₯°

Just to verify my understanding of the issue, I have a few questions, please.

This is a project called "ABC..." Vicky Hellon is a participant.

Screenshot_20221013-082844_Chrome.jpg

When I click on her name, it goes to her bio. The goal of this issue is to add a section that states what projects she's involved in, right?

Screenshot_20221013-082912_Chrome.jpg

bebatut commented 2 years ago

Yes that is the idea. If you look also at the people page, you can see the role of people in the different cohorts. It could be nice when they were participants to add also there the link to their project in the cohort they participated to

NPDebs commented 2 years ago

Okay. πŸ‘ŒπŸΌ I understand the first part of the task.

When I go to the people page, this is what I find...

Screenshot_20221013-085059_Chrome.jpg

To be clear, are you asking me to do the same thing to the bio of all the people here, who were participants in a project?

bebatut commented 2 years ago

below you see more details about the people

NPDebs commented 2 years ago

below you see more details about the people

Ah. Yes yes! Seen.

I'll get right on it, and revert to you if I have some more questions. Thanks for your patience. πŸ™πŸΌ

NPDebs commented 2 years ago

Hi @bebatut. πŸ‘‹ Here's a little progress update from me to you...

In the people.yaml file, I added a new key, named projects and assigned its value to be the name of the project the individual participated in. (Note: This info was gotten from the projects.yaml file of each cohort)

Additionally, I specified the cohort of the individual as a new key.

In lines 74-79 of the people.html file (under _includes), you will find the block of code I used to reference these new keys, and print them on the "bio card" of each participant.

On click, the link goes to "https://openlifesci.org/{{% user.cohort %}}/projects-participants/".

ols-progress-update

I have only done this for the members of cohort ols-1. Please, kindly let me know if I am on the right track, so that I can do the same for the remaining cohorts.

I have attached a link to the commit containing the aforementioned changes, right HERE.

Thank you for your time. Best regards.

bebatut commented 2 years ago

Thanks @NPDebs for the initial work there.

Regarding adding project information in the people.yaml file

In the people.html file, you can see starting on line 41 that I already extract information about roles of people in the different OLS cohorts. You could add there the extraction of the name of project in which they participated.

Btw, I realize the information about participation in OLS cohorts is not displayed anymore in the card as it used to be inside the "Role in OLS: " blurb That would be nice to fix that, and then for participants, adding there the link to their project as {{ site.ur }}/{{ cohort }}/projects-participants/{{ project }} (adding then also the link to the project section in the page, a bit like done in the table on the bottom the project page)

NPDebs commented 2 years ago

Hi @bebatut. Thank you so much for your guidance. I now realise how redundant my method would have been.

I'll revert the last commit and get to work, using your roadmap. πŸ‘

NPDebs commented 2 years ago

Hi @bebatut. πŸ‘‹

Progress update: Not so much progress. I successfully extracted the projects in each cohort by looping through ols-1-projects.yaml.

    {% for proj in project.name %}
        {% capture ols-1-projectnames %}{{ ols-1-projectnames }} {{ proj }}{% endcapture %}
    {% endfor %}

I rendered that on a page to confirmed that it worked. See screenshot below:

Screenshot (298)

To render the specific project a person is associated with (on their bio card), I wrote this block of code. πŸ‘‡

    {% for person in ols-1-participants &}
        {% for project in ols-1-projects %}
            {% if project contains person %}
                {% capture project-name %}{{ project-name }}{{ project.name }}{% endcapture %}
            {% endif %}
        {% endfor %}
    {% endfor %}

Explanation: The variable ols-1-participants stores all the participants, and ols-1-projectnames contains all the projects.

So, I attempted to loop through each person. For that person, loop through the projects, checking for the person in the project.

Since project here represents a unique project (with name, participants, mentors and description), the condition ought to check if the person is in the project. If this condition is met, then capture the name of the project (i.e project.name of the project containing the participant, person).

A link to my commits are attached here....

Please tell me know your thoughts on this. Thank you for your patience! 🀝

bebatut commented 2 years ago

It sounds like a great start and you seem to go in the good direction. One comment, what is display in the card in your screenshot looks like the project description not the name πŸ˜„

In the commit you linked I could not see all the changes you mentioned. Did you push all changes?

NPDebs commented 2 years ago

Hi @bebatut. I'm glad you approve of my approach, however fruitless it may seem at the moment. πŸ˜‚

What's displayed on the card is actually the name, and not the description of the projects. That particular project seemed to have a really long title. πŸ˜ƒ

About the linked commit.......I removed the block of code that threw an error. Would you like me to put that back in and push?

bebatut commented 2 years ago

Up to you right now πŸ˜„ How can I help you on that?

NPDebs commented 2 years ago

Up to you right now πŸ˜„ How can I help you on that?

Well, for one...I'd like to know how I can relate all the keys in a particular project to each other.

- name: Open Science Community Barcelona
  participants:
     - bonetcarne mentors:
     - zebetus
  description: > Description

If the participant is in the same object as the "name" of the project, then render the name of the project.

It seems so straightforward. Yet, the logic has been flying over my head for days.

bebatut commented 2 years ago

I think I am not sure to follow / understand here

NPDebs commented 2 years ago

I think I am not sure to follow / understand here

Okay. Here's my train of thought.

Loop through the participants. Within that loop, begin to loop through the project.yaml file.

For each participant, check if the person's name is the same as project.participants. Then capture the project.name of that project (where person == participant name), and render it on the person's bio card.

Not sure I'm explaining this properly.

If it's not too much to ask, can we do a quick Slack call at your convenience, please? @bebatut

bebatut commented 2 years ago

The loop over the project.yaml file are already done before in the page to get if people participated in cohorts. You could use that loop to extract projects for each cohort.

Then when looping on the people to create the card, you could check their status (in which cohort they participated) and for the cohort in which they were participants, looping on the projects for that cohort to extract the project name

Do you understand what I mean? I am not sure if my way of explaining is clear :smile:

NPDebs commented 2 years ago

Hi @bebatut. Thank you for your response. Yes, I was actually following your explanation, until my brain got stuck in all the loops. πŸ˜„

When you say a loop has already been done, do you mean from line 41?

Yesterday, I was looking at how you wrote the logic for a similar thing, here. It gave me an idea, but I still did not succeed.

This is what I did...

Screenshot (301)

Maybe we can communicate better over a call?

bebatut commented 2 years ago

When you say a loop has already been done, do you mean from line 41?

Yes

This is what I did...

I think I do not understand your logic there. Participants are extracted from the ols-1-projects (in loop starting in line 41) so your loop is redundant with previous one. If you need to do something it is better to use the previous loop .

And also if you loop there, you are not yet in the big loop on the people so the project name will not be rendered.

Please have a look at my suggestion from yesterday and break them in piece and see how to implement it

Maybe we can communicate better over a call?

Please join the call with @yo today (I will not be able to join)

NPDebs commented 2 years ago

Hi @bebatut. Yesterday, after brainstorming with a fellow Outreachy participant, we were able to output the title of one participant's project on her card. But the twist is, it also got printed on all the participants for OLS-1. πŸ˜… A problem in the loop, apparently.

Thank you for your suggestions. I'll try to implement them as soon as I resolve the Gitpod/Miniconda situation.

Yes, I'll be joining the call, later today. I'll ask them any questions I might have and update you.

Thank you. πŸ™ŒπŸΌ

NPDebs commented 2 years ago

Hi @bebatut.

For the Roles in OLS: part...it shows up for only the organisers of OLS. This is because only organisers have it as a key:value pair, under title. Shouldn't the other people also have titles, to be displayed as roles on their cards?

Screenshot_20221024-090424_Chrome~2 Screenshot_20221024-093419_Chrome~2

bebatut commented 2 years ago

The role of participants (participant, mentor, etc in the different cohorts) are extracted here: https://github.com/open-life-science/open-life-science.github.io/blob/main/_layouts/people.html It should be displayed, given the code here: https://github.com/open-life-science/open-life-science.github.io/blob/main/_includes/people.html#L59 I did not investigate why it is not the case anymore

NPDebs commented 2 years ago

Hi @bebatut. πŸ‘‹

I tweaked the logic a bit and the cards now display the people's roles. Here's a link to the commit.

Screenshot (330)

Observation:

Two quick questions, please:

  1. Would you like me to make the Roles in OLS: bold too?
  2. Can I open a PR for this fix?

Thank you! πŸ™Œ

bebatut commented 2 years ago

Please open the PR with the fix :smile: For making Roles in OLS: bold, not sure. Because Expertise is not bold

NPDebs commented 2 years ago

Please open the PR with the fix :smile: For making Roles in OLS: bold, not sure. Because Expertise is not bold

Thank you! I'll open the PR right away. πŸ˜ƒ

Oh, that's true. We either make both bold...or maintain the current state.

yochannah commented 3 months ago

solved by https://github.com/open-life-science/open-life-science.github.io/pull/496