diff --git a/idescriptor/templates/idescriptor/list_images.html b/idescriptor/templates/idescriptor/list_images.html new file mode 100644 index 0000000..b93cafb --- /dev/null +++ b/idescriptor/templates/idescriptor/list_images.html @@ -0,0 +1,16 @@ +{% extends "idescriptor/base_generic.html" %} +{% load i18n %} +{% load crispy_forms_tags %} + +{% block title %}{% translate "Organize images for a bot" %}{% endblock %} + +{% block content %} +
+ + +
+{% endblock %} \ No newline at end of file diff --git a/idescriptor/urls.py b/idescriptor/urls.py index be040bf..a238d36 100644 --- a/idescriptor/urls.py +++ b/idescriptor/urls.py @@ -5,4 +5,5 @@ from . import views urlpatterns = [ path("", views.index, name="index"), path("image//", views.ImageFormView.as_view(), name="image-update"), + path("images/", views.list_images, name="images-list"), ] \ No newline at end of file diff --git a/idescriptor/views.py b/idescriptor/views.py index 7c82b6c..0f5dde8 100644 --- a/idescriptor/views.py +++ b/idescriptor/views.py @@ -12,6 +12,10 @@ def get_image_for_descriptor(): image = Image.objects.filter(Q(alt_text=None) | Q(title=None)).first() return image +def list_images(request): + images = Image.objects.all() + context = {"images": images} + return render(request, 'idescriptor/list_images.html', context=context) class ImageFormView(UpdateView): model = Image