Merge pull request #86 from jelly/fix_release_details_list
Fix release details list
This commit is contained in:
commit
6a841d455b
@ -30,3 +30,9 @@ def test_release_torrent_not_found(self):
|
||||
version = self.release.version
|
||||
response = self.client.get('/releng/releases/{}/torrent/'.format(version))
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_release_details(self):
|
||||
version = self.release.version
|
||||
response = self.client.get('/releng/releases/{}/'.format(version))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertIn(version, response.content.decode('utf-8'))
|
||||
|
49
templates/releng/release_detail.html
Normal file
49
templates/releng/release_detail.html
Normal file
@ -0,0 +1,49 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Arch Linux - Release: {{ release.version }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="release box">
|
||||
<h2>{{ release.version }}</h2>
|
||||
|
||||
<ul>
|
||||
<li><strong>Release Date:</strong> {{ release.release_date|date }}</li>
|
||||
{% if release.kernel_version %}<li><strong>Kernel Version:</strong> {{ release.kernel_version }}</li>{% endif %}
|
||||
<li><strong>Available:</strong> {{ release.available|yesno|capfirst }}</li>
|
||||
{% if release.torrent_data %}
|
||||
<li><a href="{% url 'releng-release-torrent' release.version %}"
|
||||
title="Download torrent for {{ release.version }}">
|
||||
Download via Torrent <img width="12" height="12" src="{% static "download.png" %}" alt=""/></a></li>
|
||||
<li><a href="{{ release.magnet_uri }}"
|
||||
title="Get magnet link for {{ release.version }}">
|
||||
Download via Magnet URI <img width="12" height="12" src="{% static "magnet.png" %}" alt=""/></a></li>
|
||||
{% endif %}
|
||||
{% if release.md5_sum %}<li><strong>MD5:</strong> {{ release.md5_sum }}</li>{% endif %}
|
||||
{% if release.sha1_sum %}<li><strong>SHA1:</strong> {{ release.sha1_sum }}</li>{% endif %}
|
||||
</ul>
|
||||
|
||||
{% if release.info %}
|
||||
<h3>Release Notes</h3>
|
||||
|
||||
<div class="article-content">{{ release.info_html }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if release.torrent_data %}{% with release.torrent as torrent %}
|
||||
<h3>Torrent Information</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>Comment:</strong> {{ torrent.comment }}</li>
|
||||
<li><strong>Creation Date:</strong> {{ torrent.creation_date|date:"DATETIME_FORMAT" }} UTC</li>
|
||||
<li><strong>Created By:</strong> {{ torrent.created_by }}</li>
|
||||
<li><strong>Announce URL:</strong> {{ torrent.announce }}</li>
|
||||
<li><strong>File Name:</strong> {{ torrent.file_name }}</li>
|
||||
<li><strong>File Length:</strong> {{ torrent.file_length|filesizeformat }}</li>
|
||||
<li><strong>Piece Count:</strong> {{ torrent.piece_count }} pieces</li>
|
||||
<li><strong>Piece Length:</strong> {{ torrent.piece_length|filesizeformat }}</li>
|
||||
<li><strong>Info Hash:</strong> {{ torrent.info_hash }}</li>
|
||||
<li><strong>URL List Length:</strong> {{ torrent.url_list|length }} URLs</li>
|
||||
</ul>
|
||||
{% endwith %}{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
@ -44,7 +44,7 @@ <h2>Releases</h2>
|
||||
title="Get magnet link for {{ item.version }}"><img width="12" height="12" src="{% static "magnet.png" %}" alt="Magnet"/></a>
|
||||
{% endif %}</td>
|
||||
<td>{{ item.release_date|date }}</td>
|
||||
<td>{{ item.version }}</td>
|
||||
<td><a href="{{ item.get_absolute_url }}" title="Release details for {{ item.version }}">{{ item.version }}</a></td>
|
||||
<td>{{ item.kernel_version|default:"" }}</td>
|
||||
<td class="available-{{ item.available|yesno }}">{{ item.available|yesno|capfirst }}</td>
|
||||
<td>{% if item.torrent_data %}{{ item.torrent.file_length|filesizeformat }}{% endif %}</td>
|
||||
|
Loading…
Reference in New Issue
Block a user