coloring for errors

This commit is contained in:
James Turk 2011-08-02 18:08:01 -04:00
parent 29ac3b0fb7
commit f6072cdb9b
3 changed files with 8 additions and 6 deletions

View File

@ -13,6 +13,7 @@
table { border-spacing: 0px; margin-top: 20px; } table { border-spacing: 0px; margin-top: 20px; }
th { border-bottom: 2px solid black; } th { border-bottom: 2px solid black; }
a.button { padding: 0.5em 1em 0.5em 1em; border: 2px solid black; font-weight: bold; } a.button { padding: 0.5em 1em 0.5em 1em; border: 2px solid black; font-weight: bold; }
tbody tr.error td { background-color: #ff99a9 }
/* div.heading { border-bottom: 3px solid white; } */ /* div.heading { border-bottom: 3px solid white; } */
</style> </style>
</head> </head>

View File

@ -6,8 +6,8 @@ Oyster Logs
{% block body %} {% block body %}
<div class="span-2 "> <div class="span-2">
{% if prev_offset %} {% if offset %}
<a class="button" href="/log/?offset={{prev_offset}}">&laquo; Prev</a> <a class="button" href="/log/?offset={{prev_offset}}">&laquo; Prev</a>
{% endif %} {% endif %}
&nbsp; &nbsp;
@ -22,17 +22,17 @@ Oyster Logs
<div class="span-18"> <div class="span-18">
<table> <table>
<tr> <tr>
<th>&nbsp;&nbsp;&nbsp;</th>
<th>action</th> <th>action</th>
<th>description</th> <th>description</th>
<th>timestamp</th> <th>timestamp</th>
<th>&nbsp;</th>
</tr> </tr>
{% for log in logs %} {% for log in logs %}
<tr> <tr{% if log.error %} class="error" {% endif %}>
<td>{% if log.error %}{{log.error}}{% endif %}</td>
<td>{{log.action}}</td> <td>{{log.action}}</td>
<td><a href="/tracked/{{log.url}}">{{log.url}}</td> <td><a href="/tracked/{{log.url}}">{{log.url}}</td>
<td>{{log.timestamp}}</td> <td>{{log.timestamp}}</td>
<td>{% if log.error %}{{log.error}}{% endif %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View File

@ -39,7 +39,8 @@ def log_view():
logs = client.db.logs.find().sort('$natural', -1).skip(offset).limit(size) logs = client.db.logs.find().sort('$natural', -1).skip(offset).limit(size)
return flask.render_template('logs.html', logs=logs, return flask.render_template('logs.html', logs=logs,
prev_offset=prev_offset, prev_offset=prev_offset,
next_offset=next_offset) next_offset=next_offset,
offset=offset)
@app.route('/tracked/') @app.route('/tracked/')