diff --git a/opentech/public/funds/templates/public_funds/fund_index.html b/opentech/public/funds/templates/public_funds/fund_index.html index c4e3087911ee3ac71cf71493f2fb9010dd35d069..40d38499babf7c83235490e57b62fe92676ea470 100644 --- a/opentech/public/funds/templates/public_funds/fund_index.html +++ b/opentech/public/funds/templates/public_funds/fund_index.html @@ -1,36 +1 @@ -{% extends "base.html" %} -{% load wagtailcore_tags wagtailimages_tags %} -{% block body_class %}light-grey-bg{% endblock %} -{% block content %} -<div class="wrapper wrapper--small wrapper--top-bottom-inner-space"> - <div class="wrapper wrapper--listings"> - - {% if subpages.object_list.exists %} - {% for subpage in subpages.object_list.specific %} - - <a class="listing" href="{% pageurl subpage %}"> - {% if subpage.deadline %} - <p class="listing__deadline"> - <svg class="icon icon--calendar icon--small"><use xlink:href="#calendar"></use></svg> - <span>Next deadline: {{ subpage.deadline|date:"M j, Y" }}</span> - </p> - {% endif %} - - <h4 class="listing__title">{{ subpage.listing_title|default:subpage.title }}</h4> - - {% if subpage.listing_summary or subpage.introduction %} - <h6 class="listing__teaser">{{ subpage.listing_summary|default:subpage.introduction|truncatechars_html:155 }}</h6> - {% endif %} - </a> - - {% endfor %} - - {% include "includes/pagination.html" with paginator_page=subpages %} - - {% else %} - {# no items on this page #} - {% endif %} - </div> -</div> - -{% endblock %} +{% extends "utils/listing_index.html" %} diff --git a/opentech/public/funds/templates/public_funds/lab_index.html b/opentech/public/funds/templates/public_funds/lab_index.html index 36dc2aa2267d4f60bc5df9f9c76c37ddccd06926..40d38499babf7c83235490e57b62fe92676ea470 100644 --- a/opentech/public/funds/templates/public_funds/lab_index.html +++ b/opentech/public/funds/templates/public_funds/lab_index.html @@ -1,39 +1 @@ -{% extends "base.html" %} -{% load wagtailcore_tags wagtailimages_tags %} -{% block body_class %}light-grey-bg{% endblock %} -{% block content %} -<div class="wrapper wrapper--small wrapper--top-bottom-inner-space"> - {% if page.introduction %} - <h4 class="heading heading--listings-introduction">{{ page.introduction }}</h4> - {% endif %} - <div class="wrapper wrapper--listings"> - - {% if subpages.object_list.exists %} - {% for subpage in subpages.object_list.specific %} - - <a class="listing" href="{% pageurl subpage %}"> - {% if subpage.icon %} - {% image subpage.icon fill-180x180 class="listing__image" %} - {% else %} - <div class="listing__image listing__image--default"> - <svg><use xlink:href="#logo-mobile-no-text"></use></svg> - </div> - {% endif %} - <h4 class="listing__title">{{ subpage.listing_title|default:subpage.title }}</h4> - - {% if subpage.listing_summary or subpage.introduction %} - <h6 class="listing__teaser">{{ subpage.listing_summary|default:subpage.introduction|truncatechars_html:155 }}</h6> - {% endif %} - </a> - - {% endfor %} - - {% include "includes/pagination.html" with paginator_page=subpages %} - - {% else %} - {# no items on this page #} - {% endif %} - </div> -</div> - -{% endblock %} +{% extends "utils/listing_index.html" %} diff --git a/opentech/public/projects/templates/projects/project_index_page.html b/opentech/public/projects/templates/projects/project_index_page.html index 1234f44ae35aa2bc4dcfaf9857f58350e403621d..40d38499babf7c83235490e57b62fe92676ea470 100644 --- a/opentech/public/projects/templates/projects/project_index_page.html +++ b/opentech/public/projects/templates/projects/project_index_page.html @@ -1,39 +1 @@ -{% extends "base.html" %} -{% load wagtailcore_tags wagtailimages_tags %} -{% block body_class %}light-grey-bg{% endblock %} -{% block content %} -<div class="wrapper wrapper--small wrapper--top-bottom-inner-space"> - {% if page.introduction %} - <h4 class="heading heading--listings-introduction">{{ page.introduction }}</h4> - {% endif %} - <div class="wrapper wrapper--listings"> - {% if subpages.object_list.exists %} - {% for subpage in subpages.object_list.specific %} - - <a class="listing" href="{% pageurl subpage %}"> - {% if subpage.icon %} - {% image subpage.icon fill-180x180 class="listing__image" %} - {% else %} - <div class="listing__image listing__image--default"> - <svg><use xlink:href="#logo-mobile-no-text"></use></svg> - </div> - {% endif %} - - <h4 class="listing__title">{{ subpage.listing_title|default:subpage.title }}</h4> - - {% if subpage.listing_summary or subpage.introduction %} - <h6 class="listing__teaser">{{ subpage.listing_summary|default:subpage.introduction }}</h6> - {% endif %} - </a> - - {% endfor %} - - {% include "includes/pagination.html" with paginator_page=subpages %} - - {% else %} - {# no items on this page #} - {% endif %} - </div> -</div> - -{% endblock %} +{% extends "utils/listing_index.html" %} diff --git a/opentech/public/utils/templates/utils/listing_index.html b/opentech/public/utils/templates/utils/listing_index.html new file mode 100644 index 0000000000000000000000000000000000000000..90f3558b7128cbb9f59bae634251762df04b2487 --- /dev/null +++ b/opentech/public/utils/templates/utils/listing_index.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} +{% load wagtailcore_tags wagtailimages_tags %} +{% block body_class %}light-grey-bg{% endblock %} +{% block content %} +<div class="wrapper wrapper--small wrapper--top-bottom-inner-space"> + <div class="wrapper wrapper--listings"> + + {% if subpages.object_list.exists %} + {% for subpage in subpages.object_list.specific %} + + <a class="listing" href="{% pageurl subpage %}"> + {% if subpage.icon %} + {% image subpage.icon fill-180x180 class="listing__image" %} + {% else %} + <div class="listing__image listing__image--default"> + <svg><use xlink:href="#logo-mobile-no-text"></use></svg> + </div> + {% endif %} + + {% if subpage.deadline %} + <p class="listing__deadline"> + <svg class="icon icon--calendar icon--small"><use xlink:href="#calendar"></use></svg> + <span>Next deadline: {{ subpage.deadline|date:"M j, Y" }}</span> + </p> + {% endif %} + + <h4 class="listing__title">{{ subpage.listing_title|default:subpage.title }}</h4> + + {% if subpage.listing_summary or subpage.introduction %} + <h6 class="listing__teaser">{{ subpage.listing_summary|default:subpage.introduction|truncatechars_html:155 }}</h6> + {% endif %} + </a> + + {% endfor %} + + {% include "includes/pagination.html" with paginator_page=subpages %} + + {% else %} + {# no items on this page #} + {% endif %} + </div> +</div> + +{% endblock %}