summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/books/urls.py23
-rw-r--r--app/jrnl/urls.py46
-rw-r--r--app/jrnl/views.py2
-rw-r--r--app/lib/pagination/templates/pagination/pagination.html2
-rw-r--r--app/links/urls.py32
-rw-r--r--app/links/views.py3
-rw-r--r--app/locations/urls.py9
-rw-r--r--app/sightings/migrations/0002_auto_20180205_1430.py27
-rw-r--r--app/sightings/urls.py6
-rw-r--r--app/sketches/urls.py2
-rw-r--r--app/unused_apps/birds/__init__.py (renamed from app/birds/__init__.py)0
-rw-r--r--app/unused_apps/birds/aba_importer.py (renamed from app/birds/aba_importer.py)0
-rw-r--r--app/unused_apps/birds/admin.py (renamed from app/birds/admin.py)0
-rw-r--r--app/unused_apps/birds/autocomplete_light_registry.py (renamed from app/birds/autocomplete_light_registry.py)0
-rw-r--r--app/unused_apps/birds/birds.json (renamed from app/birds/birds.json)0
-rw-r--r--app/unused_apps/birds/build.py (renamed from app/birds/build.py)0
-rw-r--r--app/unused_apps/birds/migrations/0001_initial.py (renamed from app/birds/migrations/0001_initial.py)0
-rw-r--r--app/unused_apps/birds/migrations/0002_auto_20160313_0953.py (renamed from app/birds/migrations/0002_auto_20160313_0953.py)0
-rw-r--r--app/unused_apps/birds/migrations/0003_birdsighting_images.py (renamed from app/birds/migrations/0003_birdsighting_images.py)0
-rw-r--r--app/unused_apps/birds/migrations/0004_auto_20160321_1123.py (renamed from app/birds/migrations/0004_auto_20160321_1123.py)0
-rw-r--r--app/unused_apps/birds/migrations/0005_auto_20170714_2222.py (renamed from app/birds/migrations/0005_auto_20170714_2222.py)0
-rw-r--r--app/unused_apps/birds/migrations/0006_auto_20170714_2224.py (renamed from app/birds/migrations/0006_auto_20170714_2224.py)0
-rw-r--r--app/unused_apps/birds/migrations/0007_auto_20170821_1415.py (renamed from app/birds/migrations/0007_auto_20170821_1415.py)0
-rw-r--r--app/unused_apps/birds/migrations/0008_auto_20170821_1418.py (renamed from app/birds/migrations/0008_auto_20170821_1418.py)0
-rw-r--r--app/unused_apps/birds/migrations/0009_auto_20170821_1429.py (renamed from app/birds/migrations/0009_auto_20170821_1429.py)0
-rw-r--r--app/unused_apps/birds/migrations/0010_auto_20170906_2100.py (renamed from app/birds/migrations/0010_auto_20170906_2100.py)0
-rw-r--r--app/unused_apps/birds/migrations/0011_auto_20180126_1456.py48
-rw-r--r--app/unused_apps/birds/migrations/0012_auto_20180126_1739.py44
-rw-r--r--app/unused_apps/birds/migrations/0013_auto_20180126_2010.py28
-rw-r--r--app/unused_apps/birds/migrations/0014_auto_20180128_0902.py21
-rw-r--r--app/unused_apps/birds/migrations/__init__.py (renamed from app/birds/migrations/__init__.py)0
-rw-r--r--app/unused_apps/birds/models.py (renamed from app/birds/models.py)0
-rw-r--r--app/unused_apps/birds/urls.py (renamed from app/birds/urls.py)0
-rw-r--r--app/unused_apps/birds/views.py (renamed from app/birds/views.py)0
-rw-r--r--app/utils/views.py1
-rw-r--r--config/base_urls.py2
-rw-r--r--design/templates/archives/jrnl.html46
-rw-r--r--design/templates/archives/sketches.html4
38 files changed, 282 insertions, 64 deletions
diff --git a/app/books/urls.py b/app/books/urls.py
index 89c125e..4855149 100644
--- a/app/books/urls.py
+++ b/app/books/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls import url
+from django.urls import path, re_path
from django.views.generic.base import RedirectView
from . import views
@@ -6,19 +6,20 @@ from . import views
app_name = "books"
urlpatterns = [
- url(
- r'(?P<page>\d+)/$',
+ re_path(
+ r'^(?P<page>\d+)/$',
views.BookListView.as_view(),
- name='list',
+ name="list"
),
- url(
- r'(?P<slug>[-\w]+)$',
+ path(
+ r'',
+ views.BookListView.as_view(),
+ {'page':1},
+ name="list"
+ ),
+ path(
+ r'<str:slug>/',
views.BookDetailView.as_view(),
name='detail',
),
- url(
- r'^$',
- RedirectView.as_view(url="/books/1/", permanent=False),
- name="live_redirect"
- ),
]
diff --git a/app/jrnl/urls.py b/app/jrnl/urls.py
index aa01d69..a7bcc0e 100644
--- a/app/jrnl/urls.py
+++ b/app/jrnl/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls import url
+from django.urls import path, re_path
from django.views.generic.base import RedirectView
from . import views
@@ -6,51 +6,51 @@ from . import views
app_name = "jrnl"
urlpatterns = [
- url(
+ path(
r'^feed.xml',
views.JrnlRSSFeedView(),
name="feed"
),
- url(
- r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
+ re_path(
+ r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
views.EntryDetailViewTXT.as_view(),
name="detail-txt"
),
- url(
- r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
+ re_path(
+ r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
views.EntryDetailView.as_view(),
name="detail"
),
- url(
+ re_path(
r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$',
views.EntryMonthArchiveView.as_view(month_format='%m'),
name="list_month"
),
- url(
+ re_path(
r'(?P<year>\d{4})/$',
views.EntryYearArchiveView.as_view(),
name="list_year"
),
- url(
+ re_path(
+ r'^(?P<page>\d+)/$',
+ views.EntryList.as_view(),
+ name="list"
+ ),
+ re_path(
r'(?P<slug>[-\w]+)/(?P<page>\d+)/$',
views.EntryCountryList.as_view(),
name="list_country"
),
- url(
- r'(?P<page>\d+)/$',
- views.EntryList.as_view(),
- name="list"
- ),
- # redirect /slug/ to /slug/1/ for live server
- url(
- r'(?P<slug>[-\w]+)/$',
- RedirectView.as_view(url="/jrnl/%(slug)s/1/", permanent=False),
- name="live_location_redirect"
+ re_path(
+ r'^(?P<slug>[-\w]+)/$',
+ views.EntryCountryList.as_view(),
+ {'page':1},
+ name="list_country"
),
- # redirect / to /1/ for live server
- url(
+ re_path(
r'',
- RedirectView.as_view(url="/jrnl/1/", permanent=False),
- name="live_redirect"
+ views.EntryList.as_view(),
+ {'page':1},
+ name="list"
),
]
diff --git a/app/jrnl/views.py b/app/jrnl/views.py
index 59fff7a..28d44a1 100644
--- a/app/jrnl/views.py
+++ b/app/jrnl/views.py
@@ -17,7 +17,7 @@ class EntryList(PaginatedListView):
Return a list of Entries in reverse chronological order
"""
queryset = Entry.objects.filter(status__exact=1).order_by('-pub_date').select_related()
- template_name = "archives/writing.html"
+ template_name = "archives/jrnl.html"
class EntryCountryList(PaginatedListView):
diff --git a/app/lib/pagination/templates/pagination/pagination.html b/app/lib/pagination/templates/pagination/pagination.html
index 0b99346..e2f8e42 100644
--- a/app/lib/pagination/templates/pagination/pagination.html
+++ b/app/lib/pagination/templates/pagination/pagination.html
@@ -2,7 +2,7 @@
<ul class="pages">{% if page_obj.has_previous %}
<li><a href="{% page_path prev_page %}" class="prev"> Newer</a></li>{% endif %}{% for page in pages %}{% if page %}{% if page == page_obj.number %}
<li class="current page">{{ page }}</li>{% else %}
- <li><a href="{% page_path page %}" class="page">{{ page }}</a></li>{% endif %}{% else %}
+ <li><a href="{% if page == 1%}/{{request.base_path}}/{%else%}{% page_path page %}{%endif%}" class="page">{{ page }}</a></li>{% endif %}{% else %}
<li>...</li>{% endif %}{% endfor %}{% if page_obj.has_next %}
<li><a href="{% if use_page_path %}{% page_path next_page %}{% else %}?page={{ page_obj.next_page_number }}{{ getvars }}{% endif %}" class="next">Older</a></li>
{% endif %}
diff --git a/app/links/urls.py b/app/links/urls.py
index 6f9bf22..792a5ea 100644
--- a/app/links/urls.py
+++ b/app/links/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls import url
+from django.urls import path, re_path
from django.views.generic.base import RedirectView
from . import views
@@ -6,34 +6,36 @@ from . import views
app_name = "links"
urlpatterns = [
- url(
+ re_path(
+ r'^tag/(?P<slug>[-\w]+)/$',
+ views.LinkTagListView.as_view(),
+ {'page':1},
+ name='list-tag'
+ ),
+ re_path(
r'tag/(?P<slug>[-\w]+)/(?P<page>\d+)/$',
views.LinkTagListView.as_view(),
name='list-tag'
),
- url(
+ re_path(
r'(?P<slug>[-\d]+).txt$',
views.LinkDetailViewTXT.as_view(),
name="detail-txt"
),
- url(
- r'(?P<slug>[-\d]+)$',
+ path(
+ r'<int:slug>',
views.LinkDetailView.as_view(),
name='detail'
),
- url(
+ re_path(
r'(?P<page>\d+)/$',
views.LinkListView.as_view(),
name='list'
),
- url(
- r'^tag/(?P<slug>[-\w]+)/$',
- RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False),
- name="live-redirect-tag"
- ),
- url(
- r'^$',
- RedirectView.as_view(url="/links/1/", permanent=False),
- name="live-redirect"
+ path(
+ r'',
+ views.LinkListView.as_view(),
+ {'page':1},
+ name='list'
),
]
diff --git a/app/links/views.py b/app/links/views.py
index 2c74509..ebde61c 100644
--- a/app/links/views.py
+++ b/app/links/views.py
@@ -19,7 +19,8 @@ class LinkTagListView(PaginatedListView):
template_name = 'archives/links.html'
def get_queryset(self):
- return Link.objects.filter(tags__name=self.kwargs['slug'])
+ print(self.kwargs['slug'])
+ return Link.objects.filter(tags__slug=self.kwargs['slug'])
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
diff --git a/app/locations/urls.py b/app/locations/urls.py
index 72a88de..df9854a 100644
--- a/app/locations/urls.py
+++ b/app/locations/urls.py
@@ -1,15 +1,14 @@
-from django.conf.urls import url
+from django.urls import path, re_path
from . import views
app_name = "locations"
urlpatterns = [
- url(r'data/(?P<id>\d+)/$', views.data_json),
- url(
- r'^$',
+ re_path(r'data/(?P<id>\d+)/$', views.data_json),
+ path(
+ r'',
views.MapList.as_view(),
name="maplist"
),
- #url(r'^$', views.map_list),
]
diff --git a/app/sightings/migrations/0002_auto_20180205_1430.py b/app/sightings/migrations/0002_auto_20180205_1430.py
new file mode 100644
index 0000000..e917508
--- /dev/null
+++ b/app/sightings/migrations/0002_auto_20180205_1430.py
@@ -0,0 +1,27 @@
+# Generated by Django 2.0.1 on 2018-02-05 14:30
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sightings', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='sighting',
+ options={'get_latest_by': 'pub_date', 'ordering': ['-pub_date']},
+ ),
+ migrations.RenameField(
+ model_name='sighting',
+ old_name='date',
+ new_name='pub_date',
+ ),
+ migrations.AlterField(
+ model_name='apclass',
+ name='kind',
+ field=models.IntegerField(choices=[(1, 'Birds'), (2, 'Mammals'), (3, 'Reptiles'), (4, 'Amphibians'), (5, 'Plants')], default=1),
+ ),
+ ]
diff --git a/app/sightings/urls.py b/app/sightings/urls.py
index 51b29d7..f60be22 100644
--- a/app/sightings/urls.py
+++ b/app/sightings/urls.py
@@ -1,4 +1,4 @@
-from django.urls import path
+from django.urls import path, re_path
from . import views
app_name = "sightings"
@@ -10,8 +10,8 @@ urlpatterns = [
{'page':1},
name="list"
),
- path(
- r'<int:page>/',
+ re_path(
+ r'(?P<page>\d+)/$',
views.SightingListView.as_view(),
name="list"
),
diff --git a/app/sketches/urls.py b/app/sketches/urls.py
index 6554cef..7f4c915 100644
--- a/app/sketches/urls.py
+++ b/app/sketches/urls.py
@@ -17,7 +17,7 @@ urlpatterns = [
name="list"
),
path(
- r'<int:page>/',
+ r'(?P<page>\d+)/$',
views.SketchListView.as_view(),
name="list"
),
diff --git a/app/birds/__init__.py b/app/unused_apps/birds/__init__.py
index e69de29..e69de29 100644
--- a/app/birds/__init__.py
+++ b/app/unused_apps/birds/__init__.py
diff --git a/app/birds/aba_importer.py b/app/unused_apps/birds/aba_importer.py
index 93f5bef..93f5bef 100644
--- a/app/birds/aba_importer.py
+++ b/app/unused_apps/birds/aba_importer.py
diff --git a/app/birds/admin.py b/app/unused_apps/birds/admin.py
index df0951a..df0951a 100644
--- a/app/birds/admin.py
+++ b/app/unused_apps/birds/admin.py
diff --git a/app/birds/autocomplete_light_registry.py b/app/unused_apps/birds/autocomplete_light_registry.py
index 1cfa881..1cfa881 100644
--- a/app/birds/autocomplete_light_registry.py
+++ b/app/unused_apps/birds/autocomplete_light_registry.py
diff --git a/app/birds/birds.json b/app/unused_apps/birds/birds.json
index f140300..f140300 100644
--- a/app/birds/birds.json
+++ b/app/unused_apps/birds/birds.json
diff --git a/app/birds/build.py b/app/unused_apps/birds/build.py
index 565b675..565b675 100644
--- a/app/birds/build.py
+++ b/app/unused_apps/birds/build.py
diff --git a/app/birds/migrations/0001_initial.py b/app/unused_apps/birds/migrations/0001_initial.py
index b20387e..b20387e 100644
--- a/app/birds/migrations/0001_initial.py
+++ b/app/unused_apps/birds/migrations/0001_initial.py
diff --git a/app/birds/migrations/0002_auto_20160313_0953.py b/app/unused_apps/birds/migrations/0002_auto_20160313_0953.py
index a2085ea..a2085ea 100644
--- a/app/birds/migrations/0002_auto_20160313_0953.py
+++ b/app/unused_apps/birds/migrations/0002_auto_20160313_0953.py
diff --git a/app/birds/migrations/0003_birdsighting_images.py b/app/unused_apps/birds/migrations/0003_birdsighting_images.py
index d20e8b7..d20e8b7 100644
--- a/app/birds/migrations/0003_birdsighting_images.py
+++ b/app/unused_apps/birds/migrations/0003_birdsighting_images.py
diff --git a/app/birds/migrations/0004_auto_20160321_1123.py b/app/unused_apps/birds/migrations/0004_auto_20160321_1123.py
index 7672a18..7672a18 100644
--- a/app/birds/migrations/0004_auto_20160321_1123.py
+++ b/app/unused_apps/birds/migrations/0004_auto_20160321_1123.py
diff --git a/app/birds/migrations/0005_auto_20170714_2222.py b/app/unused_apps/birds/migrations/0005_auto_20170714_2222.py
index 8bdfb4b..8bdfb4b 100644
--- a/app/birds/migrations/0005_auto_20170714_2222.py
+++ b/app/unused_apps/birds/migrations/0005_auto_20170714_2222.py
diff --git a/app/birds/migrations/0006_auto_20170714_2224.py b/app/unused_apps/birds/migrations/0006_auto_20170714_2224.py
index bd4db82..bd4db82 100644
--- a/app/birds/migrations/0006_auto_20170714_2224.py
+++ b/app/unused_apps/birds/migrations/0006_auto_20170714_2224.py
diff --git a/app/birds/migrations/0007_auto_20170821_1415.py b/app/unused_apps/birds/migrations/0007_auto_20170821_1415.py
index a51776c..a51776c 100644
--- a/app/birds/migrations/0007_auto_20170821_1415.py
+++ b/app/unused_apps/birds/migrations/0007_auto_20170821_1415.py
diff --git a/app/birds/migrations/0008_auto_20170821_1418.py b/app/unused_apps/birds/migrations/0008_auto_20170821_1418.py
index e5c80a4..e5c80a4 100644
--- a/app/birds/migrations/0008_auto_20170821_1418.py
+++ b/app/unused_apps/birds/migrations/0008_auto_20170821_1418.py
diff --git a/app/birds/migrations/0009_auto_20170821_1429.py b/app/unused_apps/birds/migrations/0009_auto_20170821_1429.py
index 840d7d3..840d7d3 100644
--- a/app/birds/migrations/0009_auto_20170821_1429.py
+++ b/app/unused_apps/birds/migrations/0009_auto_20170821_1429.py
diff --git a/app/birds/migrations/0010_auto_20170906_2100.py b/app/unused_apps/birds/migrations/0010_auto_20170906_2100.py
index aada189..aada189 100644
--- a/app/birds/migrations/0010_auto_20170906_2100.py
+++ b/app/unused_apps/birds/migrations/0010_auto_20170906_2100.py
diff --git a/app/unused_apps/birds/migrations/0011_auto_20180126_1456.py b/app/unused_apps/birds/migrations/0011_auto_20180126_1456.py
new file mode 100644
index 0000000..d63cf10
--- /dev/null
+++ b/app/unused_apps/birds/migrations/0011_auto_20180126_1456.py
@@ -0,0 +1,48 @@
+# Generated by Django 2.0.1 on 2018-01-26 14:56
+
+import birds.models
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('birds', '0010_auto_20170906_2100'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AP',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('common_name', models.CharField(max_length=200)),
+ ('slug', models.SlugField()),
+ ('scientific_name', models.CharField(max_length=200)),
+ ('code', models.IntegerField(choices=[(1, 'regular occurring - common'), (2, 'regular occurring - less common'), (3, 'rare'), (4, 'casual'), (5, 'accidental'), (6, 'Cannot be found')], default=0)),
+ ('image', models.FileField(blank=True, help_text='width of high res is 1360px', null=True, upload_to=birds.models.get_upload_path)),
+ ('image_credit', models.CharField(blank=True, max_length=200, null=True)),
+ ],
+ options={
+ 'ordering': ['common_name'],
+ },
+ ),
+ migrations.CreateModel(
+ name='APClass',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('common_name', models.CharField(max_length=200)),
+ ('scientific_name', models.CharField(max_length=200)),
+ ('kind', models.IntegerField(choices=[(1, 'Bird'), (2, 'Mammal'), (3, 'Reptile'), (4, 'Amphibian'), (5, 'Plant')], default=1)),
+ ],
+ options={
+ 'verbose_name_plural': 'Animal/Plant Class',
+ 'ordering': ['kind', 'common_name'],
+ },
+ ),
+ migrations.AddField(
+ model_name='ap',
+ name='apclass',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='birds.APClass'),
+ ),
+ ]
diff --git a/app/unused_apps/birds/migrations/0012_auto_20180126_1739.py b/app/unused_apps/birds/migrations/0012_auto_20180126_1739.py
new file mode 100644
index 0000000..307aa42
--- /dev/null
+++ b/app/unused_apps/birds/migrations/0012_auto_20180126_1739.py
@@ -0,0 +1,44 @@
+# Generated by Django 2.0.1 on 2018-01-26 17:39
+
+from django.conf import settings
+import django.contrib.gis.db.models.fields
+from django.db import migrations, models
+import django.db.models.deletion
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('locations', '0002_checkin'),
+ ('photos', '0018_auto_20161130_1218'),
+ ('contenttypes', '0002_remove_content_type_name'),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('birds', '0011_auto_20180126_1456'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Sighting',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('object_id', models.PositiveIntegerField()),
+ ('point', django.contrib.gis.db.models.fields.PointField(blank=True, srid=4326)),
+ ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
+ ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
+ ('images', models.ManyToManyField(blank=True, to='photos.LuxImage')),
+ ('location', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='locations.Location')),
+ ('seen_by', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
+ ],
+ ),
+ migrations.AlterField(
+ model_name='ap',
+ name='code',
+ field=models.IntegerField(choices=[(0, 'unknown'), (1, 'regular occurring - common'), (2, 'regular occurring - less common'), (3, 'rare'), (4, 'casual'), (5, 'accidental'), (6, 'Cannot be found')], default=0),
+ ),
+ migrations.AlterField(
+ model_name='bird',
+ name='code',
+ field=models.IntegerField(choices=[(0, 'unknown'), (1, 'regular occurring - common'), (2, 'regular occurring - less common'), (3, 'rare'), (4, 'casual'), (5, 'accidental'), (6, 'Cannot be found')], default=0),
+ ),
+ ]
diff --git a/app/unused_apps/birds/migrations/0013_auto_20180126_2010.py b/app/unused_apps/birds/migrations/0013_auto_20180126_2010.py
new file mode 100644
index 0000000..613597a
--- /dev/null
+++ b/app/unused_apps/birds/migrations/0013_auto_20180126_2010.py
@@ -0,0 +1,28 @@
+# Generated by Django 2.0.1 on 2018-01-26 20:10
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('birds', '0012_auto_20180126_1739'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='sighting',
+ name='content_type',
+ ),
+ migrations.RemoveField(
+ model_name='sighting',
+ name='object_id',
+ ),
+ migrations.AddField(
+ model_name='sighting',
+ name='ap',
+ field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='birds.AP'),
+ preserve_default=False,
+ ),
+ ]
diff --git a/app/unused_apps/birds/migrations/0014_auto_20180128_0902.py b/app/unused_apps/birds/migrations/0014_auto_20180128_0902.py
new file mode 100644
index 0000000..97791ef
--- /dev/null
+++ b/app/unused_apps/birds/migrations/0014_auto_20180128_0902.py
@@ -0,0 +1,21 @@
+# Generated by Django 2.0.1 on 2018-01-28 09:02
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('birds', '0013_auto_20180126_2010'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='ap',
+ options={'ordering': ['common_name'], 'verbose_name': 'Animal/Plant', 'verbose_name_plural': 'Animal/Plant'},
+ ),
+ migrations.AlterModelOptions(
+ name='sighting',
+ options={'ordering': ['date']},
+ ),
+ ]
diff --git a/app/birds/migrations/__init__.py b/app/unused_apps/birds/migrations/__init__.py
index e69de29..e69de29 100644
--- a/app/birds/migrations/__init__.py
+++ b/app/unused_apps/birds/migrations/__init__.py
diff --git a/app/birds/models.py b/app/unused_apps/birds/models.py
index 5a14786..5a14786 100644
--- a/app/birds/models.py
+++ b/app/unused_apps/birds/models.py
diff --git a/app/birds/urls.py b/app/unused_apps/birds/urls.py
index 8781433..8781433 100644
--- a/app/birds/urls.py
+++ b/app/unused_apps/birds/urls.py
diff --git a/app/birds/views.py b/app/unused_apps/birds/views.py
index 4d7f59e..4d7f59e 100644
--- a/app/birds/views.py
+++ b/app/unused_apps/birds/views.py
diff --git a/app/utils/views.py b/app/utils/views.py
index 6ebf44d..49b701b 100644
--- a/app/utils/views.py
+++ b/app/utils/views.py
@@ -22,6 +22,7 @@ class PaginatedListView(ListView):
request.page_url = request.path + '%d/'
print(request.page_url)
request.page = int(self.kwargs['page'])
+ request.base_path = path
return super(PaginatedListView, self).dispatch(request, *args, **kwargs)
diff --git a/config/base_urls.py b/config/base_urls.py
index fd7d6a7..1d2156d 100644
--- a/config/base_urls.py
+++ b/config/base_urls.py
@@ -46,7 +46,7 @@ urlpatterns = [
path(r'photos/', include('photos.urls')),
path(r'books/', include('books.urls')),
#path(r'field-notes/', include('notes.urls')),
- path(r'birds/', include('birds.urls', namespace='birds')),
+ #path(r'birds/', include('birds.urls', namespace='birds')),
path(r'sightings/', include('sightings.urls', namespace='sightings')),
path(r'field-notes/', include('sketches.urls', namespace='sketches')),
path(r'src/', include('src.urls', namespace='src')),
diff --git a/design/templates/archives/jrnl.html b/design/templates/archives/jrnl.html
new file mode 100644
index 0000000..e249cd3
--- /dev/null
+++ b/design/templates/archives/jrnl.html
@@ -0,0 +1,46 @@
+{% extends 'base.html' %}
+{% load typogrify_tags %}
+{% load pagination_tags %}
+
+{% block pagetitle %}Luxagraf | {% if region %}Travel Writing from {{region.name|title|smartypants|safe}}{%else%}Travel Writing from Around the World {%endif%}{% if page != "1" %} -- Page {{page}}{%endif%}{% endblock %}
+{% block metadescription %}{% if region %}Travel writing, essays and dispatches from {{region.name|title|smartypants|safe}}{%else%}Travel writing, essays and dispatches from around the world{%endif%} Page {{page}}{% endblock %}
+{%block bodyid%}id="writing"{%endblock%}
+
+
+{% block primary %}<ul class="bl" id="breadcrumbs" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
+ <li><a href="/" title="luxagraf homepage" itemprop="url"><span itemprop="title">Home</span></a> &rarr; </li>
+ {% if region %}{%if region.name == 'United States'%} <li><a href="/jrnl/" title="See all Journal Entries" itemprop="url"><span itemprop="title">Journal</span></a> &rarr;</li>
+ <li itemprop="title">the United States</li>{%else%}<li><a href="/jrnl/" title="See all Journal Entries" itemprop="url"><span>Journal</span></a> &rarr;</li>
+ <li>{{region.name|title|smartypants|safe}}</li>{%endif%}{%else%}<li>Journal</li>{%endif%}
+ </ul>
+ <main role="main" id="writing-archive" class="archive">
+ <h1 class="hide">{% if region %}Journal entries from {%if region.name == 'United States'%}the United States{%else%}{{region.name|title|smartypants|safe}}{%endif%}{%else%}Journal {%endif%}</h1>{% autopaginate object_list 24 %} {% for object in object_list %}
+ <article class="h-entry hentry {% cycle 'odd' 'even' %} {% cycle 'first' 'second' 'third' %}" itemscope itemType="http://schema.org/Article">
+ <div class="post--image">
+ <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_url}}" alt="{{ object.title }}" class="u-photo post-image" itemprop="image" /></a>
+ </div>
+ <h2 class="p-name entry-title post--title" itemprop="headline"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants|widont}}</a></h2>
+ <p class="p-author author hide" itemprop="author"><span class="byline-author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Scott Gilbertson</span></span></p>
+ <time class="dt-published published dt-updated post--date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time>
+ <p>
+ <span class="p-location h-adr adr post--location" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place">
+ {% if object.country.name == "United States" %}<span class="p-locality locality">{{object.location.name|smartypants|safe}}</span>, <a class="p-region region" href="/jrnl/united-states/" title="travel writing from the United States">{{object.state.name}}</a>, <span class="p-country-name">U.S.</span>{%else%}<span class="p-region">{{object.location.name|smartypants|safe}}</span>, <a class="p-country-name country-name" href="/jrnl/{{object.country.slug}}/" title="travel writing from {{object.country.name}}">{{object.country.name}}</a>{%endif%}
+ <span style="display: none;" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
+ <data itemprop="latitude" class="p-latitude" value="{{object.latitude}}">{{object.latitude}}</data>
+ <data itemprop="longitude" class="p-longitude" value="{{object.longitude}}">{{object.longitude}}</data>
+ </span>
+ </span> &ndash;
+ <span class="p-summary entry-summary hyphenate" itemprop="description">
+ {{object.dek|safe}}
+ </span>
+ </p>
+ </article> {% endfor %}
+ </main>
+ <nav class="pagination">
+ {% paginate %}
+ </nav>
+{% endblock %}
+
+
+
+{% block js %}<script src="/media/js/hyphenate.min.js" type="text/javascript"></script>{% endblock%}
diff --git a/design/templates/archives/sketches.html b/design/templates/archives/sketches.html
index 56d3714..1021c25 100644
--- a/design/templates/archives/sketches.html
+++ b/design/templates/archives/sketches.html
@@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load typogrify_tags %}
{% load html5_datetime %}
+{% load pagination_tags %}
{% block pagetitle %} Field Notes | luxagraf {% endblock %}
{% block metadescription %} Rough notes and sketches from the field {% endblock %}
{%block bodyid%}class="notes" id="notes-archive"{%endblock%}
@@ -13,8 +14,7 @@
<main role="main">
<h1>Field Notes</h1>
<h4 class="subhead divide-after">Quick notes, sketches and images from the road (often literally)</h4>
- {% for object in object_list %}
-
+ {% autopaginate object_list 12 %}{% for object in object_list %}
<article class="h-entry post--article">
{% if object.title %}<h1 class="p-name note--title"><a href="{{object.get_absolute_url}}" class="permalink">{{object.title|safe|amp|smartypants}}</a></h1>{%endif%}
<div class="e-content">