Merge lp:~graeme-acm/sahana-eden/LA into lp:sahana-eden/la

Proposed by Graeme Foster
Status: Merged
Merged at revision: 2699
Proposed branch: lp:~graeme-acm/sahana-eden/LA
Merge into: lp:sahana-eden/la
Diff against target: 249 lines (+98/-9)
7 files modified
controllers/don.py (+43/-0)
controllers/vol.py (+5/-0)
models/don.py (+35/-4)
modules/s3/s3tools.py (+3/-2)
static/scripts/S3/ui.multiselect.js (+3/-0)
static/styles/S3/sahana.css (+6/-2)
views/layout.html (+3/-1)
To merge this branch: bzr merge lp:~graeme-acm/sahana-eden/LA
Reviewer Review Type Date Requested Status
Fran Boon Pending
Review via email: mp+73941@code.launchpad.net

Description of the change

changes for LA logs:

152, Skills widget - height
205, Assignment screen: Cancel Assignment button
216, Padding on the tables in the rheader
220, Links to Download adobe acrobat reader
227, Give2LA in Quote: 2 too small
276, Click Why from some screens, goes to /default/
286, Donation Drive - Add a Comments Field
290, Add New Voucher Distribution - Remove 'Requested by'
291, Add New Voucher Distribution -Add a comments field

Also started work on 237, Donation Request Form - need more details on what's to go in the form and have I put it in the right place. (/don/req/7/commit?inv_item_id=1)

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/don.py'
2--- controllers/don.py 2011-09-02 07:42:58 +0000
3+++ controllers/don.py 2011-09-03 14:23:25 +0000
4@@ -164,8 +164,40 @@
5
6 # Defined in the Model for use from Multiple Controllers for unified menus
7 output = response.s3.req_controller()
8+ output["rheader"].append(
9+ DIV(
10+ BUTTON(T("Donation Request Form"),
11+ _class="accept-button",
12+ _onClick="javascript: window.location='%s'" % \
13+ URL(c=request.controller,
14+ f="req_print",
15+ args=[request.args[0]]
16+ )
17+ ),
18+ BUTTON("",
19+ _class="acrobatReader",
20+ _onClick="javascript: window.open('%s')" % \
21+ "http://www.adobe.com/products/acrobat/readstep2.html"),
22+
23+ )
24+ )
25 return output
26
27+def req_print():
28+ """ Print Donation Request Form """
29+ s3mgr.load("req_req_item")
30+ r = s3base.S3Request(s3mgr,
31+ prefix="req",
32+ name="req_item",
33+ extension="pdf")
34+ s3mgr.configure("req_req_item",
35+ callback = response.s3.donationRequest,
36+ formname = "Donation Request",
37+ header = lambda x, y: None,
38+ footer = lambda x, y: None,
39+ )
40+ return r()
41+
42 # -----------------------------------------------------------------------------
43 # @ToDo: move to inside a prep - only for inv_item components
44 # Add inv_item directly to Org
45@@ -527,6 +559,17 @@
46 # -----------------------------------------------------------------------------
47 def collect():
48 """ REST Controller """
49+ def prep(r):
50+ s3mgr.configure("don_collect",
51+ list_fields = ["id",
52+ "start_datetime",
53+ "end_datetime",
54+ "site_id",
55+ "organisation_id",
56+ ])
57+ return True
58+
59+ response.s3.prep = prep
60 output = s3_rest_controller(module, resourcename)
61 return output
62
63
64=== modified file 'controllers/vol.py'
65--- controllers/vol.py 2011-09-02 12:42:17 +0000
66+++ controllers/vol.py 2011-09-03 14:23:25 +0000
67@@ -1619,6 +1619,11 @@
68 "assignment",
69 assignment,
70 "print"])),
71+ BUTTON("",
72+ _class="acrobatReader",
73+ _onClick="javascript: window.open('%s')" % \
74+ "http://www.adobe.com/products/acrobat/readstep2.html"),
75+
76 BR(),
77 BUTTON(T("CANCEL ASSIGNMENT"),
78 _class="wide-grey-button",
79
80=== modified file 'models/don.py'
81--- models/don.py 2011-09-01 16:28:16 +0000
82+++ models/don.py 2011-09-03 14:23:25 +0000
83@@ -63,6 +63,12 @@
84 empty = False,
85 widget = None
86 ),
87+ comments("donation_comments",
88+ writable = True,
89+ label = T("Donation Comments"),
90+ comment=DIV(_class="tooltip",
91+ _title="%s|%s" % (T("Donation Comments"),
92+ T("Additional comments concerning this donation drive.")))),
93 Field("volume",
94 "double",
95 label = T("Volume Collected (cub. ft)")),
96@@ -97,10 +103,10 @@
97 event_id(default=session.s3.event),
98 Field("date",
99 "date"),
100- human_resource_id("requested_by_id",
101- label = T("Requested By"),
102- empty = False,
103- default = s3_logged_in_human_resource()),
104+# human_resource_id("requested_by_id",
105+# label = T("Requested By"),
106+# empty = False,
107+# default = s3_logged_in_human_resource()),
108 organisation_id(label = T("Distributed By Organization"),
109 empty = False,
110 ),
111@@ -122,6 +128,12 @@
112 # _title="%s|%s" % (T("Requested By Facility"),
113 # T("Enter some characters to bring up a list of possible matches"))),
114 represent = shn_site_represent),
115+ comments("distribute_comments",
116+ writable = True,
117+ label = T("Voucher Comments"),
118+ comment=DIV(_class="tooltip",
119+ _title="%s|%s" % (T("Distribution Comments"),
120+ T("Additional comments about this voucher distribution.")))),
121 *s3_meta_fields())
122 # CRUD strings
123 ADD_DISTRIBUTE = T("Record Voucher Distribution")
124@@ -217,6 +229,24 @@
125 )
126 canvas.restoreState()
127
128+ def donationRequest(pdf, **args):
129+ from reportlab.lib.styles import ParagraphStyle
130+ from reportlab.lib.styles import getSampleStyleSheet
131+
132+ stylesheet=getSampleStyleSheet()
133+ normalStyle = stylesheet["Normal"]
134+ style = normalStyle
135+ styleA = ParagraphStyle(name="StyleA",
136+ parent=normalStyle,
137+ fontName="CertFont",
138+ fontSize=8,
139+ leading=12,
140+ borderPadding = (10, 2, 10, 2),
141+ alignment = 1,
142+ )
143+ line1 = "Thanks for all the fish."
144+ pdf.addParagraph(line1, styleA)
145+
146 def donationCertificate(pdf, **args):
147
148 from reportlab.lib.styles import ParagraphStyle
149@@ -360,6 +390,7 @@
150
151 # Pass variables back to global scope (response.s3.*)
152 return dict(
153+ donationRequest = donationRequest,
154 donationCertificate = donationCertificate,
155 donCertBorder = donCertBorder,
156 )
157
158=== modified file 'modules/s3/s3tools.py'
159--- modules/s3/s3tools.py 2011-08-30 06:19:17 +0000
160+++ modules/s3/s3tools.py 2011-09-03 14:23:25 +0000
161@@ -314,10 +314,11 @@
162 (name, right, link) = item[:3]
163 if not right:
164 import re
165+ _link = link
166 if "default" not in _highlight:
167 _highlight = re.match("(.*/).*$", _highlight).group(1)
168- link = re.match("(.*/).*$", link).group(1)
169- _class = "highlight" if str(link) in _highlight else " "
170+ _link = re.match("(.*/).*$", link).group(1)
171+ _class = "highlight" if str(_link) in _highlight else " "
172 items.append(LI(
173 A(name, _href=link, _class=_class)
174 ))
175
176=== added file 'static/img/acrobat_reader_50x50.gif'
177Binary files static/img/acrobat_reader_50x50.gif 1970-01-01 00:00:00 +0000 and static/img/acrobat_reader_50x50.gif 2011-09-03 14:23:25 +0000 differ
178=== modified file 'static/scripts/S3/ui.multiselect.js'
179--- static/scripts/S3/ui.multiselect.js 2011-08-13 21:20:44 +0000
180+++ static/scripts/S3/ui.multiselect.js 2011-09-03 14:23:25 +0000
181@@ -57,6 +57,9 @@
182 var that = this;
183
184 // set dimensions
185+ var displayLines = 8; // added by GF
186+ this.element.height(21*displayLines+this.selectedActions.height()+2); // added by GF
187+
188 this.container.width(this.element.width()+1);
189 this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
190 this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
191
192=== modified file 'static/styles/S3/sahana.css'
193--- static/styles/S3/sahana.css 2011-08-30 09:42:54 +0000
194+++ static/styles/S3/sahana.css 2011-09-03 14:23:25 +0000
195@@ -196,6 +196,7 @@
196 #header #la-logo, #header #logo{float:left;}
197 #header #la-logo{margin-top:24px;}
198 #header #logo{margin:55px 0px 0px 70px;}
199+
200 /*#header #personal-menu{float:right;width:50%;margin-right:0px;font-size:0.90em;}*/
201 #header #personal-menu{float:right;width:400px;margin-right:0px;font-size:0.90em;}
202 #header #personal-menu .pmenu-wrapper{float:right;}
203@@ -210,7 +211,7 @@
204 #header blockquote .open,#header blockquote .close{position:absolute;display:block;margin-top:10px;width:15px;height:15px;text-indent:9999px;}
205 #header blockquote .open{top:-10px;left:52px;float:left;background:url(../../img/la/open_quote.png) no-repeat;}
206 #header blockquote .close{bottom:25px;right:12px;float:left;background:url(../../img/la/close_quote.png) no-repeat;}
207-
208+#header blockquote .give2laTWO{font-weight: bold;}
209 /*** Navigation ***/
210
211 /* Main Navigation */
212@@ -445,8 +446,9 @@
213 .submit-button:active{background-position:0px -41px;}
214 .print-button{clear:both;width:143px;height:45px;background-image:url(../../img/la/medium_red_button.png);background-repeat:no-repeat;border:0px;color:#fff;font-weight:bold;text-transform:uppercase;}
215 a.print-button{display:block;height:30px;padding-top:13px;text-align:center;}
216-.wide-grey-button{clear:both;width:130px; height:18px;margin-bottom:10px;background:url(../../img/la/grey_button_wide.png) no-repeat;font-size:0.8em;color:#fff;text-transform:uppercase;}
217+.wide-grey-button{clear:both;width:130px; height:18px;margin-bottom:10px;background:url(../../img/la/grey_button_wide.png) no-repeat;font-size:0.7em;color:#fff;text-transform:uppercase;}
218 a.wide-grey-button{display:block;padding-top:2px;text-align:center;}
219+.acrobatReader{float:right; width:50px; height:50px; background:url(../../img/acrobat_reader_50x50.gif);}
220
221 .apply-button,
222 .accept-button,
223@@ -673,9 +675,11 @@
224 td.x-toolbar-left table {
225 margin-bottom: 0;
226 }
227+/* removed by Graeme since it hides some of the Parallax formatting see LA log 216
228 table td {
229 padding: 0;
230 }
231+*/
232 /* Fix for breadcrumbs */
233 div#home {
234 /*float: right;*/
235
236=== modified file 'views/layout.html'
237--- views/layout.html 2011-08-30 08:30:15 +0000
238+++ views/layout.html 2011-09-03 14:23:25 +0000
239@@ -84,7 +84,9 @@
240 </div>
241 <a href='#main-content' class='skipnavigation'>Skip to Content</a>
242 {{=MENUS3(response.menu, _type="nav", _id="nav", _highlight=request["wsgi"]["environ"]["PATH_INFO"])}}
243- <blockquote><span class='open'>&#8220;</span><span class='quote'>{{=T("Donate. Volunteer. Serve.")}}<br/>{{=T("Please Give2LA and do your part to ensure LA is ready for a disaster.")}}</span><span class='close'>&#8221;</span><br/><span class='name'>Mayor Antonio Villaraigosa</span></blockquote>
244+ <blockquote><span class='open'>&#8220;</span>
245+ <span class='quote'>{{=T("Donate. Volunteer. Serve.")}}<br/>{{=XML(T("Please %(give2la)s and do your part to ensure LA is ready for a disaster.") % {"give2la":"Give<span class='give2laTWO'>2</span>LA"}) }}</span>
246+ <span class='close'>&#8221;</span><br/><span class='name'>Mayor Antonio Villaraigosa</span></blockquote>
247 </div><!-- end #header -->
248
249 <div id='content'>

Subscribers

People subscribed via source and target branches

to all changes: