{% extends "template/template.html" %}
{% block title%}Event #{{e.id}}{% endblock %}
{% block content %}
<h1><A HREF="/fm/">Fault Management:</A> Event #{{e.id}}</h1>
<TABLE BORDER="0">
    <TR><TD><B>Managed Object:</B></TD><TD>{{e.managed_object}}</TD></TR>
    <TR><TD><B>Class:</B></TD><TD>{{e.event_class}}</TD></TR>
    <TR><TD><B>Priority:</B></TD><TD>{{e.event_priority}}</TD></TR>
    <TR><TD><B>Category:</B></TD><TD>{{e.event_category}}</TD></TR>
    <TR><TD><B>Status:</B></TD><TD>{{e.status}}</TD></TR>
    <TR><TD><B>Time:</B></TD><TD>{{e.timestamp}}</TD</TR>
</TABLE>
<BR/>
<B>Subject:</B> {{e.subject}}<BR/>
<PRE STYLE="border: 1px solid #CCCCCC; padding: 8px">{{e.body}}</PRE>

<h2>Variables:</h2>
<TABLE BORDER='0'>
    {% for ed in e.eventdata_set.all %}
    <TR><TD>{{ed.type}}</TD><TD>{{ed.key}}</TD><TD>{{ed.value}}</TD></TR>
    {% endfor %}
</TABLE>

<h2>History:</h2>
<TABLE BORDER="0">
    {% for l in e.eventlog_set.all %}
    <TR><TD>{{l.timestamp}}</TD><TD>{{l.from_status}}</TD><TD>{{l.to_status}}</TD><TD>{{l.message}}</TD></TR>
    {% endfor %}
</TABLE>

{%if e.repeats %}
<H2>Previous occurences:</H2>
<TABLE BORDER="0">
{% for r in e.eventrepeat_set.all %}
<TR><TD>{{r.timestamp}}</TD></TR>
{% endfor %}
</TABLE>
{% endif %}
<BR/>

{% ifequal e.status 'A' %}<A HREF="/fm/{{e.id}}/status/close/" class="addlink">Close</A>{% endifequal %}
{% ifequal e.status 'C' %}<A HREF="/fm/{{e.id}}/status/open/" class="addlink">Open</A>{% endifequal %}

<A HREF="/fm/{{e.id}}/status/reclassify/" class="addlink">Re-Classify</A>
<A HREF="/fm/{{e.id}}/create_rule/"class="addlink">Create Rule</A>
{%endblock%}