- {{#each selectedItem.param_info as |pinfo|}}
- {{param-input params=selectedItem.params info=pinfo}}
+ {{#if showCreate}}
+
+ {{text-field value=newQueryName placeholderKey="explorer.create_placeholder"}}
+ {{d-button action="create" label="explorer.create" icon="plus" class="btn-primary"}}
+
+ {{/if}}
+
+ {{#if othersDirty}}
+
+ {{fa-icon "warning"}}
+ {{i18n "explorer.others_dirty"}}
+
+ {{/if}}
+
+
+
+ {{#if selectedItem.fake}}
+ {{i18n "explorer.no_queries"}}
{{i18n "explorer.no_queries_hook"}}
+ {{else}}
+
+ {{#if selectedItem}}
+ {{#if editing}}
+
+ {{text-field value=selectedItem.name}}
+
+
+ {{textarea value=selectedItem.description}}
+
+ {{else}}
+
+
{{selectedItem.name}}
+ {{d-button action="editName" icon="pencil" class="no-text btn-small"}}
+
+
+ {{selectedItem.description}}
+
+ {{/if}}
+
+ {{! the SQL editor will show the first time you }}
+ {{#if everEditing}}
+
+
+
+ {{explorer-schema schema=schema hideSchema=hideSchema}}
+
+
+
+ {{ace-editor content=selectedItem.sql mode="sql"}}
+
+
+
+
+ {{else}}
+
+ {{hljs-code-view value=selectedItem.sql codeClass="sql"}}
+
+ {{/if}}
+
+
+
+
+
+ {{#if everEditing}}
+ {{d-button action="save" label="explorer.save" disabled=saveDisabled class="btn-primary"}}
+ {{else}}
+ {{d-button action="editName" label="explorer.edit" icon="pencil" class="btn-primary"}}
+ {{/if}}
+ {{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}}
+ {{#if everEditing}}
+ {{d-button action="discard" class="btn-danger" icon="undo" label="explorer.undo" disabled=saveDisabled}}
+ {{/if}}
+ {{d-button action="destroy" class="btn-danger" icon="trash" label="explorer.delete"}}
+ {{/if}}
+
+
+ {{/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}}
- {{#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}}
-
-
+ {{/unless}}
+
+
-
{{/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}}
-
-
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 393c7c3..8e2d007 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -22,6 +22,7 @@ en:
no_semicolons: "Remove the semicolons from the query."
dirty: "You must save the query before running."
explorer:
+ admins_only: "The data explorer is only available to admins."
title: "Data Explorer"
create: "Create New"
create_placeholder: "Query name..."