Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated authors and file README.rst.

  • Loading branch information...
commit 50a033ea2929e7c7e8d9431d49a87ccdceec0446 1 parent abcd816
Guilherme Gondim authored

Showing 2 changed files with 31 additions and 33 deletions. Show diff stats Hide diff stats

  1. +1 0  AUTHORS.txt
  2. +30 33 README.rst
1  AUTHORS.txt
@@ -6,3 +6,4 @@ Extended by
6 6 * Peter Baumgardner <http://lincolnloop.com/blog>
7 7 * Kevin Fricovsky <http://blog.howiworkdaily.com/>
8 8 * Horst Gutmann <http://zerokspot.com/>
  9 + * Guilherme Gondim <http://semente.taurinus.org/>
63 README.rst
Source Rendered
... ... @@ -1,46 +1,43 @@
1   -django-flatblocks
2   -=================
  1 +django-snippets
  2 +===============
3 3
4   -django-flatblocks is a simple application for handling small text-blocks on
5   -websites. Think about it like ``django.contrib.flatpages`` just not for a
6   -whole page but for only parts of it, like an information text describing what
7   -you can do on a site.
  4 +django-snippets acts like an {% include %}, that loads a template and
  5 +renders it with the current context, but is editable and served
  6 +dynamically from database.
8 7
9 8 Usage
10   -------------
  9 +-----
11 10
12   -Once you've created some instances of the ``flatblocks.models.FlatBlock``
13   -model, you can load it it using the ``flatblock_tags`` templatetag-library::
  11 +Once you've created some instances of the ``snippets.models.Snippet``
  12 +model, you can load it it using the ``snippets_tags`` templatetag-library::
14 13
15   - {% load flatblock_tags %}
  14 + {% load snippets_tags %}
  15 + {% load comments %}
16 16
17   - <html>
18   - <head>
19   - <!-- ... -->
20   - </head>
21   - <body>
22   - <div id="page">
23   - <div id="main">
24   - <!-- ... -->
25   - </div>
26   - <div id="sidebar">
27   - {% flatblock "page.info" %}
28   - </div>
29   - </div>
30   - </body>
31   - </html>
32   -
33   -This way you can display a text block with the name 'page.info'. If you
34   -have the name of a block in a template variable, leave out the quotes.
  17 + <!-- ... -->
  18 +
  19 + <h1>{{ entry.title }}</h1>
  20 +
  21 + {{ entry.body }}
  22 +
  23 + {% get_comment_list for entry as comment_list %}
  24 + {% if comment_list %}
  25 + <h2>Comments</h2>
  26 + {% get_snippet "comment_list" %}
  27 + {% endif %}
  28 +
  29 + <!-- ... -->
  30 +
  31 +This way you can include a snippet with the name "comment_list". If you
  32 +have the name of a snippet in a template variable, leave out the quotes.
35 33
36 34 This tag also accepts an optional argument where you can specify the number
37   -of seconds, the that block should be cached::
  35 +of seconds, the that snippet should be cached::
38 36
39   - {% flatblock "page.info" 3600 %}
40   -
  37 + {% get_snippet "comment_list" 3600 %}
41 38
42 39 History
43   -------------
  40 +-------
44 41
45 42 Since this application targets use-cases that are basically applicable to
46 43 most web-projects out there, there are tons of solutions similar to this one.
@@ -60,4 +57,4 @@ the `django-better-chunks`_ fork (``django.contrib.site``- and i18n-support).
60 57 .. _`original fork`: http://github.com/howiworkdaily/django-flatblock/
61 58 .. _`django-chunks`: http://code.google.com/p/django-chunks/
62 59 .. _`django-better-chunks`: http://bitbucket.org/hakanw/django-better-chunks/
63   -.. _`forked by Peter Baumgardner`: http://github.com/lincolnloop/django-flatblock/
  60 +.. _`forked by Peter Baumgardner`: http://github.com/lincolnloop/django-flatblock/

0 comments on commit 50a033e

Please sign in to comment.
Something went wrong with that request. Please try again.