{% extends 'jinja_master/master.html' %}
{% 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 %}
{% 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 %}
<form method="GET" action=".">
{{c.auto_resize_textarea.display(name='q', value=q,
attrs={'style':'height:1em; width: 425px; 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 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,
page=page,
sort=sort)}}
{% if allow_edit and count != 0 %}
<a href="{{tg.url('../edit/', dict(q=q, limit=limit, sort=sort))}}" class="btn">Edit All</a>
{% endif %}
{% 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 %}