Commits

Jesse Noller  committed 0cacbeb

another checkpoint

  • Participants
  • Parent commits b014eec

Comments (0)

Files changed (8)

File web/results/management/commands/parse_results.py

 from zipfile import ZipFile, ZIP_DEFLATED
 from contextlib import closing
 
+from bender import results
+
 from web.results import models
 
 # XXX - fixme
                 xml = os.path.join(sdir, 'artifacts', 'noseresults.xml')
                 sres = models.Result(jobid=job, slave=slave, result=result, xmlfile=xml)
                 sres.save()
+                print results.parse_nose_results(open(xml, 'r').read())
                 results.append(sres)
             for i in slaves:
                 job.slaves.add(i)

File web/results/urls.py

     url(r'^$', 'main', name='main'),
     url(r'^details/(?P<guid>.+)/$', 'run_details', name='details'),
     url(r'^tag/(.+)/$', 'tag_view', name='tag_view'),
+    url(r'^tags/$', 'tags', name='tags'),
     )

File web/results/views.py

 from django.template import RequestContext
 from django.shortcuts import render_to_response, get_object_or_404
 
+from bender import results
+
 from . import models
 
 def main(request):
     return render_to_response('tag.html', {'jobs': jobs, 'tag': tagname},
                                context_instance=RequestContext(request))
 
+def tags(request):
+    tags = models.Tag.objects.all()
+    return render_to_response('tags.html', {'tags': tags},
+                               context_instance=RequestContext(request))
+
 def run_details(request, guid):
-    pass
+    job = get_object_or_404(models.Job, jobid=guid)
+    for result in job.results.all():
+        pass
+    return render_to_response('job.html', {'job': job, 'jobid': guid},
+                               context_instance=RequestContext(request))
+
+"""
+class Result(models.Model):
+    jobid = models.ForeignKey('Job', related_name='ham')
+    slave = models.ForeignKey("Slave")
+    result = models.IntegerField(max_length=10)
+    xmlfile = models.CharField(max_length=1000)
+"""

File web/static_media/css/site.css

 
 body {
-/*    background: #F5F5F5;*/
     text-align: left;
     background: #FFF url(../images/Robot1.jpg) no-repeat 100% 0% !important;
+    background-attachment: fixed;
 }
 
 div#header, div#footer {
-    border: 2px solid #000 !important;
+    border: 1px solid #000 !important;
     padding:4px 5px 4px 5px;
     height: 30px;
 }
     background: #FFF;
     margin:1px 0 1px 0;
     padding:4px 5px 4px 5px;
-    border: 2px solid #000;
+    border: 1px solid #000;
     height: 10px;
 }
 
     background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#ccc)); /* for webkit browsers */
     background: -moz-linear-gradient(top,  #FFF,  #ccc); /* for firefox 3.6+ */
     padding:4px 5px 4px 5px;
-    border: 2px solid #000 !important;
+    border: 1px solid #000 !important;
     /* for IE */
     filter:alpha(opacity=90);
     /* CSS3 standard */
 }
 
 .tags {
+    float: right;
+    clear: right;
     font-size: 10px;
     text-align: right;
-    display: block;
+    background: #FFF;
+    -moz-border-radius: 4px;
+    -webkit-border-radius: 4px;
+    margin: 4px 4px 4px 4px;
+}
+
+.manage {
+    float: left;
+    clear: left;
+    font-size: 10px;
+    text-align: left;
     background: #FFF;
     -moz-border-radius: 4px;
     -webkit-border-radius: 4px;

File web/templates/base.html

         </div>
 
         <div class="clear span-24 last" id="content-container">
-            <div class="span-22 prepend-1 append-1 last" id="content">
+            <div class="span-22 prepend-1 append-1 last clearfix" id="content">
                 {% block content %}
                     content
                 {% endblock %}

File web/templates/display.html

 {% endblock %}
 
 {% block nav %}
-    <span><a href="{% url main %}">main</a></span><span>&#149;</span>
+    <span><a href="{% url main %}">main</a></span><span>&#149;</span><span><a href="{% url tags %}">tags</a>
 {% endblock %}
 
 {% block content %}
     {% for job in jobs %}
     {% if job.result == "0" %}
-        <div class="pass" id="result">
+        <div class="pass clearfix" id="result">
     {% else %}
-        <div class="failure" id="result">
+        <div class="failure clearfix" id="result">
     {% endif %}
         <h3>{{ job.name }} - {{ job.jobid }}</h3>
         {% for result in job.results.all %}
                 <b>Slave Name</b>: {{ result.slave.name }} <span>&#149;</span> <b>Platform</b>: {{ result.slave.platform }} <span>&#149;</span> <b>Result</b>: {% if result.result == 0 %}Pass{% else %}Fail{% endif %}
             </div>
         {% endfor %}
+        <span>
+        <div class="manage">
+            <a href="{% url details job.jobid %}"><img src="{{ MEDIA_URL }}/images/icons/zoom.png"/></a>
+        </div>
         <div class="tags">
             <b>Tags:</b> 
             {% for tag in job.tags.all %}
                 <a href="{% url tag_view tag.tag|urlencode %}">{{ tag.tag }}</a>
             {% endfor %}
         </div>
+        </span>
     </div>
     {% endfor %}
 {% endblock %}

File web/templates/job.html

+{% extends "display.html" %}
+
+{% block header %}
+    <h3>Bender :: detailed results for job: {{ jobid }}</h3>
+{% endblock %}
+
+{% block content %}
+    <h3>{{ job.name }} - {{ job.jobid }}</h3>
+    {% for result in job.results.all %}
+        {% if result.result == 0 %}
+            <div class="slave-result slavePass">
+        {% else %}
+            <div class="slave-result slaveError">
+        {% endif %}
+            <b>Slave Name</b>: {{ result.slave.name }} <span>&#149;</span> <b>Platform</b>: {{ result.slave.platform }} <span>&#149;</span> <b>Result</b>: {% if result.result == 0 %}Pass{% else %}Fail{% endif %}
+        </div>
+    {% endfor %}
+{% endblock %}

File web/templates/tags.html

+{% extends "display.html" %}
+
+{% block header %}
+    <h3>Bender :: all tags</h3>
+{% endblock %}
+
+{% block content %}
+    {% for tag in tags %}
+        <a href="{% url tag_view tag.tag|urlencode %}">{{ tag.tag }}</a>
+    {% endfor %}
+{% endblock %}