]> git.llucax.com Git - software/blitiri.git/log
software/blitiri.git
16 years agoShow comments when displaying a single article
Leandro Lucarella [Wed, 6 Aug 2008 20:04:56 +0000 (17:04 -0300)]
Show comments when displaying a single article

16 years agoAdd basic comments support
Leandro Lucarella [Wed, 6 Aug 2008 17:15:51 +0000 (14:15 -0300)]
Add basic comments support

This patch implements the basics for comments support. Two new classes are
added: Comment and CommentDB.

Comments are stored in almost the same format as articles, but a comment DB is
present for each article. All comments are stored in the ``comments_path``
directory (which usually won't be the same as the ``data_path`` because,
when online comment posting is implemented, it will need to be writeable by
the web server). Each article should have a subdirectory in that path (with
the article's uuid as directory name), where a ``db`` file is expected, with
this format::

comment number, creation time (epoch)

Comments are numbered incrementally and this number is considered both the
ID and the filename where the comment contents are stored under the
article's comments directory. An empty line in the comments DB represents
a deleted comment.

Comment files have a similar format to Article files, a header is expected
in the form of key, values:
Author: Leandro Lucarella
Link: http://www.example.com/
Headers end with an empty line, where the body begin, in RestructuredText
format. The link can be any URL (for example, mailto:pomelo@example.com).

A new attribute ``comments`` is added to Article class, with a list of
comments for that article (loaded via the CommentDB class).

Note that a race is possible if more than one process add a comment at the
same time, because of how the CommentDB.save() method is implemented (the
same happens with ArticleDB.save(), but it's more likely that 2 comments
are added at the same, for example when online commenting is implemented).

16 years agoDon't store leading slashes for paths in the article's DB
Leandro Lucarella [Wed, 6 Aug 2008 17:07:11 +0000 (14:07 -0300)]
Don't store leading slashes for paths in the article's DB

16 years agoUse os.path.join() to build filenames
Leandro Lucarella [Wed, 6 Aug 2008 16:44:16 +0000 (13:44 -0300)]
Use os.path.join() to build filenames

16 years agoRename DB to ArticleDB
Leandro Lucarella [Wed, 6 Aug 2008 15:28:18 +0000 (12:28 -0300)]
Rename DB to ArticleDB

16 years agoProperly translate HTML entities in user inputs when rendering
Leandro Lucarella [Wed, 6 Aug 2008 20:24:56 +0000 (17:24 -0300)]
Properly translate HTML entities in user inputs when rendering

16 years agoStrip article's haders values
Leandro Lucarella [Wed, 6 Aug 2008 20:28:35 +0000 (17:28 -0300)]
Strip article's haders values

16 years agoAdd created and updated as optional parameters to Article constructor
Leandro Lucarella [Wed, 6 Aug 2008 15:13:01 +0000 (12:13 -0300)]
Add created and updated as optional parameters to Article constructor

16 years agoRemove dead code
Leandro Lucarella [Tue, 5 Aug 2008 22:35:25 +0000 (19:35 -0300)]
Remove dead code

16 years agoMove docutils rendering bits to a helper function
Leandro Lucarella [Tue, 5 Aug 2008 00:04:46 +0000 (21:04 -0300)]
Move docutils rendering bits to a helper function

16 years agoAvoid code repetition by adding a helper function Template.get_template()
Leandro Lucarella [Mon, 4 Aug 2008 23:16:37 +0000 (20:16 -0300)]
Avoid code repetition by adding a helper function Template.get_template()

16 years agoAvoid code repetition by adding Article.to_vars() method
Leandro Lucarella [Tue, 5 Aug 2008 00:21:29 +0000 (21:21 -0300)]
Avoid code repetition by adding Article.to_vars() method

16 years agoMake default template Use XHTML 1.0 Strict
Leandro Lucarella [Fri, 8 Aug 2008 17:47:46 +0000 (14:47 -0300)]
Make default template Use XHTML 1.0 Strict

The default template was not valid HTML 4.01 Transitional.

16 years agoRemove <br/>s to make the default template more XHTML 1.0 Strict friendly
Leandro Lucarella [Fri, 8 Aug 2008 17:53:50 +0000 (14:53 -0300)]
Remove <br/>s to make the default template more XHTML 1.0 Strict friendly

16 years agoUse text/css as Content-type when rendering the style sheet
Leandro Lucarella [Fri, 8 Aug 2008 17:50:34 +0000 (14:50 -0300)]
Use text/css as Content-type when rendering the style sheet

16 years agoUse a fixed width in the default style sheet
Leandro Lucarella [Thu, 7 Aug 2008 16:10:25 +0000 (13:10 -0300)]
Use a fixed width in the default style sheet

16 years agoApply os.path.realpath() to *_path config variables to support relative paths
Leandro Lucarella [Mon, 4 Aug 2008 01:36:00 +0000 (22:36 -0300)]
Apply os.path.realpath() to *_path config variables to support relative paths

16 years agoMake blitiri.cgi work as a symlink
Leandro Lucarella [Mon, 4 Aug 2008 01:36:00 +0000 (22:36 -0300)]
Make blitiri.cgi work as a symlink

16 years agoAdd a "list" view to list all articles.
Alberto Bertogli [Tue, 11 Mar 2008 20:14:29 +0000 (18:14 -0200)]
Add a "list" view to list all articles.

17 years agoRelax config import to make it usable.
Alberto Bertogli [Tue, 22 May 2007 05:30:36 +0000 (02:30 -0300)]
Relax config import to make it usable.

The os.path.isfile("config.py") check is too strict: it makes blitiri
usable from the command line only if it's ran in the directory where it
lives.

There's no point in doing that, let's just relax the import.
The chances of a config module collision are too low to be worth the
usability problem.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
17 years agoBe more verbose with article path errors.
Alberto Bertogli [Tue, 22 May 2007 05:28:52 +0000 (02:28 -0300)]
Be more verbose with article path errors.

It's easier to debug problems if we echo the full paths when dying because
the article is not inside the data path.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
17 years agoAdd coding:utf8 to the sample config file.
Alberto Bertogli [Tue, 22 May 2007 05:09:45 +0000 (02:09 -0300)]
Add coding:utf8 to the sample config file.

If somebody edits and uses a non-ascii character, importing it will
fail and blitiri will just ignore it, which is not easier to debug.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
17 years agoInitial commit.
Alberto Bertogli [Tue, 22 May 2007 04:54:55 +0000 (01:54 -0300)]
Initial commit.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>