I am working on sort of an address book application. The addresses are
rendered as a business card in a view:

<div class="ez-mw mw radius_top" style="margin-bottom: 12px;">

  <!-- Layout 1 -->
  <div class="ez-wr wr" style="margin-bottom: 0px;">

    {{if logo:}}
      <div class="ez-box box" style="padding-top: 24px;">
        {{=IMG(_src=URL('static','init/images/logos/%s' %
logo.link))}}
      </div> <!-- ez-box -->
    {{pass}}

    {{if tagline:}}
      <div class="ez-box box" style="padding-top: 12px; overflow:
hidden;">
        <h5>{{=tagline.line}}</h5>
      </div> <!-- ez-box -->
    {{pass}}

    <div class="ez-box box" style="margin-bottom: 0px;">
      {{if organization:}}
        <h5 style="font-weight: bolder; padding-top:
24px;">{{=organization.name}}</h5>
      {{pass}}
    </div> <!-- ez-box -->

  </div> <!-- ez-wr -->

  <!-- Module 2B -->
  <div class="ez-wr wr" style="margin-top: 0px;">

    <div class="ez-fr ez-negml ez-50">
      <div class="ez-box content" style="padding-left: 0px; overflow:
hidden;">
        {{if npas:}}
          <table style="text-align: left;">
            {{for npa in npas:}}
              {{c=npa.NpaType.abbr}}
              {{a=npa.Npa.address}}
              {{if c=='T' or c=='F' or c=='M':}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=a}}</td>
                </tr>
              {{elif c=='E':}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=A(a,_href="mailto:"+a)}}</td>
                </tr>
              {{else:}}
                <tr>
                  <td>{{=c}}: </td>
                  <td>{{=A(a,_href="http://"+a)}}</td>
                </tr>
              {{pass}}
            {{pass}}
          </table>
        {{pass}}
      </div> <!-- ez-box -->
    </div> <!-- ez-fr -->

    <div class="ez-last ez-oh">
      <div class="ez-box content" style="overflow: hidden;">
        {{if address:}}
          <table style="text-align: left;">
            <tr>
              <td>{{=address.street}} {{=address.houseNumber}} {{if
address.houseNumberExtension:}}{{=address.houseNumberExtension}}
{{pass}}</td>
            </tr>
            <tr>
              <td>{{=address.zipcode}} {{=address.city}}</td>
            </tr>
          </table>
        {{pass}}
      </div> <!-- ez-box -->
    </div> <!-- ez-last -->

  </div> <!-- ez-wr -->

</div> <!-- ez-mw -->



I would like to add a link to this view which makes the business card
downloadable as a vCard. Has anyone done this in web2py? What do I
need to do to make this possible?


Kind regards,

Annet.

Reply via email to