From 59b95898f8624dce01d17cbebce784d74533b5d6 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Thu, 23 Sep 2021 10:17:01 +0200 Subject: [PATCH] Move custom photologue to seperate app --- photo21/settings.py | 1 + photologue_custom/__init__.py | 0 photologue_custom/admin.py | 3 ++ photologue_custom/apps.py | 5 +++ photologue_custom/migrations/__init__.py | 0 photologue_custom/models.py | 3 ++ .../templates/photologue/gallery_archive.html | 0 .../photologue/gallery_archive_year.html | 0 .../templates/photologue/gallery_detail.html | 23 ++++++-------- .../photologue/includes/gallery_sample.html | 0 .../templates/photologue/photo_detail.html | 31 +++++++++++++++++++ photologue_custom/tests.py | 3 ++ photologue_custom/views.py | 3 ++ 13 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 photologue_custom/__init__.py create mode 100644 photologue_custom/admin.py create mode 100644 photologue_custom/apps.py create mode 100644 photologue_custom/migrations/__init__.py create mode 100644 photologue_custom/models.py rename {photo21 => photologue_custom}/templates/photologue/gallery_archive.html (100%) rename {photo21 => photologue_custom}/templates/photologue/gallery_archive_year.html (100%) rename {photo21 => photologue_custom}/templates/photologue/gallery_detail.html (55%) rename {photo21 => photologue_custom}/templates/photologue/includes/gallery_sample.html (100%) create mode 100644 photologue_custom/templates/photologue/photo_detail.html create mode 100644 photologue_custom/tests.py create mode 100644 photologue_custom/views.py diff --git a/photo21/settings.py b/photo21/settings.py index 01ab079..2d8b229 100644 --- a/photo21/settings.py +++ b/photo21/settings.py @@ -41,6 +41,7 @@ INSTALLED_APPS = [ 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', + 'photologue_custom', 'photologue', 'sortedm2m', ] diff --git a/photologue_custom/__init__.py b/photologue_custom/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/photologue_custom/admin.py b/photologue_custom/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/photologue_custom/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/photologue_custom/apps.py b/photologue_custom/apps.py new file mode 100644 index 0000000..b08e032 --- /dev/null +++ b/photologue_custom/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class PhotologueCustomConfig(AppConfig): + name = 'photologue_custom' diff --git a/photologue_custom/migrations/__init__.py b/photologue_custom/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/photologue_custom/models.py b/photologue_custom/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/photologue_custom/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/photo21/templates/photologue/gallery_archive.html b/photologue_custom/templates/photologue/gallery_archive.html similarity index 100% rename from photo21/templates/photologue/gallery_archive.html rename to photologue_custom/templates/photologue/gallery_archive.html diff --git a/photo21/templates/photologue/gallery_archive_year.html b/photologue_custom/templates/photologue/gallery_archive_year.html similarity index 100% rename from photo21/templates/photologue/gallery_archive_year.html rename to photologue_custom/templates/photologue/gallery_archive_year.html diff --git a/photo21/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html similarity index 55% rename from photo21/templates/photologue/gallery_detail.html rename to photologue_custom/templates/photologue/gallery_detail.html index ab7108a..95d1e1d 100644 --- a/photo21/templates/photologue/gallery_detail.html +++ b/photologue_custom/templates/photologue/gallery_detail.html @@ -21,18 +21,15 @@ {% endblock %} {% block content %} -
-
-

{{ gallery.title }}

-

{% trans "Published" %} {{ gallery.date_added }}

- {% if gallery.description %}

{{ gallery.description|safe }}

{% endif %} - -
+

{{ gallery.title }}

+

{% trans "Published" %} {{ gallery.date_added }}

+{% if gallery.description %}

{{ gallery.description|safe }}

{% endif %} + +{% trans 'Download all gallery' %} {% endblock %} diff --git a/photo21/templates/photologue/includes/gallery_sample.html b/photologue_custom/templates/photologue/includes/gallery_sample.html similarity index 100% rename from photo21/templates/photologue/includes/gallery_sample.html rename to photologue_custom/templates/photologue/includes/gallery_sample.html diff --git a/photologue_custom/templates/photologue/photo_detail.html b/photologue_custom/templates/photologue/photo_detail.html new file mode 100644 index 0000000..af7ebe8 --- /dev/null +++ b/photologue_custom/templates/photologue/photo_detail.html @@ -0,0 +1,31 @@ +{% extends "photologue/root.html" %} +{% load photologue_tags i18n %} + +{% block title %}{{ object.title }}{% endblock %} + +{% block content %} +
+
+

{{ object.title }}

+

{% trans "Published" %} {{ object.date_added }}

+
+
+
+
+ {% if object.caption %}

{{ object.caption|safe }}

{% endif %} + + {{ object.title }} + +
+
+ {% if object.public_galleries %} +

{% trans "This photo is found in the following galleries" %}:

+ + {% endif %} +
+
+{% endblock %} \ No newline at end of file diff --git a/photologue_custom/tests.py b/photologue_custom/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/photologue_custom/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/photologue_custom/views.py b/photologue_custom/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/photologue_custom/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.