Commits

Anonymous committed e5d389e

Refactoring examples and adapt to the new code.

--HG--
extra : convert_revision : svn%3Aea932676-bf3b-0410-9f11-03e9079df846/trunk%40152

Comments (0)

Files changed (32)

examples/basic_blog/__init__.py

Empty file added.

examples/basic_blog/manage.py

+#!/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)

examples/basic_blog/settings.py

+# Django settings for a basic blog project based on Diario.
+
+import os
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+ADMINS = (
+    # ('Your Name', 'your_email@domain.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+DATABASE_NAME = 'basic.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. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be avilable on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+TIME_ZONE = 'America/Chicago'
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+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 = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = ''
+
+# 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 = '/admin_media/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'random-ascii-string:the-longer-the-better'
+
+# 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.middleware.doc.XViewMiddleware',
+)
+
+ROOT_URLCONF = 'basic_blog.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.
+    'templates/',
+)
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.admin',
+    'diario',
+)
+
+
+# Diario settings
+#
+
+# Number of latest itens on archive_index view. Default: 10.
+DIARIO_NUM_LATEST = 8
+
+# Markup language for blog entries. Options: 'rest', 'textile',
+# 'markdown' or 'raw' for raw text.
+# Default: 'raw'.
+DIARIO_DEFAULT_MARKUP_LANG = 'raw'

examples/basic_blog/templates/base.html

+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+	  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
+    <title>Simple Website | {% block title %}Home page{% endblock %}</title>
+  </head>
+
+  <body>
+    <div id="header">
+      <h1>Simple Website</h1>
+
+      <p>This is a simple project
+	with <a href="http://django-diario.googlecode.com">diario</a>
+	application without tagging support. See
+	the <i>"with_tagging"</i> project for a example with tagging
+	support, provided
+	by <a href="http://django-tagging.googlecode.com">tagging</a>
+	package.</p>
+
+      <ul>
+	<li><a href="/">Home page</a></li>
+	<li><a href="{% url diario-entry-list %}">Weblog</a></li>
+      </ul>
+    </div>
+
+    <hr />
+
+    <div id="content">
+      {% block content %}{% endblock %}
+    </div>
+
+    <hr />
+
+    <div id="footer">
+      <p>Copyright &copy; 2007 My Website</p>
+    </div>
+  </body>
+</html>

examples/basic_blog/templates/base_2col.html

+{% extends "base.html" %}
+
+
+{% block content %}
+
+{% block content-main %}{% endblock %}
+
+<hr />
+
+{% block content-related %}
+{% load diario_tags %}
+
+<div id="sidebar">
+  <h1>Archive</h1>
+  
+  {% get_diario_month_list as archive %}
+
+  {% if archive %}
+    {% for month in archive %}
+    <ul>
+      <li><a href="{% url diario-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
+    </ul>
+    {% endfor %}
+  {% else %}
+    <p>Empty archive. No entries published.</p>
+  {% endif %}
+ 
+</div>
+
+{% endblock %}
+
+{% endblock%}

examples/basic_blog/templates/diario/entry_archive_day.html

+{% extends "base_2col.html" %}
+
+{% block title %}Weblog | {{ day|date:"F j" }}{% endblock %}
+
+{% block content-main %}
+
+<h1>{{ day|date:"F j" }} archive</h1>
+
+{% for entry in entry_list %}
+  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
+  <p>{{ entry.pub_date|date:"F j, Y" }}</p>
+  {{ entry.body|safe }}
+{% endfor %}
+
+{% endblock %}

examples/basic_blog/templates/diario/entry_archive_month.html

+{% extends "base_2col.html" %}
+
+{% block title %} Weblog | {{ month|date:"F" }}{% endblock %}
+
+{% block content-main %}
+
+<h1>{{ month|date:"F" }} archive</h1>
+
+{% for entry in entry_list %}
+  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
+  <p>{{ entry.pub_date|date:"F j, Y" }}</p>
+  {{ entry.body|safe }}
+{% endfor %}
+
+{% endblock %}

examples/basic_blog/templates/diario/entry_archive_year.html

+{% extends "base_2col.html" %}
+
+{% block title %}Weblog | {{ year }}{% endblock %}
+
+{% block content-main %}
+
+<h1>{{ year }} archive</h1>
+
+<ul>
+{% for date in date_list %}
+  <li><a href="{{ date|date:"m" }}/">{{ date|date:"F" }}</a></li>
+{% endfor %}
+</ul>
+
+{% endblock %}

examples/basic_blog/templates/diario/entry_detail.html

+{% extends "base_2col.html" %}
+
+{% block title %}Weblog | {{ entry.title|escape }}{% endblock %}
+
+{% block content-main %}
+
+<h1>{{ entry.title }}</h1>
+{{ entry.body|safe }}
+<p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
+
+{% endblock %}

examples/basic_blog/templates/diario/entry_list.html

+{% extends "base_2col.html" %}
+
+{% block title %}Weblog{% endblock %}
+
+{% block content-main %}
+
+<h1>Latest entries</h1>
+
+{% for entry in entry_list %}
+  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
+  {{ entry.body|safe }}  
+  <p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
+{% endfor %}
+
+{% endblock %}

examples/basic_blog/templates/flatfiles/homepage.html

+{% extends "base_2col.html"  %}
+
+
+{% block content-main %}
+{% load diario_tags %}
+
+<div id="main">
+  <h1>Weblog</h1>
+
+  {% get_diario_entry_list 5 as latest_entries %}
+
+  {% if latest_entries %}
+    {% for entry in latest_entries %}
+    <div>
+      <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
+      <p>{{ entry.pub_date|date:"F j, Y" }}</p>
+      {{ entry.body|safe }}
+    </div>
+    {% endfor %}
+  {% else %}
+    <p>No entries published yet. You can add entries
+      with <a href="/admin/">/admin/</a>.</p>
+  {% endif %}
+</div>      
+
+{% endblock %}

examples/basic_blog/urls.py

+from django.conf.urls.defaults import *
+from django.contrib import admin
+from diario.feeds.entries import RssEntriesFeed, AtomEntriesFeed
+from diario.feeds.tagged import RssEntriesByTagFeed, AtomEntriesByTagFeed
+
+admin.autodiscover()
+
+entries_feeds = {
+    'rss': RssEntriesFeed,
+    'atom': AtomEntriesFeed,
+}
+
+entries_by_tag_feeds = {
+    'rss': RssEntriesByTagFeed,
+    'atom': AtomEntriesByTagFeed,
+}
+
+urlpatterns = patterns('',
+    # homepage
+    (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'flatfiles/homepage.html'}),
+
+    # weblog
+    (r'^weblog/', include('diario.urls.entries')),
+    (r'^weblog/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_feeds}),
+
+    # admin
+    (r'^admin/(.*)', admin.site.root),
+)

examples/projects/simple/__init__.py

Empty file removed.

examples/projects/simple/manage.py

-#!/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)

examples/projects/simple/settings.py

-# Django settings for simple project.
-
-import os
-BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '../../..')
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    # ('Your Name', 'your_email@domain.com'),
-)
-
-MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = 'example.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. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be avilable on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-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 = BASE_DIR + '/media/'
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-# 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 = '/media/admin/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'random-ascii-string:the-longer-the-better'
-
-# 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.middleware.doc.XViewMiddleware',
-)
-
-ROOT_URLCONF = 'simple.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.
-    BASE_DIR + '/templates/simple',
-)
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.admin',
-    'diario',
-)
-
-
-# django-diario settings
-
-# Number of latest itens on archive_index view. Default: 10.
-DIARIO_NUM_LATEST = 8
-
-# Markup language for blog entries. Options: 'rest', 'textile',
-# 'markdown' or 'raw' for raw text.
-# Default: 'raw'.
-DIARIO_DEFAULT_MARKUP_LANG = 'raw'

examples/projects/simple/urls.py

-from django.conf.urls.defaults import *
-from django.contrib import admin
-from diario.feeds import RssEntriesFeed, RssEntriesByTagFeed, AtomEntriesFeed, AtomEntriesByTagFeed
-
-admin.autodiscover()
-
-entries_feeds = {
-    'rss': RssEntriesFeed,
-    'atom': AtomEntriesFeed,
-}
-
-entries_by_tag_feeds = {
-    'rss': RssEntriesByTagFeed,
-    'atom': AtomEntriesByTagFeed,
-}
-
-urlpatterns = patterns('',
-    # homepage
-    (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'flatfiles/homepage.html'}),
-
-    # weblog
-    (r'^weblog/', include('diario.urls.entries')),
-    (r'^weblog/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_feeds}),
-
-    # admin
-    (r'^admin/(.*)', admin.site.root),
-)

examples/projects/with_tagging/__init__.py

Empty file removed.

examples/projects/with_tagging/manage.py

-#!/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)

examples/projects/with_tagging/settings.py

-# Django settings for with_tagging project.
-
-import os
-BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '../../..')
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    # ('Your Name', 'your_email@domain.com'),
-)
-
-MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = 'example.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. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be avilable on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-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 = BASE_DIR + '/media/'
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-# 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 = '/media/admin/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'random-ascii-string:the-longer-the-better'
-
-# 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.middleware.doc.XViewMiddleware',
-)
-
-ROOT_URLCONF = 'with_tagging.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.
-    BASE_DIR + '/templates/with_tagging',
-    BASE_DIR + '/templates/simple',
-)
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.admin',
-    'tagging',
-    'diario',
-)
-
-
-# django-diario settings
-
-# Number of latest itens on archive_index view. Default: 10.
-DIARIO_NUM_LATEST = 8
-
-# Markup language for blog entries. Options: 'rest', 'textile',
-# 'markdown' or 'raw' for raw text.
-# Default: 'raw'.
-DIARIO_DEFAULT_MARKUP_LANG = 'raw'
-

examples/projects/with_tagging/urls.py

-from django.conf.urls.defaults import *
-from django.contrib import admin
-from diario.feeds import RssEntriesFeed, RssEntriesByTagFeed, AtomEntriesFeed, AtomEntriesByTagFeed
-
-admin.autodiscover()
-
-entries_feeds = {
-    'rss': RssEntriesFeed,
-    'atom': AtomEntriesFeed,
-}
-
-entries_by_tag_feeds = {
-    'rss': RssEntriesByTagFeed,
-    'atom': AtomEntriesByTagFeed,
-}
-
-urlpatterns = patterns('',
-    # homepage
-    (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'flatfiles/homepage.html'}),
-
-    # weblog
-    (r'^weblog/', include('diario.urls.entries')),
-    (r'^weblog/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_feeds}),
-    (r'^weblog/tag/', include('diario.urls.tagged')),
-    (r'^weblog/tag/(?P<tag>[^/]+)/(?P<slug>(rss|atom))/$', 'diario.views.syndication.feed', {'feed_dict': entries_by_tag_feeds}),
-
-    # admin
-    (r'^admin/(.*)', admin.site.root),
-)

examples/templates/simple/base.html

-<?xml version="1.0" encoding="utf-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-	  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
-    <title>Simple Website | {% block title %}Home page{% endblock %}</title>
-  </head>
-
-  <body>
-    <div id="header">
-      <h1>Simple Website</h1>
-
-      <p>This is a simple project
-	with <a href="http://django-diario.googlecode.com">diario</a>
-	application without tagging support. See
-	the <i>"with_tagging"</i> project for a example with tagging
-	support, provided
-	by <a href="http://django-tagging.googlecode.com">tagging</a>
-	package.</p>
-
-      <ul>
-	<li><a href="/">Home page</a></li>
-	<li><a href="{% url diario-entry-list %}">Weblog</a></li>
-      </ul>
-    </div>
-
-    <hr />
-
-    <div id="content">
-      {% block content %}{% endblock %}
-    </div>
-
-    <hr />
-
-    <div id="footer">
-      <p>Copyright &copy; 2007 My Website</p>
-    </div>
-  </body>
-</html>

examples/templates/simple/base_2col.html

-{% extends "base.html" %}
-
-
-{% block content %}
-
-{% block content-main %}{% endblock %}
-
-<hr />
-
-{% block content-related %}
-{% load diario_tags %}
-
-<div id="sidebar">
-  <h1>Archive</h1>
-  
-  {% get_diario_month_list as archive %}
-
-  {% if archive %}
-    {% for month in archive %}
-    <ul>
-      <li><a href="{% url diario-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
-    </ul>
-    {% endfor %}
-  {% else %}
-    <p>Empty archive. No entries published.</p>
-  {% endif %}
- 
-</div>
-
-{% endblock %}
-
-{% endblock%}

examples/templates/simple/diario/entry_archive_day.html

-{% extends "base_2col.html" %}
-
-{% block title %}Weblog | {{ day|date:"F j" }}{% endblock %}
-
-{% block content-main %}
-
-<h1>{{ day|date:"F j" }} archive</h1>
-
-{% for entry in entry_list %}
-  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
-  <p>{{ entry.pub_date|date:"F j, Y" }}</p>
-  {{ entry.body|safe }}
-{% endfor %}
-
-{% endblock %}

examples/templates/simple/diario/entry_archive_month.html

-{% extends "base_2col.html" %}
-
-{% block title %} Weblog | {{ month|date:"F" }}{% endblock %}
-
-{% block content-main %}
-
-<h1>{{ month|date:"F" }} archive</h1>
-
-{% for entry in entry_list %}
-  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
-  <p>{{ entry.pub_date|date:"F j, Y" }}</p>
-  {{ entry.body|safe }}
-{% endfor %}
-
-{% endblock %}

examples/templates/simple/diario/entry_archive_year.html

-{% extends "base_2col.html" %}
-
-{% block title %}Weblog | {{ year }}{% endblock %}
-
-{% block content-main %}
-
-<h1>{{ year }} archive</h1>
-
-<ul>
-{% for date in date_list %}
-  <li><a href="{{ date|date:"m" }}/">{{ date|date:"F" }}</a></li>
-{% endfor %}
-</ul>
-
-{% endblock %}

examples/templates/simple/diario/entry_detail.html

-{% extends "base_2col.html" %}
-
-{% block title %}Weblog | {{ entry.title|escape }}{% endblock %}
-
-{% block content-main %}
-
-<h1>{{ entry.title }}</h1>
-{{ entry.body|safe }}
-<p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
-
-{% endblock %}

examples/templates/simple/diario/entry_list.html

-{% extends "base_2col.html" %}
-
-{% block title %}Weblog{% endblock %}
-
-{% block content-main %}
-
-<h1>Latest entries</h1>
-
-{% for entry in entry_list %}
-  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
-  {{ entry.body|safe }}  
-  <p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
-{% endfor %}
-
-{% endblock %}

examples/templates/simple/flatfiles/homepage.html

-{% extends "base_2col.html"  %}
-
-
-{% block content-main %}
-{% load diario_tags %}
-
-<div id="main">
-  <h1>Weblog</h1>
-
-  {% get_diario_entry_list 5 as latest_entries %}
-
-  {% if latest_entries %}
-    {% for entry in latest_entries %}
-    <div>
-      <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
-      <p>{{ entry.pub_date|date:"F j, Y" }}</p>
-      {{ entry.body|safe }}
-    </div>
-    {% endfor %}
-  {% else %}
-    <p>No entries published yet. You can add entries
-      with <a href="/admin/">/admin/</a>.</p>
-  {% endif %}
-</div>      
-
-{% endblock %}

examples/templates/with_tagging/base.html

-<?xml version="1.0" encoding="utf-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-	  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
-    <title>Simple Website | {% block title %}Home page{% endblock %}</title>
-  </head>
-
-  <body>
-    <div id="header">
-      <h1>Simple Website</h1>
-
-      <p>This is a simple project
-	with <a href="http://django-diario.googlecode.com">diario</a>
-	application
-	and <a href="http://django-tagging.googlecode.com">tagging</a>
-	support. See the <i>"simple"</i> project for a example without
-	tagging	support.</p>
-
-      <ul>
-	<li><a href="/">Home page</a></li>
-	<li><a href="{% url diario-entry-list %}">Weblog</a></li>
-      </ul>
-    </div>
-
-    <hr />
-
-    <div id="content">
-      {% block content %}{% endblock %}
-    </div>
-
-    <hr />
-
-    <div id="footer">
-      <p>Copyright &copy; 2007 My Website</p>
-    </div>
-  </body>
-</html>

examples/templates/with_tagging/base_2col.html

-{% extends "base.html" %}
-
-
-{% block content %}
-
-{% block content-main %}{% endblock %}
-
-<hr />
-
-{% block content-related %}
-<div id="sidebar">
-  <h1>Archive</h1>
-  {% load diario_tags %}
-  {% get_diario_month_list as archive %}
-
-  {% if archive %}
-    {% for month in archive %}
-    <ul>
-      <li><a href="{% url diario-archive-month month.year,month|date:"m" %}">{{ month|date:"F, Y" }}</a></li>
-    </ul>
-    {% endfor %}
-  {% else %}
-    <p>Empty archive. No entries published.</p>
-  {% endif %}
-</div>
-
-<div id="tags">
-  
-  <h1>Tags</h1>
-  {% load tagging_tags %}
-  {% tags_for_model diario.Entry as tags %}
-
-  <p>
-  {% if tags %}
-    {% for tag in tags %}
-      <a href="{% url diario-tagged-entry-list tag %}">{{ tag }}</a>{% if not forloop.last %},{% endif %}
-    {% endfor %}
-  {% else %}
-    No entries taggeed.
-  {% endif %}
-  </p>
-
-</div>
-
-{% endblock %}
-
-{% endblock%}

examples/templates/with_tagging/diario/entry_detail.html

-{% extends "base_2col.html" %}
-
-{% block title %}Weblog | {{ entry.title|escape }}{% endblock %}
-
-{% block content-main %}
-{% load tagging_tags %}
-{% tags_for_object entry as tags %}
-
-<h1>{{ entry.title }}</h1>
-{{ entry.body|safe }}
-<p>Posted on {{ entry.pub_date|date:"F j, Y" }}</p>
-
-<p>
-{% if tags %}
-  <b>Tags:</b>
-  {% for tag in tags %}
-    <a href="{% url diario-tagged-entry-list tag %}">{{ tag }}</a>{% if not forloop.last %},{% endif %}
-  {% endfor %}
-{% endif %}
-</p>
-
-
-{% endblock %}

examples/templates/with_tagging/diario/entry_list_tagged.html

-{% extends "base.html" %}
-
-{% block title %} Weblog | Entries tagged "{{ tag }}"{% endblock %}
-
-{% block content %}
-{% load tagging_tags %}
-
-<h1>Entries with tag "{{ tag }}"</h1>
-
-{% for entry in entry_list %}
-{% tags_for_object entry as tags %}
-  <h2><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
-  <p>{{ entry.pub_date|date:"F j, Y" }}</p>
-  <p>
-  {% if tags %}
-    <b>Tags:</b>
-    {% for tag in tags %}
-      <a href="{% url diario-tagged-entry-list tag %}">{{ tag }}</a>{% if not forloop.last %},{% endif %}
-    {% endfor %}
-  {% endif %}
-</p>
-  {{ entry.body|safe }}
-{% endfor %}
-
-{% endblock %}