From ecc4f3ef8a23e3d4143954fdccc5a28a83f9039f Mon Sep 17 00:00:00 2001 From: bnewbold Date: Wed, 11 Jan 2017 18:26:04 -0800 Subject: basic sandbox wiki editing and creation --- webface/templates/base.html | 5 +++-- webface/templates/model_create.html | 23 +++++++++++++++++++++++ webface/templates/model_edit.html | 27 +++++++++++++++++++++++++++ webface/templates/model_list.html | 8 +++++++- webface/templates/model_view.html | 8 +++++++- 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 webface/templates/model_create.html create mode 100644 webface/templates/model_edit.html (limited to 'webface/templates') diff --git a/webface/templates/base.html b/webface/templates/base.html index 66a0cca..65dafa3 100644 --- a/webface/templates/base.html +++ b/webface/templates/base.html @@ -16,8 +16,9 @@ body { font-family: monospace; font-size: larger; line-height: 1.3; }

-examples index - -full readme - +examples - +sandbox - +readme - source code

diff --git a/webface/templates/model_create.html b/webface/templates/model_create.html new file mode 100644 index 0000000..0c7faa7 --- /dev/null +++ b/webface/templates/model_create.html @@ -0,0 +1,23 @@ +{{# partial content}} +

Create New Model

+ +Model will be created with a dummy template modelica model and markdown wiki +page, which you can then edit. + +
+ +
+ + +
Namespace: + +
Name ("Slug"): + (alphanumeric with underscores) +
+
+ + +
+ +{{/partial}} +{{~> base.html~}} diff --git a/webface/templates/model_edit.html b/webface/templates/model_edit.html new file mode 100644 index 0000000..38aef60 --- /dev/null +++ b/webface/templates/model_edit.html @@ -0,0 +1,27 @@ +{{# partial content}} +

+ + {{ namespace }}/{{ model_name }} +

+ +
+ +

Modelica Code

+The computable model must conform to a subset of the Modelica language. + +

WARNING: you won't get errors or help if your code is wrong, +just a 500 error. + +

+ + +

Markdown

+ + +

+ + +
+ +{{/partial}} +{{~> base.html~}} diff --git a/webface/templates/model_list.html b/webface/templates/model_list.html index 4c80315..ad4f4f4 100644 --- a/webface/templates/model_list.html +++ b/webface/templates/model_list.html @@ -1,11 +1,17 @@ {{# partial content}} -

Models

+{{#each namespace }} +

Models: {{ this[0] }}

+{{/each}} +{{# if model_slug_list }} +{{else}} +None Yet! +{{/if}} {{/partial}} {{~> base.html~}} diff --git a/webface/templates/model_view.html b/webface/templates/model_view.html index 5d307c7..6062f33 100644 --- a/webface/templates/model_view.html +++ b/webface/templates/model_view.html @@ -1,7 +1,13 @@ {{# partial content}} -

{{ model_name }}

+

+ + {{ namespace }}/{{ model_name }} +

+{{# if editable }} edit - +{{/if }} +markdown - modelica - scheme - javascript - -- cgit v1.2.3