aboutsummaryrefslogtreecommitdiff
path: root/master
diff options
context:
space:
mode:
Diffstat (limited to 'master')
-rw-r--r--master/master/media/css/default.css9
-rw-r--r--master/master/media/images/.gitignore6
-rw-r--r--master/master/templates/frontpage.html19
-rw-r--r--master/master/urls.py4
-rw-r--r--master/master/views.py19
5 files changed, 50 insertions, 7 deletions
diff --git a/master/master/media/css/default.css b/master/master/media/css/default.css
index 8d9ce01..860ef5b 100644
--- a/master/master/media/css/default.css
+++ b/master/master/media/css/default.css
@@ -22,6 +22,14 @@ a:visited, a:hover {
color: black;
}
+img {
+ border: 0;
+}
+
+a img {
+ margin: 1%;
+}
+
#topcurves img {
width: 99%;
float: left;
@@ -34,6 +42,7 @@ a:visited, a:hover {
background-color: #e6e6e6;
padding: 1.5%;
padding-top: 0%;
+ margin-bottom: 1.5%;
float: left;
}
diff --git a/master/master/media/images/.gitignore b/master/master/media/images/.gitignore
new file mode 100644
index 0000000..bf3c3ac
--- /dev/null
+++ b/master/master/media/images/.gitignore
@@ -0,0 +1,6 @@
+jobs.png
+login.png
+logout.png
+master.png
+slaves.png
+users.png
diff --git a/master/master/templates/frontpage.html b/master/master/templates/frontpage.html
new file mode 100644
index 0000000..867654e
--- /dev/null
+++ b/master/master/templates/frontpage.html
@@ -0,0 +1,19 @@
+{# vim: set sw=4 sts=4 et filetype=htmldjango : #}
+{# Copyright: 2008 Gentoo Foundation #}
+{# Author(s): Nirbheek Chauhan <nirbheek.chauhan@gmail.com> #}
+{# License: AGPL-3 #}
+{# #}
+{# Immortal lh! #}
+{# #}
+{% extends "basic.html" %}
+{% block content %}
+<br/><br/>
+<br/><br/>
+<br/><br/>
+<center>
+ <a href=""><img src="{{ media_prefix }}images/master.png" title="Status of the master server"/></a>
+ <a href=""><img src="{{ media_prefix }}images/slaves.png" title="Status of your slaves"/></a>
+ <a href="jobs/"><img src="{{ media_prefix }}images/jobs.png" title="Status of jobs"/></a>
+ <a href=""><img src="{{ media_prefix }}images/users.png" title="Search for users"/></a>
+</center>
+{% endblock %}
diff --git a/master/master/urls.py b/master/master/urls.py
index 599b450..10dca65 100644
--- a/master/master/urls.py
+++ b/master/master/urls.py
@@ -10,8 +10,10 @@ from django.conf.urls.defaults import *
from django.conf import settings
urlpatterns = patterns('master.views',
+ (r'^$', 'front_page'),
+ (r'^jobs/$', 'jobs_page'),
(r'^~([a-zA-Z0-9_]+)/$', 'user_page'),
- (r'^~([a-zA-Z0-9_]+)/jobs/$', 'jobs_page'),
+ (r'^~(?P<username>[a-zA-Z0-9_]+)/jobs/$', 'jobs_page'),
)
urlpatterns += patterns('master.slave_api',
diff --git a/master/master/views.py b/master/master/views.py
index 8f7759d..e1b5eba 100644
--- a/master/master/views.py
+++ b/master/master/views.py
@@ -12,18 +12,25 @@ from master.models import User, Job
from django.conf import settings
import process
+details = {'media_prefix': settings.MEDIA_PREFIX}
+
+def front_page(request):
+ return render_to_response('frontpage.html', details)
+
def user_page(request, username):
user = get_object_or_404(User, username=username)
- details = {'media_prefix': settings.MEDIA_PREFIX}
for i in ('first_name', 'last_name', 'email',):
details[i] = getattr(user, i)
return render_to_response('userpage.html', details)
-def jobs_page(request, username):
- user = get_object_or_404(User, username=username)
- jobs = get_list_or_404(Job, maintainer=user)
+def jobs_page(request, username=None):
+ jobs = None
+ if username:
+ user = get_object_or_404(User, username=username)
+ jobs = get_list_or_404(Job, maintainer=user)
+ else:
+ jobs = get_list_or_404(Job)
for job in jobs:
job.stage_url = process.generate_stage_url(job)
- details = { 'media_prefix': settings.MEDIA_PREFIX,
- 'jobs': jobs }
+ details['jobs'] = jobs
return render_to_response('jobs.html', details)