{% load switch %}

{% if contacts %}

<ul class="contacts">

    {% for c in contacts %}
        <li class="{{ c.kind.slug }}">

            {{ c.kind.name }}:

            {% switch c.kind.slug %}

                {% case 'phone' %}
                    <a href="tel:{{ c.value }}">{{ c.value }}</a>
                    
                {% else %}
                    {{ c.value|urlizetrunc:50 }}
    
            {% endswitch %}

            {% if c.notes %}<small>({{ c.notes }})</small>{% endif %}

        </li>
    {% endfor %}

</ul>

{% endif %}
{% load switch %}

{% if contacts %}

<ul class="contacts">

    {% for c in contacts %}
        <li class="{{ c.kind.slug }}">

            {% switch c.kind.slug %}

                {% case 'phone' %}
                    {{ c.kind.name }}: <a href="tel:{{ c.value }}">{{ c.value }}</a>
                    
                {% case 'facebook' %}
                    <a href="{{ c.value }}">{{ c.kind.name }}</a>
                    
                {% case 'twitter' %}
                    <a href="http://twitter.com/{{ c.value }}">@{{ c.value }}</a> on Twitter
                    
                {% else %}
                    {{ c.kind.name }}: {{ c.value|urlizetrunc:50 }}
    
            {% endswitch %}

            {% if c.notes %}<small>({{ c.notes }})</small>{% endif %}

        </li>
    {% endfor %}

</ul>

{% endif %}
Handle Facebook and Twitter contacts
Handle Facebook and Twitter contacts
