diff options
author | luxagraf <sng@luxagraf.net> | 2019-01-03 15:32:35 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-01-03 15:32:35 -0600 |
commit | 7a7cd5dd4122c737ccebd2b229f42dd4117aa7c9 (patch) | |
tree | f5570219017d9172fc0384c9a258d9bb1c7f780d | |
parent | 7946407380077ca56bbeccc20405ac0fa43595bb (diff) |
finished up builder and design for posting photos
-rw-r--r-- | app/builder/views.py | 3 | ||||
-rw-r--r-- | app/photos/build.py | 18 | ||||
-rw-r--r-- | app/photos/urls.py | 48 | ||||
-rw-r--r-- | design/sass/_global.scss | 2 | ||||
-rw-r--r-- | design/sass/_notes.scss | 160 | ||||
-rw-r--r-- | design/sass/_photos.scss | 6 | ||||
-rw-r--r-- | design/sass/screenv9.scss | 1 | ||||
-rw-r--r-- | design/templates/admin/buttons.html | 2 | ||||
-rw-r--r-- | design/templates/archives/photo_daily_list.html | 5 |
9 files changed, 241 insertions, 4 deletions
diff --git a/app/builder/views.py b/app/builder/views.py index d1c47c7..c708778 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -51,6 +51,9 @@ def do_build(request): elif section == 'luxphotos': context = {'message': 'Writing galleries to Disk'} photo_builder() + elif section == 'dailyphotos': + context = {'message': 'Writing galleries to Disk'} + photo_builder() elif section == 'figments': context = {'message': 'Writing figments to Disk'} figments_builder() diff --git a/app/photos/build.py b/app/photos/build.py index b11c756..e95cbfc 100644 --- a/app/photos/build.py +++ b/app/photos/build.py @@ -2,15 +2,28 @@ import os from django.urls import reverse from builder.base import BuildNew +from .models import LuxImage + class BuildLuxPhotos(BuildNew): def build(self): self.build_detail_view() + self.build_daily_photo() def get_model_queryset(self): return self.model.objects.all() + def build_daily_photo(self): + ''' + build out images that I post daily, found by title prefix daily_ + ''' + self.build_list_view( + base_path=reverse("photos:daily_photo_list"), + qs=LuxImage.objects.filter(is_public=True, title__startswith="daily_"), + paginate_by=10 + ) + def build_detail_view(self): ''' write out all the expenses for each trip @@ -25,6 +38,11 @@ class BuildLuxPhotos(BuildNew): self.write_file(path, response.content, filename=slug) +def dailybuilder(): + j = BuildLuxPhotos("photos", "LuxImage") + j.build_daily_photo() + + def builder(): j = BuildLuxPhotos("photos", "LuxGallery") j.build() diff --git a/app/photos/urls.py b/app/photos/urls.py index cbac965..5f2a5de 100644 --- a/app/photos/urls.py +++ b/app/photos/urls.py @@ -12,7 +12,13 @@ urlpatterns = [ name="daily_photo_list" ), path( - r'data/(<str:slug>/', + r'daily/', + views.DailyPhotoList.as_view(), + {'page': 1}, + name="daily_photo_list" + ), + path( + r'data/(<str:slug>/$', views.photo_json ), re_path( @@ -25,4 +31,44 @@ urlpatterns = [ views.thumb_preview_json, name="admin_thumb_preview" ), + re_path( + r'galleries/private/(?P<slug>[-\w]+)$', + views.PrivateGallery.as_view(), + name="private" + ), + re_path( + r'galleries/private/(?P<page>\d+)/$', + views.PrivateGalleryList.as_view(), + name="private_list" + ), + re_path( + r'galleries/private/$', + RedirectView.as_view(url="/photos/galleries/private/1/", permanent=False) + ), + re_path( + r'galleries/(?P<slug>[-\w]+)$', + views.Gallery.as_view(), + name="private" + ), + re_path( + r'galleries/(?P<page>\d+)/$', + views.GalleryList.as_view(), + name="private_list" + ), + re_path( + r'galleries/$', + RedirectView.as_view(url="/photos/galleries/1/", permanent=False) + ), + re_path( + r'(?P<page>\d+)/$', + views.gallery_list, + ), + re_path( + r'(?P<slug>[-\w]+)/$', + RedirectView.as_view(url="/photos/%(slug)s/1/", permanent=False) + ), + re_path( + r'', + RedirectView.as_view(url="/photos/1/", permanent=False) + ), ] diff --git a/design/sass/_global.scss b/design/sass/_global.scss index 603339c..6807fa4 100644 --- a/design/sass/_global.scss +++ b/design/sass/_global.scss @@ -93,7 +93,7 @@ blockquote:before { @include fontsize(68); content: '\201C'; position: absolute; - top: -1rem; + top: -1.35rem; left: 50%; transform: translate(-50%, -50%); width: 3rem; diff --git a/design/sass/_notes.scss b/design/sass/_notes.scss new file mode 100644 index 0000000..1386751 --- /dev/null +++ b/design/sass/_notes.scss @@ -0,0 +1,160 @@ +//**************** Notes Structure ************************ + +.notes main, .notes--permalink main { + @include constrain_narrow(); + margin-top: 1em; + h1 { + margin-bottom: 0; + @include fontsize(28); + @include breakpoint(beta) { + @include fontsize(28); + text-align: left; + } + } +} +.notes .h-entry, .notes--permalink .h-entry { + @extend %clearfix; + border: none; + padding: 0; + margin-top: 3em; + @include breakpoint(beta) { + margin-top: 2em; + } + &:first-of-type { + margin-top: 1em; + } + &:after { + @include faded_line_after; + @include breakpoint(beta) { + margin-top: 8.5em; + } + } +} +.note--title { + @include constrain_narrow; + text-align: left; + font-weight: 400; + font-size: 1.5em; + letter-spacing: 0px; + margin-bottom: .5rem !important; + a { + text-decoration: none; + color: $body_font_color !important; + } +} + +.note--date { + @include smcaps; + @include fontsize(11); + text-align: center; + margin-bottom: 4px; + @include breakpoint(beta) { + float: right; + margin-top: 0; + } + a { + color: $brown; + text-decoration: none; + } +} +.note--date-container{ + @extend %clearfix; + +} +.e-content { + @extend %clearfix; +} +.note--location { + text-align: center; + margin-top: 0; + @include breakpoint(beta) { + float: left; + } +} +.note--footer { + margin-top: 1.7em; + @include breakpoint(beta) { + margin-top: 0; + } +} +.month--divider { + margin-top: 2em; +} +.month--header { + @include constrain_narrow(); + @include smcaps; + @include fontsize(12); + font-weight: normal; + font-family: sans-serif; + text-align: left; + margin-bottom: 3em; + border-bottom: 1px dotted rgba(0, 0, 0, 0.2); +} +.notes--permalink { + .h-entry { + margin-top: 3em; + @include breakpoint(gamma) { + margin-top: 5em; + } + } + .e-content figure.picwide { margin-left: -300px !important} + &:after { + background: none; + } + .note--title { + // @include fontsize(24); + } + .note--footer { + margin-top: 2em; + @include constrain_narrow(); + @include breakpoint(beta) { + margin-top: 1em; + } + } + #page-navigation { + clear: both; + margin-top: 10em; + } +} +/* +@include breakpoint(beta) { + .notes { + main h1 { + float: none; + margin-bottom: 1em; + width: 100%; + } + main { + @include constrain(680px); + margin-bottom: 5em; + } + article footer { + margin-top: 1em; + } + article p { + float: none; + } + .note--location { + float: left; + } + .note--date { + float: right; + } + .note--twitter { + clear: both; + float: right; + padding-top: 1em; + } + time { + display: inline; + float: right; + } + } + + .permalink { + main { + margin-top: 5em; + } + } +} +*/ diff --git a/design/sass/_photos.scss b/design/sass/_photos.scss index d152bf4..c8fbb95 100644 --- a/design/sass/_photos.scss +++ b/design/sass/_photos.scss @@ -201,6 +201,12 @@ margin: 0px 0 0 44px; } +.daily-figure { + figcaption { + max-width: 1432px; + } +} + //.figcaption { // clear: both; // background: #1a1713; diff --git a/design/sass/screenv9.scss b/design/sass/screenv9.scss index 7144000..30f7190 100644 --- a/design/sass/screenv9.scss +++ b/design/sass/screenv9.scss @@ -14,3 +14,4 @@ @import "_src.scss"; @import "_resume.scss"; @import "_photos.scss"; +@import "_notes.scss"; diff --git a/design/templates/admin/buttons.html b/design/templates/admin/buttons.html index d9d8e0b..3e8980d 100644 --- a/design/templates/admin/buttons.html +++ b/design/templates/admin/buttons.html @@ -47,7 +47,7 @@ <li class="item"><a href="/admin/build/build?id=buildrss">Build RSS</a></li> <li class="item"><a href="/admin/build/build?id=pages">Build All Pages</a></li> <li class="item"><a href="/admin/build/build?id=sketches">Build Sketches</a></li> - <li class="item"><a href="/admin/build/build?id=notes">Build Notes</a></li> + <li class="item"><a href="/admin/build/build?id=dailyphotos">Build Daily Photo</a></li> <li class="item"><a href="/admin/build/build?id=photo_galleries">Build Photo Galleries</a></li> <li class="item"><a href="/admin/build/build?id=projects">Build Project Pages</a></li> <li class="item"><a href="/admin/build/build?id=buildbooks">Build Books</a></li> diff --git a/design/templates/archives/photo_daily_list.html b/design/templates/archives/photo_daily_list.html index 59612ac..2828afb 100644 --- a/design/templates/archives/photo_daily_list.html +++ b/design/templates/archives/photo_daily_list.html @@ -15,7 +15,10 @@ <main role="main"> {% autopaginate object_list 8 %}{% for object in object_list %} <article class="h-entry hentry " itemscope="" itemtype="http://schema.org/Article"> - {% include 'lib/img_picwide.html' with image=object caption=False exif=False is_cluster=False cluster_class='' extra='' %} + <figure class="daily-figure"> + {% include 'lib/img_picwide.html' with image=object caption=False exif=False is_cluster=False cluster_class='' extra='' %} + <figcaption class="picwide">{{object.location}}, {{object.location.state.country}}</figcaption> + </figure> </article> {% endfor %} </main> |