From 9930ee946c2e60a294e745bb0972c182dcfc5199 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 19 Jul 2018 08:07:07 +0000 Subject: [PATCH] Allow templates to be edited. --- vasl_templates/webapp/static/css/main.css | 16 ++- vasl_templates/webapp/static/css/tabs-ob.css | 16 +-- .../webapp/static/css/tabs-scenario.css | 8 +- vasl_templates/webapp/static/main.js | 45 +++++++- .../static/{generate.js => snippets.js} | 58 ++++++++-- vasl_templates/webapp/templates/index.html | 13 +-- vasl_templates/webapp/tests/test_generate.py | 101 +++++++++++------- .../webapp/tests/test_template_packs.py | 90 ++++------------ vasl_templates/webapp/tests/utils.py | 54 ++++++++++ 9 files changed, 261 insertions(+), 140 deletions(-) rename vasl_templates/webapp/static/{generate.js => snippets.js} (91%) diff --git a/vasl_templates/webapp/static/css/main.css b/vasl_templates/webapp/static/css/main.css index b50cf1a..3626be7 100644 --- a/vasl_templates/webapp/static/css/main.css +++ b/vasl_templates/webapp/static/css/main.css @@ -20,12 +20,15 @@ body { height: 100% ; } #tabs .ui-tabs-nav li img { position: relative ; top: 2px ; height: 1em ; } +.snippet-control-menu-item { font-size: 75% ; } +.ui-selectmenu-icon.ui-icon { margin-top: -8px; } + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #tabs-scenario { display: grid ; display: -ms-grid ; - grid-template-rows: 14em 1fr ; -ms-grid-rows: 14em 1fr ; - grid-template-columns: 25em 1fr ; -ms-grid-columns: 25em 1fr ; + grid-template-rows: 16em 1fr ; -ms-grid-rows: 14em 1fr ; + grid-template-columns: 28em 1fr ; -ms-grid-columns: 28em 1fr ; } #tabs-scenario fieldset.tr { @@ -80,6 +83,15 @@ input[type="text"] { margin-bottom: 0.25em ; } /* -------------------------------------------------------------------- */ +.ui-dialog-titlebar { padding: 0.2em 0.5em 0.2em 0.5em !important ; } +.ui-dialog-titlebar-close { margin-top: -10px !important ; } + +.ui-dialog.edit-template .ui-dialog-buttonpane { border: none ; padding: 0 ; font-size: 75% ; } +#edit-template { padding: 2px ; } +.ui-dialog.edit-template textarea { resize: none ; width: calc(100% - 4px) ; height: 100% ; } +.ui-dialog.edit-template textarea { font-family: "Courier New" ; font-size: 80% ; } +.ui-dialog.edit-template button { margin: 0 0 0 5px ; padding: 0.1em 0.2em ; } + .ui-dialog.edit-ssr .ui-dialog-titlebar { display: none ; } .ui-dialog.edit-ssr .ui-dialog-buttonpane { border: none ; padding: 0 ; font-size: 75% ; } #edit-ssr { padding: 2px ; } diff --git a/vasl_templates/webapp/static/css/tabs-ob.css b/vasl_templates/webapp/static/css/tabs-ob.css index e9c566c..d8993ac 100644 --- a/vasl_templates/webapp/static/css/tabs-ob.css +++ b/vasl_templates/webapp/static/css/tabs-ob.css @@ -1,20 +1,14 @@ .panel-obsetup { height: 100% ; display: grid ; display: -ms-grid ; - grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ; + grid-template-rows: 1fr 2.5em ; -ms-grid-rows: 1fr 2.5em ; grid-template-columns: 1fr ; -ms-grid-columns: 1fr ; } /* FUDGE! IE hackamathon follows (nb: