[Pkg-debile-commits] [debile-web] 01/06: dput-profile on hacker page, minor renaming
Léo Cavaillé
leo.cavaille-guest at alioth.debian.org
Mon Aug 26 20:40:07 UTC 2013
This is an automated email from the git hooks/post-receive script.
leo.cavaille-guest pushed a commit to branch master
in repository debile-web.
commit e5c9215b6844f9bb258d7ef39bccfade4259c7f4
Author: Léo Cavaillé <leo at cavaille.net>
Date: Fri Aug 16 22:25:59 2013 +0200
dput-profile on hacker page, minor renaming
---
debuild/blueprints/frontend.py | 27 +++++++++++++++++++++------
templates/hacker.html | 11 ++++++++---
templates/{about.html => index.html} | 3 +--
3 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/debuild/blueprints/frontend.py b/debuild/blueprints/frontend.py
index c90957d..52d46a0 100644
--- a/debuild/blueprints/frontend.py
+++ b/debuild/blueprints/frontend.py
@@ -21,6 +21,7 @@
from flask import Blueprint, render_template, send_file
from sqlalchemy.orm import joinedload
from lucy.orm import Package, Source, Binary, Machine, User, Job, Group
+from lucy.archive import UserRepository
from lucy.config import Config
from lucy.server import Session
@@ -75,18 +76,27 @@ def get_machine_link(m):
@frontend.route("/")
def index():
session = Session()
- active_jobs = session.query(Job).options(joinedload('machine')).filter(Job.machine != None).filter(Job.finished_at == None).all()
+ active_jobs = session.query(Job)\
+ .options(joinedload('machine'))\
+ .filter(Job.machine != None)\
+ .filter(Job.finished_at == None)\
+ .all()
machines = session.query(Machine).options(joinedload('jobs')).all()
active_jobs_info = []
for j in active_jobs:
info = {}
info['job'] = j
info['package_link'] = get_package_link(j.package)
- info['machine_link'] = get_machine_link(j.machine)
+ if j.machine:
+ info['machine_link'] = get_machine_link(j.machine)
active_jobs_info.append(info)
- return render_template('about.html', **{
+
+ pending_jobs = session.query(Job)\
+ .filter(Job.assigned_at == None)\
+ .count()
+ return render_template('index.html', **{
"active_jobs_info": active_jobs_info,
- "machines": machines,
+ "pending_jobs": pending_jobs
})
@@ -286,10 +296,15 @@ def machine(machine_name):
@frontend.route("/hacker/<hacker_login>")
def hacker(hacker_login):
session = Session()
- # FIXME : unsafe code, catch exceptions
+ # FIXME : unsafe code, catch exceptions
user = session.query(User).filter(User.login == hacker_login).one()
+
+ ur = UserRepository(user)
+ dput_upload_profile = ur.generate_dputprofile()
+
return render_template('hacker.html', **{
- "hacker": user
+ "hacker": user,
+ "dput_upload_profile": dput_upload_profile
})
diff --git a/templates/hacker.html b/templates/hacker.html
index 1774a93..47d7d30 100644
--- a/templates/hacker.html
+++ b/templates/hacker.html
@@ -7,8 +7,13 @@
{{hacker.name}}'s GPG key is <code>{{hacker.gpg_fingerprint}}</code>.
-{% with sources = hacker.sources %}
- {% include "source_list_fragment.html" %}
-{% endwith %}
+To upload a package to debile :
+<ul>
+ <li>Install dput-ng</li>
+ <li>Copy the following in your <strong>~/.dput.d/profiles/debile.json</strong></li>
+</ul>
+<pre>
+{{dput_upload_profile}}
+</pre>
{% endblock %}
diff --git a/templates/about.html b/templates/index.html
similarity index 77%
rename from templates/about.html
rename to templates/index.html
index de95a63..b223de8 100644
--- a/templates/about.html
+++ b/templates/index.html
@@ -10,10 +10,9 @@ Perhaps you're looking for
{% include "job_list_fragment.html" %}
+<h1>Pending jobs</h1>
-<h1>Builder Status</h1>
-{% include "machine_list_fragment.html" %}
{% endblock %}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-web.git
More information about the Pkg-debile-commits
mailing list