|
52 | 52 | {% block list_item_header %}
|
53 | 53 | <a href="{% url "projects_detail" object.slug %}">{{ object.name }}</a>
|
54 | 54 | <div class="sub header">
|
55 |
| - {% if object.has_good_build %} |
56 |
| - {% with build=object.get_latest_build %} |
| 55 | + {% with build=object.get_latest_build %} |
| 56 | + {% if build %} |
57 | 57 | <time data-content="{{ build.date }}">
|
58 |
| - {# Translators: this will read like "Last built 1 year, 5 months ago" #} |
59 |
| - {% blocktrans with time_since=build.date|naturaltime trimmed %} |
60 |
| - Last built {{ time_since }} |
61 |
| - {% endblocktrans %} |
| 58 | + {% if build.finished %} |
| 59 | + {# Translators: this will read like "Last built 1 year, 5 months ago" #} |
| 60 | + {% blocktrans with time_since=build.date|naturaltime trimmed %} |
| 61 | + Last built {{ time_since }} |
| 62 | + {% endblocktrans %} |
| 63 | + {% else %} |
| 64 | + {# Translators: this will read like "Build started 5 minutes ago" #} |
| 65 | + {% blocktrans with time_since=build.date|naturaltime trimmed %} |
| 66 | + Build started {{ time_since }} |
| 67 | + {% endblocktrans %} |
| 68 | + {% endif %} |
62 | 69 | </time>
|
63 |
| - {% endwith %} |
64 |
| - {% else %} |
65 |
| - {% trans "Not built yet" %} |
66 |
| - {% endif %} |
| 70 | + {% else %} |
| 71 | + {% trans "Not built yet" %} |
| 72 | + {% endif %} |
| 73 | + {% endwith %} |
67 | 74 | </div>
|
68 | 75 | {% endblock list_item_header %}
|
69 | 76 |
|
70 | 77 | {% block list_item_meta %}
|
71 | 78 | {% endblock list_item_meta %}
|
72 | 79 |
|
73 | 80 | {% block list_item_extra_items %}
|
74 |
| - {% if object.has_good_build %} |
75 |
| - {% with build=object.get_latest_build %} |
76 |
| - {# Safety check, there seems to be some case where `has_good_build` and `get_latest_build` still return a null build #} |
77 |
| - {% if build %} |
78 |
| - {% include "includes/elements/chips/build.html" with project=object build=build %} |
79 |
| - {% endif %} |
80 |
| - {% endwith %} |
81 |
| - {% endif %} |
| 81 | + {% with build=object.get_latest_build %} |
| 82 | + {% if build %} |
| 83 | + {% include "includes/elements/chips/build.html" with project=object build=build %} |
| 84 | + {% endif %} |
| 85 | + {% endwith %} |
82 | 86 | {% endblock list_item_extra_items %}
|
0 commit comments