Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
CPrich905 committed Oct 16, 2023
1 parent f039593 commit 0f2f568
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions commodities/jinja2/includes/commodities/tabs/core_data.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
},
{
"key": {"text": "Indent number"},
"value": {"text": indent_number if indent_start_date else "-"},
"value": {"text": indent_number},
"actions": {"items": []}
},
{
"key": {"text": "Indent SID"},
"value": {"text": indent_sid if indent_start_date else "-"},
"value": {"text": indent_sid},
"actions": {"items": []}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

{% for i in indents %}
{% set indent_row = [
{"text": i.sid if indent_start_date else "-"},
{"text": i.indent if indent_start_date else "-"},
{"text": "{:%d %b %Y}".format(i.validity_start) if indent_start_date else "-"},
{"text": i.sid if i.sid else "-"},
{"text": i.indent if i.indent else "-"},
{"text": "{:%d %b %Y}".format(i.validity_start) if i.validity_start else "-"},

]%}
{{ indent_rows.append(indent_row) or "" }}
Expand All @@ -24,7 +24,6 @@
{"text": "Indent number", "classes": "govuk-!-width-one-eighth"},
{"text": "Indent start date", "classes": "govuk-!-width-one-eighth"},
]%}
{# valid_between.lower (start) valid_between.upper (end) #}

<h2 class="govuk-heading-l">Indent history</h2>

Expand Down
4 changes: 2 additions & 2 deletions commodities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)

indent = self.object.get_indent_as_at(date.today())
context["indent_number"] = indent.indent if indent else "-"
context["indent_sid"] = indent.sid if indent else "-"
if indent:
context["indent_number"] = indent.indent
context["indent_sid"] = indent.sid
context["indent_start_date"] = indent.validity_start

collection = get_chapter_collection(self.object)
Expand Down

0 comments on commit 0f2f568

Please sign in to comment.