diff --git a/HISTORY.rst b/HISTORY.rst index 6f005225..0b53fb07 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,11 @@ This project adheres to `Semantic Versioning `_. `unreleased`_ changes --------------------- +`2.3.0`_ (2021-07-24) +--------------------- +* `#450`_: Added Russian translations. +* `#449`_: Translates expression for duration + `2.2.0`_ (2021-06-14) --------------------- * Updated docs theme to `furo`_ @@ -329,7 +334,8 @@ Initial Release .. _2.1.2: https://github.com/groveco/django-sql-explorer/compare/2.1.1...2.1.2 .. _2.1.3: https://github.com/groveco/django-sql-explorer/compare/2.1.2...2.1.3 .. _2.2.0: https://github.com/groveco/django-sql-explorer/compare/2.1.3...2.2.0 -.. _unreleased: https://github.com/groveco/django-sql-explorer/compare/2.2.0...master +.. _2.3.0: https://github.com/groveco/django-sql-explorer/compare/2.2.0...2.3.0 +.. _unreleased: https://github.com/groveco/django-sql-explorer/compare/2.3.0...master .. _#254: https://github.com/groveco/django-sql-explorer/pull/254 .. _#334: https://github.com/groveco/django-sql-explorer/pull/334 @@ -369,6 +375,8 @@ Initial Release .. _#442: https://github.com/groveco/django-sql-explorer/pull/442 .. _#444: https://github.com/groveco/django-sql-explorer/pull/444 .. _#445: https://github.com/groveco/django-sql-explorer/pull/445 +.. _#449: https://github.com/groveco/django-sql-explorer/pull/449 +.. _#450: https://github.com/groveco/django-sql-explorer/pull/450 .. _#269: https://github.com/groveco/django-sql-explorer/issues/269 .. _#288: https://github.com/groveco/django-sql-explorer/issues/288 @@ -382,4 +390,4 @@ Initial Release .. _#440: https://github.com/groveco/django-sql-explorer/issues/440 .. _#443: https://github.com/groveco/django-sql-explorer/issues/443 -.. _furo: https://github.com/pradyunsg/furo \ No newline at end of file +.. _furo: https://github.com/pradyunsg/furo diff --git a/README.rst b/README.rst index 08c98652..1a46631b 100644 --- a/README.rst +++ b/README.rst @@ -66,3 +66,14 @@ Sql Explorer is MIT licensed, and pull requests are welcome. **Snapshot query results to S3 & download as csv** .. image:: https://s3-us-west-1.amazonaws.com/django-sql-explorer/2019_snapshots.png + + +Alternatives +------------ + +* `django-sql-dashboard`_: provides an authenticated interface for executing read-only SQL queries directly against your PostgreSQL database, bringing a useful subset of `Datasette`_ to Django. + + + +.. _django-sql-dashboard: https://github.com/simonw/django-sql-dashboard +.. _Datasette : https://datasette.io/ diff --git a/explorer/__init__.py b/explorer/__init__.py index 100849d8..41ecc3b2 100644 --- a/explorer/__init__.py +++ b/explorer/__init__.py @@ -1,6 +1,6 @@ __version_info__ = { 'major': 2, - 'minor': 2, + 'minor': 3, 'micro': 0, 'releaselevel': 'final', 'serial': 0 diff --git a/explorer/locale/ru/LC_MESSAGES/django.mo b/explorer/locale/ru/LC_MESSAGES/django.mo index d902a363..ac00d263 100644 Binary files a/explorer/locale/ru/LC_MESSAGES/django.mo and b/explorer/locale/ru/LC_MESSAGES/django.mo differ diff --git a/explorer/locale/ru/LC_MESSAGES/django.po b/explorer/locale/ru/LC_MESSAGES/django.po index 40b9e3d5..97baaaa1 100644 --- a/explorer/locale/ru/LC_MESSAGES/django.po +++ b/explorer/locale/ru/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-07-24 10:26-0500\n" +"POT-Creation-Date: 2021-07-24 16:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,8 +20,8 @@ msgstr "" "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" "%100>=11 && n%100<=14)? 2 : 3);\n" -#: explorer/apps.py:10 explorer/templates/explorer/base.html:10 -#: explorer/templates/explorer/base.html:35 +#: explorer/apps.py:10 explorer/templates/explorer/base.html:9 +#: explorer/templates/explorer/base.html:34 #: explorer/templates/explorer/fullscreen.html:8 msgid "SQL Explorer" msgstr "SQL Навигатор" @@ -39,8 +39,8 @@ msgstr "" "этого запроса.Если не использовать, будет использоваться соединение по " "умолчанию" -#: explorer/models.py:60 explorer/templates/explorer/query_list.html:49 -#: explorer/templates/explorer/querylog_list.html:33 +#: explorer/models.py:60 explorer/templates/explorer/query_list.html:22 +#: explorer/templates/explorer/query_list.html:57 msgid "Query" msgstr "Запрос" @@ -48,32 +48,32 @@ msgstr "Запрос" msgid "Queries" msgstr "Запросы" -#: explorer/templates/explorer/fullscreen.html:16 -#: explorer/templates/explorer/play.html:7 -#: explorer/templates/explorer/query.html:6 -#: explorer/templates/explorer/query.html:16 +#: explorer/templates/explorer/fullscreen.html:20 +#: explorer/templates/explorer/play.html:6 +#: explorer/templates/explorer/query.html:7 +#: explorer/templates/explorer/query.html:26 #: explorer/templates/explorer/query_list.html:6 #: explorer/templates/explorer/querylog_list.html:6 msgid "New Query" msgstr "Новый запрос" -#: explorer/templates/explorer/fullscreen.html:39 -#: explorer/templates/explorer/preview_pane.html:81 +#: explorer/templates/explorer/fullscreen.html:46 +#: explorer/templates/explorer/preview_pane.html:106 msgid "Empty Resultset" msgstr "Результат запроса пуст" -#: explorer/templates/explorer/play.html:8 -#: explorer/templates/explorer/play.html:16 -#: explorer/templates/explorer/query.html:7 +#: explorer/templates/explorer/play.html:7 +#: explorer/templates/explorer/play.html:15 +#: explorer/templates/explorer/query.html:9 #: explorer/templates/explorer/query_list.html:7 #: explorer/templates/explorer/querylog_list.html:7 #: explorer/templates/explorer/querylog_list.html:23 -#: explorer/templates/explorer/querylog_list.html:33 +#: explorer/templates/explorer/querylog_list.html:41 msgid "Playground" msgstr "Полигон" -#: explorer/templates/explorer/play.html:9 -#: explorer/templates/explorer/query.html:10 +#: explorer/templates/explorer/play.html:8 +#: explorer/templates/explorer/query.html:14 #: explorer/templates/explorer/query_list.html:8 #: explorer/templates/explorer/querylog_list.html:8 msgid "Logs" @@ -87,107 +87,115 @@ msgstr "" "Полигон предназначен для экспериментов и написания специальных запросов. По " "умолчанию тут ничего не будет сохраняться" -#: explorer/templates/explorer/play.html:24 -#: explorer/templates/explorer/query.html:46 +#: explorer/templates/explorer/play.html:27 +#: explorer/templates/explorer/query.html:61 msgid "Connection" msgstr "Соединение" -#: explorer/templates/explorer/play.html:39 +#: explorer/templates/explorer/play.html:42 msgid "Playground SQL" msgstr "Экспериментальный SQL" -#: explorer/templates/explorer/play.html:55 -#: explorer/templates/explorer/query.html:110 +#: explorer/templates/explorer/play.html:62 +#: explorer/templates/explorer/query.html:147 msgid "Refresh" msgstr "Обновить" -#: explorer/templates/explorer/play.html:58 -#: explorer/templates/explorer/play.html:68 -#: explorer/templates/explorer/query.html:98 -#: explorer/templates/explorer/query.html:115 +#: explorer/templates/explorer/play.html:65 +#: explorer/templates/explorer/play.html:77 +#: explorer/templates/explorer/query.html:127 +#: explorer/templates/explorer/query.html:154 msgid "Toggle Dropdown" msgstr "Включить выпадающий список" -#: explorer/templates/explorer/play.html:61 +#: explorer/templates/explorer/play.html:68 msgid "Save As New Query" msgstr "Сохранить как новый запрос" -#: explorer/templates/explorer/play.html:65 -#: explorer/templates/explorer/query.html:112 +#: explorer/templates/explorer/play.html:73 +#: explorer/templates/explorer/query.html:150 msgid "Download" msgstr "Скачать" -#: explorer/templates/explorer/play.html:75 -#: explorer/templates/explorer/query.html:107 +#: explorer/templates/explorer/play.html:85 +#: explorer/templates/explorer/query.html:141 msgid "Show Schema" msgstr "Показать схему базы" -#: explorer/templates/explorer/play.html:76 -#: explorer/templates/explorer/query.html:108 +#: explorer/templates/explorer/play.html:88 +#: explorer/templates/explorer/query.html:144 msgid "Hide Schema" msgstr "Скрыть схему" -#: explorer/templates/explorer/play.html:77 -#: explorer/templates/explorer/query.html:106 +#: explorer/templates/explorer/play.html:91 +#: explorer/templates/explorer/query.html:138 msgid "Format" msgstr "Отформатировать запрос" -#: explorer/templates/explorer/play.html:80 +#: explorer/templates/explorer/play.html:95 msgid "Playground Query" msgstr "Экспериментальный запрос" -#: explorer/templates/explorer/preview_pane.html:8 +#: explorer/templates/explorer/preview_pane.html:10 msgid "Preview" msgstr "Предпросмотр" -#: explorer/templates/explorer/preview_pane.html:9 +#: explorer/templates/explorer/preview_pane.html:16 msgid "Snapshots" msgstr "Варианты" -#: explorer/templates/explorer/preview_pane.html:10 -#: explorer/templates/explorer/preview_pane.html:112 +#: explorer/templates/explorer/preview_pane.html:23 +#: explorer/templates/explorer/preview_pane.html:139 msgid "Pivot" msgstr "Сводная таблица" -#: explorer/templates/explorer/preview_pane.html:19 +#: explorer/templates/explorer/preview_pane.html:38 #, python-format msgid "Execution time: %(duration)s ms" msgstr "Время выполнения: %(duration)s мс" -#: explorer/templates/explorer/preview_pane.html:28 +#: explorer/templates/explorer/preview_pane.html:46 +msgid "Showing" +msgstr "Отображение" + +#: explorer/templates/explorer/preview_pane.html:48 +msgid "First" +msgstr "Первый" + +#: explorer/templates/explorer/preview_pane.html:50 #, python-format msgid "of %(total_rows)s total rows." msgstr "из %(total_rows)s выбранных записей." -#: explorer/templates/explorer/query.html:9 +#: explorer/templates/explorer/query.html:12 msgid "Query Detail" msgstr "Подробности запроса" -#: explorer/templates/explorer/query.html:19 +#: explorer/templates/explorer/query.html:33 msgid "History" msgstr "История" -#: explorer/templates/explorer/query.html:39 +#: explorer/templates/explorer/query.html:54 msgid "Title" msgstr "Название" -#: explorer/templates/explorer/query.html:61 +#: explorer/templates/explorer/query.html:77 msgid "Description" msgstr "Описание" -#: explorer/templates/explorer/query.html:95 +#: explorer/templates/explorer/query.html:124 msgid "Save & Run" msgstr "Сохранить и запустить" -#: explorer/templates/explorer/query.html:103 +#: explorer/templates/explorer/query.html:133 msgid "Save Only" msgstr "Сохранить" -#: explorer/templates/explorer/query.html:136 +#: explorer/templates/explorer/query.html:176 msgid "Snapshot" msgstr "Вариант" -#: explorer/templates/explorer/query.html:142 +#: explorer/templates/explorer/query.html:182 #, python-format msgid "" "Avg. execution: %(avg_duration|floatformat:2)sms. Query created by " @@ -196,54 +204,54 @@ msgstr "" "Среднее время выполнения: %(avg_duration|floatformat:2)s мс. Запрос в " "%(created)s. от «%(user_email)s»" -#: explorer/templates/explorer/query_confirm_delete.html:6 +#: explorer/templates/explorer/query_confirm_delete.html:7 #, python-format -msgid "Are you sure you want to delete \"%(title)s\" ?" +msgid "Are you sure you want to delete \"%(title)s\"?" msgstr "Вы уверены в удалении «%(title)s»?" -#: explorer/templates/explorer/query_list.html:14 +#: explorer/templates/explorer/query_list.html:15 #, python-format -msgid " Your %(qlen)s Most Recently Run " -msgstr " Ваши последние запуски запросов, их %(qlen)s" +msgid "Your %(qlen)s Most Recently Run" +msgstr "Ваши последние запуски запросов, их %(qlen)s" -#: explorer/templates/explorer/query_list.html:19 +#: explorer/templates/explorer/query_list.html:23 msgid "Last Run" msgstr "Последний запуск" -#: explorer/templates/explorer/query_list.html:40 +#: explorer/templates/explorer/query_list.html:48 msgid "All Queries" msgstr "Все запросы" -#: explorer/templates/explorer/query_list.html:43 +#: explorer/templates/explorer/query_list.html:51 #: explorer/templates/explorer/schema.html:10 msgid "Search" msgstr "Поиск" -#: explorer/templates/explorer/query_list.html:50 +#: explorer/templates/explorer/query_list.html:58 msgid "Created" msgstr "Создан" -#: explorer/templates/explorer/query_list.html:52 +#: explorer/templates/explorer/query_list.html:60 msgid "Email" msgstr "Емейл" -#: explorer/templates/explorer/query_list.html:54 +#: explorer/templates/explorer/query_list.html:62 msgid "CSV" msgstr "CSV" -#: explorer/templates/explorer/query_list.html:56 +#: explorer/templates/explorer/query_list.html:64 msgid "Play" msgstr "Запустить" -#: explorer/templates/explorer/query_list.html:57 +#: explorer/templates/explorer/query_list.html:65 msgid "Delete" msgstr "Удалить" -#: explorer/templates/explorer/query_list.html:59 +#: explorer/templates/explorer/query_list.html:67 msgid "Run Count" msgstr "Число запусков" -#: explorer/templates/explorer/query_list.html:79 +#: explorer/templates/explorer/query_list.html:87 #, python-format msgid "by %(cuser)s" msgstr " пользователем «%(cuser)s»" @@ -265,19 +273,20 @@ msgstr "Запущено пользователем" msgid "Duration" msgstr "Длительность" -#: explorer/templates/explorer/querylog_list.html:21 -msgid "SQL" -msgstr "SQL" - #: explorer/templates/explorer/querylog_list.html:22 msgid "Query ID" msgstr "ID запроса" -#: explorer/templates/explorer/querylog_list.html:34 +#: explorer/templates/explorer/querylog_list.html:36 +#, python-format +msgid "Query %(query_id)s" +msgstr "пользователем «%(query_id)s»" + +#: explorer/templates/explorer/querylog_list.html:48 msgid "Open" msgstr "Открыть" -#: explorer/templates/explorer/querylog_list.html:47 +#: explorer/templates/explorer/querylog_list.html:63 #, python-format msgid "Page %(pnum)s of %(anum)s." msgstr "Страница %(pnum)s из %(anum)s." @@ -286,19 +295,19 @@ msgstr "Страница %(pnum)s из %(anum)s." msgid "Schema" msgstr "Схема" -#: explorer/templates/explorer/schema.html:14 +#: explorer/templates/explorer/schema.html:15 msgid "Collapse All" msgstr "Свернуть все" -#: explorer/templates/explorer/schema.html:17 +#: explorer/templates/explorer/schema.html:20 msgid "Expand All" msgstr "Развернуть все" -#: explorer/templates/explorer/schema_building.html:7 +#: explorer/templates/explorer/schema_building.html:6 msgid "Schema is building..." msgstr "Строится схема…" -#: explorer/templates/explorer/schema_building.html:8 +#: explorer/templates/explorer/schema_building.html:7 msgid "Please wait a minute, and refresh." msgstr "Подождите минутку и обновите." @@ -306,6 +315,9 @@ msgstr "Подождите минутку и обновите." msgid "Query saved." msgstr "Запрос сохранен." +#~ msgid "SQL" +#~ msgstr "SQL" + #~ msgid "Avg. execution:" #~ msgstr "Среднее время запроса" diff --git a/explorer/templates/explorer/base.html b/explorer/templates/explorer/base.html index 29f6bebd..161f6ae5 100644 --- a/explorer/templates/explorer/base.html +++ b/explorer/templates/explorer/base.html @@ -2,7 +2,6 @@ - @@ -30,34 +29,34 @@
{% block sql_explorer_navbar %} {% endblock %} {% block sql_explorer_footer %}
-
+

Powered by django-sql-explorer from Grove Collaborative. Rendered at {% now "SHORT_DATETIME_FORMAT" %}

-
+
{% endblock %} diff --git a/explorer/templates/explorer/export_buttons.html b/explorer/templates/explorer/export_buttons.html index a7fd7a37..1a49d8fa 100644 --- a/explorer/templates/explorer/export_buttons.html +++ b/explorer/templates/explorer/export_buttons.html @@ -1,9 +1,9 @@ {% for key, name in exporters %} {% if query and query.id %} {% if query.params %} -
  • {{ name }}
  • +
  • {{ name }}
  • {% else %} -
  • {{ name }}
  • +
  • {{ name }}
  • {% endif %} {% else %}
  • diff --git a/explorer/templates/explorer/fullscreen.html b/explorer/templates/explorer/fullscreen.html index 6e3c5572..2d50b43e 100644 --- a/explorer/templates/explorer/fullscreen.html +++ b/explorer/templates/explorer/fullscreen.html @@ -1,4 +1,4 @@ -{% load static i18n %} +{% load i18n static %} @@ -9,36 +9,43 @@ - -

    {% if query %}{{ query.title }}{% if shared %}  shared{% endif %}{% else %}{% trans "New Query" %}{% endif %}

    - - - - {% for h in headers %} - - {% endfor %} - - - - {% if data %} - {% for row in data %} - - {% for i in row %} - {% if unsafe_rendering %} - - {% else %} - - {% endif %} - {% endfor %} - - {% endfor %} +{% spaceless %} +

    + {% if query %} + {{ query.title }}{% if shared %}  shared{% endif %} {% else %} -

    + {% trans "New Query" %} {% endif %} - + +{% endspaceless %} +
    {{ h }}
    {% autoescape off %}{{ i }}{% endautoescape %}{{ i }}
    {% trans "Empty Resultset" %}
    + + + {% for h in headers %} + + {% endfor %} + + + + {% if data %} + {% for row in data %} + + {% for i in row %} + {% if unsafe_rendering %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + {% else %} + + {% endif %} +
    {{ h }}
    {% autoescape off %}{{ i }}{% endautoescape %}{{ i }}
    {% trans "Empty Resultset" %}
    diff --git a/explorer/templates/explorer/params.html b/explorer/templates/explorer/params.html index 17d8cfd1..8be655a1 100644 --- a/explorer/templates/explorer/params.html +++ b/explorer/templates/explorer/params.html @@ -1,15 +1,15 @@ {% if params %} {% endif %} diff --git a/explorer/templates/explorer/play.html b/explorer/templates/explorer/play.html index 55fc6f61..f260f951 100644 --- a/explorer/templates/explorer/play.html +++ b/explorer/templates/explorer/play.html @@ -1,12 +1,11 @@ {% extends "explorer/base.html" %} - {% load explorer_tags i18n %} {% block sql_explorer_navlinks %} {% if can_change %} -
  • {% trans "New Query" %}
  • -
  • {% trans "Playground" %}
  • -
  • {% trans "Logs" %}
  • +
  • {% trans "New Query" %}
  • +
  • {% trans "Playground" %}
  • +
  • {% trans "Logs" %}
  • {% endif %} {% endblock %} @@ -14,36 +13,44 @@

    {% trans "Playground" %}

    -

    {% trans "The playground is for experimenting and writing ad-hoc queries. By default, nothing you do here will be saved." %}

    +

    + {% blocktrans trimmed %} + The playground is for experimenting and writing ad-hoc queries. By default, nothing you do here will be saved. + {% endblocktrans %} +

    {% csrf_token %} {% if error %}
    {{ error|escape }}
    {% endif %} {% if form.connections|length > 1 %} -
    - -
    - {{ form.connection }} +
    + +
    + {{ form.connection }} +
    -
    {% else %} - {# still need to submit the connection, just hide the UI element #} - + {# still need to submit the connection, just hide the UI element #} + {% endif %}
    -
    -
    - {% trans "Playground SQL" %} -
    - {% if ql_id %} -
    - +
    +
    + {% trans "Playground SQL" %}
    - {% endif %} -
    + {% if ql_id %} +
    + + + + + +
    + {% endif %} +
    @@ -51,30 +58,38 @@

    {% trans "Playground" %}

    -
    - - + +
    +
    + + + +
    + + - -
    -
    - - + - -
    - - - -
    diff --git a/explorer/templates/explorer/preview_pane.html b/explorer/templates/explorer/preview_pane.html index 3bfb6b23..b7496fea 100644 --- a/explorer/templates/explorer/preview_pane.html +++ b/explorer/templates/explorer/preview_pane.html @@ -5,37 +5,59 @@
    -
    -
    - {% if data %}# {% endif %} - {% blocktrans with duration=duration|floatformat:2 %}Execution time: {{ duration }} ms{% endblocktrans %} -
    -
    - - {% if rows > total_rows %} - {% trans Showing %} - {% else %} - {% trans First %} - {% endif %} - {% blocktrans %}of {{ total_rows }} total rows.{% endblocktrans %} - - - - - - - - +
    +
    + {% if data %} + #  + {% endif %} + + {% blocktrans trimmed with duration=duration|floatformat:2 %} + Execution time: {{ duration }} ms + {% endblocktrans %} + +
    +
    + + {% if rows > total_rows %} + {% trans "Showing" %}  + {% else %} + {% trans "First" %}  + {% endif %} + {% blocktrans %}of {{ total_rows }} total rows.{% endblocktrans %} + + + + + + + + +
    -
    @@ -47,38 +69,43 @@ {% endfor %} - - {% for h in headers %} - - {% endfor %} + + {% for h in headers %} + + {% endfor %} - {% if data %} {% for row in data %} - - - {% for i in row %} - {% if unsafe_rendering %} - - {% else %} - - {% endif %} - {% endfor %} - + + + {% for i in row %} + {% if unsafe_rendering %} + + {% else %} + + {% endif %} + {% endfor %} + {% endfor %} {% else %} - + + + {% endif %}
    - {% if h.summary %} - -
    - {% for label, value in h.summary.stats.items %} -
    {{ label }}: {{ value }}
    - {% endfor %} -
    - {% endif %} -
    + {% if h.summary %} + +
    + {% for label, value in h.summary.stats.items %} +
    {{ label }}: {{ value }}
    + {% endfor %} +
    + {% endif %} +
    {{ forloop.counter0 }}{% autoescape off %}{{ i }}{% endautoescape %}{{ i }}
    {{ forloop.counter0 }} + {% autoescape off %}{{ i }}{% endautoescape %} + {{ i }}
    {% blocktrans %}Empty Resultset{% endblocktrans %}
    + {% trans "Empty Resultset" %} +
    @@ -92,36 +119,40 @@ {{ snapshots|length }} Snapshots (oldest first)
    -

    -

    -

    +

    +

    +

    {% endif %} {% if data %} -
    -
    -
    -
    -
    - {% blocktrans %}Pivot{% endblocktrans %} -
    -
    - -
    +
    +
    +
    +
    +
    + {% trans "Pivot" %} +
    +
    + + + + + +
    +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    - {% endif %} + {% endif %}
    diff --git a/explorer/templates/explorer/query.html b/explorer/templates/explorer/query.html index 090f17a3..974ff18b 100644 --- a/explorer/templates/explorer/query.html +++ b/explorer/templates/explorer/query.html @@ -3,20 +3,35 @@ {% block sql_explorer_navlinks %} {% if can_change %} - {% trans "New Query" %} -
  • {% trans "Playground" %}
  • + + {% trans "New Query" %} + +
  • {% trans "Playground" %}
  • + {% endif %} + {% if query %} +
  • {% trans "Query Detail" %}
  • {% endif %} - {% if query %}
  • {% trans "Query Detail" %}
  • {% endif %}
  • {% trans "Logs" %}
  • {% endblock %} {% block sql_explorer_content %}
    -

    {% if query %}{{ query.title }}{% if shared %}  shared{% endif %}{% else %}{% trans "New Query" %}{% endif %}

    + {% spaceless %} +

    + {% if query %} + {{ query.title }} + {% if shared %}  shared{% endif %} + {% else %} + {% trans "New Query" %} + {% endif %} +

    + {% endspaceless %} {% if query %} {% endif %} {% if message %} @@ -36,92 +51,115 @@

    {% if query %}{{ query.title }}{% if shared %}  shared{{ error|escape }}

    {% endfor %}{% endif %} - +
    - {% if form.connections|length > 1 and can_change %} -
    -
    - -
    + {% if form.connections|length > 1 and can_change %} +
    +
    + +
    {{ form.connection }} -
    - {% else %} +
    + {% else %} {# still need to submit the connection, just hide the UI element #} - {% endif %} + {% endif %}
    {% if form.description.errors %}
    {{ form.description.errors }}
    {% endif %} - +
    - +
    - {% if form.sql.errors %}{% for error in form.sql.errors %} -
    {{ error|escape }}
    - {% endfor %}{% endif %} + {% if form.sql.errors %} + {% for error in form.sql.errors %} +
    {{ error|escape }}
    + {% endfor %} + {% endif %}
    -
    -
    - SQL -
    -
    - {% if query %} - - - {% endif %} +
    +
    + SQL +
    +
    + {% if query %} + + + + + + + + + {% endif %} +
    -
    - +
    {% if params %} - {% include 'explorer/params.html' %} + {% include 'explorer/params.html' %} {% endif %}
    {% if can_change %}
    - - - + + +
    - - - + + + {% else %} - +
    - - - + + +
    {% endif %}
    -
    @@ -129,20 +167,24 @@

    {% if query %}{{ query.title }}{% if shared %}  shared

    + {% include 'explorer/preview_pane.html' %} +
    -
    - {% if query and can_change and tasks_enabled %} - {{ form.snapshot }} {% blocktrans %}Snapshot{% endblocktrans %} - {% endif %} -
    -
    - - {% if query.avg_duration %} - {% blocktrans with avg_duration=query.avg_duration user_email=form.created_by_user_email created=form.created_at_time %}Avg. execution: {{ avg_duration|floatformat:2 }}ms. Query created by {{ user_email }} on {{ created }}.{% endblocktrans %} - {% endif %} - -
    +
    + {% if query and can_change and tasks_enabled %} + {{ form.snapshot }} {% blocktrans %}Snapshot{% endblocktrans %} + {% endif %} +
    +
    + + {% if query.avg_duration %} + {% blocktrans trimmed with avg_duration=query.avg_duration user_email=form.created_by_user_email created=form.created_at_time %} + Avg. execution: {{ avg_duration|floatformat:2 }}ms. Query created by {{ user_email }} on {{ created }}. + {% endblocktrans %} + {% endif %} + +
    {% endblock %} diff --git a/explorer/templates/explorer/query_confirm_delete.html b/explorer/templates/explorer/query_confirm_delete.html index 4cb1d543..6091443c 100644 --- a/explorer/templates/explorer/query_confirm_delete.html +++ b/explorer/templates/explorer/query_confirm_delete.html @@ -1,9 +1,12 @@ {% extends "explorer/base.html" %} +{% load i18n %} {% block sql_explorer_content %}
    {% csrf_token %}
    - {% blocktrans with title=object.title %}Are you sure you want to delete "{{ title }}" ?{% endblocktrans %} + {% blocktrans trimmed with title=object.title %} + Are you sure you want to delete "{{ title }}"? + {% endblocktrans %}
    diff --git a/explorer/templates/explorer/query_list.html b/explorer/templates/explorer/query_list.html index 27595af7..4d3f162a 100644 --- a/explorer/templates/explorer/query_list.html +++ b/explorer/templates/explorer/query_list.html @@ -3,110 +3,127 @@ {% block sql_explorer_navlinks %} {% if can_change %} -
  • {% trans "New Query" %}
  • -
  • {% trans "Playground" %}
  • -
  • {% trans "Logs" %}
  • +
  • {% trans "New Query" %}
  • +
  • {% trans "Playground" %}
  • +
  • {% trans "Logs" %}
  • {% endif %} {% endblock %} {% block sql_explorer_content %} {% if recent_queries|length > 0 %} -

    {% blocktrans with qlen=recent_queries|length %} Your {{qlen}} Most Recently Run {% endblocktrans %}

    +

    + {% blocktrans trimmed with qlen=recent_queries|length %} + Your {{qlen}} Most Recently Run + {% endblocktrans %} +

    - + {% for object in recent_queries %} - - - - - + + + + + {% endfor %}
    {% trans Query %}{% trans "Query" %} {% trans "Last Run" %} CSV
    {{ object.query.title }}{{ object.run_at|date:"SHORT_DATETIME_FORMAT" }} - -
    + {{ object.query.title }} + {{ object.run_at|date:"SHORT_DATETIME_FORMAT" }} + + + +
    {% endif %}
    -
    -
    -

    {% trans "All Queries" %}

    -
    -
    - +
    +
    +

    {% trans "All Queries" %}

    +
    +
    + +
    -
    - - - - - - {% if tasks_enabled %} - - {% endif %} - - {% if can_change %} - - - {% endif %} - - - - - {% for object in object_list %} - - {% if object.is_header %} - - {% else %} - - +
    {% trans "Query" %}{% trans "Created" %}{% trans "Email" %}{% trans "CSV" %}{% trans "Play" %}{% trans "Delete" %}{% trans "Run Count" %}
    - - - {{ object.title }} ({{ object.count }}) - - - {{ object.title }} - {{ object.created_at|date:"SHORT_DATE_FORMAT" }} - {% if object.created_by_user %} - {% blocktrans with cuser=object.created_by_user %}by {{cuser}}{% endblocktrans %} - {% endif %} -
    + + + + {% if tasks_enabled %} - + {% endif %} - + {% if can_change %} - - + + {% endif %} - - - {% endif %} - - {% endfor %} - -
    {% trans "Query" %}{% trans "Created" %} - - {% trans "Email" %} - - {% trans "CSV" %} - - - - {% trans "Play" %}{% trans "Delete" %}{{ object.run_count }}
    + {% trans "Run Count" %} + + + + {% for object in object_list %} + + {% if object.is_header %} + + + + {{ object.title }} ({{ object.count }}) + + + + {% else %} + + {{ object.title }} + + {{ object.created_at|date:"SHORT_DATE_FORMAT" }} + {% if object.created_by_user %} + {% blocktrans trimmed with cuser=object.created_by_user %} + by {{cuser}} + {% endblocktrans %} + {% endif %} + + {% if tasks_enabled %} + + + + {% endif %} + + + + + + {% if can_change %} + + + + + + + + + + + {% endif %} + {{ object.run_count }} + {% endif %} + + {% endfor %} + +
    {% endblock %} {% block sql_explorer_scripts %} - {% endblock %} diff --git a/explorer/templates/explorer/querylog_list.html b/explorer/templates/explorer/querylog_list.html index b7c4e2cc..47e456b8 100644 --- a/explorer/templates/explorer/querylog_list.html +++ b/explorer/templates/explorer/querylog_list.html @@ -3,9 +3,9 @@ {% block sql_explorer_navlinks %} {% if can_change %} -
  • {% trans "New Query" %}
  • -
  • {% trans "Playground" %}
  • -
  • {% trans "Logs" %}
  • +
  • {% trans "New Query" %}
  • +
  • {% trans "Playground" %}
  • +
  • {% trans "Logs" %}
  • {% endif %} {% endblock %} @@ -15,24 +15,40 @@

    {% blocktrans with pagenum=page_obj.number %}Recent Query Logs - Page {{page - - - - - - + + + + + + {% for object in recent_logs %} - - - - - - - - + + + + + + + + {% endfor %}
    {% blocktrans %}Run At{% endblocktrans %}{% blocktrans %}Run By{% endblocktrans %}{% blocktrans %}Duration{% endblocktrans %}{% blocktrans %}SQL{% endblocktrans %}{% blocktrans %}Query ID{% endblocktrans %}{% blocktrans %}Playground{% endblocktrans %}{% trans "Run At" %}{% trans "Run By" %}{% trans "Duration" %}SQL{% trans "Query ID" %}{% trans "Playground" %}
    {{ object.run_at|date:"SHORT_DATETIME_FORMAT" }}{{ object.run_by_user.email }}{{ object.duration|floatformat:2 }}ms{{ object.sql }} {% if object.query_id %}{% blocktrans %}Query{% endblocktrans %} {{ object.query_id }}{% elif object.is_playground %}{% blocktrans %}Playground{% endblocktrans %}{% else %}--{% endif %}{% blocktrans %}Open{% endblocktrans %}
    {{ object.run_at|date:"SHORT_DATETIME_FORMAT" }}{{ object.run_by_user.email }}{{ object.duration|floatformat:2 }}ms{{ object.sql }} + {% if object.query_id %} + + {% blocktrans trimmed with query_id=object.query_id %} + Query {{ query_id }} + {% endblocktrans %} + + {% elif object.is_playground %} + {% trans "Playground" %} + {% else %} + -- + {% endif %} + + + {% trans "Open" %} + +
    @@ -44,7 +60,9 @@

    {% blocktrans with pagenum=page_obj.number %}Recent Query Logs - Page {{page << {% endif %} - {% blocktrans with pnum=page_obj.number anum=page_obj.paginator.num_pages %}Page {{ pnum }} of {{ anum }}.{% endblocktrans %} + {% blocktrans trimmed with pnum=page_obj.number anum=page_obj.paginator.num_pages %} + Page {{ pnum }} of {{ anum }}. + {% endblocktrans %} {% if page_obj.has_next %} >> diff --git a/explorer/templates/explorer/schema.html b/explorer/templates/explorer/schema.html index 4816c4e6..9e8bee5f 100644 --- a/explorer/templates/explorer/schema.html +++ b/explorer/templates/explorer/schema.html @@ -4,17 +4,21 @@ {% block sql_explorer_content_takeover %}
    -

    {% blocktrans %}Schema{% endblocktrans %}

    +

    {% trans "Schema" %}

    - +

      @@ -30,11 +34,11 @@

      {{ m.0 }}

      {% for c in m.1 %} - - {{ c.0 }} - - {{ c.1 }} - + + {{ c.0 }} + + {{ c.1 }} + {% endfor %} diff --git a/explorer/templates/explorer/schema_building.html b/explorer/templates/explorer/schema_building.html index 521ae442..57b80631 100644 --- a/explorer/templates/explorer/schema_building.html +++ b/explorer/templates/explorer/schema_building.html @@ -2,10 +2,8 @@ {% load i18n %} {% block sql_explorer_content_takeover %} - -
      -

      {% blocktrans %}Schema is building...{% endblocktrans %}

      -
      {% blocktrans %}Please wait a minute, and refresh.{% endblocktrans %}
      -
      - -{% endblock %} \ No newline at end of file +
      +

      {% trans "Schema is building..." %}

      +
      {% trans "Please wait a minute, and refresh." %}
      +
      +{% endblock %} diff --git a/manage.py b/manage.py index 5ef8448a..02d1103e 100644 --- a/manage.py +++ b/manage.py @@ -1,8 +1,11 @@ #!/usr/bin/env python -import os, sys +import os +import sys + +from django.core import management + sys.path.append(os.path.join(os.path.dirname(__file__), 'explorer')) os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings' -from django.core import management + if __name__ == "__main__": management.execute_from_command_line() - \ No newline at end of file diff --git a/test_project/settings.py b/test_project/settings.py index cf7e4d80..3f322836 100644 --- a/test_project/settings.py +++ b/test_project/settings.py @@ -1,6 +1,6 @@ -import django import os import djcelery + SECRET_KEY = 'shhh' DEBUG = True STATIC_URL = '/static/'