Skip to content

Commit

Permalink
Merge pull request #205 from MBARIMike/main
Browse files Browse the repository at this point in the history
More table view and detail cleanup - e.g. put names in titles
  • Loading branch information
MBARIMike authored Apr 8, 2024
2 parents 557cd06 + cc16cb5 commit b6efdf1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion smdb/smdb/templates/smdb/compilation_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ block.super }}
{% endblock %}

{% block title %}Compilation details on demand{% endblock %}
{% block title %}Compilation {{ compilation.name }}{% endblock %}

{% block content %}
<tab>
Expand Down
18 changes: 7 additions & 11 deletions smdb/smdb/templates/smdb/expedition_detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% extends "base.html" %}
{% load django_tables2 %}
{% load static %}

{% block css %}
{{ block.super }}
Expand All @@ -8,20 +10,14 @@
{{ block.super }}
{% endblock %}

{% block title %}Expedition details on demand{% endblock %}
{% block title %}Expedition {{ expedition.name }}{% endblock %}

{% block content %}
<tab>
<h2>{{ expedition.name }}</h2>
Missions:
<div class="container-fluid">
{% for mission in expedition.mission_set.all|dictsort:"name" %}
<div class="row">
<div class="col">
<a href="{% url 'mission-detail' mission.slug %}">{{ mission.name }}</a>
</div>
</div>
{% endfor %}
</div>
<h2>Missions:</h2>
<div>
{% render_table table %}
</div>>
</tab>
{% endblock %}
2 changes: 1 addition & 1 deletion smdb/smdb/templates/smdb/mission_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ block.super }}
{% endblock %}

{% block title %}Mission details on demand{% endblock %}
{% block title %}Mission {{ mission.name }}{% endblock %}

{% block content %}

Expand Down
6 changes: 6 additions & 0 deletions smdb/smdb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
expedition = super().get_object()

table = MissionTable(
Mission.objects.filter(expedition=expedition),
)
RequestConfig(self.request).configure(table)
context["table"] = table

return context

def get_object(self):
Expand Down

0 comments on commit b6efdf1

Please sign in to comment.