euscanwww: finish ``world'' feature
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
parent
c8d0e5a789
commit
10e491f972
@ -1,7 +1,7 @@
|
||||
from django import forms
|
||||
|
||||
class WorldFileForm(forms.Form):
|
||||
world_file = forms.FileField()
|
||||
|
||||
class WorldForm(forms.Form):
|
||||
world = forms.CharField(widget=forms.Textarea)
|
||||
world = forms.FileField()
|
||||
|
||||
class PackagesForm(forms.Form):
|
||||
packages = forms.CharField(widget=forms.Textarea)
|
||||
|
@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404
|
||||
from django.db.models import Sum, Max
|
||||
|
||||
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')
|
||||
def index(request):
|
||||
@ -67,20 +67,21 @@ def package(request, category, package):
|
||||
|
||||
@render_to('euscan/world.html')
|
||||
def world(request):
|
||||
form = WorldForm()
|
||||
file_form = WorldFileForm()
|
||||
world_form = WorldForm()
|
||||
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')
|
||||
def world_scan(request):
|
||||
packages = []
|
||||
|
||||
# FIXME
|
||||
if 'world_file' in request.FILES:
|
||||
data = request.FILES['world_file'].read()
|
||||
elif 'world' in request.POST:
|
||||
data = request.POST['world']
|
||||
if 'world' in request.FILES:
|
||||
data = request.FILES['world'].read()
|
||||
elif 'packages' in request.POST:
|
||||
data = request.POST['packages']
|
||||
else:
|
||||
data = ""
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
<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.maintainers %}">Maintainers</a></li>
|
||||
<li><a href="{% url euscan.views.world %}">World</a></li>
|
||||
<li>---</li>
|
||||
<li><a href="#">Login</a></li>
|
||||
<li><a href="#">Register</a></li>
|
||||
|
@ -19,7 +19,7 @@
|
||||
{% for category in categories %}
|
||||
{% if category.n_versions == category.n_packaged %}
|
||||
<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">
|
||||
{% else %}
|
||||
<tr class="gradeX">
|
||||
|
@ -2,7 +2,15 @@
|
||||
|
||||
{% block content %}
|
||||
<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>
|
||||
<ul>
|
||||
<li>Packages: {{ n_packages }}</li>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<p>Import your /var/lib/portage/world file</p>
|
||||
|
||||
<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" />
|
||||
</form>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<p>Or just list some packages</p>
|
||||
|
||||
<form action="{% url euscan.views.world_scan %}" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
{{ packages_form.as_p }}
|
||||
<input type="submit" value="Submit" />
|
||||
</form>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user