urls from future in templates

This commit is contained in:
volpino 2012-05-06 20:27:14 +02:00
parent 948c5b8c39
commit 23f43e869a
15 changed files with 132 additions and 103 deletions

View File

@ -1,10 +1,12 @@
{% load url from future %}
<?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" />
{% block meta %}
<link rel="alternate" type="application/atom+xml" title="Global log" href="{% url global_feed %}" />
<link rel="alternate" type="application/atom+xml" title="Global log" href="{% url "global_feed" %}" />
{% endblock %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style.css" media="screen" title="Normal" />
@ -27,13 +29,13 @@
<div class="menu">
<ul>
{% block menu %}
<li><a href="{% url djeuscan.views.index %}">Home</a></li>
<li><a href="{% url djeuscan.views.categories %}">Categories</a></li>
<li><a href="{% url djeuscan.views.herds %}">Herds</a></li>
<li><a href="{% url djeuscan.views.maintainers %}">Maintainers</a></li>
<li><a href="{% url djeuscan.views.overlays %}">Overlays</a></li>
<li><a href="{% url djeuscan.views.world %}">Scan World</a></li>
<li><a href="{% url djeuscan.views.statistics %}">Statistics</a></li>
<li><a href="{% url "index" %}">Home</a></li>
<li><a href="{% url "categories" %}">Categories</a></li>
<li><a href="{% url "herds" %}">Herds</a></li>
<li><a href="{% url "maintainers" %}">Maintainers</a></li>
<li><a href="{% url "overlays" %}">Overlays</a></li>
<li><a href="{% url "world" %}">Scan World</a></li>
<li><a href="{% url "statistics" %}">Statistics</a></li>
<!--
<li>---</li>
<li><a href="#">Login</a></li>
@ -43,12 +45,12 @@
{% block menu_feed %}
<li>
<img src="{{ STATIC_URL }}img/feed.png" alt="feed" />
<a title="Global Feed" href="{% url global_feed %}">Global Feed</a>
<a title="Global Feed" href="{% url "global_feed" %}">Global Feed</a>
</li>
{% endblock %}
<li>---</li>
<li><a href="{% url djeuscan.views.api %}">API</a></li>
<li><a href="{% url djeuscan.views.about %}">About</a></li>
<li><a href="{% url "api" %}">API</a></li>
<li><a href="{% url "about" %}">About</a></li>
{% endblock %}
</ul>
</div>

View File

@ -7,21 +7,21 @@
{% if infos.n_overlay == 0 or infos.n_overlay <= infos.n_packaged %}
<td>
{% else %}{% if infos.n_overlay < infos.n_packaged %}
{% elif infos.n_overlay < infos.n_packaged %}
<td class="bad">
{% else %}
<td class="ugly">
{% endif %}{% endif %}
{{ infos.n_overlay }}
{% endif %}
{{ infos.n_overlay }}
</td>
{% if infos.n_versions == infos.n_packaged|add:infos.n_overlay %}
<td>
{% else %}{% if infos.n_versions < infos.n_packaged|add:infos.n_overlay|mul:2 %}
{% elif infos.n_versions < infos.n_packaged|add:infos.n_overlay|mul:2 %}
<td class="bad">
{% else %}
<td class="ugly">
{% endif %}{% endif %}
{% endif %}
{{ infos.n_versions|sub:infos.n_packaged|sub:infos.n_overlay }}
</td>

View File

@ -3,6 +3,8 @@
{% load div %}
{% load mul %}
{% load url from future %}
<table id="table" class="display">
<thead>
<th>Package</th>
@ -18,7 +20,7 @@
{% for package in packages %}
<tr>
<td>
<a href="{% url djeuscan.views.package package.category package.name %}">
<a href="{% url "package" package.category package.name %}">
{{ package.category }}/{{ package.name }}
</a>
{% package_bar package %}

View File

@ -1,15 +1,17 @@
{% extends "_base.html" %}
{% load url from future %}
{% block content %}
<h2>API</h2>
<p>
<ul>
<li><a href="{% url api.views.root 'json' %}">/api/1.0/api.json</a></li>
<li><a href="{% url api.views.statistics 'json' %}">/api/1.0/statistics.json</a></li>
<li><a href="{% url api.views.maintainers 'json' %}">/api/1.0/maintainers.json</a></li>
<li><a href="{% url api.views.herds 'json' %}">/api/1.0/herds.json</a></li>
<li><a href="{% url api.views.categories 'json' %}">/api/1.0/categories.json</a></li>
<li><a href="{% url "api.views.root" 'json' %}">/api/1.0/api.json</a></li>
<li><a href="{% url "api.views.statistics" 'json' %}">/api/1.0/statistics.json</a></li>
<li><a href="{% url "api.views.maintainers" 'json' %}">/api/1.0/maintainers.json</a></li>
<li><a href="{% url "api.views.herds" 'json' %}">/api/1.0/herds.json</a></li>
<li><a href="{% url "api.views.categories" 'json' %}">/api/1.0/categories.json</a></li>
<li>/api/1.0/packages/by-maintainer/&lt;maintainer-id&gt;.json</li>
<li>/api/1.0/packages/by-category/&lt;category&gt;.json</li>
<li>/api/1.0/packages/by-herd/&lt;herd&gt;.json</li>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - categories
@ -24,14 +25,14 @@
{% for category in categories %}
<tr>
<td>
<a href="{% url djeuscan.views.category category.category %}">{{ category.category }}</a>
<a href="{% url "category" category.category %}">{{ category.category }}</a>
{% package_bar category %}
</td>
{% package_cols category %}
{% if request.GET.extras %}
<td>
<img src="{% url djeuscan.views.chart_category category.category 'packages-monthly-small' %}" />
<img src="{% url djeuscan.views.chart_category category.category 'versions-monthly-small' %}" />
<img src="{% url "chart_category" category.category 'packages-monthly-small' %}" />
<img src="{% url "chart_category" category.category 'versions-monthly-small' %}" />
</td>
{% endif %}
</tr>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - Category: {{ category }}
@ -10,7 +11,7 @@
{{ block.super }}
<li>
<img src="{{ STATIC_URL }}/img/feed.png" alt="feed" />
<a title="{{ category }} Feed" href="{% url category_feed category %}">{{ category }}</a>
<a title="{{ category }} Feed" href="{% url "category_feed" category %}">{{ category }}</a>
</li>
{% endblock %}
@ -22,19 +23,19 @@
<h3>Statistics</h2>
<h4>Current statistics</h4>
<p>
<img src="{% url djeuscan.views.chart_category category 'pie-versions' %}" />
<img src="{% url djeuscan.views.chart_category category 'pie-packages' %}" />
<img src="{% url "chart_category" category 'pie-versions' %}" />
<img src="{% url "chart_category" category 'pie-packages' %}" />
</p>
<h4>All Time</h4>
<p>
<img src="{% url djeuscan.views.chart_category category 'versions-weekly' %}" />
<img src="{% url djeuscan.views.chart_category category 'versions-monthly' %}" />
<img src="{% url "chart_category" category 'versions-weekly' %}" />
<img src="{% url "chart_category" category 'versions-monthly' %}" />
</p>
<p>
<img src="{% url djeuscan.views.chart_category category 'packages-weekly' %}" />
<img src="{% url djeuscan.views.chart_category category 'packages-monthly' %}" />
<img src="{% url "chart_category" category 'packages-weekly' %}" />
<img src="{% url "chart_category" category 'packages-monthly' %}" />
</p>
{% endblock %}
@ -44,9 +45,9 @@
<div class="menu">
<dl>
<dt>Versions</dt>
<dd><img src="{% url djeuscan.views.chart_category category 'versions-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_category" category 'versions-monthly-small' %}" /></dd>
<dt>Packages</dt>
<dd><img src="{% url djeuscan.views.chart_category category 'packages-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_category" category 'packages-monthly-small' %}" /></dd>
</dl>
</div>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - Herd: {{ herd.herd }}
@ -10,7 +11,7 @@
{{ block.super }}
<li>
<img src="{{ STATIC_URL }}/img/feed.png" alt="feed" />
<a title="{{ herd.herd }} Feed" href="{% url herd_feed herd.herd %}">{{ herd.herd }}</a>
<a title="{{ herd.herd }} Feed" href="{% url "herd_feed" herd.herd %}">{{ herd.herd }}</a>
</li>
{% endblock %}
@ -21,18 +22,18 @@
<h3>Statistics</h2>
<h4>Current statistics</h4>
<p>
<img src="{% url djeuscan.views.chart_herd herd.herd 'pie-versions' %}" />
<img src="{% url djeuscan.views.chart_herd herd.herd 'pie-packages' %}" />
<img src="{% url "chart_herd" herd.herd 'pie-versions' %}" />
<img src="{% url "chart_herd" herd.herd 'pie-packages' %}" />
</p>
<h4>All Time</h4>
<p>
<img src="{% url djeuscan.views.chart_herd herd.herd 'versions-weekly' %}" />
<img src="{% url djeuscan.views.chart_herd herd.herd 'versions-monthly' %}" />
<img src="{% url "chart_herd" herd.herd 'versions-weekly' %}" />
<img src="{% url "chart_herd" herd.herd 'versions-monthly' %}" />
<p>
</p>
<img src="{% url djeuscan.views.chart_herd herd.herd 'packages-weekly' %}" />
<img src="{% url djeuscan.views.chart_herd herd.herd 'packages-monthly' %}" />
<img src="{% url "chart_herd" herd.herd 'packages-weekly' %}" />
<img src="{% url "chart_herd" herd.herd 'packages-monthly' %}" />
</p>
{% endblock %}
@ -42,9 +43,9 @@
<div class="menu">
<dl>
<dt>Versions</dt>
<dd><img src="{% url djeuscan.views.chart_herd herd.herd 'versions-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_herd" herd.herd 'versions-monthly-small' %}" /></dd>
<dt>Packages</dt>
<dd><img src="{% url djeuscan.views.chart_herd herd.herd 'packages-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_herd" herd.herd 'packages-monthly-small' %}" /></dd>
</dl>
</div>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - herds
@ -21,21 +22,21 @@
</thead>
<tbody>
{% for herd in herds %}
<tr>
<td>
<a href="{% url djeuscan.views.herd herd.herds__herd %}">
{{ herd.herds__herd }}
</a>
{% package_bar herd %}
</td>
{% package_cols herd %}
{% if request.GET.extras %}
<td>
<img src="{% url djeuscan.views.chart_herd herd.herds__herd 'packages-monthly-small' %}" />
<img src="{% url djeuscan.views.chart_herd herd.herds__herd 'versions-monthly-small' %}" />
</td>
{% endif %}
</tr>
<tr>
<td>
<a href="{% url "herd" herd.herds__herd %}">
{{ herd.herds__herd }}
</a>
{% package_bar herd %}
</td>
{% package_cols herd %}
{% if request.GET.extras %}
<td>
<img src="{% url "chart_herd" herd.herds__herd 'packages-monthly-small' %}" />
<img src="{% url "chart_herd" herd.herds__herd 'versions-monthly-small' %}" />
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -5,10 +5,12 @@
{% block content %}
<h2>What's euscan ?</h2>
<p>
Euscan is both a tool to check if an ebuild is outdated (app-portage/euscan) and a web interface.
Euscan is both a tool to check if an ebuild is outdated (app-portage/euscan)
and a web interface.
</p>
<p>
This web interface allow you to browse the portage tree, and find outdated ebuilds. It is designed to help maintainers monitor their packages and bump them.
This web interface allow you to browse the portage tree, and find outdated
ebuilds. It is designed to help maintainers monitor their packages and bump them.
</p>
<h2>Overview</h2>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - Maintainer: {{ maintainer.name }}
@ -10,7 +11,9 @@
{{ block.super }}
<li>
<img src="{{ STATIC_URL }}/img/feed.png" alt="feed" />
<a title="{{ maintainer.name }} Feed" href="{% url maintainer_feed maintainer.id %}">{{ maintainer.name }}</a>
<a title="{{ maintainer.name }} Feed" href="{% url "maintainer_feed" maintainer.id %}">
{{ maintainer.name }}
</a>
</li>
{% endblock %}
@ -21,19 +24,19 @@
<h3>Statistics</h2>
<h4>Current statistics</h4>
<p>
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'pie-versions' %}" />
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'pie-packages' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'pie-versions' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'pie-packages' %}" />
</p>
<h4>All Time</h4>
<p>
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'versions-weekly' %}" />
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'versions-monthly' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'versions-weekly' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'versions-monthly' %}" />
</p>
<p>
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'packages-weekly' %}" />
<img src="{% url djeuscan.views.chart_maintainer maintainer.id 'packages-monthly' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'packages-weekly' %}" />
<img src="{% url "chart_maintainer" maintainer.id 'packages-monthly' %}" />
</p>
{% endblock %}
@ -42,9 +45,9 @@
<div class="menu">
<dl>
<dt>Versions</dt>
<dd><img src="{% url djeuscan.views.chart_maintainer maintainer.id 'versions-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_maintainer" maintainer.id 'versions-monthly-small' %}" /></dd>
<dt>Packages</dt>
<dd><img src="{% url djeuscan.views.chart_maintainer maintainer.id 'packages-monthly-small' %}" /></dd>
<dd><img src="{% url "chart_maintainer" maintainer.id 'packages-monthly-small' %}" /></dd>
</dl>
</div>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - maintainers
@ -16,30 +17,32 @@
<th><img src="{{ STATIC_URL }}img/upstream-icon.png" alt="upstream" title="Versions only upstream" /></th>
<th><img src="{{ STATIC_URL }}img/freshness-icon.png" title="Freshness" /></th>
{% if request.GET.extras %}
<th>Graphs</th>
<th>Graphs</th>
{% endif %}
</thead>
<tbody>
{% for maintainer in maintainers %}
<tr>
<td>
<a href="{% url djeuscan.views.maintainer maintainer.maintainers__id %}">
{% if maintainer.maintainers__name != maintainer.maintainers__email %}
{{ maintainer.maintainers__name }} &lt;{{ maintainer.maintainers__email }}&gt;
{% else %}
{{ maintainer.maintainers__name }}
{% endif %}
</a>
{% package_bar maintainer %}
</td>
{% package_cols maintainer %}
{% if request.GET.extras %}
<td>
<img src="{% url djeuscan.views.chart_maintainer maintainer.maintainers__id 'packages-monthly-small' %}" />
<img src="{% url djeuscan.views.chart_maintainer maintainer.maintainers__id 'versions-monthly-small' %}" />
</td>
{% endif %}
</tr>
<tr>
<td>
<a href="{% url "maintainer" maintainer.maintainers__id %}">
{% if maintainer.maintainers__name != maintainer.maintainers__email %}
{{ maintainer.maintainers__name }} &lt;{{ maintainer.maintainers__email }}&gt;
{% else %}
{{ maintainer.maintainers__name }}
{% endif %}
</a>
{% package_bar maintainer %}
</td>
{% package_cols maintainer %}
{% if request.GET.extras %}
<td>
<img src="{% url "chart_maintainer" maintainer.maintainers__id 'packages-monthly-small' %}" />
<img src="{% url "chart_maintainer" maintainer.maintainers__id 'versions-monthly-small' %}" />
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -1,6 +1,7 @@
{% extends "euscan/_datatable.html" %}
{% load packages %}
{% load url from future %}
{% block title %}
{{ block.super }} - overlays
@ -17,7 +18,9 @@
{% for overlay in overlays %}
<tr>
<td>
<a href="{% url djeuscan.views.overlay overlay.version__overlay %}">{{ overlay.version__overlay }}</a>
<a href="{% url "overlay" overlay.version__overlay %}">
{{ overlay.version__overlay }}
</a>
</td>
</tr>
{% endfor %}

View File

@ -1,17 +1,21 @@
{% extends "euscan/_datatable.html" %}
{% load sub %}
{% load url from future %}
{% block meta %}
{{ block.super }}
<link rel="alternate" type="application/atom+xml" title="{{ package }} Feed" href="{% url package_feed package.category package.name %}" />
<link rel="alternate" type="application/atom+xml" title="{{ package }} Feed"
href="{% url "package_feed" package.category package.name %}" />
{% endblock %}
{% block menu_feed %}
{{ block.super }}
<li>
<img src="{{ STATIC_URL }}/img/feed.png" alt="feed" />
<a title="{{ package }} Feed" href="{% url package_feed package.category package.name %}">{{ package }}</a>
<a title="{{ package }} Feed" href="{% url "package_feed" package.category package.name %}">
{{ package }}
</a>
</li>
{% endblock %}
@ -38,7 +42,7 @@
<dt>Herds</dt>
<dd>
{% for herd in package.herds.all %}
<a href="{% url djeuscan.views.herd herd.herd %}">
<a href="{% url "herd" herd.herd %}">
{{ herd.herd }}
</a>
&lt;{{ herd.email }}&gt;
@ -50,12 +54,12 @@
<dd>
{% for maintainer in package.maintainers.all %}
{% if maintainer.name != maintainer.email %}
<a href="{% url djeuscan.views.maintainer maintainer.id %}">
<a href="{% url "maintainer" maintainer.id %}">
{{ maintainer.name }}
</a>
&lt;{{ maintainer.email }}&gt;
{% else %}
<a href="{% url djeuscan.views.maintainer maintainer.id %}">
<a href="{% url "maintainer" maintainer.id %}">
{{ maintainer.email }}
</a>
{% endif %}

View File

@ -1,19 +1,21 @@
{% extends "_base.html" %}
{% load url from future %}
{% block content %}
<h2>What's euscan ?</h2>
<h2>Statistics</h2>
<h3>Current statistics</h3>
<img src="{% url djeuscan.views.chart 'pie-versions' %}" />
<img src="{% url djeuscan.views.chart 'pie-packages' %}" />
<img src="{% url "chart" 'pie-versions' %}" />
<img src="{% url "chart" 'pie-packages' %}" />
<h3>All time statistics</h3>
<img src="{% url djeuscan.views.chart 'packages-weekly' %}" />
<img src="{% url djeuscan.views.chart 'packages-monthly' %}" />
<img src="{% url "chart" 'packages-weekly' %}" />
<img src="{% url "chart" 'packages-monthly' %}" />
<img src="{% url djeuscan.views.chart 'versions-weekly' %}" />
<img src="{% url djeuscan.views.chart 'versions-monthly' %}" />
<img src="{% url "chart" 'versions-weekly' %}" />
<img src="{% url "chart" 'versions-monthly' %}" />
{% endblock %}

View File

@ -1,5 +1,7 @@
{% extends "_base.html" %}
{% load url from future %}
{% block title %}
{{ block.super }} - World scan
{% endblock %}
@ -11,7 +13,7 @@
<p>Import your /var/lib/portage/world file</p>
<form action="{% url djeuscan.views.world_scan %}" method="post" enctype="multipart/form-data">{% csrf_token %}
<form action="{% url "world_scan" %}" method="post" enctype="multipart/form-data">{% csrf_token %}
{{ world_form.as_p }}
<input type="submit" value="Submit" />
</form>
@ -20,7 +22,7 @@
<p>Or just list some packages</p>
<form action="{% url djeuscan.views.world_scan %}" method="post">{% csrf_token %}
<form action="{% url "world_scan" %}" method="post">{% csrf_token %}
{{ packages_form.as_p }}
<input type="submit" value="Submit" />
</form>