<dl>
<dt>[% loc('My tags') %]:</dt>
<dd>
[% IF tags %]
[% FOREACH tag IN tags %]
[%IF tag.tag == highlight %]
<a id="tag_[% tag.tag %]" class="tag highlight"
[%ELSE%]
<a class="tag"
[%END%]
href="/.gallery/by_tag/[% tag.tag %]">[% tag.tag %]</a> [<span class="remove"><a href="[%c.uri_for('gallery/untag',photo.id,tag.tag)%]" class="tagaction">x</a></span>][% UNLESS loop.last() %],[% END %]
[%END%]
[%END%]
</dd>
<dt>[% loc('Popular tags') %]:</dt>
<dd>
[%IF others_tags %]
[% FOREACH othertag IN others_tags %]
[% SET tagmatch='\b' _ othertag.tag _ '\b' %]
[% NEXT IF taglist.match(tagmatch) %]
[%IF othertag.tag == highlight %]
<a id="tag_[%tag.tag%]" class="tag highlight" title="[%othertag.refcount%]"
[%ELSE%]
<a class="tag" title="[%othertag.refcount%]"
[%END%]
href="[% c.uri_for('gallery/by_tag',othertag.tag) %]" >[% othertag.tag %]</a>
[% IF user.active %]
[<span class="add"><a href="[% c.uri_for('gallery/tag',photo.id,tag.tag) %]" class="tagaction">+</a></span>][% UNLESS loop.last() %],[% END %]
[%END%]
[%END%]
[%END%]
</dd>
</dl>