From b19b9027a56fef1e60ad6adc64714008947120a3 Mon Sep 17 00:00:00 2001 From: Daniel Diaz Date: Tue, 25 May 2021 23:08:23 -0500 Subject: [PATCH] Modified Photoapp templates --- .../photoapp/templates/photoapp/create.html | 15 +++++++++ .../photoapp/templates/photoapp/delete.html | 32 +++++++++++++++++++ .../photoapp/templates/photoapp/detail.html | 29 +++++++++++++++++ config/photoapp/templates/photoapp/list.html | 16 +++++++--- .../photoapp/templates/photoapp/taglist.html | 11 +++++++ .../photoapp/templates/photoapp/update.html | 15 +++++++++ 6 files changed, 114 insertions(+), 4 deletions(-) create mode 100644 config/photoapp/templates/photoapp/update.html diff --git a/config/photoapp/templates/photoapp/create.html b/config/photoapp/templates/photoapp/create.html index e69de29..101f342 100644 --- a/config/photoapp/templates/photoapp/create.html +++ b/config/photoapp/templates/photoapp/create.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} +{% load crispy_forms_tags %} + +{% block body %} +
+

Add photo

+
+
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+{% endblock body %} diff --git a/config/photoapp/templates/photoapp/delete.html b/config/photoapp/templates/photoapp/delete.html index e69de29..4b34237 100644 --- a/config/photoapp/templates/photoapp/delete.html +++ b/config/photoapp/templates/photoapp/delete.html @@ -0,0 +1,32 @@ +{% extends 'base.html' %} {% block body %} +
+

+ You are going to delete: "{{ photo }} + " +

+

Are you sure, you want to delete the photo ?

+
+
+ {% csrf_token %} +
+
+ Cancel +
+
+ +
+
+

This action is irreversible

+
+
+
+ +{% endblock body %} diff --git a/config/photoapp/templates/photoapp/detail.html b/config/photoapp/templates/photoapp/detail.html index e69de29..3411b2d 100644 --- a/config/photoapp/templates/photoapp/detail.html +++ b/config/photoapp/templates/photoapp/detail.html @@ -0,0 +1,29 @@ +{% extends 'base.html' %} + +{% block body %} +
+

{{ photo.title }}

+

Uploaded on: {{photo.created}}
By {{photo.submitter.username}}

+ {% if user == photo.submitter %} +

+ Update + Delete +

+ {% endif %} +
+
+
+ +
+
+

More about this photo:

+
    + {% for tag in photo.tags.all %} +
  • {{tag.name}}
  • + {% endfor %} +
+

{{ photo.description }}

+
+
+ +{% endblock body %} diff --git a/config/photoapp/templates/photoapp/list.html b/config/photoapp/templates/photoapp/list.html index d7c5b6c..bc37761 100644 --- a/config/photoapp/templates/photoapp/list.html +++ b/config/photoapp/templates/photoapp/list.html @@ -1,7 +1,15 @@ -{% extends 'base.html' %} +{% extends 'base.html' %} {% block body %} - - -{% endblock body %} \ No newline at end of file +
+ {% for photo in photos %} +
+ + {{photo.title}} + +
+ {% endfor %} +
+ +{% endblock body %} diff --git a/config/photoapp/templates/photoapp/taglist.html b/config/photoapp/templates/photoapp/taglist.html index e69de29..50771c1 100644 --- a/config/photoapp/templates/photoapp/taglist.html +++ b/config/photoapp/templates/photoapp/taglist.html @@ -0,0 +1,11 @@ +{% extends 'photoapp/list.html' %} + +{% block body %} + +
+

Photos with the tag {{tag}}

+
+ +{{ block.super }} + +{% endblock body %} \ No newline at end of file diff --git a/config/photoapp/templates/photoapp/update.html b/config/photoapp/templates/photoapp/update.html new file mode 100644 index 0000000..10f00c8 --- /dev/null +++ b/config/photoapp/templates/photoapp/update.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} +{% load crispy_forms_tags %} + +{% block body %} +
+

Edit photo {{photo}}

+
+
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+{% endblock body %}