Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Stop using included page for contacts & people
Browse files Browse the repository at this point in the history
  • Loading branch information
evildmp committed Nov 27, 2014
1 parent 30181d3 commit 989c852
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 3 deletions.
@@ -0,0 +1,110 @@
{% extends entity.get_template %}
{% comment %}

Extends the base page template, and includes the main_page_body_file specified in the view.

{% endcomment %}
{% load typogrify_tags entity_tags thumbnail placeholder_tags %}

{% block title %}
<title>{{ title }}</title>
{% endblock %}

{% block col_class %}
{% with is_menu_node="True" %}
{{ block.super }}
{% endwith %}
{% endblock col_class %}

{% block skip_and_language %}
{% endblock %}

{% if pagetitle %}
{% block pagetitle %}
<h{{PAGE_TITLE_HEADING_LEVEL}}>{{ pagetitle|typogrify }}</h{{PAGE_TITLE_HEADING_LEVEL}}>
{% endblock pagetitle %}
{% endif %}

{% block main_page_body %}

{% thumbnail entity.image.file entity_image_size crop subject_location=entity.image.subject_location as image %}

{% block arkestra_content %}

<div class="row columns2">
{% render_placeholder intro_page_placeholder %}

<div class="column firstcolumn">
<div class = "">
<h{{ IN_BODY_HEADING_LEVEL }}>Contact information</h{{ IN_BODY_HEADING_LEVEL }}>
<dl class="not-indented">
{% include "includes/key_contacts.html" %}
{% with entity_map_size as map_size %}
{% include "includes/contact_information.html" %}
{% endwith %}
</dl>
{% if image %}<img src="{{ image.url }}" alt = "" class="right"/>{% endif %}
</div>
</div>

{% if entity.get_people_with_roles or initials_list or people %}
<div class="column lastcolumn">
{% block people_search %}
<h{{ IN_BODY_HEADING_LEVEL }}>Person search</h{{ IN_BODY_HEADING_LEVEL }}>
<form action="" method="GET" class="filter-form">
{% for field in search_fields %}
<div>
<label for="{{ field.field_name }}">
<span class="label-text">{{ field.field_label }}:</span>
</label>

<input placeholder="{{ field.placeholder }}" type="search" name="{{ field.field_name }}" value="{{ field.value }}"> <input type="submit" value="Search">

</div>
{% endfor %}
</form>
{% endblock people_search %}
{% if search %}
{% if people_qs %}
{% with people_qs as people %}
{% include "includes/people_with_roles.html" %}
{% endwith %}
{% else %}
<p>No matching results</p>
{% endif %}
{% else %}
{% if entity.get_key_people %}
<div class="">
<h{{ IN_BODY_HEADING_LEVEL }}>Key people</h{{ IN_BODY_HEADING_LEVEL }}>
{% regroup entity.get_key_people by role as roles %}
<dl class="not-indented personlist">
{% for role in roles %}
<dt>{{ role.grouper }}</dt>
{% for person in role.list %}
{% thumbnail person.person.image.file person_thumbnail_size subject_location=person.person.image.subject_location crop as personimage %}
<dd class="row"><a href ="{{ person.person.get_absolute_url }}">{{person.person}}{% if personimage %} <img class="right" alt="" src="{{ personimage.url }}" />{% endif %}</a></dd>
{% endfor %}
{% endfor %}
</dl>
</div>
{% endif %}
{% endif %}
{% if initials_list %}
<h{{ IN_BODY_HEADING_LEVEL }}>All people A-Z by surname</h{{ IN_BODY_HEADING_LEVEL }}>
<ul class= "index">
{% for initial in initials_list %}
<li><a href="{% url contact-people-letter entity.slug,initial|lower %}">{{ initial }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if people %}
<h{{ IN_BODY_HEADING_LEVEL }}>{{ people_list_heading }}</h{{ IN_BODY_HEADING_LEVEL }}>
{% include "includes/people_with_roles.html" %}
{% endif %}
</div>
{% endif %}
</div>
{% endblock arkestra_content %}


{% endblock main_page_body %}
4 changes: 1 addition & 3 deletions contacts_and_people/views.py
Expand Up @@ -25,7 +25,6 @@ def contacts_and_people(request, slug):
# request.path = entity.get_website.get_absolute_url()
request.current_page = entity.get_website
template = entity.get_template()
main_page_body_file = "contacts_and_people/entity_contacts_and_people.html"

# meta values - title and meta
title = "Contact information for %s" % entity
Expand Down Expand Up @@ -99,12 +98,11 @@ def contacts_and_people(request, slug):
return render_to_response(
# this is a catch-all template, that then uses includes to bring in
# extra information
"arkestra_utilities/entity_auto_page.html",
"contacts_and_people/contacts_and_people.html",
{
"entity": entity,
"pagetitle": pagetitle,
"entity.website.template": template,
"main_page_body_file": main_page_body_file,
"email": entity.email,
"title": title,
"meta": meta,
Expand Down

0 comments on commit 989c852

Please sign in to comment.