Browse Source

Add an edit object page

prieto 8 years ago
parent
commit
52f5e461fa

+ 19
- 0
plugins/webui/templates/listing/edit_object.html View File

@@ -0,0 +1,19 @@
1
+{% extends "base.html" %}
2
+{% import 'components/components.html' as components %}
3
+{% set my_classname = params['classe'].pop() %}
4
+{% set my_id = params['id'].pop() %}
5
+{% set my_class = leapi.Object.name2class(my_classname) %}
6
+{% set objects = my_class.get(('%s = %s') % ('lodel_id', my_id)) %}
7
+{% set obj = objects.pop() %}
8
+{% block title %}Lodel 2 - Object {{ my_id }} {% endblock %}
9
+{% import "components/components.html" as components %}
10
+{% block content %}
11
+<h1>Lodel 2 - Object {{ my_id }} of the class {{ my_classname }}</h1>
12
+    
13
+<ul>
14
+    <!-- To get a component HTML code, it is necessary to call : components.<macro_name>(args) -->
15
+    {% for fieldname, fieldvalue in obj.datas().items() %}
16
+    <li> {{ fieldname }} : {{ components.input(fieldname , value=fieldvalue , type='text') }} </li>
17
+    {% endfor %}
18
+</ul>
19
+{% endblock %}

+ 1
- 1
plugins/webui/templates/listing/show_object.html View File

@@ -14,7 +14,7 @@
14 14
     <!-- To get a component HTML code, it is necessary to call : components.<macro_name>(args) -->
15 15
     {% for fieldname, fieldvalue in obj.datas().items() %}
16 16
         {% if fieldvalue is not none %}
17
-    <li> {{ fieldname }} : {{ components.input(fieldname , value=fieldvalue , type='text') }} </li>
17
+    <li> {{ fieldname }} : {{ fieldvalue }} </li>
18 18
         {% endif %}
19 19
     {% endfor %}
20 20
 </ul>

Loading…
Cancel
Save