Show more space launch details.

This commit is contained in:
Edward Betts 2023-10-03 14:16:25 +01:00
parent 6ed9e520ed
commit 10bc7d85b5
2 changed files with 27 additions and 10 deletions

View file

@ -81,7 +81,7 @@ def summarize_launch(launch: Launch) -> Summary:
return { return {
"name": launch["name"], "name": launch["name"],
"status": launch["status"]["abbrev"], "status": launch["status"],
"t0_date": t0_date, "t0_date": t0_date,
"t0_time": t0_time, "t0_time": t0_time,
"window_start": launch["window_start"], "window_start": launch["window_start"],
@ -89,10 +89,13 @@ def summarize_launch(launch: Launch) -> Summary:
"launch_provider": launch_provider, "launch_provider": launch_provider,
"launch_provider_abbrev": launch_provider_abbrev, "launch_provider_abbrev": launch_provider_abbrev,
"launch_provider_type": launch["launch_service_provider"]["type"], "launch_provider_type": launch["launch_service_provider"]["type"],
"rocket": launch["rocket"]["configuration"]["name"], "rocket": launch["rocket"]["configuration"]["full_name"],
"mission": launch["mission"]["name"] if launch["mission"] else "N/A", "mission": launch["mission"],
"pad_name": launch["pad"]["name"],
"pad_wikipedia_url": launch["pad"]["wiki_url"],
"location": launch["pad"]["location"]["name"], "location": launch["pad"]["location"]["name"],
"country_code": launch["pad"]["country_code"], "country_code": launch["pad"]["country_code"],
"orbit": launch["mission"]["orbit"],
} }

View file

@ -78,26 +78,40 @@
<p>{{ market }}</p> <p>{{ market }}</p>
{% endfor %} {% endfor %}
<h3>Rocket launches</h3> <h3>Space launches</h3>
<table class="table table-hover"> <table class="table table-hover">
{% for launch in rockets %} {% for launch in rockets %}
<tr> <tr>
<td class="text-nowrap text-end">{{ launch.t0_date }} <td class="text-nowrap text-end">{{ launch.t0_date }}
{% if launch.t0_time %}<br/>{{ launch.t0_time }}{% endif %}</td> {% if launch.t0_time %}<br/>{{ launch.t0_time }}{% endif %}</td>
<td class="text-nowrap">{{ launch.status }}</td> <td class="text-nowrap"><abbr title="{{ launch.status.name }}">{{ launch.status.abbrev }}</abbr></td>
<td>{{ launch.rocket }}<br>{{launch.mission }}</td> <td>{{ launch.rocket }}
<td> &mdash;
{{launch.mission.name }}
&mdash;
{% if launch.launch_provider_abbrev %} {% if launch.launch_provider_abbrev %}
<abbr title="{{ launch.launch_provider }}">{{ launch.launch_provider_abbrev }}</abbr> <abbr title="{{ launch.launch_provider }}">{{ launch.launch_provider_abbrev }}</abbr>
{% else %} {% else %}
{{ launch.launch_provider }} {{ launch.launch_provider }}
{% endif %} {% endif %}
({{ launch.launch_provider_type }})</td> ({{ launch.launch_provider_type }})
<td>{{ launch.location }}</td> &mdash;
{{ launch.orbit.name }} ({{ launch.orbit.abbrev }})
<br/>
<a href="{{ launch.pad_wikipedia_url }}">{{ launch.pad_name }}</a>
&mdash; {{ launch.location }}<br/>
{% for line in launch.mission.description.splitlines() %}
<p>{{ line }}</p>
{% endfor %}
</td>
</tr>
{% endfor %} {% endfor %}
</div>
</table> </table>
</div>
</body> </body>
</html> </html>