Ignore:
Timestamp:
25/06/10 14:29:20 (10 years ago)
Author:
astephen
Message:

fixing up jobs page and moving renderer code into renderer package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/renderer/ui_renderer.py

    r6955 r7095  
    4545        return stream.render('xhtml') 
    4646 
     47 
     48    def renderJobsPage(self, jobs, total_matches, args, bad_args): 
     49        """ 
     50        Renders jobs page. 
     51        """ 
     52        rjobs = '<table border="2"><tr><td>Job id</td><td>Job type</td><td>User</td><td>Submission time</td><td>Job status</td></tr>\n' 
     53        for  (job_id, user, status, job_type, created) in jobs: 
     54            created = created.split(".")[0] 
     55            row = "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n" % (job_id, job_type, user, created, status) 
     56            rjobs += row 
     57 
     58        rjobs += "</table>" 
     59  
     60        items = [("Jobs Page", "This is where you can view jobs."), 
     61                 ("Warning bad args", str(bad_args)), 
     62                 ("Filtering Area", str(args)), 
     63                 ("Total Matches", str(total_matches)), 
     64                 ("Jobs", rjobs)]  #["<br>%s = %s" % (job[0], str(job)) for job in jobs])]  
     65 
     66        return self.render("Jobs Page", items) 
     67 
Note: See TracChangeset for help on using the changeset viewer.