Skip to content

Commit

Permalink
Make pseudo-links behave more traditionally #615
Browse files Browse the repository at this point in the history
* Make pseudo-links behave more traditionally #615
* Add links to resource tables and relationship table
  • Loading branch information
oliverroick authored Sep 26, 2016
1 parent 25d299c commit ca5ac83
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
13 changes: 8 additions & 5 deletions cadasta/templates/organization/organization_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ <h2>{% trans "Organization Overview" %}</h2>
{% else %}
<td class="unarchived"><div>False</div></td>
{% endif %}
<td>{{ prj.name }}{% if prj.archived %}
<span class="label label-danger">
Archived
</span>
{% endif %}</td>
<td>
<a href="{% url 'organization:project-dashboard' organization=organization.slug project=prj.slug %}">{{ prj.name }}</a>
{% if prj.archived %}
<span class="label label-danger">
Archived
</span>
{% endif %}
</td>
<td>{{ prj.country }}</td>
<td>{{ prj.last_updated }}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion cadasta/templates/organization/organization_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>{% trans "Organizations" %}</h1>
</div>
{% endif %}
<div class="org-text">
<h4>{{ org.name }}
<h4><a href="{% url 'organization:dashboard' slug=org.slug %}">{{ org.name }}</a>
{% if org.archived %}
<span class="label label-danger">Archived</span>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion cadasta/templates/organization/organization_members.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ <h2>{% trans "Members" %}</h2>
<tbody>
{% for user in organization.users.all %}
<tr class="linked" onclick="window.document.location='{% url 'organization:members_edit' slug=organization.slug username=user.username %}';">
<td>{{ user.get_display_name }}
<td>
<a href="{% url 'organization:members_edit' slug=organization.slug username=user.username %}">{{ user.get_display_name }}</a>
<div class="hidden-sm hidden-md hidden-lg">
{{ user.username }}<br />
{{ user.email }}
Expand Down
7 changes: 4 additions & 3 deletions cadasta/templates/organization/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ <h1>{% trans "Projects" %}</h1>
<td class="unarchived"><div>False</div></td>
{% endif %}
<td>
<h4>{{ proj.name }}
{% if proj.archived %}
<h4>
<a href="{% url 'organization:project-dashboard' organization=proj.organization.slug project=proj.slug %}">{{ proj.name }}</a>
{% if proj.archived %}
<span class="label label-danger">{% trans "Archived" %}</span>
{% endif %}
{% endif %}
</h4>
</h4>
<p>{{ proj.description }}</p>
Expand Down
2 changes: 1 addition & 1 deletion cadasta/templates/resources/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<img src="{{ resource.thumbnail }}" class="thumb-60">
</div>
<div class="resource-text">
<p><strong>{{ resource.name }}</strong>
<p><strong><a href="{% url 'resources:project_detail' project=object.slug organization=object.organization.slug resource=resource.id %}">{{ resource.name }}</a></strong>
{% if resource.archived %}
<span class="label label-danger">{% trans "Deleted" %}</span>
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions cadasta/templates/resources/table_sm.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
</thead>
<tbody>
{% for resource in resource_list %}
<tr class="linked" onclick="window.document.location='{% url 'resources:project_detail' project=object.slug organization=object.organization.slug resource=resource.id %}';">
{% url 'resources:project_detail' project=object.slug organization=object.organization.slug resource=resource.id as resource_url %}
<tr class="linked" onclick="window.document.location='{{ resource_url }}';">
<td>
<div class="resource-60">
<img src="{{ resource.thumbnail }}" class="thumb-60">
</div>
<div class="resource-text">
<p><strong>{{ resource.name }}</strong></p>
<p><a href="{{ resource_url }}"><strong>{{ resource.name }}</strong></a></p>
<p class="small">{{ resource.original_file }}</p>
</div>
</td>
Expand Down
5 changes: 3 additions & 2 deletions cadasta/templates/spatial/location_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ <h2><span>{% trans "Location" %} </span>{{ location.name }}</h2>
</thead>
<tbody>
{% for rel in relationships %}
<tr class="linked" onclick="window.document.location='{% url 'parties:relationship_detail' object.organization.slug object.slug rel.id %}';">
<td>{{ rel.tenure_type.label }}</td>
{% url 'parties:relationship_detail' object.organization.slug object.slug rel.id as relationship_url %}
<tr class="linked" onclick="window.document.location='{{ relationship_url }}';">
<td><a href="{{ relationship_url }}">{{ rel.tenure_type.label }}</a></td>
<td><a href="{% url 'parties:detail' object.organization.slug object.slug rel.party.id %}">{{ rel.party.name }}</a></td>
</tr>
{% endfor %}
Expand Down

0 comments on commit ca5ac83

Please sign in to comment.