<%page args="job, event, request, options" />

<% search      = event.fields['_search']                          %>
<% count       = event.fields['_count']                           %>
<% tags        = event.fields.get('_tags','')                     %>
<% example     = event.fields.get('_example','No example')        %>
<% coverage    = event.fields.get('_coverage','0')                %>
<% depth       = event.fields.get('_depth','0')                   %>
<% cooccurring = event.fields.get('_cooccurring-eventtypes','')   %>
<% et_percent  = event.fields.get('_percent-with-eventtypes','')  %>
<% padding     = "%spx" % (30 * int(str(depth))) %>

<span id="eventTypeForm"/>


<div class="row" style="margin-left: ${padding}">

    <big><b>${search|h}</b></big>

    <div class="barGraphWrapper splClearfix">
        <div class="splBarGraph"><div class="splBarGraphBar" style="width: ${coverage}%;"/></div></div>
        <div class="splBarGraphValue">
          <b>coverage:</b> ${coverage}%
        </div>
    </div>

    <div class="splClearfix">
        <b>Example:</b> ${example|h}<br/>

        % if cooccurring != '':
        <b>cooccurring-eventtypes:</b> ${cooccurring|h}
        % endif

        % if et_percent != '':
        <b>percent-with-eventtypes:</b> ${et_percent}
        % endif
        <b>count:</b> ${count}

        <br/>
        <a href="#" onclick="Splunk.Popup.createEventtypeForm($('.eventtypeForm')[0], 'Save Eventtype', '${search|h}', '${tags|h}');">Save</a>
         |
        <a target=_blank href='flashtimeline?q=search+${search|h}'">Test</a>
    </div>

</div><!-- /.row -->
