diff --git a/app/views/blazer/queries/_form.html.erb b/app/views/blazer/queries/_form.html.erb new file mode 100644 index 0000000..22a19b2 --- /dev/null +++ b/app/views/blazer/queries/_form.html.erb @@ -0,0 +1,250 @@ +<% if @query.errors.any? %> +
<%= @query.errors.full_messages.first %>
+<% end %> + +
+ <%= form_for @query, url: (@query.persisted? ? query_path(@query, params: variable_params(@query)) : queries_path(params: variable_params(@query))), html: {autocomplete: "off"} do |f| %> +
+
+
+ <%= f.hidden_field :statement %> +
+
<%= @query.statement %>
+
+
+
+
+ <%= link_to t('.back'), :back %> + <%= t('.docs') %> + <%= t('.schema') %> +
+ + <%= f.select :data_source, Blazer.data_sources.values.select { |ds| q = @query.dup; q.data_source = ds.id; q.editable?(blazer_user) }.map { |ds| [ds.name, ds.id] }, {}, class: ("hide" if Blazer.data_sources.size <= 1), style: "width: 140px;" %> +
+ +
+ <%= t('.run') %> + <%= t('.cancel') %> +
+
+
+
+ <%= f.label :name %> + <%= f.text_field :name, class: "form-control" %> +
+
+ <%= f.label :description %> + <%= f.text_area :description, placeholder: t('.optional'), style: "height: 80px;", class: "form-control" %> +
+
+ <%= f.submit "For Enter Press", class: "hide" %> + <% if @query.persisted? %> + <%= link_to t('.delete'), query_path(@query), method: :delete, "data-confirm" => t('.are_you_sure'), class: "btn btn-danger" %> + <%= f.submit t('.fork'), class: "btn btn-info" %> + <% end %> + <%= f.submit @query.persisted? ? t('.update') : t('.create'), class: "btn btn-success" %> +
+ <% if @query.persisted? %> + <% dashboards_count = @query.dashboards.count %> + <% checks_count = @query.checks.count %> + <% words = [] %> + <% words << pluralize(dashboards_count, "dashboard") if dashboards_count > 0 %> + <% words << pluralize(checks_count, "check") if checks_count > 0 %> + <% if words.any? %> +
+ <%= t('.part_of', words: words.to_sentence) %> +
+ <% end %> + <% end %> +
+
+ <% end %> + +
+

<%= t('.loading') %>

+
+
+
+ + diff --git a/app/views/blazer/queries/home.html.erb b/app/views/blazer/queries/home.html.erb new file mode 100644 index 0000000..58e2686 --- /dev/null +++ b/app/views/blazer/queries/home.html.erb @@ -0,0 +1,166 @@ +
+ + + + + + + <% if Blazer.user_class %> + + <% end%> + + + + + + <% if Blazer.user_class %> + + <% end %> + + +
<%= t('.name') %><%= t('.mastermind') %>
+ {{ query.name }} + {{ query.vars }} + {{ query.creator }}
+ +

<%= t('.loading') %>

+
+ + diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 0000000..03857ea --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,42 @@ +es: + activerecord: + models: + query: Consulta + attributes: + query: + name: Nombre + description: Descripción + blazer: + queries: + home: + all: Todas + viewed: Vistas + mine: Mías + new_query: Crear consulta + toggle_dropdown: Desplegar opciones + checks: Alertas + uploads: Subida de archivos + new_dashboard: Crear resumen + new_check: Crear alerta + placeholder: Empieza a escribir para encontrar + name: Nombre + mastermind: Editorx + loading: Cargando... + new: + new_query: Crear consulta + form: + back: Volver + docs: Documentación + schema: Esquema + preview_table: Previsualizar la tabla + run: Resultados + cancel: Cancelar + optional: Opcional + delete: Eliminar + are_you_sure: ¿Confirmas que quieres eliminar esta consulta? + fork: Clonar + update: Guardar cambios + create: Guardar + part_of: Es parte de %{words}. Cualquier cambio puede afectarlas. + loading: Cargando... +