Updated QR code display based on requests from mbarbier. Default display is a small icon that reveals the full QR code, but the full code can be rendered by setting the display value to "full".

This commit is contained in:
cappadona 2011-06-24 09:50:49 +00:00
parent a285edcec0
commit eda748901f
4 changed files with 54 additions and 6 deletions

View file

@ -3,6 +3,7 @@
<#-- Individual profile page template for foaf:Person individuals -->
<#include "individual-setup.ftl">
<#include "individual-qrCodeFoafPerson.ftl">
<section id="individual-intro" class="vcard person" role="region">
@ -33,7 +34,7 @@
<li role="listitem"><a title="View this individual in RDF format" class="icon-rdf" href="${rdfUrl}">RDF</a></li>
</#if>
<#include "individual-qrCodeFoafPerson.ftl">
<@qrCode />
</ul>
</nav>

View file

@ -1,7 +1,27 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#include "individual-qrCodeGenerator.ftl">
<#include "individual-qrCodeGenerator.ftl">
<#if hasValidVCard()>
<li role="listitem"><a title="Export QR codes" href="${individual.doQrData().exportQrCodeUrl}"><img class="middle" src="${urls.images}/individual/qr_icon.png" alt="qr icon" /></a></li>
</#if>
<#-- This macro will display a vCard QR code (includes email, phone number, URI, etc)
* default display is a small icon that reveals the full QR code when clicked
* setting the display to "full" will render a full-size QR code (<@qrCode display="full" />)
* the size can be set using the width parameter (default is 125px)
-->
<#macro qrCode display="icon" width="125">
<#if hasValidVCard()>
<#assign qrCodeLinkedImage><a title="Export QR codes" href="${individual.doQrData().exportQrCodeUrl}"><@qrCodeVCard qrCodeWidth=width /></a></#assign>
<#if (display == "full")>
<h5 class="qrCode">vCard QR</h5>
${qrCodeLinkedImage}
<#elseif (display == "icon")>
<li role="listitem">
<a id="qrIcon" title="vCard QR Code" href="${individual.doQrData().exportQrCodeUrl}"><img class="middle" src="${urls.images}/individual/qr_icon.png" alt="qr icon" /></a>
<span id="qrCodeImage" class="hide">${qrCodeLinkedImage} <a class="qrCloseLink" href="#">Close</a></span>
</li>
<#else>
<p class="notice">You have passed an invalid value for the qrCode display parameter.</p>
</#if>
</#if>
</#macro>