Commit 30ffdd4f authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[views] chtoupido-fix

parent a4eca6c6a4fd
......@@ -4,7 +4,7 @@
modname = 'cmt'
distname = 'cubicweb-cmt'
numversion = (0, 5, 0)
numversion = (0, 5, 1)
version = '.'.join(str(num) for num in numversion)
license = 'LCL'
......
cubicweb-cmt (0.5.1-1) unstable; urgency=low
* new upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Tue, 09 Aug 2011 15:48:25 +0200
cubicweb-cmt (0.5.0-1) unstable; urgency=low
* new upstream release
......
sync_schema_props_perms('billing')
sync_schema_props_perms('your_ref')
......@@ -52,3 +52,4 @@ class billing(RelationDefinition):
subject = 'ShoppingCart'
object = 'BillingAddress'
cardinality = '?1'
composite = 'subject'
......@@ -37,6 +37,7 @@ uicfg.actionbox_appearsin_addmenu.tag_subject_of(('Conference', 'has_shoppingite
uicfg.actionbox_appearsin_addmenu.tag_subject_of(('ShoppingCart', 'billing', '*'), True)
uicfg.primaryview_section.tag_subject_of(('ShoppingCart', 'billing', '*'), 'hidden')
uicfg.primaryview_section.tag_object_of(('ShoppingCart', 'billing', 'BillingAddress'), 'hidden')
uicfg.autoform_section.tag_subject_of(('ShoppingCart', 'billing', '*'), 'main', 'inlined')
_ = unicode
......@@ -103,7 +104,7 @@ class ConferenceRegistrationComponent(component.CtxComponent):
label = self._cw._(self.label)
w(u'<div class="conferenceBox">')
w(u'<div id="confRegister">')
w(u'<a href="%s">%s</a>' % (xml_escape(self.conf.absolute_url(vid='conf-registration'), xml_escape(label)))
w(u'<a href="%s">%s</a>' % (xml_escape(self.conf.absolute_url(vid='conf-registration')), xml_escape(label)))
w(u'</div></div>')
# debugging purpose
return self.label
......@@ -151,6 +152,15 @@ class CmtShoppingCartPrimaryView(ShoppingCartPrimaryView):
btn_modify = (u'<div><a href="%s">%s</a></div>' % (
self._cw.build_url(entity.eid, vid='edition'),
self._cw._('modify your registration')))
if entity.billing:
self.w(u'<p>%s</p>' % self._cw._('Billing address'))
entity.billing[0].view('primary', w=self.w)
else:
add_url = self._cw.build_url('add/BillingAddress',
__linkto='billing:%d:object' % entity.eid,
__redirectpath='shoppingcart/%d' % entity.eid,
__redirectvid='primary')
self.w(u'<p><a href="%s">%s</a></p>' % (xml_escape(add_url), self._cw._('Add a billing address')))
if reg == 'not payed for':
rset = self._cw.execute('Any C WHERE C has_shoppingitemtype T, I item_type T, '
'SC items_in_cart I, SC eid %(x)s', dict(x=entity.eid))
......@@ -171,7 +181,7 @@ class CmtShoppingCartPrimaryView(ShoppingCartPrimaryView):
payreq.url_err = entity.absolute_url(__message='The payment failed.')
label = self._cw._('pay now %s %s to confirm your registration') % (
payreq.amount, payreq.currency)
icon = u'<img alt="OK_ICON" src="%s"/>' % self._cw.external_resource('OK_ICON')
icon = u'<img alt="OK_ICON" src="%s"/>' % self._cw.uiprops['OK_ICON']
submit = u'<button type="submit" class="validateButton">%s %s</button>' % (icon, label)
self.w(u'<table width="100%%"><tr><td>%s</td><td>%s</td></tr></table>' % (
cmcic.html_form(tpe, payreq, submit),
......@@ -183,16 +193,7 @@ class CmtShoppingCartPrimaryView(ShoppingCartPrimaryView):
self.w(u'</p>')
self.w(btn_modify)
else:
if entity.billing:
self.w(u'<p>%s</p>' % self._cw._('Billing address'))
entity.billing[0].view('primary', w=self.w)
else:
add_url = self._cw.build_url('add/BillingAddress',
__linkto='billing:%d:object' % entity.eid,
__redirectpath='shoppingcart/%d' % entity.eid,
__redirectvid='primary')
self.w(u'<p><a href="%s">%s</a></p>' % (xml_escape(add_url), self._cw._('Add a billing address')))
self.w(u'<hr /><p><a href="%s">%s</a></p>' % (entity.book_conf[0].absolute_url(), self._cw._('Go to the conference schedule')))
self.w(u'<p><a href="%s">%s</a></p>' % (entity.book_conf[0].absolute_url(), self._cw._('Go to the conference schedule')))
REPLACE_LIST.append((CmtShoppingCartPrimaryView, ShoppingCartPrimaryView))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment