website icon indicating copy to clipboard operation
website copied to clipboard

Finish internship feedback and payment features

Open sagesharp opened this issue 5 years ago • 10 comments

The internship feedback collection and processing is nearly complete. There's a few loose ends on the organizer side:

  • [ ] Ability to exclude intern feedback from the file export used to ask Conservancy to pay the interns.
  • [ ] Ability to mark that the organizers have told Conservancy to pay the intern.

There needs to be a website interface (linked from the organizer dashboard) to mark whether the Outreachy organizers have approved payment for the intern.

It should be a series of check boxes (with the default being what organizer_payment_approved is in the model). The information that needs to be displayed is whether the internship was asked to be extended, whether the internship should be terminated, and whether the mentor said the intern should be paid. Use colors to highlight issues like termination requested or don't pay. Perhaps there should be a link to that person's detailed feedback on another page. Then the page should save the information and update organizer_payment_approved in all the models.

There needs to be a second page that allows organizers to export specific interns. By default, all interns with successful feedback from mentors should be checked. Interns with termination or extension feedback should not be checked.

sagesharp avatar Apr 04 '19 18:04 sagesharp

Hi @sagesharp sorry if i am not following the rules but can't see where to do this. I am an outreachy mentor and an open source enthusiast from @LibreHealth. I would love to take upon this issue thanks

muarachmann avatar Jun 04 '19 18:06 muarachmann

Hi @muarachmann! Sorry for the delayed response. Please let me know if you still want to take on this task. If so, I can point out more specific information about what files to modify.

sagesharp avatar Jul 04 '19 18:07 sagesharp

Sure. I would be glad to work on the files with the right pointers

On Thu, Jul 4, 2019 at 7:55 PM Sage Sharp [email protected] wrote:

Hi @muarachmann https://github.com/muarachmann! Sorry for the delayed response. Please let me know if you still want to take on this task. If so, I can point out more specific information about what files to modify.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/outreachy/website/issues/294?email_source=notifications&email_token=AD4X4XSDWOBCR5BRZYUMQHLP5ZBR3A5CNFSM4HDV6SUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZH7RBI#issuecomment-508557445, or mute the thread https://github.com/notifications/unsubscribe-auth/AD4X4XS2P2N2FMNRDCYDAPLP5ZBR3ANCNFSM4HDV6SUA .

muarachmann avatar Jul 04 '19 23:07 muarachmann

Okay, thanks for your help! :slightly_smiling_face: I'm assuming you're already familiar with Django, because this is a medium-complexity task. If you're not, there's other tasks I can recommend.

First, make sure you've got your local environment set up following the instructions on the README. When you get to the instructions for setting up a new internship round, run this code in the shell instead of the code in the README:

>>> from home.scenarios import *
>>> InternshipWeekScenario(week=3)

That should set up a mentor and an intern who is in the middle of the third internship week. That is when initial feedback opens. You can log into the mentor account with the username 'mentor1' and password 'test'. You can log into the intern account with the username 'intern1' and 'test'. There's also mentor2 and intern2 accounts that were created by that command.

You can also log into an organizer account to see what my dashboard looks like. The instructions in the README asked you to create a superuser account. A superuser account is an Outreachy organizer account. So log in with that username and password, and go to https://localhost:8000/dashboard to see our dashboard. There will be a section called "Intern Progress" that you'll see. You'll see buttons to view initial feedback, or export initial feedback.

The first part of this task is a bit complicated, so let me talk about the second part: the ability to mark whether the organizer has approved an intern's stipend.

There's an organizer_payment_approved field in the BaseMentorFeedback class that is used to indicate whether organizers have approved the payments. There are three classes that have BaseMentorFeedback as a superclass: InitialMentorFeedback, MidpointMentorFeedback, and FinalMentorFeedback. When that field is set to true, the Outreachy intern will see on their dashboard that the particular stipend has been approved to be paid by the Outreachy organizers.

Required: What we need is a separate page that has a list of interns as check boxes. We'll need three pages, for updating payment authorization status for initial, mid-point, and final stipends. The page should only be accessible by the Outreachy organizers (aka superusers aka people with Django "staff" permissions). The check box should control the boolean field organizer_payment_approved in InitialMentorFeedback, MidpointMentorFeedback, or FinalMentorFeedback. There should be an 'Update payment authorization' button at the bottom of the page that saves the form and the field values.

Bonus: Add anchor tags to the headings for each intern name in page to view the internship feedback. The anchor tags can use the InternSelection pk or the account's username, since that's unique. Then link to the heading for the intern's feedback in the payment approved checklist. Displaying the internship status like it is on the organizer dashboard (e.g. pay, terminate, extend to a particular date) would help as well.

For the exporting of specific intern's feedback, you'll need to have a checklist of interns on a new page. There should be pages for exporting initial, mid-point, and final feedback. You'll need to handle the case where mentors have not submitted feedback for a particular intern. Perhaps don't have a check box for them, but keep a separate list of interns without feedback on that page? Again, linking to the intern's feedback heading and showing the feedback status would help me figure out which ones I need to export. Ideally, all the check boxes would be checked by default, so I don't have to check 40+ boxes each time I export.

The Outreachy organizer dashboard template is in a couple different files. The one for the internship progress section is here. For adding headings to intern feedback templates, you'll need to edit the templates for initial feedback, mid-point feedback, and final feedback.

To add the six new views, you'll need to update home/views.py and home/urls.py. I'd recommend putting the new view code after the current feedback views.

That's a lot of info, and let me know what other questions you have!

sagesharp avatar Jul 05 '19 22:07 sagesharp

Hi @sagesharp all setup. I tried the mentors login which works fine however the interns credentials dont work i.e intern1 and test. It keeps telling me Please enter a correct username and password. Note that both fields may be case-sensitive.. Also when i look the auth_user table i see only 3 users super_user and the mentors info (2). Probably intern is not created. How can i achieve that. Thanks

muarachmann avatar Jul 06 '19 05:07 muarachmann

Okay i got it was applicant1 rather

muarachmann avatar Jul 06 '19 05:07 muarachmann

Hi @sagesharp added a new page for the first view.I need to understand some certain stuffs like i see on the views.py the current_round or round_page variable and how can i get the interns from there in order to portray in my view thanks.

For example i see this sample code.

pages = CohortPage.objects.all()
    old_cohorts = []
    for p in pages:
        old_cohorts.append((p.round_start, p.round_end,
                            AlumInfo.objects.filter(page=p).order_by('community', 'name')))
    rounds = RoundPage.objects.all().order_by('-internstarts')

Maybe expatiating on this will do :)

muarachmann avatar Jul 09 '19 03:07 muarachmann

There are two types of intern listings - one that uses CohortPage objects and one that uses InternSelection objects. The CohortPage is for historic intern listings, before the website was fully functional. The InternSelection object is the one you want instead. We should probably document not to add new code around the CohortPage class because it's a legacy class.

In order to get the interns that are associated with a RoundPage, you want to call RoundPage.get_approved_intern_selections. You can also call that function from a view or from within the template. For example, take a look at home/templates/home/initial_feedback.html:

        {% with interns=current_round.get_approved_intern_selections %}                        
                {% for i in interns %}

Then you can loop over the InternSelection objects in the template.

Let me know if you have more questions!

sagesharp avatar Jul 10 '19 17:07 sagesharp

Hi @muarachmann! I'm just checking in to see how you're doing on this issue. No pressure on completing this, but do let me know if you're stuck! I'm happy to answer questions, review WIP contributions, or do a screen share session if you need it. Thanks for tackling this!

sagesharp avatar Jul 17 '19 18:07 sagesharp

Hi @sagesharp

Yeah i would love a screen share session so i understand some stuffs that is if you are available. As of now i created a page and here is how it looks like with the checkboxes though confused on what to display etc.

Screen Shot 2019-07-17 at 9 35 09 PM

Also i intentionally submitted a feedback for only intern Dustin Lawrence as seen above and required he being paid. There are a couple of stuffs i would love to find out too like for example

  • base.html can't find it in the whole codebase but i see it extended by all views
  • css file too i see it cached and compressed what if one wants to add some styling? not in this context maybe but just wanted to know
  • Also is the bootstrap framework being used? Just curious cause i see some styling pattern that follow it like common classes but when i apply some trival bootstrap classes they don't seem to work.

Looking forward to hearing from you. Also can i open a PR for this so that you can see what i have done and correct me?

muarachmann avatar Jul 17 '19 20:07 muarachmann