euscanwww: category, categories and package views

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
Corentin Chary
2011-04-15 00:24:45 +02:00
parent 25964491dd
commit 2dee08dfb7
13 changed files with 173 additions and 64 deletions

View File

@ -1,8 +1,9 @@
?xml version="1.0" encoding="utf8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<?xml version="1.0" encoding="utf8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>{% block title %}euscan{% endblock %}</title>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset="utf-8" />
{% block css %}
<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}img/style.css" media="screen" title="Normal" />
{% endblock %}
@ -14,7 +15,9 @@
{% block header %}<h1>euscan</h1>{% endblock %}
</div>
<div id="content">
{% block content %}{% endblock %}
{% block content %}
{% endblock %}
</div>
<div id="menus">
{% block menus %}
<div id="menu">

View File

@ -1,21 +1,34 @@
{% extends "euscan/_datatable.html" %}
{% load sub %}
{% load mul %}
{% block title %}
{{ block.super }} - categories
{% endblock %}
{% block content %}
<h2>Categories</h2>
<table id="table">
<table id="table" class="display">
<thead>
<th>Category</th>
<th>Ebuilds</th>
<th>Unpackaged</th>
</thead>
<tbody>
{% for category in categories %}
<tr>
<td>{{ category.category }}</td>
{% if category.n_versions == category.n_packaged %}
<tr class="gradeA">
{% else %}{% if category.n_versions < category.n_packaged|mul:2 %}
<tr class="gradeC">
{% else %}
<tr class="gradeX">
{% endif %}{% endif %}
<td><a href="{% url euscan.views.category category.category %}">{{ category.category }}</a></td>
<td>{{ category.n_packaged }}</td>
<td>{{ category.n_versions|sub:category.n_packaged }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -0,0 +1,38 @@
{% extends "euscan/_datatable.html" %}
{% load sub %}
{% load mul %}
{% block title %}
{{ block.super }} - {{ category }}
{% endblock %}
{% block content %}
<h2>Category: {{ category }}</h2>
<table id="table" class="display">
<thead>
<th>Package</th>
<th>Ebuilds</th>
<th>Unpackaged</th>
</thead>
<tbody>
{% for package in packages %}
{% if package.n_versions == package.n_packaged %}
<tr class="gradeA">
{% else %}{% if package.n_versions < package.n_packaged|mul:2 %}
<tr class="gradeC">
{% else %}
<tr class="gradeX">
{% endif %}{% endif %}
<td>
<a href="{% url euscan.views.package package.category package.name %}">
{{ package.category }}/{{ package.name }}
</a>
</td>
<td>{{ package.n_packaged }}</td>
<td>{{ package.n_versions|sub:package.n_packaged }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -0,0 +1,73 @@
{% extends "euscan/_datatable.html" %}
{% load sub %}
{% block title %}
{{ block.super }} - {{ package.category }}/{{ package.name }}
{% endblock %}
{% block content %}
<h2>{{ package.category }}/{{ package.name }}</h2>
<dl>
{% if package.description %}
<dt>Description</dt>
<dd>{{ package.description }}</dd>
{% endif %}
{% if package.homepage %}
<dt>Homepage</dt>
<dd><a href="{{ package.homepage }}">{{ package.homepage }}</a></dd>
{% endif %}
{% if package.herds.all %}
<dt>Herds</dt>
<dd>
{% for herd in package.herds.all %}
<a href="{% url euscan.views.herd herd.herd %}">
{{ herd.herd }}
</a>
&lt;{{ herd.email }}&gt;
{% endfor %}
</dd>
{% endif %}
{% if package.maintainers.all %}
<dt>Maintainers</dt>
<dd>
{% for maintainer in package.maintainers.all %}
{% if maintainer.name != maintainer.email %}
<a href="{% url euscan.views.maintainer maintainer.id %}">
{{ maintainer.name }}
</a>
&lt;{{ maintainer.email }}&gt;
{% else %}
<a href="{% url euscan.views.maintainer maintainer.id %}">
{{ maintainer.email }}
</a>
{% endif %}
{% endfor %}
</dd>
{% endif %}
{% if packaged %}
<dt>Packaged Versions</dt>
<dd>
<ul>
{% for version in packaged %}
<li>
{{ version.version }}-{{ version.revision }} :{{ version.slot }} [{{ version.overlay }}]
</li>
{% endfor %}
</ul>
</dd>
{% endif %}
{% if upstream %}
<dt>Upstream versions</dt>
<dd>
<ul>
{% for version in upstream %}
<li>
{{ version.version }} - {{ version.url }}
</li>
{% endfor %}
</ul>
</dd>
{% endif %}
</dl>
{% endblock %}