summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/builder/views.py5
-rw-r--r--app/gtd/admin.py9
-rw-r--r--app/notes/admin.py28
-rw-r--r--app/notes/forms.py15
-rw-r--r--app/notes/migrations/0001_initial.py30
-rw-r--r--app/notes/migrations/0002_luxnote_tags.py20
-rw-r--r--app/notes/migrations/__init__.py0
-rw-r--r--app/notes/models.py41
-rw-r--r--app/notes/templates/confirm_delete.html12
-rw-r--r--app/notes/templates/note_detail.html25
-rw-r--r--app/notes/templates/note_form.html39
-rw-r--r--app/notes/templates/note_list.html31
-rw-r--r--app/notes/templates/project_detail.html40
-rw-r--r--app/notes/templates/project_form.html35
-rw-r--r--app/notes/templates/project_list.html25
-rw-r--r--app/notes/urls.py39
-rw-r--r--app/notes/views.py75
-rw-r--r--app/posts/build.py12
-rw-r--r--app/posts/models.py2
-rw-r--r--app/posts/templates/photo_essay_detail.html4
-rw-r--r--app/posts/templates/photo_essay_list.html47
-rw-r--r--app/posts/urls/__init__old.py4
-rw-r--r--app/posts/urls/friends_urls.py25
-rw-r--r--app/posts/urls/guide_urls.py30
-rw-r--r--app/posts/urls/range_urls.py20
-rw-r--r--app/posts/urls/trip_urls.py25
-rw-r--r--app/posts/views/photo_essay_views.py10
-rw-r--r--app/trading/admin.py2
28 files changed, 535 insertions, 115 deletions
diff --git a/app/builder/views.py b/app/builder/views.py
index 6621bc2..c39297d 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -6,7 +6,7 @@ from django.template import RequestContext
from books.build import builder as book_builder
from sightings.build import builder as sightings_builder
from pages.build import BuildPages, BuildHome
-from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide, BuildEssays, BuildRange, BuildFriends, BuildFilms, BuildTrips, BuildSitemap
+from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide, BuildEssays, BuildRange, BuildFriends, BuildFilms, BuildTrips, BuildSitemap, BuildPhotoEssays
def do_build(request):
section = request.GET.get('id', '')
@@ -28,6 +28,9 @@ def do_build(request):
elif section == 'homepage':
context = {'message': 'Writing index to Disk'}
BuildHome("pages", "homepage").build()
+ elif section == 'photos':
+ context = {'message': 'Writing Photo Essasy to Disk'}
+ BuildPhotoEssays("posts", "post").build()
elif section == 'films':
context = {'message': 'Writing films to Disk'}
BuildFilms("posts", "post").build()
diff --git a/app/gtd/admin.py b/app/gtd/admin.py
index 7335727..49520f2 100644
--- a/app/gtd/admin.py
+++ b/app/gtd/admin.py
@@ -5,7 +5,9 @@ from utils.widgets import AdminImageWidget, LGEntryForm
from .models import (
WiredNote,
WiredPost,
- WiredUpdate
+ WiredUpdate,
+ GTDNote,
+ GTDProject
)
@admin.register(WiredPost)
class WiredPostAdmin(admin.ModelAdmin):
@@ -22,3 +24,8 @@ class WiredPostAdmin(admin.ModelAdmin):
class WiredUpdateAdmin(admin.ModelAdmin):
list_display = ('name', 'date')
+
+@admin.register(GTDNote)
+class GTDNoteAdmin(admin.ModelAdmin):
+ list_display = ('title', 'project','url', 'note_type' )
+ list_filter = ['project', 'note_type']
diff --git a/app/notes/admin.py b/app/notes/admin.py
new file mode 100644
index 0000000..2c099ca
--- /dev/null
+++ b/app/notes/admin.py
@@ -0,0 +1,28 @@
+from django.contrib import admin
+
+from utils.widgets import AdminImageWidget, LGEntryForm, TagListFilter
+
+from .models import (
+ LuxNote,
+)
+
+
+@admin.register(LuxNote)
+class LuxNoteAdmin(admin.ModelAdmin):
+ list_display = ('title', 'admin_link', 'date_created')
+ search_fields = ['title', 'description', 'url']
+ list_filter = [TagListFilter]
+ fieldsets = (
+ (None, {
+ 'fields': (
+ 'title',
+ 'url',
+ 'description',
+ 'body_markdown',
+ 'tags',
+ )
+ }),
+ )
+
+ class Media:
+ js = ('next-prev-links.js',)
diff --git a/app/notes/forms.py b/app/notes/forms.py
new file mode 100644
index 0000000..72395c6
--- /dev/null
+++ b/app/notes/forms.py
@@ -0,0 +1,15 @@
+from django.forms import ModelForm
+
+from .models import LuxNote
+
+
+class LuxNoteCreateForm(ModelForm):
+ class Meta:
+ model = LuxNote
+ fields = ['title', 'url', 'description', 'body_markdown', 'tags' ]
+
+
+class LuxNoteEditForm(ModelForm):
+ class Meta:
+ model = LuxNote
+ fields = ['title', 'url', 'description', 'body_markdown', 'tags' ]
diff --git a/app/notes/migrations/0001_initial.py b/app/notes/migrations/0001_initial.py
new file mode 100644
index 0000000..deb651d
--- /dev/null
+++ b/app/notes/migrations/0001_initial.py
@@ -0,0 +1,30 @@
+# Generated by Django 5.1.7 on 2025-04-07 16:21
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='LuxNote',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('title', models.CharField(max_length=200)),
+ ('url', models.CharField(blank=True, max_length=400, null=True)),
+ ('description', models.TextField(blank=True, null=True)),
+ ('body_markdown', models.TextField(blank=True, null=True)),
+ ('body_html', models.TextField(blank=True)),
+ ('date_created', models.DateTimeField(auto_now=True)),
+ ],
+ options={
+ 'ordering': ('-date_created',),
+ 'get_latest_by': 'date_created',
+ },
+ ),
+ ]
diff --git a/app/notes/migrations/0002_luxnote_tags.py b/app/notes/migrations/0002_luxnote_tags.py
new file mode 100644
index 0000000..6cb50be
--- /dev/null
+++ b/app/notes/migrations/0002_luxnote_tags.py
@@ -0,0 +1,20 @@
+# Generated by Django 5.1.7 on 2025-04-07 16:22
+
+import taggit.managers
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('notes', '0001_initial'),
+ ('taggit', '0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='luxnote',
+ name='tags',
+ field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
+ ),
+ ]
diff --git a/app/notes/migrations/__init__.py b/app/notes/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/notes/migrations/__init__.py
diff --git a/app/notes/models.py b/app/notes/models.py
new file mode 100644
index 0000000..c0c88e8
--- /dev/null
+++ b/app/notes/models.py
@@ -0,0 +1,41 @@
+import datetime
+
+from django.db import models
+from django.urls import reverse
+from django.utils import timezone
+from django.utils.html import format_html
+
+from taggit.managers import TaggableManager
+from utils.util import markdown_to_html
+
+
+#class LuxProject(models.Model):
+
+class LuxNote(models.Model):
+ title = models.CharField(max_length=200)
+ url = models.CharField(max_length=400, blank=True, null=True)
+ description = models.TextField(blank=True, null=True)
+ body_markdown = models.TextField(null=True, blank=True)
+ body_html = models.TextField(blank=True)
+ date_created = models.DateTimeField(auto_now=True)
+ #project = models.ForeignKey(LuxProject, on_delete=models.SET_NULL, null=True, blank=True)
+ tags = TaggableManager(blank=True)
+
+ class Meta:
+ ordering = ('-date_created',)
+ get_latest_by = 'date_created'
+
+ def __str__(self):
+ return self.title
+
+ def admin_link(self):
+ return format_html('<a href="%s">Visit Site</a>' % (self.url))
+ admin_link.short_description = 'Link'
+
+ def save(self, *args, **kwargs):
+ if self.body_markdown:
+ self.body_html = markdown_to_html(self.body_markdown)
+ super(LuxNote, self).save(*args, **kwargs)
+
+ def get_absolute_url(self, *args, **kwargs):
+ return reverse('notes:note-edit', kwargs={"pk": self.pk})
diff --git a/app/notes/templates/confirm_delete.html b/app/notes/templates/confirm_delete.html
new file mode 100644
index 0000000..8e657b1
--- /dev/null
+++ b/app/notes/templates/confirm_delete.html
@@ -0,0 +1,12 @@
+<form method="post">{% csrf_token %}
+
+
+
+
+<p>Are you sure you want to delete "{{ object }}"?</p>
+
+
+
+
+ <input type="submit" value="Confirm">
+</form>
diff --git a/app/notes/templates/note_detail.html b/app/notes/templates/note_detail.html
new file mode 100644
index 0000000..5dc7ace
--- /dev/null
+++ b/app/notes/templates/note_detail.html
@@ -0,0 +1,25 @@
+{% extends 'base_notes.html' %}
+{% block primary %}
+<style>
+p {
+ margin-top: 1rem !important;
+ margin-bottom: 1rem;
+}
+</style>
+<main class="post-detail">
+ <div class="note-list">
+ <article>
+ <h2>{% if object.url %}<a href="{{object.url}}">{{object.title}}</a>{%else%}{{object.title}}{%endif%} <span class="note-edit"><a href="{%url 'notes:note-edit' object.id %}">edit</a></span></h2>
+ <p>{{object.description}}</p>
+ --------------------
+ <p>{{object.body_html|safe}}</p>
+ <p class="small"><a href="{% url 'notes:note-delete' object.pk %}">delete</a></p>
+ </article>
+</div>
+</main>
+
+
+{% endblock %}
+{% block js %}
+<script type="text/javascript">var go_from_select = function(opt) { window.location = window.location.pathname + opt };</script>
+{% endblock%}
diff --git a/app/notes/templates/note_form.html b/app/notes/templates/note_form.html
new file mode 100644
index 0000000..9c8ac37
--- /dev/null
+++ b/app/notes/templates/note_form.html
@@ -0,0 +1,39 @@
+{% extends 'base_notes.html' %}
+{% block extrahead %}
+<style>
+form .selector label {
+ position: inherit;
+}
+</style>
+<script src="/media/js/nice-select2.js"></script>
+<link rel="stylesheet" href="/media/nice-select2.css">
+{% endblock %}
+{% block primary %}
+<main role="main" class="archive-wrapper">
+ <div class="post-body">
+ <form action="" method="post" class="comment-form">{% csrf_token %}
+ {% for field in form %}
+ <fieldset>
+ {%if field.name == "project" or field.name == "status" or field.name == 'note_type'%}<span class="selector">{{field.label_tag}}</span>{%else%}{{field.label_tag}}{%endif%}
+ {%if field.name == "body_markdown" or field.name == "description" %}<div class="textarea-rounded">{{ field }}</div>{%else%}{{field}}{%endif%}
+ </fieldset>
+ <small class="alert">{% if field.errors %}{{field.errors}}{% endif %}</small>
+ {%endfor%}
+ <input class="btn" type="submit" name="add_new" value="Save and add another" />
+ <input type="submit" name="save" class="btn" value="Save" />
+ </form>
+ </div>
+</main>
+{% endblock %}
+ {% block js %}
+<script type="text/javascript">
+var options = {searchable: true};
+NiceSelect.bind(document.getElementById("id_project"), options);
+ {% if is_update %}{%else%}
+let params = new URL(document.location).searchParams;
+document.getElementById('id_title').value = params.get("title");
+document.getElementById('id_url').value = params.get("url");
+document.getElementById('id_body_markdown').value = params.get("description");
+{% endif %}
+</script>
+ {% endblock%}
diff --git a/app/notes/templates/note_list.html b/app/notes/templates/note_list.html
new file mode 100644
index 0000000..1439f4a
--- /dev/null
+++ b/app/notes/templates/note_list.html
@@ -0,0 +1,31 @@
+{% extends 'base_notes.html' %}
+{% block primary %}
+<main class="post-detail">
+ <div class="post-header"><ul class="flex header-list">
+ <li><a class="btn" href="{% url 'notes:note-list' %}">All</a></li>
+ {% for object in note_types %}
+ <li><a class="btn" href="{% url 'gtd:note-list-status' object.label|lower%}">{{object.label}}</a></li>
+ {% endfor %}
+ <li class="right"><a href="{% url 'notes:note-create' %}" class="btn">New Note</a></li>
+ </ul>
+
+<select class="form-control" style="margin-top: 2%;" onchange="go_from_select(this.options[this.selectedIndex].value)">
+ <option value="">All Projects</option>{% for object in tags %}
+ <option {% if current == object.name %}selected="selected" {%endif%}value="?tag={{object}}">{{object}}</option>{%endfor%}
+</select>
+ </div>
+ <div class="note-list">{% for object in object_list %}<article>
+ <h2>{% if object.url %}<a href="{{object.url}}">{{object.title}}</a>{%else%}{{object.title}}{%endif%} <span class="note-edit"><a href="{%url 'notes:note-edit' object.id %}">edit</a></span></h2>
+ <p>{{object.description}}</p>
+ {% if object.project %}<p class="small">For: <a href="{% url 'notes:project-detail' object.project.id %}">{{object.project}}</a></p>{%endif%}
+ <p class="small"><a href="{% url 'notes:note-detail' object.pk %}">View local</a></p>
+ <p class="small"><a href="{% url 'notes:note-delete' object.pk %}">delete</a></p>
+ </article>
+{% endfor%}</div>
+</main>
+
+
+{% endblock %}
+{% block js %}
+<script type="text/javascript">var go_from_select = function(opt) { window.location = window.location.pathname + opt };</script>
+{% endblock%}
diff --git a/app/notes/templates/project_detail.html b/app/notes/templates/project_detail.html
new file mode 100644
index 0000000..543b9f6
--- /dev/null
+++ b/app/notes/templates/project_detail.html
@@ -0,0 +1,40 @@
+{% extends 'base_gtd.html' %}
+{% load typogrify_tags %}
+{% load get_note_type %}
+{% block extrahead %}
+<style>
+.detail-header {
+ margin-top: 3rem;
+ margin-bottom: 1rem;
+ padding-bottom: 1rem;
+}
+</style>
+{% endblock %}
+{% block primary %}
+<main role="main" class="archive-wrapper">
+ <div class="post-header detail-header">
+ <h1>Project: {{object.title}}</h1>
+
+<select class="form-control" style="margin-top: 2%;" onchange="go_from_select(this.options[this.selectedIndex].value)">
+ <option value="">All Projects</option>{% for object in projects %}
+ <option {% if object.title == project %}selected="selected" {%endif%}value="{% url 'gtd:project-detail' object.id%}">{{object}}</option>{%endfor%}
+</select>
+ </div>
+ <div class="post-body">
+ {{object.body_html|smartypants|safe}}
+ {% regroup note_set by note_type as type_list %}
+ {% for type in type_list %}
+ <h4>{% get_note_type type.grouper %}</h4>
+ <div class="note-list">{% for object in type.list %}<article>
+ <h2>{% if object.get_status_display == 'Completed' %}<strike style="color: #918d8d">{%endif%}{% if object.url %}<a href="{{object.url}}">{{object.title}}</a>{%else%}{{object.title}}{%endif%} <span class="note-edit"><a href="{%url 'gtd:note-edit' object.pk%}">edit</a></span>{% if object.get_status_display == 'Completed' %}</strike>{%endif%}</h2>
+ {{object.body_html|smartypants|safe}}
+ {% if object.get_status_display != 'None' %}<p class="small">{{object.get_status_display}}</p>{% endif %}
+ <p class="small"><a href="{% url 'gtd:note-delete' object.pk %}">delete</a></p></article>
+ {% endfor %}</div>
+{% endfor %}
+ </div>
+</main>
+{% endblock %}
+{% block js %}
+<script type="text/javascript">var go_from_select = function(opt) { console.log(opt); window.location = opt };</script>
+{% endblock%}
diff --git a/app/notes/templates/project_form.html b/app/notes/templates/project_form.html
new file mode 100644
index 0000000..ac7d13f
--- /dev/null
+++ b/app/notes/templates/project_form.html
@@ -0,0 +1,35 @@
+{% extends 'base_gtd.html' %}
+
+{% block extrahead %}
+<style>
+form .selector label {
+ position: inherit;
+}
+</style>
+{% endblock %}
+{% block primary %}
+<main role="main" class="archive-wrapper">
+ <div class="post-body">
+ <form action="" method="post" class="comment-form">{% csrf_token %}
+ {% for field in form %}
+ <fieldset>
+ {%if field.name == "project_type" or field.name == "outcome" or field.name == 'note_type'%}<span class="selector">{{field.label_tag}}</span>{%else%}{{field.label_tag}}{%endif%}
+ {%if field.name == "body_markdown"%}<div class="textarea-rounded">{{ field }}</div>{%else%}{{field}}{%endif%}
+ </fieldset>
+ <small class="alert">{% if field.errors %}{{field.errors}}{% endif %}</small>
+ {%endfor%}
+ <input class="btn" type="submit" name="add_new" value="Save and add another" />
+ <input type="submit" name="save" class="btn" value="Save" />
+ </form>
+ </div>
+</main>
+{% endblock %}
+ {% block js %}
+ {% if is_update %}{%else%}
+<script type="text/javascript">
+let params = new URL(document.location).searchParams;
+document.getElementById('id_title').value = params.get("title");
+document.getElementById('id_body_markdown').value = params.get("description");
+</script>
+{% endif %}
+ {% endblock%}
diff --git a/app/notes/templates/project_list.html b/app/notes/templates/project_list.html
new file mode 100644
index 0000000..ba46b59
--- /dev/null
+++ b/app/notes/templates/project_list.html
@@ -0,0 +1,25 @@
+{% extends 'base_gtd.html' %}
+{% block primary %}
+<main class="post-detail">
+ <div class="post-header"><ul class="flex header-list">
+ <li><a class="btn" href="{% url 'gtd:project-list' %}">All</a></li>
+ {% for object in project_types %}
+ <li><a class="btn" href="{% url 'gtd:project-list-type' object.1|lower%}">{%if object.1 == 'Lbh'%}{{object.1|upper}}{%else%}{{object.1}}{%endif%}</a></li>
+ {% endfor %}
+ <li class="right"><a href="{% url 'gtd:project-create' %}" class="btn">New</a></li>
+ </ul>
+ </div>
+ <div class="note-list">{% for object in object_list %}<article>
+ <h2><a href="{{object.get_absolute_url}}">{{object.title}}</a><span class="note-edit"><a href="{% url 'gtd:project-edit' object.pk %}">edit</a></span></h2>
+ <p>{{object.body_markdown}}</p>
+ <p class="small">Date Goal: {{object.date_goal}}</p>
+ <p class="small">Type: {{object.get_project_type_display}}</p>
+ <p class="small"><a href="{% url 'gtd:project-delete' object.pk %}">delete</a></p>
+ </article>
+{% endfor%}</div>
+</main>
+
+
+{% endblock %}
+{% block js %}
+{% endblock%}
diff --git a/app/notes/urls.py b/app/notes/urls.py
new file mode 100644
index 0000000..cdab47c
--- /dev/null
+++ b/app/notes/urls.py
@@ -0,0 +1,39 @@
+from django.urls import path
+
+from . import views
+
+app_name = "notes"
+
+urlpatterns = [
+ path(
+ r'',
+ views.LuxNoteListView.as_view(),
+ {'note_type': None},
+ name="note-list"
+ ),
+ path(
+ r'create',
+ views.LuxNoteCreateView.as_view(),
+ name="note-create"
+ ),
+ path(
+ r'<pk>',
+ views.LuxNoteDetailView.as_view(),
+ name="note-detail"
+ ),
+ path(
+ r'<str:note_type>',
+ views.LuxNoteListView.as_view(),
+ name="note-list-status"
+ ),
+ path(
+ r'<pk>/edit',
+ views.LuxNoteUpdateView.as_view(),
+ name="note-edit"
+ ),
+ path(
+ r'<pk>/delete',
+ views.LuxNoteDeleteView.as_view(),
+ name="note-delete"
+ ),
+]
diff --git a/app/notes/views.py b/app/notes/views.py
new file mode 100644
index 0000000..984af9a
--- /dev/null
+++ b/app/notes/views.py
@@ -0,0 +1,75 @@
+from django.views.generic import UpdateView, DetailView, ListView, CreateView, DeleteView, RedirectView
+from django.views.generic.base import TemplateView
+from django.urls import reverse, reverse_lazy
+from django.db.models import Q
+from django.db.models import Count
+
+#from taxonomy.models import Category
+
+from .models import (
+ LuxNote,
+)
+
+from .forms import (
+ LuxNoteCreateForm,
+ LuxNoteEditForm,
+)
+
+
+class LuxNoteCreateView(CreateView):
+ model = LuxNote
+ form_class = LuxNoteCreateForm
+ template_name = "note_form.html"
+
+ def get_success_url(self):
+ if 'add_new' in self.request.POST:
+ return reverse('notes:note-create')
+ else:
+ if self.object.project:
+ return reverse('notes:project-detail', kwargs={"pk": self.object.project.pk})
+ else:
+ return reverse('notes:note-create')
+
+
+class LuxNoteUpdateView(UpdateView):
+ model = LuxNote
+ form_class = LuxNoteEditForm
+ template_name = "note_form.html"
+
+ def get_context_data(self, **kwargs):
+ context = super(LuxNoteUpdateView, self).get_context_data(**kwargs)
+ context['is_update'] = True
+ return context
+
+ def get_success_url(self):
+ return reverse('notes:note-list')
+
+
+class LuxNoteListView(ListView):
+ model = LuxNote
+ template_name = "note_list.html"
+
+ def get_queryset(self):
+ tag = self.request.GET.get("tag", False)
+ if tag:
+ return LuxNote.objects.filter(tags__name__in=[tag])
+ return LuxNote.objects.all()
+
+ def get_context_data(self, **kwargs):
+ context = super(LuxNoteListView, self).get_context_data(**kwargs)
+ context['tags'] = LuxNote.tags.all().order_by('name')
+ context['current'] = self.request.GET.get("tag", False)
+ return context
+
+
+class LuxNoteDeleteView(DeleteView):
+ # specify the model you want to use
+ model = LuxNote
+ success_url = "/notes"
+ template_name = "confirm_delete.html"
+
+
+class LuxNoteDetailView(DetailView):
+ model = LuxNote
+ template_name = "note_detail.html"
+
diff --git a/app/posts/build.py b/app/posts/build.py
index fdfcd1a..ba0fe27 100644
--- a/app/posts/build.py
+++ b/app/posts/build.py
@@ -175,6 +175,18 @@ class BuildFilms(BuildNew):
self.build_detail_view()
+class BuildPhotoEssays(BuildNew):
+
+ def get_model_queryset(self):
+ return self.model.objects.filter(post_type=PostType.PHOTO_ESSAY).filter(status__exact=1).order_by('-pub_date')
+
+ def build(self):
+ self.build_list_view(
+ base_path=reverse("photo_essay:list"),
+ paginate_by=30
+ )
+ self.build_detail_view()
+
class BuildTrips(BuildNew):
def get_model_queryset(self):
diff --git a/app/posts/models.py b/app/posts/models.py
index 6179fbe..ba578b8 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -135,6 +135,8 @@ class Post(models.Model):
return self.title
def get_absolute_url(self):
+ if self.post_type == PostType.PHOTO_ESSAY:
+ return reverse('photo_essay:detail', kwargs={"slug": self.slug})
if self.post_type == PostType.ESSAY:
return reverse('essays:detail', kwargs={"cat": self.get_post_topic_display(), "slug": self.slug})
if self.post_type == PostType.SRC:
diff --git a/app/posts/templates/photo_essay_detail.html b/app/posts/templates/photo_essay_detail.html
index 0655f40..de735f2 100644
--- a/app/posts/templates/photo_essay_detail.html
+++ b/app/posts/templates/photo_essay_detail.html
@@ -9,7 +9,7 @@
{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %}
{% block primary %}
<main role="main">
- <figure class="large-top-image">{%with object=object_list%}
+ <figure class="large-top-image">
<a href="{{object.get_absolute_url}}" title="{{object.title}}">{%with image=object.featured_image%}
<img style="margin:0;" sizes="(max-width: 960px) 100vw"
srcset="{{image.get_srcset}}"
@@ -30,5 +30,5 @@
{{object.body_html|safe|smartypants}}
</div>
</div>
- </main>{%endwith%}
+ </main>
{% endblock%}
diff --git a/app/posts/templates/photo_essay_list.html b/app/posts/templates/photo_essay_list.html
new file mode 100644
index 0000000..e8bebfd
--- /dev/null
+++ b/app/posts/templates/photo_essay_list.html
@@ -0,0 +1,47 @@
+{% extends 'base.html' %}
+{%block htmlclass%}class="detail single"{% endblock %}
+{% load typogrify_tags %}
+{% load get_image_by_size %}
+{% load html5_datetime %}
+{% load pagination_tags %}
+{% block pagetitle %} Photos | luxagraf {% endblock %}
+{% block metadescription %} Recent Images {% endblock %}
+{%block bodyid%}class="photos" id="notes-archive"{%endblock%}
+{% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %}
+{% block primary %}
+ <main class="archive-wrapper">
+ <div class="archive-intro">
+ <h1>Photos</h1>
+ <h3>I first picked up a camera in the late 1980s and started documenting trips into the mountains, inspired by <a href="https://en.wikipedia.org/wiki/Galen_Rowell">Galen Rowell</a>. These are ongoing projects, updated regularly.</h3>
+ <hr />
+ <h2>Join us. Subscribe to <em>Friends of a Long Year</em></h2>
+ <iframe target='_parent' style="border:none; background:white; width:100%;" title="embedded form for subscribing the the Friends of a Long Year newsletter" onload="resizeIframe(this)" src="{% url 'lttr:subscribe' slug='friends' %}"></iframe>
+ </div>
+ <ul class="photo-list">{% for object in object_list %}
+ <li class="h-entry hentry" itemscope itemType="http://schema.org/BlogPosting">{% get_image_by_size object.featured_image 'featured_photo_essay' as featured %}
+ <figure>
+ <a href="{{object.get_absolute_url}}">
+ <img src="{{featured}}" alt="{{object.featured_image.alt}} photographed by Scott Gilbertson">
+ </a>
+ <figcaption>
+ <h1 class="p-name" itemprop="headline">{{object.title|smartypants|safe}}</h1>
+ <time class="dt-published published dt-updated card-smcaps" datetime="{{object.pub_date|date:'c'}}" itemprop="datePublished"> &nbsp;&ndash; Last update: {{object.last_updated|date:"F Y"}}</time>
+ <span class="hide" itemprop="author" itemscope itemtype="http://schema.org/Person">by <span class="p-author h-card" ><span itemprop="name">Scott Gilbertson</span></span></span>
+ {%if object.location %}<span class="p-location h-adr adr card-smcaps" itemprop="contentLocation" itemscope itemtype="http://schema.org/Place">(
+ {% if object.location.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.location.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.location.country_slug}}/" title="travel writing from {{object.location.country_name}}">{{object.location.country_name}}</a>{%endif%}
+ )</span>{%endif%}
+ </figcaption>
+ </figure>
+ </a>
+ </li>{%endfor%}
+ </ul>
+ </main>
+{% endblock%}
+{% block js %}
+
+<script>
+ function resizeIframe(obj) {
+ obj.style.height = (obj.contentWindow.document.body.scrollHeight - 75) + 'px';
+ }
+</script>
+{% endblock %}
diff --git a/app/posts/urls/__init__old.py b/app/posts/urls/__init__old.py
deleted file mode 100644
index 4993c34..0000000
--- a/app/posts/urls/__init__old.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from .guide_urls import urlpatterns as guide_urlpatterns
-from .reviews_urls import urlpatterns as review_urlpatterns
-
-urlpatterns = review_urlpatterns + guide_urlpatterns
diff --git a/app/posts/urls/friends_urls.py b/app/posts/urls/friends_urls.py
deleted file mode 100644
index ca68ca0..0000000
--- a/app/posts/urls/friends_urls.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from django.urls import path, re_path, include
-from django.views.generic.base import RedirectView
-
-from ..views import friends_views as views
-
-app_name = "range"
-
-urlpatterns = [
- # path(
- # r'feed.xml',
- # views.FriendsRSSFeedView(),
- # name="feed"
- # ),
- # path(
- # r'<int:issue>/<str:slug>',
- # views.FriendsDetailView.as_view(),
- # name="friends-detail"
- # ),
- path(
- r'',
- views.FriendsListView.as_view(),
- {'page':1},
- name="friends-list"
- ),
-]
diff --git a/app/posts/urls/guide_urls.py b/app/posts/urls/guide_urls.py
deleted file mode 100644
index 5e2b37e..0000000
--- a/app/posts/urls/guide_urls.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from django.urls import path, re_path, include
-from django.views.generic.base import RedirectView
-
-from ..views import guide_views as views
-
-app_name = "guides"
-
-urlpatterns = [
- path(
- r'',
- views.GuideListView.as_view(),
- {'page':1},
- name="guide-list"
- ),
- path(
- r'<int:page>/',
- views.GuideListView.as_view(),
- name="guide-list"
- ),
- path(
- r'<str:topic>/<str:slug>',
- views.GuidePostDetailView.as_view(),
- name="guide-post-detail"
- ),
- path(
- r'<str:slug>/',
- views.GuideDetailView.as_view(),
- name="guide-detail"
- ),
-]
diff --git a/app/posts/urls/range_urls.py b/app/posts/urls/range_urls.py
deleted file mode 100644
index 65638ce..0000000
--- a/app/posts/urls/range_urls.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from django.urls import path, re_path, include
-from django.views.generic.base import RedirectView
-
-from ..views import range_views as views
-
-app_name = "range"
-
-urlpatterns = [
- path(
- r'',
- views.RangeListView.as_view(),
- {'page':1},
- name="list"
- ),
- path(
- r'<int:page>',
- views.RangeListView.as_view(),
- name="list"
- ),
-]
diff --git a/app/posts/urls/trip_urls.py b/app/posts/urls/trip_urls.py
deleted file mode 100644
index 7e9c95f..0000000
--- a/app/posts/urls/trip_urls.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from django.urls import path, re_path, include
-from django.views.generic.base import RedirectView
-
-from ..views import trip_views as views
-
-app_name = "trips"
-
-urlpatterns = [
- path(
- r'<str:slug>',
- views.TripDetailView.as_view(),
- name="detail"
- ),
- path(
- r'<int:page>/',
- views.TripListView.as_view(),
- name="list"
- ),
- path(
- r'',
- views.TripListView.as_view(),
- {'page':1},
- name="list"
- ),
-]
diff --git a/app/posts/views/photo_essay_views.py b/app/posts/views/photo_essay_views.py
index 4f08910..8c35621 100644
--- a/app/posts/views/photo_essay_views.py
+++ b/app/posts/views/photo_essay_views.py
@@ -14,13 +14,11 @@ from taxonomy.models import Category
class PhotoEssayListView(PaginatedListView):
model = Post
# TODO: change this when I have an actual archive to show
- template_name = "photo_essay_detail.html"
+ template_name = "photo_essay_list.html"
def get_queryset(self):
queryset = super(PhotoEssayListView, self).get_queryset()
- return queryset.get(slug="dawn")
- # real queryset
- #return queryset.filter(site__domain='luxagraf.net').filter(post_type__in=[PostType.PHOTO_ESSAY]).filter(status__exact=1).order_by('-pub_date').prefetch_related('location').prefetch_related('featured_image')
+ return queryset.filter(site__domain='luxagraf.net').filter(post_type__in=[PostType.PHOTO_ESSAY]).filter(status__exact=1).order_by('-pub_date').prefetch_related('location').prefetch_related('featured_image')
def get_context_data(self, **kwargs):
'''
@@ -48,10 +46,10 @@ class PhotoEssayDetailView(LuxDetailView):
related.append(model.objects.get(slug=obj.slug, pub_date=obj.pub_date))
context['related'] = related
context['breadcrumbs'] = ('Photos',)
- context['crumb_url'] = reverse('posts:photo-essay-list')
+ context['crumb_url'] = reverse('photo_essay:list')
return context
def get_template_names(self):
obj = self.get_object()
- return ["film_detail.html"]
+ return ["photo_essay_detail.html"]
diff --git a/app/trading/admin.py b/app/trading/admin.py
index 46982b0..5206c82 100644
--- a/app/trading/admin.py
+++ b/app/trading/admin.py
@@ -26,7 +26,7 @@ class LuxOptionsTradeAdmin(admin.ModelAdmin):
@admin.register(LuxTrade)
class LuxTradeAdmin(admin.ModelAdmin):
- list_display = ('symbol', 'status', 'open_date', 'entry_price', 'stop_price', 'close_price', 'shares', 'amount_invested')
+ list_display = ('symbol', 'status', 'open_date', 'close_date', 'entry_price', 'stop_price', 'close_price', 'shares', 'amount_invested')
list_filter = ['status', 'open_date']
class Media:
js = ('image-loader.js', 'next-prev-links.js')