diff --git a/oshipka/webapp/templates/delete_instance.html b/oshipka/webapp/templates/delete_instance.html
index 0a16e3c..c29fb7b 100644
--- a/oshipka/webapp/templates/delete_instance.html
+++ b/oshipka/webapp/templates/delete_instance.html
@@ -1,9 +1,9 @@
{% extends "layout.html" %}
{% block content %}
-
Delete {{ model_name }}:{{ instance.uuid }} ?
+ Delete {{ model_name }}:{{ instance.id }} ?
Back
diff --git a/oshipka/webapp/views.py b/oshipka/webapp/views.py
index 1dea866..6570d74 100644
--- a/oshipka/webapp/views.py
+++ b/oshipka/webapp/views.py
@@ -72,6 +72,8 @@ def update_view(model_view, template, pre_process_func=None, post_process_func=N
def create_view(model_view, template, template_ctx_func=None, post_add=None, post_create=None):
+ template = template if template else "{}/create.html".format(model_view.model_name)
+
def inner():
if request.method == "GET":
template_ctx = template_ctx_func() if template_ctx_func else {}
diff --git a/vm_gen/templates/html/_create.html b/vm_gen/templates/html/_create.html
new file mode 100644
index 0000000..063300e
--- /dev/null
+++ b/vm_gen/templates/html/_create.html
@@ -0,0 +1,11 @@
+Create [[ name ]]
+
\ No newline at end of file
diff --git a/vm_gen/templates/html/_edit.html b/vm_gen/templates/html/_edit.html
index e69de29..d3eab1c 100644
--- a/vm_gen/templates/html/_edit.html
+++ b/vm_gen/templates/html/_edit.html
@@ -0,0 +1,12 @@
+Edit {% include "[[ name|camel_to_snake ]]/_title.html" %}
+
\ No newline at end of file
diff --git a/vm_gen/templates/html/_get.html b/vm_gen/templates/html/_get.html
index e69de29..10edc07 100644
--- a/vm_gen/templates/html/_get.html
+++ b/vm_gen/templates/html/_get.html
@@ -0,0 +1,3 @@
+{% include "[[ name|camel_to_snake ]]/_title.html" %}
+edit |
+delete
\ No newline at end of file
diff --git a/vm_gen/templates/html/_list.html b/vm_gen/templates/html/_list.html
index dcfb8ae..7d0c018 100644
--- a/vm_gen/templates/html/_list.html
+++ b/vm_gen/templates/html/_list.html
@@ -1,3 +1,14 @@
+[[ name|pluralize ]]
+Create
+
{% for instance in instances %}
- {{ instance.number }}
+
+
+ {% include "[[ name|camel_to_snake ]]/_title.html" %}
+ |
+ [
+ e |
+ x
+ ]
+
{% endfor %}
\ No newline at end of file
diff --git a/vm_gen/templates/html/_title.html b/vm_gen/templates/html/_title.html
new file mode 100644
index 0000000..733c227
--- /dev/null
+++ b/vm_gen/templates/html/_title.html
@@ -0,0 +1,10 @@
+[%- if display %]
+ [%- if display.primary %]
+ {{ instance.[[ display.primary ]] }}
+ [%- endif %]
+ [%- if display.secondary %]
+ - {{ instance.[[ display.secondary ]] }}
+ [%- endif %]
+[%- else %]
+ [[ name ]] {{ instance.id }}
+[%- endif %]
\ No newline at end of file
diff --git a/vm_gen/templates/html/create.html b/vm_gen/templates/html/create.html
new file mode 100644
index 0000000..ac7fe3b
--- /dev/null
+++ b/vm_gen/templates/html/create.html
@@ -0,0 +1,5 @@
+{% extends "layout.html" %}
+
+{% block content %}
+ {% include "[[ name|camel_to_snake ]]/_create.html" %}
+{% endblock %}
\ No newline at end of file
diff --git a/vm_gen/vm_gen.py b/vm_gen/vm_gen.py
index 0896481..3fc7bde 100644
--- a/vm_gen/vm_gen.py
+++ b/vm_gen/vm_gen.py
@@ -106,7 +106,7 @@ if __name__ == "__main__":
MODELS_PATH = os.path.join(WEBAPP_PATH, "models")
if not os.path.exists(MODELS_PATH):
os.makedirs(MODELS_PATH)
- HTML_TEMPLATES_PATH = os.path.join(WEBAPP_PATH, "templates_gen")
+ HTML_TEMPLATES_PATH = os.path.join(WEBAPP_PATH, "templates")
env = Environment(
loader=FileSystemLoader(searchpath=VM_TEMPLATES_PATH),