-
Notifications
You must be signed in to change notification settings - Fork 54
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
Comments
Attached is By The People's service letter. |
A transcriber needed it today. |
Here's a sample letter we built by hand today for someone needing documentation for court appointed service hours. (I have a doc file as well, if we want to use that while building this.) Key things we decided: |
Code we used to do this as a one-off in the console today: Get the user's timeuser_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_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 daydate_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 collectionpages_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 |
Most likely do this using either HTML or markdown to pandoc. |
Ok. Longer design discussion with @benwbrum and here's what we decided:
@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. |
#2858 Added feature for showing contributions hours view and PDF letter download
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.
The text was updated successfully, but these errors were encountered: