We have a great new page at https://publiclab.org/notes/ made by @RuthNjeri and it uses a slightly different presentation of types of content by nav, instead of by tab:
Unfortunately it looks like this type of page also got that template:
https://publiclab.org/notes/author/cess/
Actually that should have tabs similarly to https://publiclab.org/tag/water-quality - i think something about how we choose templates by route may have messed this up.
let's find the place where the template is chosen and it should be an easy fix to return it to the prior template, esp. so that clicking "Questions" shows you questions by that author instead of just all questions at https://publiclab.org/questions
Thanks! This would make a nice first-timers-only issue once we find the line of code!
This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!
I'd like to work on this and create the FTO.
Looks like this template was deliberately used for this route:
In notes_controller.rb

However, the one used in tag_controller.rb is not really a template:
At the end of tag#show

In fact, the show view for tags is styled between <style> tags in the same file. The links in that view are kind of hardcoded for tags only, so I don't think we can use that view for notes#author.
Possible solutions for this (that I can think of):
NotesHelper (?)Personally, I prefer the first solution since it's cleaner and more consistent with the new page. Is this still suitable for an FTO?
Hi, @aliciapaz! great research here. This area of code is best known by @RuthNjeri who's a code community coordinator (like me)! But, just starting to dig a bit, first using the poorly named "blame" view (should be "appreciate" 馃槃 ):
https://github.com/publiclab/plots2/blame/main/app/controllers/notes_controller.rb#L321-L359
These actions are all pointing at notes/index, and i think what happened is that that used to be almost identical to notes/show but after Ruth's Outreachy project #8935 we changed notes/index.
I wonder if it's possible to simply change it to notes/show and if the templates would start working then?
If not, perhaps we can look at the notes/index template before @RuthNjeri's changes and see what it used to look at, to help us get notes/show working that way.
How does that sound, @aliciapaz? Thank you!
Oh no, i'm thinking of tag/show, as you say, not notes/show. My bad!
So my suggestion to try out might be to try changing notes/index to tag/show? I hope that would work!
Thanks @jywarren!
I tried that, but since the links are hardcoded, when you click on 'questions', it goes to questions/tag/<TagNameButIsReallyAnAuthorName>
that's what I meant with:
The links in that view are kind of hardcoded for tags only, so I don't think we can use that view for notes#author.
I think this could work!!
If not, perhaps we can look at the notes/index template before @RuthNjeri's changes and see what it used to look at, to help us get notes/show working that way.
Hi @aliciapaz and @jywarren, I am having a look at this now, yes I did work on the notes/index view, if you want to have a look at the changes that were made, you can have a look at it here
I have looked at the tag/show file, it has a lot of reliance on tags instance variables and tag logic, compared to the notes/index, the logic to be updated and changed is minimal...I think having a new page notes/author similar to notes/index but with the tabs makes sense, just incase we want to update the authors's page design in the future...and I also think it separates the logic for a singular user and all the notes in the system.
Thank you @RuthNjeri
So broken down in tasks, this issue would require:
notes/authornotes/author based on notes/index but with the contents by tabs instead of navDoes this make sense?
This would be my first time contributing to the tests of the project 馃憖
Hi @aliciapaz yes i think that's correct - and i appreciate the idea from @RuthNjeri on separating functions. I /believe/ we can use just the partial template for the tabs, instead of rewriting the tabs, is that right @RuthNjeri?
https://github.com/publiclab/plots2/blob/main/app/views/tag/show/_nav_tabs.html.erb
Thank you!!!! @aliciapaz if you need help on where to begin please reach out!
@aliciapaz yes, that's correct, I am not too sure you can write a unit or functional test for the tab links, testing whether it is a tab sounds like a system test. I think the links have their respective tests, but if they don't, you can add them. I trust your judgement with the testing, you can add them and tag me to review.
@jywarren yes, reusing the nav_tabs template sounds good!
Thank you @RuthNjeri! I will work on this over the weekend.