Skip to content

Commit

Permalink
feat(template): update with new model fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Mar 12, 2022
1 parent 267e567 commit 26215ae
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 35 deletions.
13 changes: 0 additions & 13 deletions benefits/core/templates/core/includes/button.html

This file was deleted.

2 changes: 1 addition & 1 deletion benefits/core/templates/core/includes/icon-title.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 class="icon-title">
<span class="icon">
{% include "core/includes/icon.html" with icon=icon alt=alt %}
{% include "core/includes/icon.html" with icon=icon %}
</span>
{{ title }}
</h1>
9 changes: 4 additions & 5 deletions benefits/core/templates/core/includes/icon.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{% if not icon.src %}
<p class="bg-grey-lightest color-standout">Missing <strong><code>icon.src</code></strong> argument</p>
{% if not icon.file %}
<p class="bg-grey-lightest color-standout">Missing <strong><code>icon.file</code></strong></p>
{% elif not icon.alt %}
<p class="bg-grey-lightest color-standout">Missing <strong><code>icon.alt</code></strong> argument</p>
<p class="bg-grey-lightest color-standout">Missing <strong><code>icon.alt</code></strong></p>
{% else %}
{% load static %}
<img class="icon" src="{% static icon.src %}" alt="{{ icon.alt }}" />
<img class="icon" src="{{ icon.file.url }}" alt="{{ icon.alt.text }}" />
{% endif %}
2 changes: 1 addition & 1 deletion benefits/core/templates/core/includes/media-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<div class="media-left">
{% include "core/includes/icon.html" with icon=item.icon %}
</div>
<div class="media-body"><strong>{{ item.heading }}</strong><br />{{ item.details }}</div>
<div class="media-body"><strong>{{ item.heading.text }}</strong><br />{{ item.details.text }}</div>
</div>
2 changes: 1 addition & 1 deletion benefits/core/templates/core/includes/media-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="media-list">
{% for media in items %}
{% for media in items.all %}
{% include "core/includes/media-item.html" with item=media %}
{% endfor %}
</div>
10 changes: 10 additions & 0 deletions benefits/core/templates/core/includes/pagenavigation-button.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if pagenav.target %}
<a {%if pagenav.id %}id="{{ pagenav.id }}"{% endif %}
{%if pagenav.target %}target="{{ pagenav.target }}"{% endif %}
{%if pagenav.rel %}rel="{{ pagenav.rel }}"{% endif %}
class="btn btn-lg {{ pagenav.classes | join:' ' }}"
href="{{ pagenav.target.slug }}"
role="button">
{{ pagenav.text.text }}
</a>
{% endif %}
29 changes: 15 additions & 14 deletions benefits/core/templates/core/page.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{% extends "core/base.html" %}

{% if page.title %}
{% if page.classes %}
{% block classes %}{{ page.classes|join:" " }}{% endblock %}
{% endif %}

{% if page.title %}
{% block page_title %}{{ page.title }} | {% endblock page_title %}
{% block page_title %}{{ page.title.text }} | {% endblock page_title %}
{% endif %}

{% block main_content %}
<div class="container-fluid">
<div class="row">
{% if page.image %}
{% load static %}
<div class="col-lg-6 image" style="background: 48% 75% url('{% static page.image.src %}') no-repeat; background-size: cover;">
</div>
{% if page.image.file %}
<div class="col-lg-6 image" style="background: 48% 75% url('{{ page.image.file.url }}') no-repeat; background-size: cover;"></div>
<div class="col-md-8 offset-md-2 col-lg-6 offset-lg-0">
{% else %}
<div class="col-md-8 offset-md-2 col-xl-6 offset-xl-3">
Expand All @@ -27,20 +25,20 @@
{% if page.icon %}
{% include "core/includes/icon-title.html" with title=page.content_title icon=page.icon %}
{% else %}
<h1>{{ page.content_title }}</h1>
<h1>{{ page.content_title.text }}</h1>
{% endif %}
{% endif %}
{% endblock icon_title %}

{% block media_list %}
{% if page.media|length_is:"0" %}{% else %}
{% include "core/includes/media-list.html" with items=page.media %}
{% if page.media.all.length > 0 %}
{% include "core/includes/media-list.html" with items=page.media.all %}
{% endif %}
{% endblock media_list %}

{% block paragraph_content %}
{% for p in page.paragraphs %}
<p>{{ p }}</p>
{% for p in page.paragraphs.all %}
<p>{{ p.text }}</p>
{% endfor %}
{% endblock paragraph_content %}

Expand All @@ -53,10 +51,13 @@ <h1>{{ page.content_title }}</h1>
{% endblock forms %}

{% block buttons %}
{% if page.buttons|length_is:"0" %}{% else %}
{% if page.navigation.all.length > 0 %}
<div class="buttons">
{% for b in page.buttons %}
{% include "core/includes/button.html" with button=b %}
{% if page.navigation_title %}
<label>{{ page.navigation_title.text }}</label>
{% endif %}
{% for n in page.navigation.all %}
{% include "core/includes/pagenavigation-button.html" with pagenav=n %}
{% endfor %}
</div>
{% endif %}
Expand Down

0 comments on commit 26215ae

Please sign in to comment.