diff --git a/server.py b/server.py index 065ce47..78618a1 100644 --- a/server.py +++ b/server.py @@ -70,12 +70,12 @@ def delete(id): @app.get("/") def show(id): cursor.execute('SELECT * FROM items WHERE id=%s', [id]) - parent=cursor.fetchone() + item=cursor.fetchone() cursor.execute('SELECT * FROM items WHERE parent_id=%s',[id]) if request.cookies.get('movingItemId'): - return render_template('show.html', parent=parent, children=cursor, moving_item_id=request.cookies.get('movingItemId')) + return render_template('show.html', item=item, children=cursor, moving_item_id=request.cookies.get('movingItemId')) else: - return render_template('show.html', parent=parent, children=cursor) + return render_template('show.html', item=item, children=cursor) @app.get('//edit') def edit(id): diff --git a/templates/show.html b/templates/show.html index 205f39d..08a8781 100644 --- a/templates/show.html +++ b/templates/show.html @@ -6,10 +6,10 @@ - {%if parent%} + {%if item%}
-

{{parent[1]}}

- {{parent[2]}} +

{{item[1]}}

+ {{item[2]}}
{%else%}
@@ -17,7 +17,7 @@
{%endif%}
- {%if parent%} + {%if item%}

Child Items

{%else%}

Items

@@ -30,8 +30,8 @@ {%endfor%} {%if moving_item_id %} - {% if parent %} -
+ {% if item %} +
{% else %} @@ -46,8 +46,8 @@
- {%if parent%} - + {%if item%} + {%endif%}
@@ -55,12 +55,12 @@