{% extends "template/template.html" %}
{% block title%}Event #{{e.id}}{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><A HREF="/">Home</A> &rsaquo; <A HREF="/fm/">Fm</A> &rsaquo; <A HREF="/fm/">Events</A> &rsaquo; {{e.id}}</div>{% endblock %}
{% block object-tools %}
<ul class="object-tools">
    {% ifequal e.status 'A' %}<LI><A HREF="/fm/{{e.id}}/status/close/" class="addlink">Close</A></LI>{% endifequal %}
    {% ifequal e.status 'C' %}<LI><A HREF="/fm/{{e.id}}/status/open/" class="addlink">Open</A></LI>{% endifequal %}
    <LI><A HREF="/fm/{{e.id}}/status/reclassify/" class="addlink">Re-Classify</A></LI>
    <LI><A HREF="/fm/{{e.id}}/create_rule/"class="addlink">Create Rule</A></LI>
    <LI><A HREF="/fm/{{e.id}}/create_postprocessing_rule/"class="addlink">Create Post-Processing Rule</A></LI>
</ul>
{% endblock %}
{% block content %}
<ul class="object-tools">
    {% ifequal e.status 'A' %}<LI><A HREF="/fm/{{e.id}}/status/close/" class="addlink">Close</A></LI>{% endifequal %}
    {% ifequal e.status 'C' %}<LI><A HREF="/fm/{{e.id}}/status/open/" class="addlink">Open</A></LI>{% endifequal %}
    <LI><A HREF="/fm/{{e.id}}/status/reclassify/" class="addlink">Re-Classify</A></LI>
    <LI><A HREF="/fm/{{e.id}}/create_rule/"class="addlink">Create Rule</A></LI>
    <LI><A HREF="/fm/{{e.id}}/create_postprocessing_rule/"class="addlink">Create Post-Processing Rule</A></LI>
</ul>

<h1>Event #{{e.id}}: {{e.subject}}</h1>
<DIV CLASS="module">
    <TABLE WIDTH="100%">
        <CAPTION><A CLASS="section">Common</A></CAPTION>
        <TR><TD STYLE="width: 200px"><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>
</DIV>

<DIV CLASS="module">
    <TABLE WIDTH="100%">
        <CAPTION><A CLASS="section">Subject: {{e.subject}}</A></CAPTION>
        <TR><TD><PRE>{{e.body}}</PRE></TD></TR>
    </TABLE>
</DIV>

<DIV CLASS="module">
    <TABLE WIDTH="100%">
        <CAPTION><A CLASS="section">Event Data</A></CAPTION>
        {% for ed in e.eventdata_set.all %}
            <TR><TD>{{ed.type}}</TD><TD STYLE="width: 400px">{{ed.key}}</TD><TD>{{ed.value}}</TD></TR>
        {% endfor %}
    </TABLE>
</DIV>

<DIV CLASS="module">
<TABLE WIDTH="100%">
    <CAPTION><A CLASS="section">Event History</A></CAPTION>
    {% for l in e.eventlog_set.all %}
        <TR><TD STYLE="width: 200px">{{l.timestamp}}</TD><TD>{{l.from_status}}</TD><TD>{{l.to_status}}</TD><TD>{{l.message}}</TD></TR>
    {% endfor %}
</TABLE>
</DIV>

{%if e.repeats %}
<DIV CLASS="module">
<TABLE WIDTH="100%">
    <CAPTION><A CLASS="section">Previous occurences</A></CAPTION>
    {% for r in e.eventrepeat_set.all %}
        <TR><TD>{{r.timestamp}}</TD></TR>
    {% endfor %}
</TABLE>
{% endif %}

{%endblock%}