Merge lp:~graeme-acm/sahana-eden/LA into lp:sahana-eden/la
- LA
- Merge into la
Proposed by
Graeme Foster
Status: | Merged |
---|---|
Merged at revision: | 2698 |
Proposed branch: | lp:~graeme-acm/sahana-eden/LA |
Merge into: | lp:sahana-eden/la |
Diff against target: |
205 lines (+46/-21) 5 files modified
controllers/vol.py (+1/-1) models/00_utils.py (+1/-0) models/req.py (+1/-1) models/vol.py (+39/-15) private/prepopulate/demo/LA/req_req.csv (+4/-4) |
To merge this branch: | bzr merge lp:~graeme-acm/sahana-eden/LA |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Fran Boon | Pending | ||
Review via email: mp+73795@code.launchpad.net |
Commit message
Description of the change
minor fixes to vol assignment report (logo on badge, report to person)
Fix to dates to check utc details
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'controllers/vol.py' |
2 | --- controllers/vol.py 2011-09-02 11:01:59 +0000 |
3 | +++ controllers/vol.py 2011-09-02 12:20:15 +0000 |
4 | @@ -1545,7 +1545,7 @@ |
5 | TR( |
6 | TD(record.request_number), |
7 | TD(record.purpose), |
8 | - TD(B(s3_date_represent(record.date_required)), |
9 | + TD(B(s3_date_represent_utc(record.date_required)), |
10 | BR(), |
11 | "%s - %s" % (time_req, |
12 | time_until), |
13 | |
14 | === modified file 'models/00_utils.py' |
15 | --- models/00_utils.py 2011-08-29 01:19:43 +0000 |
16 | +++ models/00_utils.py 2011-09-02 12:20:15 +0000 |
17 | @@ -181,6 +181,7 @@ |
18 | s3_time_represent = S3DateTime.time_represent |
19 | s3_datetime_represent = S3DateTime.datetime_represent |
20 | s3_utc_represent = lambda dt: s3_datetime_represent(dt, utc=True) |
21 | +s3_date_represent_utc = lambda dt: s3_datetime_represent(dt, utc=True).split()[0] |
22 | |
23 | # ----------------------------------------------------------------------------- |
24 | def s3_filename(filename): |
25 | |
26 | === modified file 'models/req.py' |
27 | --- models/req.py 2011-09-02 11:01:59 +0000 |
28 | +++ models/req.py 2011-09-02 12:20:15 +0000 |
29 | @@ -1955,7 +1955,7 @@ |
30 | time_until = "" |
31 | # Restore in case used later |
32 | deployment_settings.L10n.datetime_format = save |
33 | - return DIV(B(s3_date_represent(req.date_required)), |
34 | + return DIV(B(s3_date_represent_utc(req.date_required)), |
35 | BR(), |
36 | "%s - %s" % (time_req, |
37 | time_until) |
38 | |
39 | === modified file 'models/vol.py' |
40 | --- models/vol.py 2011-09-02 11:43:54 +0000 |
41 | +++ models/vol.py 2011-09-02 12:20:15 +0000 |
42 | @@ -827,6 +827,28 @@ |
43 | canvas.line(width/2 - adjust, posn, width/2 - adjust, -marginB) |
44 | canvas.restoreState() |
45 | |
46 | + def badgeLogo(canvas, dataList): |
47 | + """ |
48 | + callback method to draw the tear off lines for the report |
49 | + """ |
50 | + from PIL import Image |
51 | + pdf = dataList[0] |
52 | + top = dataList[1] |
53 | + margin = dataList[3] |
54 | + left1 = dataList[2] / 2 + margin |
55 | + left2 = dataList[2] - margin |
56 | + height = dataList[4] |
57 | + adjust = dataList[5] |
58 | + if pdf.logo and os.path.exists(pdf.logo): |
59 | + im = Image.open(pdf.logo) |
60 | + (iwidth, iheight) = im.size |
61 | + width = iwidth * (height/iheight) |
62 | + canvas.drawImage(pdf.logo, |
63 | + left1 + adjust, |
64 | + top - height - adjust, |
65 | + width = width, |
66 | + height = height) |
67 | + |
68 | def pdfGridStyle(tableObj, startRow, rowCnt, endCol): |
69 | from reportlab.lib.colors import Color |
70 | style = [("FONTNAME", (0, 0), (-1, -1), "Helvetica"), |
71 | @@ -842,7 +864,7 @@ |
72 | from reportlab.lib.units import inch |
73 | def assignmentPDF(pdf, **args): |
74 | # set the banner |
75 | - pdf.setMargins(left=0.4*inch, right = 0.4*inch) |
76 | + pdf.setMargins(bottom=0.3*inch, left=0.4*inch, right = 0.4*inch) |
77 | pdf.setHeaderBanner("static/img/la/Give2LAbranding_BW.jpg") |
78 | # get the assignment details |
79 | atable = db.vol_assignment |
80 | @@ -874,12 +896,12 @@ |
81 | lbl_startTime = T("Arrival Time") |
82 | lbl_endTime = T("Finish Time") |
83 | lbl_meetingPoint = T("Location") |
84 | - lbl_reportTo = T("Contact Person") |
85 | + lbl_contact = T("Contact Person") |
86 | lbl_reportPlace = T("Contact Place") |
87 | lbl_email = T("Email") |
88 | lbl_phone = T("Phone Number") |
89 | lbl_title3 = "%s:" % T("Check-in Slip") |
90 | - lbl_title4 = "%s:" % T("Volunteer ID") |
91 | + lbl_title4 = "%s:" % T("VOLUNTEER ID") |
92 | lbl_volunteer = T("Volunteer") |
93 | lbl_task = T("Task") |
94 | lbl_task_comments = T("Comments") |
95 | @@ -887,6 +909,7 @@ |
96 | lbl_checkout = T("Check-out Time") |
97 | lbl_address = T("Address") |
98 | lbl_emergenctContact = T("Emergency Contact") |
99 | + lbl_report_to = T("Report To") |
100 | txt_disclaimer1 = T("As a volunteer working to assist disaster survivors and in disaster recovery efforts, you will be required to fill out and sign the Give2LA Registration Forms.") |
101 | txt_disclaimer2 = T("Please let us know in advance if you cannot report for your Volunteer Assignment by calling %(name)s on %(phone)s or via email at %(email)s.") |
102 | |
103 | @@ -911,7 +934,7 @@ |
104 | cell2 = [] |
105 | heading = "<para align='CENTER'><b>%s</b></para>" % lbl_title2 |
106 | cell2.append([pdf.addParagraph(heading, append=False), ""]) |
107 | - heading = "<b>%s</b>" % lbl_reportTo |
108 | + heading = "<b>%s</b>" % lbl_contact |
109 | cell2.append([pdf.addParagraph(heading, append=False), |
110 | pdf.addParagraph(name, append=False)]) |
111 | cell2.append(["", address]) |
112 | @@ -988,7 +1011,6 @@ |
113 | heading = "<b>%s</b>" % lbl_volunteer |
114 | cell3.append([pdf.addParagraph(heading, append=False), |
115 | pdf.addParagraph(vol_name, append=False)]) |
116 | -# start log 122 |
117 | heading = "<b>%s</b>" % lbl_task |
118 | cell3.append([pdf.addParagraph(heading, append=False), |
119 | pdf.addParagraph(record.purpose, append=False)]) |
120 | @@ -999,9 +1021,6 @@ |
121 | cell3.append([pdf.addParagraph(heading, append=False), ""]) |
122 | heading = "<b>%s</b>" % lbl_checkout |
123 | cell3.append([pdf.addParagraph(heading, append=False), ""]) |
124 | -# end log 122 |
125 | -# log 105 heading = "<b>%s</b>" % lbl_address |
126 | -# log 105 cell3.append([pdf.addParagraph(heading, append=False), address]) |
127 | heading = "<b>%s</b>" % lbl_emergenctContact |
128 | emContact = "%s<br/>%s" % (emergency_name, |
129 | emergency_phone) |
130 | @@ -1010,19 +1029,22 @@ |
131 | emContact]) |
132 | |
133 | cell4 = [] |
134 | - heading = "<para align='CENTER'><b>%s</b></para>" % lbl_title4 |
135 | - cell4.append([pdf.addParagraph(heading, append=False), ""]) |
136 | - heading = "<b>%s</b>" % lbl_volunteer |
137 | + heading = "<b>%s</b>" % lbl_title4 |
138 | + cell4.append([pdf.addParagraph("", append=False), |
139 | + pdf.addParagraph(heading, append=False)]) |
140 | +# cell4.append([pdf.addParagraph(heading, append=False), ""]) |
141 | +# heading = "<b>%s</b>" % lbl_volunteer |
142 | + cell4.append([pdf.addParagraph("", append=False), |
143 | + pdf.addParagraph("<u><b>%s</u></b>" %vol_name, append=False)]) |
144 | + heading = "<b>%s</b>" % lbl_report_to |
145 | cell4.append([pdf.addParagraph(heading, append=False), |
146 | - pdf.addParagraph(vol_name, append=False)]) |
147 | + pdf.addParagraph(name, append=False)]) |
148 | heading = "<b>%s</b>" % lbl_task |
149 | cell4.append([pdf.addParagraph(heading, append=False), |
150 | pdf.addParagraph(record.purpose, append=False)]) |
151 | heading = "<b>%s</b>" % lbl_task_comments |
152 | cell4.append([pdf.addParagraph(heading, append=False), |
153 | pdf.addParagraph(comments, append=False)]) |
154 | -# log 104 heading = "<b>%s</b>" % lbl_address |
155 | -# log 104 cell4.append([pdf.addParagraph(heading, append=False),address]) |
156 | heading = "<b>%s</b>" % lbl_emergenctContact |
157 | cell4.append([pdf.addParagraph(heading, append=False), |
158 | emContact]) |
159 | @@ -1036,6 +1058,7 @@ |
160 | style1 = [("VALIGN", (0, 0), (-1, -1), "TOP"), |
161 | ("SPAN",(0, 0), (1, 0)), |
162 | ] |
163 | + style1logo = [("VALIGN", (0, 0), (-1, -1), "TOP")] |
164 | style2 = [("VALIGN", (0, 0), (-1, -1), "TOP"), |
165 | ("SPAN",(0, 0), (1, 0)), |
166 | ("SPAN",(0,1),(0,2)), |
167 | @@ -1053,7 +1076,7 @@ |
168 | style=style1_1 |
169 | ) |
170 | table3 = pdf.getStyledTable(cell3, colWidths=[col1*.3, col1*.7], style=style1) |
171 | - table4 = pdf.getStyledTable(cell4, colWidths=[col3*.3, col3*.7], style=style1) |
172 | + table4 = pdf.getStyledTable(cell4, colWidths=[col3*.3, col3*.7], style=style1logo) |
173 | tableC = pdf.getStyledTable([[table3, "", table4]], |
174 | colWidths=[col1, col2, col3], |
175 | style=style1_1) |
176 | @@ -1083,6 +1106,7 @@ |
177 | # need to add the overlay at the end so that the canvas origin |
178 | # is at the bottom of the printed page |
179 | pdf.addOverlay(tearOff, (h3[0]+5, width, 0.4*inch, 0.4*inch, inch+20)) |
180 | + pdf.addOverlay(badgeLogo, (pdf, h3[0], width, 5, .6*inch, 4)) |
181 | |
182 | def rosterPDF(pdf, **args): |
183 | # set the banner |
184 | |
185 | === modified file 'private/prepopulate/demo/LA/req_req.csv' |
186 | --- private/prepopulate/demo/LA/req_req.csv 2011-09-02 08:18:15 +0000 |
187 | +++ private/prepopulate/demo/LA/req_req.csv 2011-09-02 12:20:15 +0000 |
188 | @@ -1,6 +1,6 @@ |
189 | "Event","Incident","Request Type","Request Number","Date Requested","Priority","Purpose","Date Required","Date Required Until","Requester","Assigned To","Approved by","Requested for","Requested for Facility","Transportation Required","Security Required","Public","Date Delivered","Received by","Comments" |
190 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Inventory Items","LAUREL_CANYON*07_2011#01","2011-07-24 10:00:00","Medium","Provide refreshments to people coming to the Poinsettia Recreation Center Family Assistance Center to get information","2011-09-26 10:00:00","2011-09-26 20:00:00","Frank Bone","Joe Bloggs","Jeff Wayne","Curran Spencer","Koreatown/Wilshire District Office","T","T","F","07-26-2011 9:15:00",, |
191 | -"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Inventory Items","LAUREL_CANYON*07_2011#02","2011-07-24 10:00:01","High","Transportation required","2011-09-26 10:00:01","2011-09-26 20:00:01","Frank Bone","Jeff Wayne","Joe Bloggs","Curran Spencer","Koreatown/Wilshire District Office","F","F","F",,, |
192 | +"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Inventory Items","LAUREL_CANYON*07_2011#02","2011-07-24 10:00:01","High","Transportation required","2011-09-25 10:00:01","2011-09-25 20:00:01","Frank Bone","Jeff Wayne","Joe Bloggs","Curran Spencer","Koreatown/Wilshire District Office","F","F","F",,, |
193 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Inventory Items","LAUREL_CANYON*07_2011#03","2011-07-24 10:00:02","Low","Additional water will be needed","2011-09-26 10:00:02","2011-09-26 20:00:02","Joe Bloggs","Jeff Wayne","Frank Bone","Curran Spencer","Koreatown/Wilshire District Office","F","F","F",,, |
194 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#04","2011-07-24 10:00:03","High","Drivers are needed to be on stand-by","2011-09-26 10:00:03","2011-09-26 20:00:03","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
195 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#05","2011-07-24 10:00:04","Medium","We need people to prepare and hand out refreshments","2011-09-26 10:00:04","2011-09-26 20:00:04","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
196 | @@ -10,6 +10,6 @@ |
197 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#09","2011-07-24 10:00:08","Medium","We need some security guards","2011-09-26 10:00:08","2011-09-26 20:00:08","Joe Bloggs","Jeff Wayne","Frank Bone","Iliana Hurley","Koreatown/Wilshire District Office","F","F","T",,, |
198 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#10","2011-07-24 10:00:09","Medium","We need people to help plan the event","2011-09-26 10:00:09","2011-09-26 20:00:09","Joe Bloggs","Jeff Wayne","Frank Bone","Iliana Hurley","Koreatown/Wilshire District Office","F","F","T",,, |
199 | "Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#11","2011-07-24 10:00:10","Medium","We need people to take photographs of the event","2011-09-26 10:00:10","2011-09-26 20:00:10","Joe Bloggs","Jeff Wayne","Frank Bone","Iliana Hurley","Koreatown/Wilshire District Office","F","F","T",,, |
200 | -"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#12","2011-07-24 10:00:11","Medium","We need people to write up a summary of the event","2011-09-27 10:00:11","2011-09-26 20:00:11","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
201 | -"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#13","2011-07-24 10:00:12","Medium","We need people to clear up afterward","2011-09-27 10:00:12","2011-09-26 20:00:12","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
202 | -"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#14","2011-07-24 10:00:13","Medium","We need people to man the telephones and answer queries","2011-09-27 10:00:13","2011-09-26 20:00:13","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","F",,, |
203 | +"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#12","2011-07-24 10:00:11","Medium","We need people to write up a summary of the event","2011-09-27 10:00:11","2011-09-27 20:00:11","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
204 | +"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#13","2011-07-24 10:00:12","Medium","We need people to clear up afterward","2011-09-27 10:00:12","2011-09-27 20:00:12","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","T",,, |
205 | +"Summer 2011 Forest Fires","Laurel Canyon Brush Fire","Volunteer","LAUREL_CANYON*07_2011#14","2011-07-24 10:00:13","Medium","We need people to man the telephones and answer queries","2011-09-27 10:00:13","2011-09-27 20:00:13","Joe Bloggs","Jeff Wayne","Frank Bone","Emerald Potter","Koreatown/Wilshire District Office","F","F","F",,, |