provide location url on feedback messages/pages
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2204 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
8d931d9786
commit
c9ec411a95
3 changed files with 21 additions and 6 deletions
|
@ -62,7 +62,7 @@ class MessageInstance(Instance):
|
||||||
if self.client is None:
|
if self.client is None:
|
||||||
return ''
|
return ''
|
||||||
if zope29:
|
if zope29:
|
||||||
path = self.client.manager.getPhysicalPath()
|
path = self.client.manager.getPhysicalPath()[:-3]
|
||||||
url = request.physicalPathToURL(path)
|
url = request.physicalPathToURL(path)
|
||||||
else:
|
else:
|
||||||
url = absoluteURL(self.client.manager, request)
|
url = absoluteURL(self.client.manager, request)
|
||||||
|
|
|
@ -207,6 +207,7 @@ class CheckoutView(ServiceManagerView):
|
||||||
result.append(dict(service=service.title,
|
result.append(dict(service=service.title,
|
||||||
fromTo=self.getFromTo(service),
|
fromTo=self.getFromTo(service),
|
||||||
location=service.location,
|
location=service.location,
|
||||||
|
locationUrl=service.locationUrl,
|
||||||
number=reg.number,
|
number=reg.number,
|
||||||
serviceObject=service))
|
serviceObject=service))
|
||||||
return result
|
return result
|
||||||
|
@ -223,7 +224,12 @@ class CheckoutView(ServiceManagerView):
|
||||||
def listRegistrationsText(self):
|
def listRegistrationsText(self):
|
||||||
result = []
|
result = []
|
||||||
for info in self.getRegistrationsInfo():
|
for info in self.getRegistrationsInfo():
|
||||||
line = '\n'.join((info['service'], info['fromTo'], info['location']))
|
location, locationUrl = info['location'], info['locationUrl']
|
||||||
|
if locationUrl.startswith('/'):
|
||||||
|
locationUrl = self.request.get('SERVER_URL') + locationUrl
|
||||||
|
locationInfo = (locationUrl and '%s (%s)' % (location, locationUrl)
|
||||||
|
or location)
|
||||||
|
line = '\n'.join((info['service'], info['fromTo'], locationInfo))
|
||||||
if info['serviceObject'].allowRegWithNumber:
|
if info['serviceObject'].allowRegWithNumber:
|
||||||
line += '\nTeilnehmer: %s\n' % info['number']
|
line += '\nTeilnehmer: %s\n' % info['number']
|
||||||
result.append(line)
|
result.append(line)
|
||||||
|
@ -251,9 +257,13 @@ class CheckoutView(ServiceManagerView):
|
||||||
def listRegistrationsHtml(self):
|
def listRegistrationsHtml(self):
|
||||||
result = []
|
result = []
|
||||||
for info in self.getRegistrationsInfo():
|
for info in self.getRegistrationsInfo():
|
||||||
|
location, locationUrl = info['location'], info['locationUrl']
|
||||||
|
locationInfo = (locationUrl
|
||||||
|
and ('<a href="%s">%s</a>' % (locationUrl, location))
|
||||||
|
or location)
|
||||||
line = self.row % (info['number'], info['service'],
|
line = self.row % (info['number'], info['service'],
|
||||||
info['fromTo'].replace(' ', ' '),
|
info['fromTo'].replace(' ', ' '),
|
||||||
info['location'])
|
locationInfo)
|
||||||
result.append(line)
|
result.append(line)
|
||||||
return self.html % '\n'.join(result)
|
return self.html % '\n'.join(result)
|
||||||
|
|
||||||
|
|
|
@ -261,9 +261,14 @@ class IService(Interface):
|
||||||
description=_(u'Web address (URL) for more information '
|
description=_(u'Web address (URL) for more information '
|
||||||
'about the service.'),
|
'about the service.'),
|
||||||
required=False,)
|
required=False,)
|
||||||
infoUrl = schema.TextLine(
|
info = schema.TextLine(
|
||||||
title=_(u'Additional information'),
|
title=_(u'Additional information'),
|
||||||
description=_(u'Web address (URL) of a document that '
|
description=_(u'Name/title of a document or web page that '
|
||||||
|
'offers additional information.'),
|
||||||
|
required=False,)
|
||||||
|
infoUrl = schema.TextLine(
|
||||||
|
title=_(u'URL for additional information'),
|
||||||
|
description=_(u'Web address (URL) of a document or web page that '
|
||||||
'offers additional information.'),
|
'offers additional information.'),
|
||||||
required=False,)
|
required=False,)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue