euscanwww: finish ``world'' feature

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
Corentin Chary 2011-04-16 11:44:57 +02:00
parent c8d0e5a789
commit 10e491f972
6 changed files with 26 additions and 16 deletions

View File

@ -1,7 +1,7 @@
from django import forms from django import forms
class WorldFileForm(forms.Form):
world_file = forms.FileField()
class WorldForm(forms.Form): class WorldForm(forms.Form):
world = forms.CharField(widget=forms.Textarea) world = forms.FileField()
class PackagesForm(forms.Form):
packages = forms.CharField(widget=forms.Textarea)

View File

@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404
from django.db.models import Sum, Max from django.db.models import Sum, Max
from euscan.models import Version, Package, Herd, Maintainer, EuscanResult from euscan.models import Version, Package, Herd, Maintainer, EuscanResult
from euscan.forms import WorldForm, WorldFileForm from euscan.forms import WorldForm, PackagesForm
@render_to('euscan/index.html') @render_to('euscan/index.html')
def index(request): def index(request):
@ -67,20 +67,21 @@ def package(request, category, package):
@render_to('euscan/world.html') @render_to('euscan/world.html')
def world(request): def world(request):
form = WorldForm() world_form = WorldForm()
file_form = WorldFileForm() packages_form = PackagesForm()
return { 'form' : form , 'file_form' : file_form } return { 'world_form' : world_form,
'packages_form' : packages_form }
@render_to('euscan/world_scan.html') @render_to('euscan/world_scan.html')
def world_scan(request): def world_scan(request):
packages = [] packages = []
# FIXME # FIXME
if 'world_file' in request.FILES: if 'world' in request.FILES:
data = request.FILES['world_file'].read() data = request.FILES['world'].read()
elif 'world' in request.POST: elif 'packages' in request.POST:
data = request.POST['world'] data = request.POST['packages']
else: else:
data = "" data = ""

View File

@ -25,6 +25,7 @@
<li><a href="{% url euscan.views.categories %}">Categories</a></li> <li><a href="{% url euscan.views.categories %}">Categories</a></li>
<li><a href="{% url euscan.views.herds %}">Herds</a></li> <li><a href="{% url euscan.views.herds %}">Herds</a></li>
<li><a href="{% url euscan.views.maintainers %}">Maintainers</a></li> <li><a href="{% url euscan.views.maintainers %}">Maintainers</a></li>
<li><a href="{% url euscan.views.world %}">World</a></li>
<li>---</li> <li>---</li>
<li><a href="#">Login</a></li> <li><a href="#">Login</a></li>
<li><a href="#">Register</a></li> <li><a href="#">Register</a></li>

View File

@ -19,7 +19,7 @@
{% for category in categories %} {% for category in categories %}
{% if category.n_versions == category.n_packaged %} {% if category.n_versions == category.n_packaged %}
<tr class="gradeA"> <tr class="gradeA">
{% else %}{% if category.n_versions < category.n_packaged|mul:2 %} {% else %}{% if category.n_versions < category.n_packaged|mul:1.5 %}
<tr class="gradeC"> <tr class="gradeC">
{% else %} {% else %}
<tr class="gradeX"> <tr class="gradeX">

View File

@ -2,7 +2,15 @@
{% block content %} {% block content %}
<h2>What's euscan ?</h2> <h2>What's euscan ?</h2>
<p>blabla</p> <p>
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 was designed to help maintainers monitor their packages and bump them.
</p>
<p>
euscan code source is available at <a href="http://git.iksaif.net/?p=euscan.git;a=summary">http://git.iksaif.net/?p=euscan.git;a=summary</a>.
</p>
<h2>Statistics</h2> <h2>Statistics</h2>
<ul> <ul>
<li>Packages: {{ n_packages }}</li> <li>Packages: {{ n_packages }}</li>

View File

@ -12,7 +12,7 @@
<p>Import your /var/lib/portage/world file</p> <p>Import your /var/lib/portage/world file</p>
<form action="{% url euscan.views.world_scan %}" method="post" enctype="multipart/form-data">{% csrf_token %} <form action="{% url euscan.views.world_scan %}" method="post" enctype="multipart/form-data">{% csrf_token %}
{{ file_form.as_p }} {{ world_form.as_p }}
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
</form> </form>
@ -21,7 +21,7 @@
<p>Or just list some packages</p> <p>Or just list some packages</p>
<form action="{% url euscan.views.world_scan %}" method="post">{% csrf_token %} <form action="{% url euscan.views.world_scan %}" method="post">{% csrf_token %}
{{ form.as_p }} {{ packages_form.as_p }}
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
</form> </form>