Queries

{{#if not_https}}
{{fa-icon "warning"}} {{i18n "explorer.https_warning"}}
{{/if}}
{{combo-box valueAttribute="id" value=selectedQueryId nameProperty="listName" content=content castInteger="true" nameChanges="true"}} {{d-button action="showCreate" icon="plus" class="no-text"}} {{d-button action="importQuery" label="explorer.import.label" icon="upload"}}
{{#if showCreate}}
{{text-field value=newQueryName placeholderKey="explorer.create_placeholder"}} {{d-button action="create" label="explorer.create" icon="plus" class="btn-primary"}}
{{/if}}
{{#if selectedItem.fake}} {{i18n "explorer.no_queries"}} {{i18n "explorer.no_queries_hook"}} {{else}}
{{#if selectedItem}}
{{#if editing}} {{text-field value=selectedItem.name}} {{else}}

{{selectedItem.name}}

{{d-button action="editName" icon="pencil" class="no-text btn-small"}} {{/if}}
{{#if editing}} {{textarea value=selectedItem.description}} {{else}} {{selectedItem.description}} {{/if}}
{{ace-editor content=selectedItem.sql mode="sql" stashSelf=editor}}
{{explorer-schema schema=schema}}
{{d-button action="save" label="explorer.save" disabled=saveDisabled class="btn-primary"}} {{d-button action="download" label="explorer.export" disabled=runDisabled icon="download"}}
{{#if selectedItem.destroyed}} {{d-button action="recover" class="" icon="undo" label="explorer.recover"}} {{else}} {{d-button action="discard" class="btn-danger" icon="undo" label="explorer.undo" disabled=saveDisabled}} {{d-button action="destroy" class="btn-danger" icon="trash" label="explorer.delete"}} {{/if}}
{{/if}}
{{#if selectedItem.param_names}}
{{d-button action="saveDefaults" label="explorer.save_params" type="button"}} {{d-button action="resetParams" label="explorer.reset_params" type="button"}}
{{#each selectedItem.param_names as |pname|}}
{{param-field params=selectedItem.params pname=pname}} {{pname}}
{{/each}}
{{/if}}
{{#if runDisabled}} {{#if saveDisabled}} {{d-button label="explorer.run" disabled="true" class="btn-primary"}} {{else}} {{d-button action="saverun" label="explorer.saverun"}} {{/if}} {{else}} {{d-button action="run" label="explorer.run" disabled=runDisabled class="btn-primary" type="submit"}} {{/if}}

{{/if}} {{conditional-loading-spinner condition=loading}} {{#unless selectedItem.fake}} {{#if results}}
{{#if showResults}} {{query-result query=selectedItem content=results}} {{else}} {{#each results.errors as |err|}}
{{~err}}
{{/each}} {{/if}}
{{/if}} {{/unless}}