{% extends "../base.html" %}

{% block content1 %}                                                
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td valign="top" class="textContent">

            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td align="center" valign="top" class="status_{{level}}">
                        <{{ alert.name }}>
                        {% if target %} {{ target }}: {% end %}
                        {{ level.upper() }}
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" class="statusValue">
                        {{ alert.convert(value) }}
                    </td>
                </tr>
            </table>

        </td>
    </tr>
</table>
{% end %}

{% block content2 %}
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td align="center" valign="top" class="textContent">
            <h3>{{ dt.datetime.now().strftime('%H:%M %d/%m/%Y') }}: {{ target or alert.query }}</h3>
            <br />
            <img src="{{alert.get_graph_url(alert.query)}}" alt="graph"/>
        </td>
    </tr>
    <tr>
        <td align="center" valign="top" class="bottomShim">
            <table border="0" cellpadding="0" cellspacing="0" width="260" class="emailButton">
                <tr>
                    <td align="center" valign="middle" class="buttonContent">
                        <a href="{{alert.get_graph_url(alert.query)}}" target="_blank">Open the graph</a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
{% end %}
