示例#1
0
    def contents(self):
        context = self.context

        zip = context.zip
        
        city_vocab = context.getField('city').Vocabulary()
        city = city_vocab.getValue(context.city)   # fix the infamous UnicodeDecodeError bug
        city = city.encode('utf8')
        
        url = context.absolute_url()
        
        html = """<div style="padding-left: 0; margin-left: -38px" >
                        <strong>%s %s</strong>
                      </div>
                   """ % (zip, city)

        #photo = context.getImage()
        #if photo.get_size():
        html = html + """<div class="stationPhotoContainer" style="padding-left: 0; margin-left: -38px" > 
                              <a href="%s" >
                               <img src="%s" alt="%s" />
                              </a>
                             </div>""" % (url + '/image/image_view_fullscreen',
                                          url + '/image_googlemap',
                                          self.title)

        if html:
            return ({'title': _("Info"),
                     'text' : html,},)
示例#2
0
文件: base.py 项目: kamon/jubin.site
JubinExtraSchema = atapi.Schema((

    atapi.StringField(
            'contactName',
            storage=atapi.AnnotationStorage(),
            widget = atapi.StringWidget(
                label=u"Contact",
            ),
        ),

    # no display // TODO : Hide that in edit mode for Station 
    atapi.StringField(
        'privatePhone',
        storage=atapi.AnnotationStorage(),
        widget=atapi.StringWidget(
            label=_(u"Private phone"),
            description=_(u""),
        ),
    ),


))


BasePartnerSchema = OrganizationSchema.copy() \
                      + JubinAddressSchema \
                      + JubinExtraSchema

# Re-enable 'description' field for Jubin base schema - Optional but may be useful for all partner types
BasePartnerSchema['description'].widget.visible = {'edit': 'visible',
                                                    'view': 'visible'}