summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-02-03 08:03:45 -0600
committerluxagraf <sng@luxagraf.net>2018-02-03 08:03:45 -0600
commit31b07974cddc8843bab58f5b3e3a6bac9b529433 (patch)
tree1d06166d1f1775a49cd8ac0d14d0f9ca8e111d8d
parent76bb858208c37c737d9ee99442e8772ca0871f80 (diff)
finished up notes app and made it live
-rw-r--r--app/sketches/models.py2
-rw-r--r--app/sketches/urls.py12
-rw-r--r--app/sketches/views.py2
-rw-r--r--config/base_urls.py4
-rw-r--r--design/sass/_notes.scss43
-rw-r--r--design/templates/archives/notes_date.html76
-rw-r--r--design/templates/base.html4
7 files changed, 39 insertions, 104 deletions
diff --git a/app/sketches/models.py b/app/sketches/models.py
index 0af28ad..22522bd 100644
--- a/app/sketches/models.py
+++ b/app/sketches/models.py
@@ -29,7 +29,7 @@ class Sketch(models.Model):
return self.title
def get_absolute_url(self):
- return reverse("sketch:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
+ return reverse("sketches:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
@property
def region(self):
diff --git a/app/sketches/urls.py b/app/sketches/urls.py
index 4bade9b..6554cef 100644
--- a/app/sketches/urls.py
+++ b/app/sketches/urls.py
@@ -1,10 +1,15 @@
-from django.urls import path
+from django.urls import path, re_path
from . import views
app_name = "sketches"
urlpatterns = [
+ re_path(
+ r'(?P<year>[0-9]{4})/$',
+ views.SketchYearArchiveView.as_view(),
+ name="list_year"
+ ),
path(
r'',
views.SketchListView.as_view(),
@@ -31,9 +36,4 @@ urlpatterns = [
views.SketchMonthArchiveView.as_view(month_format='%m'),
name="list_month"
),
- path(
- r'<int:year>/',
- views.SketchYearArchiveView.as_view(),
- name="list_year"
- ),
]
diff --git a/app/sketches/views.py b/app/sketches/views.py
index d6d548b..b696932 100644
--- a/app/sketches/views.py
+++ b/app/sketches/views.py
@@ -11,7 +11,7 @@ class SketchListView(PaginatedListView):
Return a list of Notes in reverse chronological order
"""
queryset = Sketch.objects.all().order_by('-pub_date')
- template_name = "archives/notes.html"
+ template_name = "archives/sketches.html"
class SketchDetailView(DetailView):
diff --git a/config/base_urls.py b/config/base_urls.py
index 341d3bb..9493d2f 100644
--- a/config/base_urls.py
+++ b/config/base_urls.py
@@ -44,10 +44,10 @@ urlpatterns = [
path(r'expenses/', include('expenses.urls', namespace='expenses')),
path(r'photos/', include('photos.urls')),
path(r'books/', include('books.urls')),
- path(r'field-notes/', include('notes.urls')),
+ #path(r'field-notes/', include('notes.urls')),
path(r'birds/', include('birds.urls', namespace='birds')),
path(r'sightings/', include('sightings.urls', namespace='sightings')),
- path(r'sketches/', include('sketches.urls', namespace='sketches')),
+ path(r'field-notes/', include('sketches.urls', namespace='sketches')),
path(r'src/', include('src.urls', namespace='src')),
path(r'figments/', include('figments.urls', namespace='figments')),
path(r'resume/', include('resume.urls', namespace='resume')),
diff --git a/design/sass/_notes.scss b/design/sass/_notes.scss
index 27655c7..e0f7c28 100644
--- a/design/sass/_notes.scss
+++ b/design/sass/_notes.scss
@@ -36,26 +36,12 @@
font-weight: 400;
font-size: 1.5em;
letter-spacing: 0px;
-}
-//date-as-headline
-.note--date-hed {
- margin-bottom: 0;
- time {
- text-align: left;
- font-weight: 400;
- font-size: 1.5em;
- letter-spacing: 0px;
- font-style: italic;
- text-transform: none;
- color: $body_font;
- }
a {
- border: none;
text-decoration: none;
+ color: $body_font !important;
}
}
-//small date
.note--date {
@include smcaps;
@include fontsize(11);
@@ -77,33 +63,6 @@
float: left;
}
}
-.note--actions {
- font-size: 0.75em;
- text-align: center;
- @include breakpoint(beta) {
- float: right;
- clear: both;
- margin-top: .5em;
- }
- li {
- display: inline-block;
- }
- li:after {
- content: "\2219";
- margin-left: 0.25em;
- padding-right: 0.35em;
- padding-left: 0.35em;
- }
- li:last-child:after {
- content: "";
- padding-right: 0;
- padding-left: 0;
- margin-left: 0;
- }
- a {
- color: $brown;
- }
-}
.note--footer {
margin-top: 1.7em;
@include breakpoint(beta) {
diff --git a/design/templates/archives/notes_date.html b/design/templates/archives/notes_date.html
index 345a383..be41176 100644
--- a/design/templates/archives/notes_date.html
+++ b/design/templates/archives/notes_date.html
@@ -13,42 +13,28 @@
<main role="main">
<h1>Field Notes Published in {% if not month %}{{year|date:"Y"}}{%else%} {{month|date:"F Y"}}{% endif %}</h1>{% if month %}{% for object in object_list %}</h1>
- <article class="h-entry">
- <h2 class="p-name note--title">{{object.title|safe|amp|smartypants}}</h2>
+ <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">
- {{object.body_html|safe|amp|smartypants}}
+ {{object.body_html|safe|smartypants}}
</div>
<span class="p-author h-card">
<data class="p-name" value="Scott Gilbertson"></data>
<data class="u-url" value="https://luxagraf.net/"></data>
</span>
- <footer class="note--footer">
- <p class="note--date">
- <a class="u-url" href="{{object.get_absolute_url}}" rel="bookmark"><time class="dt-published" datetime="{{object.pub_date|html5_datetime}}">{{object.pub_date|date:"F j, Y"}}</time></a>
- </p>{% if object.location %}
- <p class="p-location h-adr note--location bl" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
+ <footer>
+ {% if object.location %}
+ <p class="p-location h-adr note--location bl" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
<span class="p-locality">{{object.location.name|smartypants|safe}}</span>,
<span class="p-region">{{object.location.state.name}}</span>,
<span class="p-country-name">{{object.location.state.country.name}}</span>
<data class="p-latitude" value="{{object.latitude}}"></data>
<data class="p-longitude" value="{{object.longitude}}"></data>
- </p>{% endif %}{% if object.twitter_id %}
- <ul class="note--actions">
- <li><a rel="syndication" class="u-syndication" href="https://twitter.com/luxagraf/status/{{object.twitter_id}}">View on Twitter</a></li>
- <li>
- <action do="reply" with="{{SITE_URL}}{{object.get_absolute_url}}"><a href="https://twitter.com/intent/tweet?in_reply_to={{object.twitter_id}}">Reply</a></action>
- </li>
- <li>
- <action do="post" with="{{SITE_URL}}{{object.get_absolute_url}}">
- <a href="https://twitter.com/intent/retweet?tweet_id={{object.twitter_id}}">Retweet</a>
- </action>
- </li>
- <li>
- <action do="bookmark" with="{{SITE_URL}}{{object.get_absolute_url}}">
- <a href="https://twitter.com/intent/favorite?tweet_id={{object.twitter_id}}">Favourite</a>
- </action>
- </li>
- </ul>{% endif %}
+ </p>{% endif %}
+
+ <p class="note--date">
+ <a class="u-url" href="{{object.get_absolute_url}}" rel="bookmark"><time class="dt-published" datetime="{{object.pub_date|html5_datetime}}">{{object.pub_date|date:"F j, Y"}}</time></a>
+ </p>
</footer>
</article>
{% endfor %}
@@ -56,38 +42,28 @@
{% regroup object_list by pub_date.month as entries_by_month %}{% for month in entries_by_month %}
<section class="month--divider">
<h2 class="month--header">{{ month.list.0.pub_date|date:"F Y" }}</h2>{% for object in month.list|dictsortreversed:"pub_date" %}
- <article class="h-entry">
- <h2 class="p-name note--title">{{object.title|safe|amp|smartypants}}</h2>
+ <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">
- {{object.body_html|safe|amp|smartypants }}
+ {{object.body_html|safe|smartypants}}
</div>
- <footer class="note--footer">
- <p class="note--date">
- <a class="u-url" href="{{object.get_absolute_url}}" rel="bookmark"><time class="dt-published" datetime="{{object.pub_date|html5_datetime}}">{{object.pub_date|date:"F j, Y"}}</time></a>
- </p>{% if object.location %}
- <p class="p-location h-adr note--location bl" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
+ <span class="p-author h-card">
+ <data class="p-name" value="Scott Gilbertson"></data>
+ <data class="u-url" value="https://luxagraf.net/"></data>
+ </span>
+ <footer>
+ {% if object.location %}
+ <p class="p-location h-adr note--location bl" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
<span class="p-locality">{{object.location.name|smartypants|safe}}</span>,
<span class="p-region">{{object.location.state.name}}</span>,
<span class="p-country-name">{{object.location.state.country.name}}</span>
<data class="p-latitude" value="{{object.latitude}}"></data>
<data class="p-longitude" value="{{object.longitude}}"></data>
- </p>{% endif %}{% if object.twitter_id %}
- <ul class="note--actions">
- <li><a rel="syndication" class="u-syndication" href="https://twitter.com/luxagraf/status/{{object.twitter_id}}">View on Twitter</a></li>
- <li>
- <action do="reply" with="{{SITE_URL}}{{object.get_absolute_url}}"><a href="https://twitter.com/intent/tweet?in_reply_to={{object.twitter_id}}">Reply</a></action>
- </li>
- <li>
- <action do="post" with="{{SITE_URL}}{{object.get_absolute_url}}">
- <a href="https://twitter.com/intent/retweet?tweet_id={{object.twitter_id}}">Retweet</a>
- </action>
- </li>
- <li>
- <action do="bookmark" with="{{SITE_URL}}{{object.get_absolute_url}}">
- <a href="https://twitter.com/intent/favorite?tweet_id={{object.twitter_id}}">Favourite</a>
- </action>
- </li>
- </ul>{% endif %}
+ </p>{% endif %}
+
+ <p class="note--date">
+ <a class="u-url" href="{{object.get_absolute_url}}" rel="bookmark"><time class="dt-published" datetime="{{object.pub_date|html5_datetime}}">{{object.pub_date|date:"F j, Y"}}</time></a>
+ </p>
</footer>
</article>
{% endfor %}
diff --git a/design/templates/base.html b/design/templates/base.html
index 42867ca..d62d742 100644
--- a/design/templates/base.html
+++ b/design/templates/base.html
@@ -39,8 +39,8 @@
<nav role="navigation" class="bl">
<ul>
<li id="laverdad"><a href="/jrnl/" title="What we've been up to lately">Journal</a></li>
- <!--<li id="nota"><a href="/field-notes/" title="Quick notes and images from the road">Notes</a></li>
- <li id="fotos"><a href="/photos/" title="Photos from travels around the world">Photos</a></li>i-->
+ <li id="nota"><a href="/field-notes/" title="Quick notes and images from the road">Notes</a></li>
+ <!--<li id="fotos"><a href="/photos/" title="Photos from travels around the world">Photos</a></li>i-->
<li id="maps"><a href="/map" title="Maps">Map</a></li>
<li id="about"><a href="/about" title="About Luxagraf">About</a></li>
<li id="etc" class="last"><a href="/projects/" title="the less visible portions of the iceberg">More</a></li>