From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../templates/console/bookmark_content.twig | 25 +++ srcs/phpmyadmin/templates/console/display.twig | 192 +++++++++++++++++++++ .../phpmyadmin/templates/console/query_action.twig | 12 ++ srcs/phpmyadmin/templates/console/toolbar.twig | 10 ++ 4 files changed, 239 insertions(+) create mode 100644 srcs/phpmyadmin/templates/console/bookmark_content.twig create mode 100644 srcs/phpmyadmin/templates/console/display.twig create mode 100644 srcs/phpmyadmin/templates/console/query_action.twig create mode 100644 srcs/phpmyadmin/templates/console/toolbar.twig (limited to 'srcs/phpmyadmin/templates/console') diff --git a/srcs/phpmyadmin/templates/console/bookmark_content.twig b/srcs/phpmyadmin/templates/console/bookmark_content.twig new file mode 100644 index 0000000..259edbf --- /dev/null +++ b/srcs/phpmyadmin/templates/console/bookmark_content.twig @@ -0,0 +1,25 @@ +
+ {{ welcome_message }} +
+{% for bookmark in bookmarks %} + +{% endfor %} diff --git a/srcs/phpmyadmin/templates/console/display.twig b/srcs/phpmyadmin/templates/console/display.twig new file mode 100644 index 0000000..3d54c9e --- /dev/null +++ b/srcs/phpmyadmin/templates/console/display.twig @@ -0,0 +1,192 @@ +
+
+ {# Console toolbar #} + {% include 'console/toolbar.twig' with { + 'parent_div_classes': 'collapsed', + 'content_array': [ + {0: 'switch_button console_switch', 1: 'Console'|trans, 'image': image}, + ['button clear', 'Clear'|trans], + ['button history', 'History'|trans], + ['button options', 'Options'|trans], + cfg_bookmark is defined ? ['button bookmarks', 'Bookmarks'|trans] : null, + ['button debug hide', 'Debug SQL'|trans] + ] + } only %} + {# Console messages #} +
+
+
+ + {% trans 'Press Ctrl+Enter to execute query' %} + + + {% trans 'Press Enter to execute query' %} + +
+ {% if sql_history is not empty %} + {% for record in sql_history|reverse %} + + {% endfor %} + {% endif %} +
+
+ +
+
+ {# Drak the console with other cards over it #} +
+ {# Debug SQL card #} +
+ {% include 'console/toolbar.twig' with { + 'parent_div_classes': '', + 'content_array': [ + ['button order order_asc', 'ascending'|trans], + ['button order order_desc', 'descending'|trans], + ['text', 'Order:'|trans], + ['switch_button', 'Debug SQL'|trans], + ['button order_by sort_count', 'Count'|trans], + ['button order_by sort_exec', 'Execution order'|trans], + ['button order_by sort_time', 'Time taken'|trans], + ['text', 'Order by:'|trans], + ['button group_queries', 'Group queries'|trans], + ['button ungroup_queries', 'Ungroup queries'|trans] + ] + } only %} +
+
+
+
+
+ {% include 'console/query_action.twig' with { + 'parent_div_classes': 'debug_query action_content', + 'content_array': [ + ['action collapse', 'Collapse'|trans], + ['action expand', 'Expand'|trans], + ['action dbg_show_trace', 'Show trace'|trans], + ['action dbg_hide_trace', 'Hide trace'|trans], + ['text count hide', 'Count'|trans], + ['text time', 'Time taken'|trans] + ] + } only %} +
+
+ {% if cfg_bookmark %} +
+ {% include 'console/toolbar.twig' with { + 'parent_div_classes': '', + 'content_array': [ + ['switch_button', 'Bookmarks'|trans], + ['button refresh', 'Refresh'|trans], + ['button add', 'Add'|trans] + ] + } only %} +
+ {{ bookmark_content|raw }} +
+
+
+ {% include 'console/toolbar.twig' with { + 'parent_div_classes': '', + 'content_array': [ + ['switch_button', 'Add bookmark'|trans] + ] + } only %} +
+
+ + + + +
+
+ +
+
+
+
+ {% endif %} + {# Options card #} +
+ {% include 'console/toolbar.twig' with { + 'parent_div_classes': '', + 'content_array': [ + ['switch_button', 'Options'|trans], + ['button default', 'Set default'|trans] + ] + } only %} +
+ +
+ +
+ +
+ +
+ +
+
+
+
+ {# Templates for console message actions #} + {% include 'console/query_action.twig' with { + 'parent_div_classes': 'query_actions', + 'content_array': [ + ['action collapse', 'Collapse'|trans], + ['action expand', 'Expand'|trans], + ['action requery', 'Requery'|trans], + ['action edit', 'Edit'|trans], + ['action explain', 'Explain'|trans], + ['action profiling', 'Profiling'|trans], + cfg_bookmark is defined ? ['action bookmark', 'Bookmark'|trans] : null, + ['text failed', 'Query failed'|trans], + {0: 'text targetdb', 1: 'Database'|trans, 'extraSpan': ''}, + {0: 'text query_time', 1: 'Queried time'|trans, 'extraSpan': ''} + ] + } only %} +
+
+
diff --git a/srcs/phpmyadmin/templates/console/query_action.twig b/srcs/phpmyadmin/templates/console/query_action.twig new file mode 100644 index 0000000..62bc30a --- /dev/null +++ b/srcs/phpmyadmin/templates/console/query_action.twig @@ -0,0 +1,12 @@ +
+ {% for content in content_array %} + {% if content is defined %} + + {{ content[1] }} + {% if content['extraSpan'] is defined %} + : {{ content['extraSpan'] }} + {% endif %} + + {% endif %} + {% endfor %} +
diff --git a/srcs/phpmyadmin/templates/console/toolbar.twig b/srcs/phpmyadmin/templates/console/toolbar.twig new file mode 100644 index 0000000..b16c290 --- /dev/null +++ b/srcs/phpmyadmin/templates/console/toolbar.twig @@ -0,0 +1,10 @@ +
+ {% for content in content_array %} + {% if content is defined %} +
+ {{ content['image'] is defined ? content['image']|raw }} + {{ content[1] }} +
+ {% endif %} + {% endfor %} +
-- cgit