This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
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 #52 from warunsl/add-template-for-logs
Add template for tree log view
- Loading branch information
Showing
3 changed files
with
91 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>{{tree.tree}} - {{tree.status}}</title> | ||
<link rel="stylesheet" type="text/css" href="/static/style.css" /> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<div id = "main"> | ||
<span class="atRight"> | ||
{% if 'REMOTE_USER' in request.environ: -%} | ||
{{request.environ['REMOTE_USER']}} | ||
<a class="loginout" href="/logout">Logout</a> | ||
{% else: -%} | ||
<a class="loginout" href="/login">Login</a> | ||
{% endif -%} | ||
</span> | ||
<h1><a href="/">TreeStatus</a></h1> | ||
<h2>{{tree.tree}} is <span class="{{tree.status.lower().replace(" ", "_")}}">{{tree.status.upper()}}</span></h2><br/> | ||
{% if tree.reason: -%} | ||
<h2>Reason: {{tree.reason|e|linkbugs}}</h2> | ||
{% endif -%} | ||
{% if tree.message_of_the_day -%} | ||
<h3>{{tree.message_of_the_day|e|linkbugs}}</h3> | ||
{% endif -%} | ||
<div id="tableWrapper"> | ||
<h2 id="previous">History</h2> | ||
<table class="history"> | ||
<thead> | ||
<tr> | ||
<th class="tableWho">User</th> | ||
<th class="tableWhen">Time</th> | ||
<th class="tableState">Action</th> | ||
<th class="tableReason">Reason</th> | ||
<th class="tableTags">Tags</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for log in logs: -%} | ||
<tr> | ||
<td class="tableWho"> | ||
{% if 'REMOTE_USER' in request.environ: -%} | ||
{{log.who}} | ||
{% else -%} | ||
{{log.who|obfuscate}} | ||
{% endif -%} | ||
</td> | ||
<td class="tableWhen"> | ||
{{log.when}} | ||
</td> | ||
<td class="tableState"> | ||
{{log.action}} | ||
</td> | ||
<td class="tableReason"> | ||
{{log.reason|e|linkbugs}} | ||
</td> | ||
<td class="tableTags"> | ||
{{", ".join(log.tags)}} | ||
</td> | ||
</tr> | ||
{% endfor -%} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
<div id="footer"> | ||
<span class="footerWrapper"> | ||
<a href="/">All trees</a> | ||
<a href="/help">Help</a> | ||
<a href="https://github.com/mozilla/treestatus">Source</a> | ||
{% if 'REMOTE_USER' in request.environ: -%} | ||
<a href="/logout">Logout</a> | ||
{% else: -%} | ||
<a href="/login">Login</a> | ||
{% endif -%} | ||
</span> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |