Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volunteer hours downloadable letter #2858

Closed
saracarl opened this issue Oct 28, 2021 · 6 comments · Fixed by #3837
Closed

volunteer hours downloadable letter #2858

saracarl opened this issue Oct 28, 2021 · 6 comments · Fixed by #3837
Assignees
Labels
feature transcriber issues affecting transcriber happiness

Comments

@saracarl
Copy link
Collaborator

Similar to #1240, we should provide a downloadable letter that documents user contributions.

We could start with a simple letter that says who the owning organization is (what if they work on multiple projects?), but we could also let project owners upload a logo and a signature and format a PDF for their specific project.

@saracarl
Copy link
Collaborator Author

Attached is By The People's service letter.
letter.pdf
(note it doesn't have hours, just metrics)

@anabasftp
Copy link
Collaborator

A transcriber needed it today.

@saracarl
Copy link
Collaborator Author

Here's a sample letter we built by hand today for someone needing documentation for court appointed service hours.
MichaelLaleskaServiceHours.pdf

(I have a doc file as well, if we want to use that while building this.)

Key things we decided:
-- document total hours for a time frame; that will include clicking around time and commenting/editing time.
-- for the table, we counted "pages they had worked on" -- transcriptions, notes, edits, etc.
-- We dropped the one collection that had a page count of 0 (not sure why it showed up, but it did)

@benwbrum
Copy link
Owner

Code we used to do this as a one-off in the console today:

Get the user's time

user_id = 32017019
user = User.find user_id

summaries_for_user= AhoyActivitySummary.where(user_id: user_id)

Record time per collection

*Note that some time does not have a collection_id, so this could be undercount "overhead" time navigating to projects, etc.

collection_minutes_map= summaries_for_user.group(:collection_id).sum(:minutes)
collection_minutes_map.each_pair do |collection_id, minutes|
  collection=Collection.where(id:collection_id).first
  if collection.nil?
    output_array << [nil, nil, minutes]
  else
    output_array << [collection.owner.display_name, collection.title, minutes]
  end
end
f = File.open("/tmp/time_per_collection.csv", "w+")
f.print output_array.map{|row| row.join(",")}.join("\n")
f.close

Record time per day

date_minutes_map= summaries_for_user.group(:date).sum(:minutes)
output_array= []
date_minutes_map.keys.sort.each do |date|
  output_array << [date, date_minutes_map[date]]
end
f = File.open("/tmp/time_per_day.csv", "w+")
f.print output_array.map{|row| row.join(",")}.join("\n")
f.close

Record pages per collection

pages_per_collection = user.deeds.where(deed_type: DeedType.collection_edits).group(:collection_id).count(:page_id)
output_array=[]
pages_per_collection.each_pair do |collection_id, edits|
  collection=Collection.where(id:collection_id).first
  if collection.nil?
    output_array << [nil, nil, edits]
  else
    output_array << [collection.owner.display_name, collection.title, edits]
  end
end
f = File.open("/tmp/pages_per_collection.csv", "w+")
f.print output_array.sort{ |a,b| b[2]<=>a[2]}.map{|row| row.join("\t")}.join("\n")
f.close

@saracarl saracarl added the transcriber issues affecting transcriber happiness label Oct 18, 2023
@benwbrum benwbrum added the bug label Oct 18, 2023
@saracarl
Copy link
Collaborator Author

Most likely do this using either HTML or markdown to pandoc.

@benwbrum benwbrum added feature and removed bug labels Oct 18, 2023
@saracarl
Copy link
Collaborator Author

Ok. Longer design discussion with @benwbrum and here's what we decided:

  1. This belongs on the collaborator dashboard. We should put it right under "Your Activity" and it should be a link that reads "Your Hours"
    image
  2. The "Your Hours" view should default to the last 7 days, and have a calendar selection widget for range similar to the Collaborators tab:
    image
  3. We should show two things based on the dates: a sentence "Michael Aleksa has contributed 81 hours and 32 minutes between July 22, 2023 and October 10, 2023" and a table of collections and pages (like the letter).
    image
    You can pull the table styling from the admin dashboard.
  4. Then there should be a button "download a letter" (this should produce the pdf as above in the issue, with the same data as shown on the screen).

@benwbrum thinks we should build a maximum and minimum into the date picker to improve their experience. Start date would be the date of their first ahoy visit/activity on the site. End date date would be yesterday. I think this is a nice-to-have, but worth exploring.

@symmetrically symmetrically self-assigned this Oct 27, 2023
saracarl added a commit that referenced this issue Nov 29, 2023
#2858 Added feature for showing contributions hours view and PDF letter download
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature transcriber issues affecting transcriber happiness
Projects
None yet
4 participants