Move custom photologue to seperate app
This commit is contained in:
parent
0edbc79023
commit
59b95898f8
13 changed files with 59 additions and 13 deletions
0
photologue_custom/__init__.py
Normal file
0
photologue_custom/__init__.py
Normal file
3
photologue_custom/admin.py
Normal file
3
photologue_custom/admin.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
photologue_custom/apps.py
Normal file
5
photologue_custom/apps.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PhotologueCustomConfig(AppConfig):
|
||||
name = 'photologue_custom'
|
||||
0
photologue_custom/migrations/__init__.py
Normal file
0
photologue_custom/migrations/__init__.py
Normal file
3
photologue_custom/models.py
Normal file
3
photologue_custom/models.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
36
photologue_custom/templates/photologue/gallery_archive.html
Normal file
36
photologue_custom/templates/photologue/gallery_archive.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{% extends "photologue/root.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Latest photo galleries" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1>{% trans "Latest photo galleries" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<aside class="col-md-2">
|
||||
<h5>{% trans "Filter by year" %}</h5>
|
||||
<div class="list-group">
|
||||
{% for date in date_list %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'photologue:pl-gallery-archive-year' date.year %}">{{ date|date:"Y" }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</aside>
|
||||
<main class="col-md-10">
|
||||
{% if latest %}
|
||||
<div class="row mb-2">
|
||||
{% for gallery in latest %}
|
||||
<div class="col-md-3">
|
||||
{% include "photologue/includes/gallery_sample.html" %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{% trans "No galleries were found" %}.</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{% extends "photologue/root.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% blocktrans with show_year=year|date:"Y" %}Galleries for {{ show_year }}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1>{% blocktrans with show_year=year|date:"Y" %}Galleries for {{ show_year }}{% endblocktrans %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<aside class="col-md-2">
|
||||
<a href="{% url 'photologue:pl-gallery-archive' %}">⬅ {% trans "View all galleries" %}</a>
|
||||
</aside>
|
||||
<main class="col-md-10">
|
||||
{% if object_list %}
|
||||
<div class="row mb-2">
|
||||
{% for gallery in object_list %}
|
||||
<div class="col-md-3">
|
||||
{% include "photologue/includes/gallery_sample.html" %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{% trans "No galleries were found." %}</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
</div>
|
||||
{% endblock %}
|
||||
35
photologue_custom/templates/photologue/gallery_detail.html
Normal file
35
photologue_custom/templates/photologue/gallery_detail.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{% extends "photologue/root.html" %}
|
||||
{% load static i18n %}
|
||||
|
||||
{% block title %}{{ gallery.title }}{% endblock %}
|
||||
|
||||
{% block extracss %}
|
||||
<link rel="stylesheet" href="{% static 'lightgallery/css/lightgallery.css' %}" />
|
||||
<link rel="stylesheet" href="{% static 'lightgallery/css/lg-zoom.css' %}" />
|
||||
<link rel="stylesheet" href="{% static 'lightgallery/css/lg-thumbnail.css' %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajs %}
|
||||
<script src="{% static 'lightgallery/lightgallery.min.js' %}"></script>
|
||||
<script src="{% static 'lightgallery/plugins/thumbnail/lg-thumbnail.min.js' %}"></script>
|
||||
<script src="{% static 'lightgallery/plugins/zoom/lg-zoom.min.js' %}"></script>
|
||||
<script>
|
||||
lightGallery(document.getElementById('lightgallery'), {
|
||||
plugins: [lgZoom, lgThumbnail]
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ gallery.title }}</h1>
|
||||
<p class="text-muted small">{% trans "Published" %} {{ gallery.date_added }}</p>
|
||||
{% if gallery.description %}<p>{{ gallery.description|safe }}</p>{% endif %}
|
||||
<div class="gallery-list mb-3" id="lightgallery">
|
||||
{% for photo in gallery.public %}
|
||||
<a href="{{ photo.get_absolute_url }}" data-src="{{ photo.get_display_url }}" data-download-url="{{ photo.image.url }}">
|
||||
<img src="{{ photo.get_thumbnail_url }}" class="img-thumbnail" alt="{{ photo.title }}">
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a href="#" class="btn btn-secondary">{% trans 'Download all gallery' %}</a>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{% load i18n %}
|
||||
|
||||
<div class="card text-white bg-dark">
|
||||
{% for photo in gallery.sample %}
|
||||
<img src="{{ photo.get_thumbnail_url }}" class="card-img-top" alt="{{ photo.title }}">
|
||||
{% endfor %}
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ gallery.title }}</h5>
|
||||
<p class="card-text text-muted small mb-0">{% trans "Published" %} {{ gallery.date_added }}</p>
|
||||
{% if gallery.description %}<p class="card-text small mb-0">{{ gallery.description|safe }}</p>{% endif %}
|
||||
<a href="{{ gallery.get_absolute_url }}" class="stretched-link"></a>
|
||||
</div>
|
||||
</div>
|
||||
31
photologue_custom/templates/photologue/photo_detail.html
Normal file
31
photologue_custom/templates/photologue/photo_detail.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{% extends "photologue/root.html" %}
|
||||
{% load photologue_tags i18n %}
|
||||
|
||||
{% block title %}{{ object.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1>{{ object.title }}</h1>
|
||||
<p class="text-muted small">{% trans "Published" %} {{ object.date_added }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{% if object.caption %}<p>{{ object.caption|safe }}</p>{% endif %}
|
||||
<a href="{{ object.image.url }}">
|
||||
<img src="{{ object.get_display_url }}" class="img-thumbnail" alt="{{ object.title }}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{% if object.public_galleries %}
|
||||
<p>{% trans "This photo is found in the following galleries" %}:</p>
|
||||
<ul>
|
||||
{% for gallery in object.public_galleries %}
|
||||
<li><a href="{{ gallery.get_absolute_url }}">{{ gallery.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
3
photologue_custom/tests.py
Normal file
3
photologue_custom/tests.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
photologue_custom/views.py
Normal file
3
photologue_custom/views.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue