From baf14633cbd8af6413290ccae5765aefd2a278a5 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Mon, 20 Jun 2016 16:37:07 -0400 Subject: remove old django folder --- bn_django/__init__.py | 0 bn_django/dump_to_pelican.py | 41 ---- bn_django/journal/__init__.py | 0 bn_django/journal/admin.py | 51 ---- bn_django/journal/artifact_urls.py | 27 -- bn_django/journal/feeds.py | 67 ----- bn_django/journal/models.py | 98 -------- .../feeds/latest_entries_description.html | 1 - .../templates/feeds/latest_entries_title.html | 1 - .../templates/feeds/latest_links_description.html | 1 - .../templates/feeds/latest_links_title.html | 1 - .../feeds/latest_microentries_description.html | 1 - .../templates/feeds/latest_microentries_title.html | 1 - bn_django/journal/templates/journal/artifacts.html | 16 -- bn_django/journal/templates/journal/base.html | 5 - .../templates/journal/codeartifact_detail.html | 36 --- .../templates/journal/codeartifact_list.html | 27 -- .../templates/journal/entry_archive_month.html | 35 --- .../templates/journal/entry_archive_year.html | 35 --- .../journal/templates/journal/entry_detail.html | 31 --- .../journal/templates/journal/entry_list.html | 39 --- .../templates/journal/imageartifact_detail.html | 40 --- .../templates/journal/imageartifact_list.html | 29 --- .../templates/journal/linkartifact_detail.html | 34 --- .../templates/journal/linkartifact_list.html | 43 ---- .../templates/journal/microentry_arhive_month.html | 31 --- .../templates/journal/microentry_arhive_year.html | 31 --- .../templates/journal/microentry_detail.html | 32 --- .../journal/templates/journal/microentry_list.html | 39 --- .../templates/journal/videoartifact_detail.html | 35 --- .../templates/journal/videoartifact_list.html | 27 -- bn_django/journal/urls.py | 41 ---- bn_django/journal/views.py | 1 - bn_django/manage.py | 11 - bn_django/photos/__init__.py | 1 - bn_django/photos/admin.py | 6 - bn_django/photos/manual_import.py | 64 ----- bn_django/photos/models.py | 272 --------------------- bn_django/photos/templates/photos/base.html | 5 - .../photos/templates/photos/gallery_detail.html | 45 ---- .../photos/templates/photos/gallery_list.html | 57 ----- bn_django/photos/templates/photos/import_form.html | 62 ----- .../photos/templates/photos/photo_detail.html | 111 --------- bn_django/photos/urls.py | 23 -- bn_django/photos/views.py | 185 -------------- bn_django/settings.py.example | 91 ------- bn_django/templates/404.html | 3 - bn_django/templates/500.html | 3 - bn_django/templates/about.html | 29 --- bn_django/templates/base.html | 64 ----- bn_django/templates/comment_list | 41 ---- bn_django/templates/comments/form.html | 0 bn_django/templates/comments/posted.html | 8 - bn_django/templates/comments/preview.html | 69 ------ bn_django/templates/copyright.html | 12 - bn_django/templates/credits.html | 20 -- bn_django/templates/flatpages/default.html | 7 - bn_django/templates/frontpage.html | 97 -------- bn_django/templates/newcomments_table | 16 -- bn_django/templates/newknowldge_table | 13 - bn_django/templates/nogo.html | 15 -- bn_django/templates/search.html | 10 - bn_django/templates/static/directory_index | 18 -- bn_django/urls.py.example | 63 ----- 64 files changed, 2318 deletions(-) delete mode 100644 bn_django/__init__.py delete mode 100644 bn_django/dump_to_pelican.py delete mode 100644 bn_django/journal/__init__.py delete mode 100644 bn_django/journal/admin.py delete mode 100644 bn_django/journal/artifact_urls.py delete mode 100644 bn_django/journal/feeds.py delete mode 100644 bn_django/journal/models.py delete mode 100644 bn_django/journal/templates/feeds/latest_entries_description.html delete mode 100644 bn_django/journal/templates/feeds/latest_entries_title.html delete mode 100644 bn_django/journal/templates/feeds/latest_links_description.html delete mode 100644 bn_django/journal/templates/feeds/latest_links_title.html delete mode 100644 bn_django/journal/templates/feeds/latest_microentries_description.html delete mode 100644 bn_django/journal/templates/feeds/latest_microentries_title.html delete mode 100644 bn_django/journal/templates/journal/artifacts.html delete mode 100644 bn_django/journal/templates/journal/base.html delete mode 100644 bn_django/journal/templates/journal/codeartifact_detail.html delete mode 100644 bn_django/journal/templates/journal/codeartifact_list.html delete mode 100644 bn_django/journal/templates/journal/entry_archive_month.html delete mode 100644 bn_django/journal/templates/journal/entry_archive_year.html delete mode 100644 bn_django/journal/templates/journal/entry_detail.html delete mode 100644 bn_django/journal/templates/journal/entry_list.html delete mode 100644 bn_django/journal/templates/journal/imageartifact_detail.html delete mode 100644 bn_django/journal/templates/journal/imageartifact_list.html delete mode 100644 bn_django/journal/templates/journal/linkartifact_detail.html delete mode 100644 bn_django/journal/templates/journal/linkartifact_list.html delete mode 100644 bn_django/journal/templates/journal/microentry_arhive_month.html delete mode 100644 bn_django/journal/templates/journal/microentry_arhive_year.html delete mode 100644 bn_django/journal/templates/journal/microentry_detail.html delete mode 100644 bn_django/journal/templates/journal/microentry_list.html delete mode 100644 bn_django/journal/templates/journal/videoartifact_detail.html delete mode 100644 bn_django/journal/templates/journal/videoartifact_list.html delete mode 100644 bn_django/journal/urls.py delete mode 100644 bn_django/journal/views.py delete mode 100755 bn_django/manage.py delete mode 100644 bn_django/photos/__init__.py delete mode 100644 bn_django/photos/admin.py delete mode 100644 bn_django/photos/manual_import.py delete mode 100644 bn_django/photos/models.py delete mode 100644 bn_django/photos/templates/photos/base.html delete mode 100644 bn_django/photos/templates/photos/gallery_detail.html delete mode 100644 bn_django/photos/templates/photos/gallery_list.html delete mode 100644 bn_django/photos/templates/photos/import_form.html delete mode 100644 bn_django/photos/templates/photos/photo_detail.html delete mode 100644 bn_django/photos/urls.py delete mode 100644 bn_django/photos/views.py delete mode 100644 bn_django/settings.py.example delete mode 100644 bn_django/templates/404.html delete mode 100644 bn_django/templates/500.html delete mode 100644 bn_django/templates/about.html delete mode 100644 bn_django/templates/base.html delete mode 100644 bn_django/templates/comment_list delete mode 100644 bn_django/templates/comments/form.html delete mode 100644 bn_django/templates/comments/posted.html delete mode 100644 bn_django/templates/comments/preview.html delete mode 100644 bn_django/templates/copyright.html delete mode 100644 bn_django/templates/credits.html delete mode 100644 bn_django/templates/flatpages/default.html delete mode 100644 bn_django/templates/frontpage.html delete mode 100644 bn_django/templates/newcomments_table delete mode 100644 bn_django/templates/newknowldge_table delete mode 100644 bn_django/templates/nogo.html delete mode 100644 bn_django/templates/search.html delete mode 100644 bn_django/templates/static/directory_index delete mode 100644 bn_django/urls.py.example (limited to 'bn_django') diff --git a/bn_django/__init__.py b/bn_django/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/bn_django/dump_to_pelican.py b/bn_django/dump_to_pelican.py deleted file mode 100644 index bc2be28..0000000 --- a/bn_django/dump_to_pelican.py +++ /dev/null @@ -1,41 +0,0 @@ - -import os -from journal.models import * -from django.contrib.flatpages.models import * - -def save_page(p): - if p.id == 15: return - url = p.url.decode('utf-8') - f = open("flat_page_dump/" + url.strip("/").replace("/", "_") + ".html", 'w') - f.write("Title: " + p.title + "\n") - f.write("Url: " + url + "\n") - f.write("SaveAs: " + url + "index.html\n") - f.write("Date: " + str(p.date)) - f.write("\n") - f.write("\n") - f.write(p.content.decode('utf-8')) - f.close() - -os.system("mkdir flat_page_dump") - -for page in FlatPage.objects.all(): - save_page(page) - -def save_links(): - f = open("link_dump.html", 'w') - f.write("\n") - f.close() - -def save_micro(): - f = open("micro_dump.html", 'w') - f.write("\n") - f.close() - diff --git a/bn_django/journal/__init__.py b/bn_django/journal/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/bn_django/journal/admin.py b/bn_django/journal/admin.py deleted file mode 100644 index 3f1024c..0000000 --- a/bn_django/journal/admin.py +++ /dev/null @@ -1,51 +0,0 @@ -from django.contrib import admin -from bn_django.journal.models import * - -class EntryAdmin(admin.ModelAdmin): - #fieldsets = ( - #(None, { - #'fields': ('title', 'date', 'html_content', 'author', 'subjournal') - #}, ), - ##('Advanced options', { - #'classes': ('collapse',), - #'fields': ('slug',)})) - #prepopulated_fields = {'slug': ('title'),'text_content': ('html_content')} - #date_hierarchy = 'date' - #list_display = ('date', 'title', 'subjournal', 'author') - search_fields = ('title','text_content') - -class MicroEntryAdmin(admin.ModelAdmin): - #fieldsets = ( - #(None, { - #'fields': ('title', 'date', 'html_content', 'author', - #'subjournal',), }), - #('Advanced options', { - #'classes': ('collapse',), - #'fields': ('slug',)})) - prepopulated_fields = {'slug': ('title'),'text_content': ('html_content')} - date_hierarchy = 'date' - list_display = ('date', 'title', 'subjournal', 'author') - search_fields = ('title','text_content') - -class SubJournalAdmin(admin.ModelAdmin): - pass - -class LinkArtifactAdmin(admin.ModelAdmin): - pass - -class CodeAdmin(admin.ModelAdmin): - pass - -class VideoAdmin(admin.ModelAdmin): - pass - -class ImageAdmin(admin.ModelAdmin): - pass - -admin.site.register(Entry,EntryAdmin) -admin.site.register(MicroEntry,EntryAdmin) -admin.site.register(SubJournal) -admin.site.register(LinkArtifact) -admin.site.register(CodeArtifact) -admin.site.register(VideoArtifact) -admin.site.register(ImageArtifact) diff --git a/bn_django/journal/artifact_urls.py b/bn_django/journal/artifact_urls.py deleted file mode 100644 index 9a3bde4..0000000 --- a/bn_django/journal/artifact_urls.py +++ /dev/null @@ -1,27 +0,0 @@ -from django.conf.urls.defaults import * -from django.conf import settings - -from models import Artifact, VideoArtifact, ImageArtifact, LinkArtifact, CodeArtifact - -urlpatterns = patterns('django.views.generic.list_detail', - (r'^images/$', 'object_list', - dict(queryset=ImageArtifact.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^images/(?P\d+)/$', 'object_detail', - dict(queryset=ImageArtifact.objects.all())), - (r'^links/$', 'object_list', - dict(queryset=LinkArtifact.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^links/(?P\d+)/$', 'object_detail', - dict(queryset=LinkArtifact.objects.all())), - (r'^code/$', 'object_list', - dict(queryset=CodeArtifact.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^code/(?P\d+)/$', 'object_detail', - dict(queryset=CodeArtifact.objects.all())), - (r'^videos/$', 'object_list', - dict(queryset=VideoArtifact.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^videos/(?P\d+)/$', 'object_detail', - dict(queryset=VideoArtifact.objects.all())), -) diff --git a/bn_django/journal/feeds.py b/bn_django/journal/feeds.py deleted file mode 100644 index 09f1a4e..0000000 --- a/bn_django/journal/feeds.py +++ /dev/null @@ -1,67 +0,0 @@ -from django.contrib.syndication.feeds import Feed -from models import Entry, MicroEntry, LinkArtifact - - -class LatestEntries(Feed): - title = "bnewbold.net journal entries" - link = "/journal/entries/" - description = " " - - def items(self): - return Entry.objects.order_by('-date')[:5] - - def item_link(self,item): - return "http://bnewbold.net%s" % item.get_absolute_url() - - def item_author_name(self,item): - return item.author.username - - def item_author_email(self,item): - return item.author.email - - def item_pubdate(self,item): - return item.date - -class LatestMicroEntries(Feed): - title = "bnewbold.net microentries" - link = "/journal/microentries/" - description = "Quick updates" - - def items(self): - return MicroEntry.objects.order_by('-date')[:5] - - def item_link(self,item): - return "http://bnewbold.net%s" % item.get_absolute_url() - - def item_author_name(self,item): - return item.author.username - - def item_author_email(self,item): - return item.author.email - - def item_pubdate(self,item): - return item.date - -class LatestLinks(Feed): - title = "bnewbold.net links" - link = "/artifacts/links/" - description = "Links to love" - - def items(self): - return LinkArtifact.objects.order_by('-date')[:5] - - def item_link(self,item): - return item.url - - def item_author_name(self,item): - return item.author.username - - def item_author_email(self,item): - return item.author.email - - def item_pubdate(self,item): - return item.date - -feed_list = {'latest_entries':LatestEntries, - 'latest_microentries':LatestMicroEntries, - 'latest_links':LatestLinks } diff --git a/bn_django/journal/models.py b/bn_django/journal/models.py deleted file mode 100644 index a4402b2..0000000 --- a/bn_django/journal/models.py +++ /dev/null @@ -1,98 +0,0 @@ -from django.db import models -from django.dispatch import dispatcher -from django.db.models import signals -from django.contrib.auth.models import User, AnonymousUser -from bn_django.photos.models import Photo - -class SubJournal(models.Model): - name = models.CharField("full title", blank=False,max_length=196) - date = models.DateField("date started", auto_now_add=True) - slug = models.SlugField() - description = models.TextField("description of content",blank=True) - - def __unicode__(self): - return self.name - - class Meta: - get_latest_by = 'date' - ordering = ['-date'] - -class JournalCommon(models.Model): - author = User("User who created this") - date = models.DateTimeField("associated day", auto_now=True) - last_edited = models.DateTimeField("day last edited", auto_now_add=True) - subjournal = models.ForeignKey(SubJournal,blank=True,null=True) - defunct = models.BooleanField("is this entry all around done with?",default=False,blank=False) - private = models.BooleanField("is this entry for validated users only?",default=False,blank=False) - - class Meta: - abstract = True - get_latest_by = 'date' - ordering = ['-date'] - -class Entry(JournalCommon): - html_content = models.TextField("html format content", blank=False) - title = models.CharField("entry title", max_length=384) - slug = models.SlugField() - - def __unicode__(self): - return self.title - - def get_absolute_url(self): - #return "/journal/entries/%04d/%02d/%02d/%s/"%(self.date.year, self.date.month, self.date.day, self.slug) - return "/journal/entries/%s/"%self.slug - -class MicroEntry(JournalCommon): - html_content = models.TextField("html format content", blank=False) - text_content = models.TextField("text version of content", blank=True,null=True) - - def __unicode__(self): - return self.html_content[:50] - - def get_absolute_url(self): - return "/journal/microentries/%s/"%self.id - #return "/journal/microentries/%04d/%02d/%02d/%s/"%(self.date.year, self.date.month, self.date.day, self.slug) - -class Artifact(JournalCommon): - html_caption = models.TextField("html format caption", blank=True) - text_caption = models.TextField("text format caption", blank=True) - entry = models.ForeignKey(Entry, blank=True, null=True) - title = models.CharField("title of the artifact", max_length=256, blank=True) - - class Meta: - abstract = True - -class VideoArtifact(Artifact): - codec = models.CharField("what codec/format the video is", max_length=384) - filepath = models.FileField(upload_to="artifacts/%Y/%m/") - external_url = models.URLField("external representation to reduce bandwidth (youtube, etc)", blank=True) - -class CodeArtifact(Artifact): - code = models.TextField("raw source code", blank=False) - language = models.CharField("what programming language", max_length=160, \ - blank=True) - -class LinkArtifact(Artifact): - url = models.URLField("external link to something wonderful!",verify_exists=False) - - def __unicode__(self): - return self.title - - def get_absolute_url(self): - return "/artifacts/links/%s/"% self.id - -class ImageArtifact(Artifact,Photo): - """Multiply inherets from the photo app - """ - -def build_display_images(sender, instance, signal, *args, **kwargs): - """Simple hook for save-after trigger - """ - instance.build_display_images() -def delete_thumbnails(sender, instance, signal, *args, **kwargs): - """Simple hook for pre-delete trigger. - """ - instance.delete_thumbnails() - -signals.post_save.connect(build_display_images, sender=ImageArtifact) -signals.pre_delete.connect(delete_thumbnails, sender=ImageArtifact) diff --git a/bn_django/journal/templates/feeds/latest_entries_description.html b/bn_django/journal/templates/feeds/latest_entries_description.html deleted file mode 100644 index 6f28865..0000000 --- a/bn_django/journal/templates/feeds/latest_entries_description.html +++ /dev/null @@ -1 +0,0 @@ -{{obj.html_content|safe|truncatewords_html:300}} diff --git a/bn_django/journal/templates/feeds/latest_entries_title.html b/bn_django/journal/templates/feeds/latest_entries_title.html deleted file mode 100644 index e12d8e1..0000000 --- a/bn_django/journal/templates/feeds/latest_entries_title.html +++ /dev/null @@ -1 +0,0 @@ -{{obj.title|safe}} diff --git a/bn_django/journal/templates/feeds/latest_links_description.html b/bn_django/journal/templates/feeds/latest_links_description.html deleted file mode 100644 index 32c8857..0000000 --- a/bn_django/journal/templates/feeds/latest_links_description.html +++ /dev/null @@ -1 +0,0 @@ -{{ obj.html_caption|safe|truncatewords_html:200}} diff --git a/bn_django/journal/templates/feeds/latest_links_title.html b/bn_django/journal/templates/feeds/latest_links_title.html deleted file mode 100644 index d355de5..0000000 --- a/bn_django/journal/templates/feeds/latest_links_title.html +++ /dev/null @@ -1 +0,0 @@ -{{ obj.title }} diff --git a/bn_django/journal/templates/feeds/latest_microentries_description.html b/bn_django/journal/templates/feeds/latest_microentries_description.html deleted file mode 100644 index 427823d..0000000 --- a/bn_django/journal/templates/feeds/latest_microentries_description.html +++ /dev/null @@ -1 +0,0 @@ -{{obj.html_content|safe|truncatewords_html:160}} diff --git a/bn_django/journal/templates/feeds/latest_microentries_title.html b/bn_django/journal/templates/feeds/latest_microentries_title.html deleted file mode 100644 index d992ff6..0000000 --- a/bn_django/journal/templates/feeds/latest_microentries_title.html +++ /dev/null @@ -1 +0,0 @@ -{{obj.title}} diff --git a/bn_django/journal/templates/journal/artifacts.html b/bn_django/journal/templates/journal/artifacts.html deleted file mode 100644 index 4b82573..0000000 --- a/bn_django/journal/templates/journal/artifacts.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Artifacts!{% endblock %} - -{% block content %}
-Oh golly oh golly! We've got - - - -Also check out journal entries and microentries. -{% endblock %} diff --git a/bn_django/journal/templates/journal/base.html b/bn_django/journal/templates/journal/base.html deleted file mode 100644 index 819b1f4..0000000 --- a/bn_django/journal/templates/journal/base.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} - -{% block path %} - journal -{% endblock %} diff --git a/bn_django/journal/templates/journal/codeartifact_detail.html b/bn_django/journal/templates/journal/codeartifact_detail.html deleted file mode 100644 index fefdea8..0000000 --- a/bn_django/journal/templates/journal/codeartifact_detail.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "journal/base.html" %} -{# {% load markup %} #} -{% load comments %} -{% block path %}artifacts - » code - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Code Snippet]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

Code added {{ object.date }}, -{% if object.author %}
by {{ object.author }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-{% if object.language %}This is in {{object.language}}.

{%endif%} -
-{{object.code}}
-
-{% if object.html_caption|safe %}

{{object.html_caption}}{% endif %} -{% else %} -

This is not the artifact you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/codeartifact_list.html b/bn_django/journal/templates/journal/codeartifact_list.html deleted file mode 100644 index ee52afd..0000000 --- a/bn_django/journal/templates/journal/codeartifact_list.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends "journal/base.html" %} - -{% block path %}artifacts - » code -{% endblock %} - -{% block title %}Code Snippets{% endblock %} - -{% block content %} -
-{% if object_list %} -
    - {% for item in object_list %} -
  • {{item.title}} - {% if item.language %} ({{item.language}}){% endif %} - {% endfor %} -
-{% else %} -

No code snippets have been uploaded yet.

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_archive_month.html b/bn_django/journal/templates/journal/entry_archive_month.html deleted file mode 100644 index a9e72da..0000000 --- a/bn_django/journal/templates/journal/entry_archive_month.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block title %}Journal Entries{% endblock %} - -{% block content %} -
-
-This page has an RSS feed. -
-See also artifacts, -microentries. - -
-{% if object_list %} - {% for item in object_list %} - {% get_comment_count for item as comment_count %} -

- {% if item.title %}{{item.title}}{%else%}[Untitled]{%endif%}

- {{item.date|date:"D, d/m/Y @H:i"}} by {{ item.author.username }}. - {{ comment_count }} comments -

- {{ item.html_content|truncatewords_html:256 }} -

- {% endfor %} -{% else %} -

No entries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_archive_year.html b/bn_django/journal/templates/journal/entry_archive_year.html deleted file mode 100644 index a9e72da..0000000 --- a/bn_django/journal/templates/journal/entry_archive_year.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block title %}Journal Entries{% endblock %} - -{% block content %} -
-
-This page has an RSS feed. -
-See also artifacts, -microentries. - -
-{% if object_list %} - {% for item in object_list %} - {% get_comment_count for item as comment_count %} -

- {% if item.title %}{{item.title}}{%else%}[Untitled]{%endif%}

- {{item.date|date:"D, d/m/Y @H:i"}} by {{ item.author.username }}. - {{ comment_count }} comments -

- {{ item.html_content|truncatewords_html:256 }} -

- {% endfor %} -{% else %} -

No entries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_detail.html b/bn_django/journal/templates/journal/entry_detail.html deleted file mode 100644 index b68e4b6..0000000 --- a/bn_django/journal/templates/journal/entry_detail.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block path %}{{ block.super }} - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Entry]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

Entry dated {{ object.date }}, -{% if object.author %}
written by {{ object.author }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-

{{ object.html_content|safe }}

-{% else %} -

This is not the entry you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/entry_list.html b/bn_django/journal/templates/journal/entry_list.html deleted file mode 100644 index 8902552..0000000 --- a/bn_django/journal/templates/journal/entry_list.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block title %}Journal Entries{% endblock %} - -{% block otherhead %}{{ block.super}} - -{% endblock %} - -{% block content %} -
-
-This page has an RSS feed. -
-See also artifacts, -microentries. - -
-{% if object_list %} - {% for item in object_list %} - {% get_comment_count for item as comment_count %} -

- {% if item.title %}{{item.title}}{%else%}[Untitled]{%endif%}

- {{item.date|date:"D, d/m/Y @H:i"}} by {{ item.author.username }}. - {{ comment_count }} comments -

- {{ item.html_content|truncatewords_html:256 }} -

- {% endfor %} -{% else %} -

No entries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/imageartifact_detail.html b/bn_django/journal/templates/journal/imageartifact_detail.html deleted file mode 100644 index 45ea1aa..0000000 --- a/bn_django/journal/templates/journal/imageartifact_detail.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "journal/base.html" %} -{# {% load markup %} #} -{% load comments %} -{% block path %}artifacts - » images - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Image]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

Image uploaded {{ object.date }}, -{% if object.author %}
by {{ object.author }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-
- -
-{% if object.html_caption %}

{{object.html_caption}}{% endif %} -{% else %} -

This is not the artifact you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/imageartifact_list.html b/bn_django/journal/templates/journal/imageartifact_list.html deleted file mode 100644 index 6530773..0000000 --- a/bn_django/journal/templates/journal/imageartifact_list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "journal/base.html" %} - -{% block path %}artifacts - » images{% endblock %} - -{% block title %}Uploaded Images{% endblock %} - -{% block content %} -
-{% if object_list %} - -{% for item in object_list %} {% cycle , , ,  %} - {% endfor %} -
- - {{ item.title }} -
-{% else %} -

There are no images! If you just uploaded a batch -of photos, try hitting your browser's reload button to see if they -show up.

{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/linkartifact_detail.html b/bn_django/journal/templates/journal/linkartifact_detail.html deleted file mode 100644 index 70f9656..0000000 --- a/bn_django/journal/templates/journal/linkartifact_detail.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "journal/base.html" %} - -{% load comments %} - -{% block path %}artifacts - » links - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Link]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

Link created {{ object.date }}, -{% if object.author %}
by {{ object.author }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-{{object.url}} -{% if object.html_caption %}

{{object.html_caption|safe}}{% endif %} -{% else %} -

This is not the artifact you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/linkartifact_list.html b/bn_django/journal/templates/journal/linkartifact_list.html deleted file mode 100644 index 136ce72..0000000 --- a/bn_django/journal/templates/journal/linkartifact_list.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "journal/base.html" %} - -{% block otherhead %}{{ block.super}} - -{% endblock %} - -{% block path %}artifacts - » links -{% endblock %} - -{% block title %}Links Galore!{% endblock %} -{% block right_stuff %} -This page has an RSS feed. -{%endblock %} - -{% block content %} -New favorite finds from the net. Good posts from -RSS feeds -end up at feeds.bnewbold.net. -
-
-{% if object_list %} -
    - {% for item in object_list %} -
  • {{item.title}} - {% if item.html_caption %} -  "{{item.html_caption|safe|truncatewords_html:10}}"{%endif%} -
    - added {{item.date|date:"D, M d, Y"}} - - more info - - {{ item.url|urlizetrunc:70 }} - {% endfor %} -
-{% else %} -

No links have been entered yet.

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/microentry_arhive_month.html b/bn_django/journal/templates/journal/microentry_arhive_month.html deleted file mode 100644 index eca642d..0000000 --- a/bn_django/journal/templates/journal/microentry_arhive_month.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block path %}{{block.super}} - » microentries - -{% block title %}Journal Microentries{% endblock %} - -{% block content %} -
-{% if object_list %} - {% for item in object_list %} - {{item.date|date:"D, d/m/Y @H:i"}}: - - {% if item.title %}{{item.title}}{%else%}[Untitled]{%endif%} -

- {{ item.html_content|truncatewords_html:256 }} - {% get_comment_count for item as comment_count %} - ({{ comment_count }} comments) -

- {% endfor %} -{% else %} -

No entries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/microentry_arhive_year.html b/bn_django/journal/templates/journal/microentry_arhive_year.html deleted file mode 100644 index eca642d..0000000 --- a/bn_django/journal/templates/journal/microentry_arhive_year.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block path %}{{block.super}} - » microentries - -{% block title %}Journal Microentries{% endblock %} - -{% block content %} -
-{% if object_list %} - {% for item in object_list %} - {{item.date|date:"D, d/m/Y @H:i"}}: - - {% if item.title %}{{item.title}}{%else%}[Untitled]{%endif%} -

- {{ item.html_content|truncatewords_html:256 }} - {% get_comment_count for item as comment_count %} - ({{ comment_count }} comments) -

- {% endfor %} -{% else %} -

No entries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/microentry_detail.html b/bn_django/journal/templates/journal/microentry_detail.html deleted file mode 100644 index 245fe32..0000000 --- a/bn_django/journal/templates/journal/microentry_detail.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "journal/base.html" %} - -{% load comments %} -{% block path %}{{ block.super }} - » microentries - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Microentry]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

dated {{ object.date }}, -{% if object.author %}
written by {{ object.author.username }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-

{{ object.html_content|safe }}

-{% else %} -

This is not the entry you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/microentry_list.html b/bn_django/journal/templates/journal/microentry_list.html deleted file mode 100644 index 25255f6..0000000 --- a/bn_django/journal/templates/journal/microentry_list.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "journal/base.html" %} -{% load comments %} - -{% block otherhead %}{{ block.super}} - -{% endblock %} - -{% block path %}{{block.super}} - » microentries{% endblock %} - -{% block title %}Journal Microentries{% endblock %} - -{% block content %} -
-
-This page has an RSS feed. -
- -{% if object_list %} - {% for item in object_list %} - {{item.date|date:"D, m/d/Y @H:i"}}: - {% if item.title %} - {{item.title}}{%endif%} -

- {{ item.html_content|truncatewords_html:256 }} - {% get_comment_count for item as comment_count %} - ({{ comment_count }} comments, link) -

- {% endfor %} -{% else %} -

No microentries have been entered yet!

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/templates/journal/videoartifact_detail.html b/bn_django/journal/templates/journal/videoartifact_detail.html deleted file mode 100644 index 09b0ac2..0000000 --- a/bn_django/journal/templates/journal/videoartifact_detail.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "journal/base.html" %} - -{% load comments %} -{% block path %}artifacts - » videos - » {{ object.title }} -{% endblock %} - -{% block title %} -{% if object.title %}{{ object.title }}{% else %}[Untitled Video]{% endif %} -{% endblock %} - -{% block content %}
-{% if object %}
-

Video uploaded {{ object.date }}, -{% if object.author %}
by {{ object.author }},{% endif %} -{% if object.last_edited %}
last edited {{ object.last_edited }}.{% endif %} -

-{% if object.external_url %}View this video here

{%endif%} -Download the video. -

The video codec is {{ object.codec }}.
-{% if object.html_caption %}

{{object.html_caption|safe}}{% endif %} -{% else %} -

This is not the artifact you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-{% get_comment_list for object as comments %} -{% include "comment_list" %} -

Post a comment

-{% render_comment_form for object %} -
-{% endblock %} diff --git a/bn_django/journal/templates/journal/videoartifact_list.html b/bn_django/journal/templates/journal/videoartifact_list.html deleted file mode 100644 index b5af050..0000000 --- a/bn_django/journal/templates/journal/videoartifact_list.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends "journal/base.html" %} - -{% block path %}artifacts - » videos -{% endblock %} - -{% block title %}Videos{% endblock %} - -{% block content %} -
-{% if object_list %} -
    - {% for item in object_list %} -
  • {{item.title}} - {%if item.codec%} (codec: {{item.codec}}){% endif %} - {% endfor %} -
-{% else %} -

No videos have been entered yet.

-{% endif %} - -{% if is_paginated %} {% if has_previous %} -« previous | -{% endif %} {% if has_next %} -next » -{% endif %} {% endif %} -{% endblock %} diff --git a/bn_django/journal/urls.py b/bn_django/journal/urls.py deleted file mode 100644 index 4b50f40..0000000 --- a/bn_django/journal/urls.py +++ /dev/null @@ -1,41 +0,0 @@ -from django.conf.urls.defaults import * -from django.conf import settings - -from models import Entry, MicroEntry -from feeds import feed_list - -urlpatterns = patterns('django.views.generic.list_detail', - (r'^$', 'object_list', - dict(queryset=Entry.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^entries/$', 'object_list', - dict(queryset=Entry.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^microentries/$', 'object_list', - dict(queryset=MicroEntry.objects.order_by('-date'), - paginate_by=35, allow_empty=False)), - (r'^microentries/(?P\d+)/$', 'object_detail', - dict(queryset=Entry.objects.order_by('-date'))), - (r'^entries/(?P[\d\w-]+)/$', 'object_detail', - dict(queryset=Entry.objects.order_by('-date'))), -) - -urlpatterns += patterns('', - (r'^rss/(?P.*)/$','django.contrib.syndication.views.feed', - {'feed_dict':feed_list}) -) - -#urlpatterns += patterns('django.views.generic.date_based', - #(r'^entries/(?P\d{4})/(?P\d{2})/(?P\d{2})/(?P[\d\w-]+)/$', 'object_detail', - #dict(queryset=Entry.objects.all(), date_field='date')), - #(r'^entries/(?P\d{4})/(?P\d{2})/$', 'archive_month', - #dict(queryset=Entry.objects.all(), date_field='date')), - #(r'^entries/(?P\d{4})/$', 'archive_year', - #dict(queryset=Entry.objects.all(), date_field='date')), - #(r'^microentries/(?P\d{4])/(?P\d{2})/(?P\d{2})/(?P\d+)/$', 'object_detail', - #dict(queryset=MicroEntry.objects.all())), - #(r'^microentries/(?P\d{4})/(?P\d{2})/$', 'archive_month', - #dict(queryset=MicroEntry.objects.all())), - #(r'^microentries/(?P\d{4])/$', 'archive_year', - #dict(queryset=MicroEntry.objects.all())), -#) diff --git a/bn_django/journal/views.py b/bn_django/journal/views.py deleted file mode 100644 index 60f00ef..0000000 --- a/bn_django/journal/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/bn_django/manage.py b/bn_django/manage.py deleted file mode 100755 index 5e78ea9..0000000 --- a/bn_django/manage.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - -if __name__ == "__main__": - execute_manager(settings) diff --git a/bn_django/photos/__init__.py b/bn_django/photos/__init__.py deleted file mode 100644 index 52af441..0000000 --- a/bn_django/photos/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Strongly based on code from the stockphoto project (google it?)""" diff --git a/bn_django/photos/admin.py b/bn_django/photos/admin.py deleted file mode 100644 index a32ae7e..0000000 --- a/bn_django/photos/admin.py +++ /dev/null @@ -1,6 +0,0 @@ -from bn_django.photos.models import Photo, Gallery -from django.contrib import admin - -admin.site.register(Photo) -admin.site.register(Gallery) - diff --git a/bn_django/photos/manual_import.py b/bn_django/photos/manual_import.py deleted file mode 100644 index 8311445..0000000 --- a/bn_django/photos/manual_import.py +++ /dev/null @@ -1,64 +0,0 @@ -# Create your views here. - -# django imports -from django.conf import settings - -# other imports -import zipfile -import os -import stat -import shutil -from datetime import datetime -from tempfile import NamedTemporaryFile, mkdtemp -import Image -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO - -# Handling settings here -STOCKPHOTO_BASE = 'photos' - -# models -from bn_django.photos.models import Gallery, Photo - -# views - - -def manual_import_photos(thezipfile, thegallery): - # Check if the gallery is valid - gallery = thegallery; - - f = file(thezipfile); - zip = zipfile.ZipFile(f) - #date = the_date - #if not date: - date = datetime.date(datetime.now()) - - destdir= os.path.join(settings.MEDIA_ROOT, STOCKPHOTO_BASE, - datetime.strftime(datetime.now(), - "%Y/%m/%d/")) - if not os.path.isdir(destdir): - os.makedirs(destdir, 0775) - for filename in zip.namelist(): - photopath = os.path.join(destdir, os.path.basename(filename)) - data = zip.read(filename) - file_data = StringIO(data) - try: - Image.open(file_data) - except: - # don't save and process non Image files - continue - photo = file(photopath, "wb") - photo.write(data) - - # Create the object - if photopath.startswith(os.path.sep): - photopath = photopath[len(settings.MEDIA_ROOT):] - photo = Photo(image=photopath, date=date, - photographer='Bryan Newbold', - title = os.path.basename(filename), - gallery_id = thegallery) - # Save it -- the thumbnails etc. get created. - photo.save() - return diff --git a/bn_django/photos/models.py b/bn_django/photos/models.py deleted file mode 100644 index 4964467..0000000 --- a/bn_django/photos/models.py +++ /dev/null @@ -1,272 +0,0 @@ -from django.db import models -from django.utils.translation import ugettext as _ -import django.contrib.auth.models as auth -from django.conf import settings -from django.dispatch import dispatcher -from django.db.models import signals - -import os, os.path -import Image - -# Handle settings here -try: - STOCKPHOTO_BASE = settings.STOCKPHOTO_BASE.strip('/') -except AttributeError: - STOCKPHOTO_BASE='photos' - -STOCKPHOTO_URL='http://media.bnewbold.net/hosted-photos' - -try: - ADMIN_URL = settings.ADMIN_URL -except AttributeError: - ADMIN_URL='/admin' -if ADMIN_URL[-1] == '/': - ADMIN_URL=ADMIN_URL[:-1] - -# Create your models here. -class Gallery(models.Model): - title = models.CharField("title", max_length=80) - slug = models.SlugField() - date = models.DateField("publication date", auto_now_add=True) - created = models.ForeignKey(auth.User, - verbose_name="gallery created by" - ) - display_width = models.IntegerField( - "width to display full images", - default=640) - display_height = models.IntegerField( - "height to display full images", - default=480) - thumbnail_width = models.IntegerField( - "width to display thumbnails", - default=150) - thumbnail_height = models.IntegerField( - "height to display thumbnails", - default=100) - - class Meta: - get_latest_by = 'date' - - class Admin: - ordering = ['date'] - prepopulated_fields = {'slug': 'title'} - - def __str__(self): - return self.title - def get_absolute_url(self): - return "%s/%s/" % (STOCKPHOTO_BASE, self.slug) - def get_admin_url(self): - return "%s/photos/gallery/%d/" % (ADMIN_URL, self.id) - def was_published_today(self): - return self.date.date() == datetime.date.today() - - def first(self): - try: - return self.photo_set.all()[0] - except IndexError: - return None - def update_thumbs(self): - for photo in self.photo_set.all(): - photo.create_disp() - photo.create_thumb() - -class Photo(models.Model): - # import os, os.path, Image - image = models.ImageField("Photograph", - upload_to= STOCKPHOTO_BASE + "/%Y/%m/%d/") - title = models.CharField("title", max_length=80) - desc = models.TextField("description", blank=True) - gallery = models.ForeignKey(Gallery, blank=True, null=True) - photographer = models.CharField("photographer", max_length=80, - blank=True) - date = models.DateField("date photographed", blank=True, null=True) - extra = models.TextField("any extra information about the photo", - blank=True) - class META: - get_latest_by = ['date'] - - class Admin: - list_display = ('title', 'date', 'gallery', 'id') - ordering = ['id'] - list_filter = ['gallery'] - search_fields = ['title'] - - def __str__(self): - return self.title - - def delete_thumbnails(self): - """Remove thumbnail and display-sized images when deleting. - - This may fail if, for example, they don't exist, so it should - fail silently. It may not be a good idea to delete the - original, as the user may not understand that deleting it from - the gallery deletes it from the filesystem, so currently we - don't do that. - - """ - try: - os.unlink(self.thumbpath()) - except (IOError, OSError): - pass - try: - os.unlink(self.disppath()) - except (IOError, OSError): - pass - # Deleting the original might be a bad thing. - #os.unlink(self.fullpath()) - - def get_absolute_url(self): - return "%s/detail/%d/" % (STOCKPHOTO_BASE, self.id) - - def get_admin_url(self): - return "%s/photos/photos/%d/" % (ADMIN_URL, self.id) - - def thumbpath(self): - """Path to the thumbnail - """ - photobase = self.image.name[len(STOCKPHOTO_BASE)+1:] - return os.path.join( settings.MEDIA_ROOT, STOCKPHOTO_BASE, - "cache", "thumbs", photobase) - - def thumburl(self): - """URL to the thumbnail - """ - photobase = self.image.name[len(STOCKPHOTO_BASE)+1:] - return STOCKPHOTO_URL + "/cache/thumbs/" + photobase - - def disppath(self): - photobase = self.image.name[len(STOCKPHOTO_BASE)+1:] - return os.path.join( settings.MEDIA_ROOT, STOCKPHOTO_BASE, - "cache", photobase) - - def dispurl(self): - photobase = self.image.name[len(STOCKPHOTO_BASE)+1:] - return STOCKPHOTO_URL + "/cache/" + photobase - - def fullpath(self): - if self.image.name.startswith(os.path.sep): - return self.image.name - return os.path.join(settings.MEDIA_ROOT, self.image.name) - - def fullurl(self): - if(self.image.name.startswith("photos/")): - return STOCKPHOTO_URL + '/' + self.image.name[7:] - else: - return STOCKPHOTO_URL + '/' + self.image.name - - - def next(self): - '''Return id of 'next' photo in the same gallery or None if at - the end.''' - # we could probably be more clever here by using the new nifty - # db access filters and queries, but for now, this is good enough - photo_list = [x for x in self.gallery.photo_set.all()] - ind = photo_list.index(self) - if (ind +1) == len(photo_list): - return None - else: - return photo_list[ind + 1] - - def prev(self): - """Return id of 'previous' photo in the same gallery or None - if at the beginning - """ - photo_list = [x for x in self.gallery.photo_set.all()] - ind = photo_list.index(self) - if ind == 0: - return False - else: - return photo_list[ind - 1] - - def full_exists(self): - return os.path.exists( self.fullpath() ) - - def disp_exists(self): - return os.path.exists( self.disppath() ) - - def thumb_exists(self): - return os.path.exists( self.thumbpath() ) - - def create_disp(self): - im = Image.open( self.fullpath() ) - format = im.format - # create the path for the display image - disp_path = self.disppath() - disp_dir = os.path.dirname(disp_path) - if not os.path.exists(disp_dir): - os.makedirs(disp_dir, 0775) - - # Make a copy of the image, scaled, if needed. - maxwidth = self.gallery.display_width - maxheight = self.gallery.display_height - width, height = im.size - if (width > maxwidth) and width > height: - scale = float(maxwidth)/width - width = int(width * scale) - height = int(height * scale) - newim = im.resize( (width, height), Image.ANTIALIAS ) - elif (height > maxheight) and height >= width: - scale = float(maxheight)/height - width = int(width * scale) - height = int(height * scale) - newim = im.resize( (width, height), Image.ANTIALIAS ) - else: - newim = im - newim.save(disp_path, format) - - def create_thumb(self): - im = Image.open( self.fullpath() ) - format = im.format - # create the path for the thumbnail image - thumb_path = self.thumbpath() - thumb_dir = os.path.dirname(thumb_path) - if not os.path.exists(thumb_dir): - os.makedirs(thumb_dir, 0775) - - # Make a copy of the image, scaled, if needed. - maxwidth = self.gallery.thumbnail_width - maxheight = self.gallery.thumbnail_height - width, height = im.size - if (width > maxwidth) and (width > height): - scale = float(maxwidth)/width - width = int(width * scale) - height = int(height * scale) - newim = im.resize( (width, height), Image.ANTIALIAS ) - elif (height > maxheight): - scale = float(maxheight)/height - width = int(width * scale) - height = int(height * scale) - newim = im.resize( (width, height), Image.ANTIALIAS ) - else: - newim = im - newim.save(thumb_path, format) - - def build_display_images(self): - """Make thumbnail and display-sized images after saving. - - For some reason, this may fail on a first pass (self.image may - be empty when this is called), but if we just let it fail - silently, it will apparently get called again and succeed. - """ - if self.image: - if not self.thumb_exists(): - self.create_thumb() - if not self.disp_exists(): - self.create_disp() - -def build_display_images(sender, instance, signal, *args, **kwargs): - """Simple hook for save-after trigger - """ - instance.build_display_images() -def delete_thumbnails(sender, instance, signal, *args, **kwargs): - """Simple hook for pre-delete trigger. - """ - instance.delete_thumbnails() - -signals.post_save.connect(build_display_images, sender=Photo) -signals.pre_delete.connect(delete_thumbnails, sender=Photo) - -#dispatcher.connect(build_display_images, signal=signals.post_save, -# sender=Photo) -#dispatcher.connect(delete_thumbnails, signal=signals.pre_delete, -# sender=Photo) diff --git a/bn_django/photos/templates/photos/base.html b/bn_django/photos/templates/photos/base.html deleted file mode 100644 index d229057..0000000 --- a/bn_django/photos/templates/photos/base.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} - -{% block path %} - photos -{% endblock %} diff --git a/bn_django/photos/templates/photos/gallery_detail.html b/bn_django/photos/templates/photos/gallery_detail.html deleted file mode 100644 index 0b3a4af..0000000 --- a/bn_django/photos/templates/photos/gallery_detail.html +++ /dev/null @@ -1,45 +0,0 @@ -{% extends "photos/base.html" %} -{# {% load markup %} #} -{% block path %} -{{ block.super }} -{% if object %} - » - {{ object.title }} -{% endif %} {% endblock %} -{% block title %} -{% if object %}Photo Set: {{ object.title }} {% endif %} -{% endblock %} -{% block content %} -{% if object %} -{% if object.photo_set.count %} - -{% for item in object.photo_set.all %} {% cycle , , ,  %} - {% endfor %} -
- - {{ item.title }} -
-{% else %} -

There are no photos in this gallery. If you just uploaded a batch -of photos, try hitting your browser's reload button to see if they -show up.

{% endif %} -  - -{% else %}

This is not the gallery you are looking for.

{% endif %} -{% endblock %} diff --git a/bn_django/photos/templates/photos/gallery_list.html b/bn_django/photos/templates/photos/gallery_list.html deleted file mode 100644 index 11c7289..0000000 --- a/bn_django/photos/templates/photos/gallery_list.html +++ /dev/null @@ -1,57 +0,0 @@ -{% extends "photos/base.html" %} -{# {% load markup %} #} - -{% block title %}Photo Sets{% endblock %} - -{% block content %} -{% if object_list %} - - {% for item in object_list %} - - - {% endfor %} -
- - {% if item.first %} - {{ item.first.title }} - {% else %} - (No photo available) - {% endif %} - - -

- {{ item.title }}

- {{ item.photo_set.count }} photo{{ item.photo_set.count|pluralize}} - {% if item.first.date %} - starting in {{ item.first.date|date:"M, Y" }}{% endif %} -
-{% else %} -

No galleries have been set up yet.

-{% endif %} - - -{% if is_paginated %} - -{% if has_previous %} -« previous | -{% endif %} -{% if has_next %} -next » -{% endif %} -{% endif %} - - - -{% endblock %} diff --git a/bn_django/photos/templates/photos/import_form.html b/bn_django/photos/templates/photos/import_form.html deleted file mode 100644 index bd01a9a..0000000 --- a/bn_django/photos/templates/photos/import_form.html +++ /dev/null @@ -1,62 +0,0 @@ -{% extends "photos/base.html" %} -{# {% load markup %} #} -{% block title %}Import photos into a gallery -{% if gallery%} ({{gallery.title}}){% endif %}{% endblock %} - -{% block content %} -{% if gallery %} - -
-
- {%if form.zipfile.errors %} - - {{ form.zipfile.errors|join:", " }} -
- {% endif %} - - - {{ form.zipfile }}

- - {%if form.photographer.errors %} - - {{ form.photographer.errors|join:", " }} -
- {% endif %} - - - {{ form.photographer }}

- - {%if form.date.errors %} - - {{ form.date.errors|join:", " }} -
- {% endif %} - - - {{ form.date }}

- -
-
-

- When you upload a batch of photos in a zipfile, it will give each of - them a title based on its filename, and assigns them all the same - photographer and date. That's probably not always what you want, so - you can change any of these settings on a per-photo basis - after you upload the images. -

-

- UPDATE: The title and rotation will be guessed from EXIF data... -

- -{% else %} -

Oops! No gallery here!

-{% endif %} - -{% endblock %} diff --git a/bn_django/photos/templates/photos/photo_detail.html b/bn_django/photos/templates/photos/photo_detail.html deleted file mode 100644 index 78b95fe..0000000 --- a/bn_django/photos/templates/photos/photo_detail.html +++ /dev/null @@ -1,111 +0,0 @@ -{% extends "photos/base.html" %} -{# {% load markup %} #} - -{% load comments %} - -{% block path %} - {{ block.super }} - » - {{ object.gallery.title }} - » - {{ object.title }} -{% endblock %} - -{% block title %} -{% if object %} -{{ object.title }} -{% endif %} -{% endblock %} - -{% block content %} - -{% if object %} -
-{% if object.date %} -

Photo taken {{ object.date }}{% if object.photographer %} -by {{ object.photographer }}.

-{% else %}.

-{% endif %} -{% else %} -{% if object.photographer %} -

Photo by {{ object.photographer }}.

-{% endif %} -{% endif %} -
-{% if object.next %} - - -{% endif %} -{% if object.prev %} - -{% endif %} - -
-
- - {{ object.title }} - -
-

{{ object.desc|safe }}

- {% if object.extra %} -

More information

-

{{ object.extra|safe }}

- {% endif %} -
-
-
-{% if object.prev %} - - « previous - -{% endif %} -{% if object.next %} - - next » - -{% endif %} -
- - -{% else %} -

This is not the photo you are looking for.

-{% endif %} -{% endblock %} - -{% block commentary %} -
-

Post a comment

-{% render_comment_form for object %} -{% get_comment_list for object as comments %} -{% include "comment_list" %} -
-{% endblock %} diff --git a/bn_django/photos/urls.py b/bn_django/photos/urls.py deleted file mode 100644 index 233ccc4..0000000 --- a/bn_django/photos/urls.py +++ /dev/null @@ -1,23 +0,0 @@ -from django.conf.urls.defaults import * -from django.conf import settings - -from models import Gallery, Photo, ADMIN_URL, STOCKPHOTO_URL - -info_dict = { 'extra_context': { 'admin_url': ADMIN_URL, - 'stockphoto_url': STOCKPHOTO_URL} } - -urlpatterns = patterns('django.views.generic.list_detail', - (r'^$', 'object_list', - dict(info_dict, queryset=Gallery.objects.order_by('-date'), - paginate_by=35, allow_empty= True)), - (r'^(?P[\d\w-]+)/$', 'object_detail', - dict(info_dict, queryset=Gallery.objects.all(), slug_field='slug')), - (r'^(?P\d+)/$', 'object_detail', - dict(info_dict, queryset=Gallery.objects.all())), - (r'^detail/(?P\d+)/$', 'object_detail', - dict(info_dict, queryset=Photo.objects.all())), -) -urlpatterns += patterns('bn_django.photos.views', - (r'^import/(?P\d+)/$', 'import_photos'), - #(r'^export/(\d+)/$', 'export'), -) diff --git a/bn_django/photos/views.py b/bn_django/photos/views.py deleted file mode 100644 index a6459f6..0000000 --- a/bn_django/photos/views.py +++ /dev/null @@ -1,185 +0,0 @@ -# Create your views here. - -# django imports -from django.conf import settings -from django import forms, http, template -from django.contrib.auth.decorators import login_required -from django.shortcuts import get_object_or_404, render_to_response -from django.http import HttpResponse - -# other imports -import zipfile -import os -import stat -import shutil -from datetime import datetime -from tempfile import NamedTemporaryFile, mkdtemp -import Image -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO - -# Handling settings here -try: - STOCKPHOTO_BASE = settings.STOCKPHOTO_BASE.strip('/') -except AttributeError: - STOCKPHOTO_BASE = 'photos' - -# models -from bn_django.photos.models import Gallery, Photo - -# views - -class ImportForm(forms.Form): - zipfile = forms.FileField() - photographer = forms.CharField() - date = forms.DateField() - - def valid_zipfile(self, field_data, all_data): - zip_file = StringIO(field_data['content']) - zip = zipfile.ZipFile(zip_file) - return not zip.testzip() - -@login_required -def import_photos(request, thegallery): - """Import a batch of photographs uploaded by the user. - - Import a batch of photographs uploaded by the user, all with - the same information for gallery, photographer and date. The - title will be set from the filename, and the description will be - blank. Self-respecting photographers will edit the fields for - each photograph; this is just a way to get a bunch of photographs - uploaded quickly. - - The photographs should be wrapped up in a zip archive. The - archive will be unpacked (and flattened) in a temporary directory, - and all image files will be identified and imported into the - gallery. Other files in the archive will be silently ignored. - - After importing the images, the view will display a page which may - contain the number of images imported, and a link to the gallery - into which the images were imported. - """ - # Check if the gallery is valid - gallery = get_object_or_404(Gallery, pk=thegallery) - # And that the user has permission to add photos - if not request.user.has_perm('gallery.add_photo'): - return http.HttpResponseForbidden("No permission to add photos") - - if request.POST: - #new_data = request.POST.copy() - #new_data.update(request.FILES) - form = ImportForm(request.POST, request.FILES) - if not form.is_valid(): - return render_to_response('photos/import_form.html', - dict(form=form, gallery=gallery)) - # So now everything is okay - f = request.FILES['zipfile'] # the zip"file" - zip = zipfile.ZipFile(f) - date = request.POST['date'] - if not date: - date = datetime.date(datetime.now()) - destdir= os.path.join(settings.MEDIA_ROOT, STOCKPHOTO_BASE, - datetime.strftime(datetime.now(), "%Y/%m/%d/")) - - if not os.path.isdir(destdir): - os.makedirs(destdir, 0775) - for filename in zip.namelist(): - photopath = os.path.join(destdir, os.path.basename(filename)) - data = zip.read(filename) - file_data = StringIO(data) - try: - Image.open(file_data) - except: - # don't save and process non Image files - continue - photo = file(photopath, "wb") - photo.write(data) - f = photo - - # Create the object - if photopath.startswith(os.path.sep): - photopath = photopath[len(settings.MEDIA_ROOT):] - photo = Photo(image=photopath, date=date, - photographer=request.POST['photographer'], - title = 'untitled', - gallery_id = thegallery) - - # Save it -- the thumbnails etc. get created. - photo.save() - - # Try to harvest EXIF data - try: - import EXIF - tags = EXIF.process_file(open(photo.image.path)) - try: - if tags.has_key('Image DateTime'): - exifdate = tags['Image DateTime'].printable - photo.date = apply(datetime, map(int, exifdate.split(' ')[0].split(':'))) - except Exception, E: - print E - pass - try: - if tags.has_key('EXIF UserComment'): - exiftitle = tags['EXIF UserComment'].printable - if not exiftitle == []: - photo.title = exiftitle - - except Exception, E: - print E - pass - try: - if tags.has_key('Image Orientation'): - exifrot = tags['EXIF UserComment'].printable - if exifrot == 'Rotated 90 CCW': - #DO ROTATION - pass - except Exception, E: - print E - pass - except Exception, E: - print E - pass - finally: - photo.save() - - # And jump to the directory for this gallery - response = http.HttpResponseRedirect(gallery.get_absolute_url()) - response['Pragma'] = 'no cache' - response['Cache-Control'] = 'no-cache' - return response - else: - form = ImportForm() - return render_to_response('photos/import_form.html', - dict(form=form, gallery=gallery)) - # request, - -#@login_required -#def export(request, thegallery): - #"""Export a gallery to a zip file and send it to the user. - #""" - ## Check if the gallery is valid - #gallery = get_object_or_404(Gallery, pk=thegallery) - # - ## gather up the photos into a new directory - #tmpdir = mkdtemp() - #for photo in gallery.photo_set.all(): - #shutil.copy(photo.get_image_filename(), - #tmpdir) - #files = [ os.path.join(tmpdir, ff) for ff in os.listdir(tmpdir) ] - #outfile = NamedTemporaryFile() - #zf = zipfile.ZipFile(outfile, "w", - #compression=zipfile.ZIP_DEFLATED) - #for filename in files: - #zf.write(filename, arcname=os.path.basename(filename)) - #zf.close() - ##outfile.flush() - #outfile.seek(0) - #shutil.rmtree(tmpdir) - #response = HttpResponse(outfile) - #response['Content-Type'] = "application/zip" - #response['Content-Length'] = str(os.stat(outfile.name)[stat.ST_SIZE]) - #response['Content-Disposition'] = "attachment; filename=photos.zip" - #return response - # diff --git a/bn_django/settings.py.example b/bn_django/settings.py.example deleted file mode 100644 index c16b9c8..0000000 --- a/bn_django/settings.py.example +++ /dev/null @@ -1,91 +0,0 @@ -# Django settings for bn_django project. - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), - ('Bryan Newbold', 'bnewbold@mit.edu'), -) - -MANAGERS = ADMINS - -DATABASE_ENGINE = 'sqlite3' # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'. -DATABASE_NAME = '/home/bnewbold/bn-project/bn_django/bn_django.db' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. - -# Local time zone for this installation. All choices can be found here: -# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE -TIME_ZONE = 'America/Boston' - -# Language code for this installation. All choices can be found here: -# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes -# http://blogs.law.harvard.edu/tech/stories/storyReader$15 -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/home/bnewbold/bn-project/static/' - -# URL that handles the media served from MEDIA_ROOT. -# Example: "http://media.lawrence.com" -MEDIA_URL = '/static/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/static/django-admin/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = 'jdsgk29845ldsfg0090204tv(GFD8g0(%$)*@$#R%U)#*ifd;/q' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', - 'django.contrib.csrf.middleware.CsrfMiddleware', - 'django.middleware.doc.XViewMiddleware', -) - -ROOT_URLCONF = 'bn_django.urls' - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - '/home/bnewbold/bn-project/bn_django/templates', -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.flatpages', - 'django.contrib.markup', - 'django.contrib.comments', - 'bn_django.photos', - 'bn_django.git_wiki', - 'bn_django.journal', -) - -#Don't have much memory, so never use MemoryFileUploadHandler -FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.TemporaryFileUploadHandler", ) diff --git a/bn_django/templates/404.html b/bn_django/templates/404.html deleted file mode 100644 index e1f116e..0000000 --- a/bn_django/templates/404.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "base.html"%} -{% block title %}For oh four{% endblock %} -{% block content %}Whoopsie!{% endblock %} diff --git a/bn_django/templates/500.html b/bn_django/templates/500.html deleted file mode 100644 index 78786b7..0000000 --- a/bn_django/templates/500.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "base.html"%} -{% block title %}Server Error{% endblock %} -{% block content %}Sorry...{% endblock %} diff --git a/bn_django/templates/about.html b/bn_django/templates/about.html deleted file mode 100644 index 39ac311..0000000 --- a/bn_django/templates/about.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "base.html" %} - -{% block path %}{% endblock %} - -{% block title %}About bnewbold.net{% endblock %} - -{% block right_stuff %} -{% endblock %} - -{% block content %} -
- the author -
-
the perp
-
-This website is the web presence of Bryan Newbold. Chunks of the homunculus -include: -
-
brain dump -
photo gallery -
journal -
rss aggregator -
browsable code repository -
-

-There's a lot of borrowed software under the hood; see credits. -
{% endblock %} diff --git a/bn_django/templates/base.html b/bn_django/templates/base.html deleted file mode 100644 index 568bf62..0000000 --- a/bn_django/templates/base.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -{% block stylesheets %} - - - - -{% endblock %} -{% block externaljs %} {% endblock %} {% block otherhead %} {% endblock %} -{% block windowtitle %}bnewbold.net{% endblock %} - - -

-
- - journal  - photos  - code  - knowledge - bnewbold.net -
-
-
-
-
-
- - - -
- -
- -{% block path %}{% endblock %} - -

{% block title %}Hey Hey Hey!{% endblock %}

-

{% block subtitle %}{% endblock %}

-
-{% block right_stuff %} -{% endblock %} -
-
- - -
-{% block content %} -Here lies content! -{% endblock %} -
-{% block commentary %} {% endblock %} - - - diff --git a/bn_django/templates/comment_list b/bn_django/templates/comment_list deleted file mode 100644 index d00dc6a..0000000 --- a/bn_django/templates/comment_list +++ /dev/null @@ -1,41 +0,0 @@ -{% if comments or free_comments %} -{% comment %}TODO: this needs to be rewriten!{% endcomment %} - -
- -{% for c in comments %} - -{% endfor %} -{% for c in free_comments %} - -{% endfor %} -
- Posted by - {% if c.user.username %} {{ c.user.username }} - {% else %}{{ c.user_name }} {% endif %}
- on - {{ c.submit_date|date:"F j, Y" }}
- at {{ c.submit_date|date:"H:i" }} -
- {% if c.headline %} - {{ c.headline|escape|wordwrap:80 }} -
- {% endif %} - {{ c.comment|escape|linebreaks|wordwrap:80 }} -
- Posted by - {% if c.person_name %}{{ c.person_name}}{% else %}anonymous{% endif %}
- on - {{ c.submit_date|date:"F j, Y" }}
- at {{ c.submit_date|date:"H:i T" }} -
- {% if c.headline %} - {{ c.headline|escape|wordwrap:80 }} -
- {% endif %} - {{ c.comment|escape|wordwrap:80 }} -
-

-{% else %} -

No comments yet!

-{% endif %} diff --git a/bn_django/templates/comments/form.html b/bn_django/templates/comments/form.html deleted file mode 100644 index e69de29..0000000 diff --git a/bn_django/templates/comments/posted.html b/bn_django/templates/comments/posted.html deleted file mode 100644 index e3eb0d2..0000000 --- a/bn_django/templates/comments/posted.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block title %}{% trans "Thanks for your comment" %}.{% endblock %} - -{% block content %} -
-{% endblock %} diff --git a/bn_django/templates/comments/preview.html b/bn_django/templates/comments/preview.html deleted file mode 100644 index dbbc6c3..0000000 --- a/bn_django/templates/comments/preview.html +++ /dev/null @@ -1,69 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block title %}{% trans "Comment Submission" %}{% endblock %} - -{% block content %}
-
- {% load comments %} -
- {% if form.errors %} -

{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}

- {% else %} -

{% trans "Preview your comment:" %}

- - -{% if comment.person_name %} - -{% else %} - -{% endif %} -
- Posted by - {% if comment.person_name %}{{ comment.person_name}}{% else %}anonymous{% endif %}
- on - {{ comment.submit_date|date:"F j, Y" }}
- at {{ comment.submit_date|date:"H:i T" }} -
- {% if comment.headline %} - {{ comment.headline|escape|wordwrap:80 }} -
- {% endif %} - {{ comment|escape|wordwrap:80 }} -
- Posted by - {% if comment.user.username %} {{ comment.user.username }} - {% else %}{{ comment.user_name }} {% endif %}
- on - {{ comment.submit_date|date:"F j, Y" }}
- at {{ comment.submit_date|date:"H:i" }} -
- {% if comment.headline %} - {{ comment.headline|escape|wordwrap:80 }} -
- {% endif %} - {{ comment|escape|wordwrap:80 }} -
-

- {% trans "and" %} {% trans "or make changes" %}: -

- {% endif %} - - {% for field in form %} {% if field.is_hidden %} {{ field }} {% else %} - {% ifequal field.name "honeypot" %} - {{ field.label_tag }}{{ field }} - {% else %} - {% endifequal %} {% endif %} {% endfor %} - -
- - {{ field.label_tag }} - {{ field }} - {% if field.errors %}{{ field.errors }}{% endif %} -
- - - (no HTML or other markup) -
- -{% endblock %} diff --git a/bn_django/templates/copyright.html b/bn_django/templates/copyright.html deleted file mode 100644 index c48b304..0000000 --- a/bn_django/templates/copyright.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Fuck Copyrights{% endblock %} - -{% block right_stuff %} -{% endblock %} - -{% block content %} -

I'm not a big fan of copyrights or licensing. Feel free to use the content and code from this website however you please. I would appreciate attribution or at least letting me know if you're doing something cool, but it's not required. -

If I had to chose a license it would probably be MIT or BSD style. -

I don't think I've violated any other person's rights, but if you think something is a copied and/or unattributed drop a dime! -{% endblock %} diff --git a/bn_django/templates/credits.html b/bn_django/templates/credits.html deleted file mode 100644 index 954a26d..0000000 --- a/bn_django/templates/credits.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Software credits{% endblock %} - -{% block right_stuff %} -{% endblock %} - -{% block content %} -This site uses a variety of delicious software! -

operating system

-

It's freeBSD under the hood when not hosted elsewhere. -

web framework

-

The site is powered by the django toolkit (which runs on python). -

I use the stockphoto app written by Jason McBrayer for the photos section. -

text editor

-

vim! fuck emacs! -

versioning system

-

I use git as a revisioning system for the knowledge wiki and my software (including this site!). - -{% endblock %} diff --git a/bn_django/templates/flatpages/default.html b/bn_django/templates/flatpages/default.html deleted file mode 100644 index 49c773a..0000000 --- a/bn_django/templates/flatpages/default.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ flatpage.title }}{% endblock %} - -{% block content %} -{{ flatpage.content }} -{% endblock %} diff --git a/bn_django/templates/frontpage.html b/bn_django/templates/frontpage.html deleted file mode 100644 index 6d3652a..0000000 --- a/bn_django/templates/frontpage.html +++ /dev/null @@ -1,97 +0,0 @@ -{% extends "base.html" %} - -{% block stylesheets %} - - - - - -{{ block.super }}{% endblock %} - -{% block path %}{% endblock %} - -{% block title %}{% endblock %} - -{% block right_stuff %} -
-
-
-
-RSS feeds:
-{% comment %}   - journal entries
{% endcomment %} -   - web links
-   - site code changes
-

-Other sites:
-   - github
-   - keybase
-   - equator
-{% endblock %} - -{% block content %} -
-

-
-
-

Where am I?

-As of Fall 2015 I am living in Seattle (WA) working as a freelance embedded -engineer. I spent the last year working remotely, building digital control -systems for optical atomic magnetometers at -Twinleaf , a small company headquartered -in Princeton, NJ. - - - - - - More... -
- -
- - -{% endblock %} - diff --git a/bn_django/templates/newcomments_table b/bn_django/templates/newcomments_table deleted file mode 100644 index c01863d..0000000 --- a/bn_django/templates/newcomments_table +++ /dev/null @@ -1,16 +0,0 @@ - -{% for c in latest_comments %} - - - - - -{% endfor %} -
- {{ c.submit_date|date:"F jS" }} - {% if c.user.username %}{{ c.user.username }} - {% else %}{{c.user_name}}{% endif%} - {{ c.comment|truncatewords:10 }} - - - {{ c.content_type.name }}
diff --git a/bn_django/templates/newknowldge_table b/bn_django/templates/newknowldge_table deleted file mode 100644 index 686a12f..0000000 --- a/bn_django/templates/newknowldge_table +++ /dev/null @@ -1,13 +0,0 @@ -{% if latest_knowledge %} - -{% for l in latest_knowledge %} - - - - -{% endfor %} -
- {{ l.date }} - - {{ l.description|truncatewords:6 }}
-{% else %}No shortlog!{% endif %} diff --git a/bn_django/templates/nogo.html b/bn_django/templates/nogo.html deleted file mode 100644 index ca83269..0000000 --- a/bn_django/templates/nogo.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Unstable{% endblock %} - -{% block right_stuff %} -{% endblock %} - -{% block content %} -The dynamic portions of this website are extremely unstable right now, leading -to runaway cpu utilization on my virtual host and locking up of more imporant -services (static html, etc). So for the time being i'm freezing large portions, -hopefully everything will be back soon; a number of new python wrappers for python look promising and i'm excited to implement jsMath to replace the current clunky math system. - -For now try a more generic git cgi interface to my content at http://git.bnewbold.net. -{% endblock %} diff --git a/bn_django/templates/search.html b/bn_django/templates/search.html deleted file mode 100644 index 27fb35d..0000000 --- a/bn_django/templates/search.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Search?{% endblock %} - -{% block right_stuff %} -{% endblock %} - -{% block content %} -

Seach isn't implemented yet! -{% endblock %} diff --git a/bn_django/templates/static/directory_index b/bn_django/templates/static/directory_index deleted file mode 100644 index 61e7f02..0000000 --- a/bn_django/templates/static/directory_index +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base.html" %} - -{% block title %} -

Index of /{{ directory }}

-{% endblock %} - -{% block content %} -
-
    -{% for f in file_list %} -
  • {{ f }}
  • -{% endfor %} -
-
-
-
- -{% endblock %} diff --git a/bn_django/urls.py.example b/bn_django/urls.py.example deleted file mode 100644 index df261c7..0000000 --- a/bn_django/urls.py.example +++ /dev/null @@ -1,63 +0,0 @@ -from django.conf import settings -from django.conf.urls.defaults import * -from photos.models import Photo, Gallery -from django.contrib.comments.models import Comment -from django.contrib import admin -import git_wiki.models - -admin.autodiscover() - -urlpatterns = patterns('', - # Example: - # (r'^bn_django/', include('bn_django.foo.urls')), - (r'^$', 'django.views.generic.simple.direct_to_template', - {'template': 'frontpage.html','extra_context':dict({ \ - 'latest_photos':Photo.objects.order_by('-date')[:2], \ - 'latest_galleries':Gallery.objects.order_by('-date')[:4], \ - #'latest_comments':Photo.objects.order_by('date')[:4] \ - 'latest_knowledge':git_wiki.models.shortlog(), \ - 'latest_comments':Comment.objects.order_by('-submit_date')[:8], \ - 'newitems':git_wiki.models.newest_items(), \ - })}), - (r'^about/$', 'django.views.generic.simple.direct_to_template', - {'template': 'about.html'}), - (r'^credits/$', 'django.views.generic.simple.direct_to_template', - {'template': 'credits.html'}), - (r'^copyright/$', 'django.views.generic.simple.direct_to_template', - {'template': 'copyright.html'}), - - (r'^knowledge/$', 'bn_django.git_wiki.views.frontpage',), - #(r'^k/$', 'django.views.generic.simple.direct_to_template', - # {'template': 'nogo.html'}), - (r'^k/', include('bn_django.git_wiki.urls')), - (r'^code/$', 'django.views.generic.simple.direct_to_template', - {'template': 'nogo.html'}), - #(r'^code/', include('bn_django.git_browse.urls')), - (r'^photos/', include('bn_django.photos.urls')), - - #(r'^search/', include('bn_django.search.urls')), - - # Uncomment this for admin: - (r'^admin/doc/', include('django.contrib.admindocs.urls')), - (r'^admin/(.*)', admin.site.root), - (r'^comments/', include('django.contrib.comments.urls')), - - (r'^journal/', include('bn_django.journal.urls')), - (r'^artifacts/$', 'django.views.generic.simple.direct_to_template', - {'template': 'journal/artifacts.html'}), - (r'^artifacts/', include('bn_django.journal.artifact_urls')), - - # uncomment for development - #(r'^static/(?P.*)$', 'django.views.static.serve', - # {'document_root': '/home/bnewbold/code/bn-project/static', - # 'show_indexes': True}), - #(r'^style/(?P.*)$', 'django.views.static.serve', - # {'document_root': '/home/bnewbold/code/bn-project/static/style'}), - #(r'^media/(?P.*)$', 'django.views.static.serve', - # {'document_root': '/home/bnewbold/code/bn-project/media'}), -) - -if settings.DEBUG: - urlpatterns += patterns('', - (r'^static/(?P.*)$', 'django.views.static.serve', - {'document_root': '/path/to/media'}), ) -- cgit v1.2.3