-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from ImperialCollegeLondon/django-tables2
Use Django Tables 2 for the index page
- Loading branch information
Showing
8 changed files
with
82 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Tables for the main app.""" | ||
|
||
import django_tables2 as tables | ||
|
||
|
||
class ProcessTable(tables.Table): | ||
"""Defines and Process Table for the data from the Process Manager.""" | ||
|
||
uuid = tables.Column(verbose_name="UUID") | ||
name = tables.Column(verbose_name="Name") | ||
user = tables.Column(verbose_name="User") | ||
session = tables.Column(verbose_name="Session") | ||
status_code = tables.Column(verbose_name="Status Code") | ||
exit_code = tables.Column(verbose_name="Exit Code") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
{% extends "main/base.html" %} | ||
{% load render_table from django_tables2 %} | ||
|
||
{% block title %}Home{% endblock title %} | ||
|
||
{% block content %} | ||
Welcome to the index page. | ||
|
||
<table border="1"> | ||
<tr> | ||
<th>uuid</th> | ||
<th>name</th> | ||
<th>user</th> | ||
<th>session</th> | ||
<th>status code</th> | ||
<th>exit code</th> | ||
</tr> | ||
{% for value in values %} | ||
<tr> | ||
<td>{{ value.uuid.uuid }}</td> | ||
<td>{{ value.process_description.metadata.name }}</td> | ||
<td>{{ value.process_description.metadata.user }}</td> | ||
<td>{{ value.process_description.metadata.session }}</td> | ||
<td>{{ value.status_code }}</td> | ||
<td>{{ value.return_code }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% render_table table %} | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters