Changeset 68c93e8


Ignore:
Timestamp:
Jul 22, 2012, 9:52:37 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
0229bd5
Parents:
549c9e9
git-author:
Alex Dehnert <adehnert@…> (07/22/12 21:52:37)
git-committer:
Alex Dehnert <adehnert@…> (07/22/12 21:52:37)
Message:

Correctly linkify constitution URL

We previously linkified any non-empty constitution URL. We now only
linkify constitution URLs starting with "http://" or "https://".

Location:
asadb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r04a46ed r68c93e8  
    8282        context = super(GroupDetailView, self).get_context_data(**kwargs)
    8383        group = context['group']
     84
     85        const_link = None
     86        const_url = group.constitution_url
     87        if const_url.startswith("http://") or const_url.startswith("https://"):
     88            const_link = const_url
     89        context['constitution_link'] = const_link
    8490
    8591        # Indicate whether this person should be able to see "private" info
  • asadb/template/groups/group_detail.html

    rbae2a5f r68c93e8  
    7070<tr class='private-info'>
    7171    <th>Constitution</th>
    72     <td>{% if group.constitution_url %}<a href='{{group.constitution_url}}'>{{group.constitution_url}}</a>{%else%}<i>not provided</i>{%endif%}</td>
     72    <td>{% if group.constitution_url %}
     73        {% if constitution_link %}<a href='{{group.constitution_url}}'>{{group.constitution_url}}</a>
     74        {%else%}{{group.constitution_url}}{%endif%}
     75    {%else%}<i>not provided</i>{%endif%}</td>
    7376</tr>
    7477{% endif %}
Note: See TracChangeset for help on using the changeset viewer.