{% extends g.theme.master %}
{% do g.register_app_css('css/tracker.css') %}
{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Search{% endblock %}
{% block header %}Search {{c.app.config.options.mount_point}}: {{q}}{% endblock %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
{% endblock %}
{% block actions %}
{% if allow_edit and count != 0 %}
<a href="{{tg.url(c.app.url+'edit/', dict(q=q, limit=limit, sort=sort))}}" title="Bulk Edit"><b data-icon="p" class="ico"></b></a>
{% endif %}
{% endblock %}
{% if q and h.has_artifact_access('save_searches')() %}
{% block edit_box %}
<div class="editbox" style="display:none">
{{c.bin_form.display(
value=dict(summary=q,terms=q,sort=sort),
action=c.project.url()+'admin/'+c.app.config.options.mount_point+'/bins/save_bin'
)}}
</div>
{% endblock %}
{% endif %}
{% block content %}
<div class="grid-19">
<form method="GET" action=".">
<input type="text" name="q" value="{{q}}" style="width: 525px; float: left; margin-right: .5em">
<input type="submit" value="Search"/>
</form>
{% if q and h.has_artifact_access('save_searches')() %}
<input type="button" value="Save Search" id="save_search"/>
{% endif %}
</div>
<div style="clear:both"></div>
{{c.ticket_search_results.display(solr_error=solr_error,
count=count,
limit=limit,
query=q,
tickets=tickets,
sortable_custom_fields=sortable_custom_fields,
columns=columns,
page=page,
sort=sort)}}
{% endblock %}
{% block extra_js %}
{% if q and h.has_artifact_access('save_searches')() %}
<script type="text/javascript">
$('#save_search').click(function(){
$('div.editbox').show();
});
$('#cancel_new_bin').click(function(){
$('div.editbox').hide();
});
</script>
{% endif %}
{% endblock %}