]>
git.llucax.com Git - software/blitiri.git/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Alberto Bertogli [Sat, 6 Sep 2008 14:46:24 +0000 (11:46 -0300)]
Use the vars' version when building the comment link
Otherwise, the object versions won't be sanitize()d, and can contain
malicious code.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Sat, 6 Sep 2008 14:33:47 +0000 (11:33 -0300)]
sanitize() must only be called on strings
Otherwise, we may call sanitize() and think it's safe when it's not.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Sat, 6 Sep 2008 14:29:30 +0000 (11:29 -0300)]
Create the comments directory for an article if it doesn't exist
It is needed when comments are enabled after the article was added,
otherwise the save() will fail.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Sat, 6 Sep 2008 14:14:36 +0000 (11:14 -0300)]
Fix valid_link() to avoid scheme repetition
valid_link("mailto:x@y") returns "mailto:mailto:x@y". This patch fixes it,
and simplifies the code path.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Sat, 6 Sep 2008 13:56:11 +0000 (10:56 -0300)]
Fix links to articles in the list view
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Fri, 5 Sep 2008 19:31:56 +0000 (16:31 -0300)]
Simplify captcha configuration
We provide some built-in captcha classes, and the user can select them
with a simple string. He/she can still use a custom class.
At the moment, only the title captcha is supported.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Fri, 5 Sep 2008 19:11:25 +0000 (16:11 -0300)]
Use decorator syntax
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Mon, 1 Sep 2008 19:42:06 +0000 (16:42 -0300)]
Make the cached() decorator take into account all arguments
Also, while at it, move the test for cache_path into the decorator, and
fix the cache file name.
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Alberto Bertogli [Mon, 1 Sep 2008 16:29:09 +0000 (13:29 -0300)]
Improve cache_path option comments
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Leandro Lucarella [Sun, 31 Aug 2008 17:51:41 +0000 (14:51 -0300)]
Fix 80 chars column limit
Leandro Lucarella [Sun, 31 Aug 2008 17:45:41 +0000 (14:45 -0300)]
Add basic caching support to restructured text rendering
Leandro Lucarella [Sun, 31 Aug 2008 17:44:53 +0000 (14:44 -0300)]
Add the total render time as a comment when handling CGI
Leandro Lucarella [Mon, 25 Aug 2008 03:53:06 +0000 (00:53 -0300)]
Add post preview
This patch adds a post preview feature to see how a post is rendered without
adding it to the articles DB, using the URI /preview/post/ARTICLE_PATH (where
ARTICLE_PATH is the relative path to the article from the data path).
Leandro Lucarella [Tue, 12 Aug 2008 20:55:50 +0000 (17:55 -0300)]
Disable unsecure rst directives for online commenting
Leandro Lucarella [Tue, 12 Aug 2008 20:54:31 +0000 (17:54 -0300)]
Be aware of rst parsing errors with no line information
Leandro Lucarella [Tue, 12 Aug 2008 22:03:32 +0000 (19:03 -0300)]
Remove \r (use unix style end of lines) from comments body
Leandro Lucarella [Wed, 13 Aug 2008 21:15:38 +0000 (18:15 -0300)]
Store the sanitized form data when commenting online
When storing a comment, we should use the validated data instead of
the raw one.
Leandro Lucarella [Sun, 10 Aug 2008 18:46:56 +0000 (15:46 -0300)]
Add (customizable) captcha support
Leandro Lucarella [Sun, 10 Aug 2008 05:50:12 +0000 (02:50 -0300)]
Validate link form field when adding a comment online
Leandro Lucarella [Sat, 9 Aug 2008 22:12:24 +0000 (19:12 -0300)]
Add form error reporting to online comments
Leandro Lucarella [Sun, 10 Aug 2008 04:52:13 +0000 (01:52 -0300)]
Make the comment author a link only if the comment has a link attribute
Leandro Lucarella [Sat, 9 Aug 2008 20:47:57 +0000 (17:47 -0300)]
Search for the right template name when rendering the comment form
Leandro Lucarella [Thu, 7 Aug 2008 16:33:08 +0000 (13:33 -0300)]
Add online commenting support
This patch adds support for online commenting. A new template
``com_form.html`` to customize the commenting form is added. Online
commenting is only available if ``enable_comments`` is True, and you need
to let the web server write to the ``comments_path`` directory.
Note that this patch exposes the race in the CommentDB.save() method
(described in the previous commit), but since this event is unlikely
enough, we don't care at the moment and can be fixed later if needed.
Leandro Lucarella [Thu, 7 Aug 2008 01:51:50 +0000 (22:51 -0300)]
Add a configuration option to enable the comments support
Leandro Lucarella [Wed, 6 Aug 2008 20:04:56 +0000 (17:04 -0300)]
Show comments when displaying a single article
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).
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
Leandro Lucarella [Wed, 6 Aug 2008 16:44:16 +0000 (13:44 -0300)]
Use os.path.join() to build filenames
Leandro Lucarella [Wed, 6 Aug 2008 15:28:18 +0000 (12:28 -0300)]
Rename DB to ArticleDB
Leandro Lucarella [Wed, 6 Aug 2008 20:24:56 +0000 (17:24 -0300)]
Properly translate HTML entities in user inputs when rendering
Leandro Lucarella [Wed, 6 Aug 2008 20:28:35 +0000 (17:28 -0300)]
Strip article's haders values
Leandro Lucarella [Wed, 6 Aug 2008 15:13:01 +0000 (12:13 -0300)]
Add created and updated as optional parameters to Article constructor
Leandro Lucarella [Tue, 5 Aug 2008 22:35:25 +0000 (19:35 -0300)]
Remove dead code
Leandro Lucarella [Tue, 5 Aug 2008 00:04:46 +0000 (21:04 -0300)]
Move docutils rendering bits to a helper function
Leandro Lucarella [Mon, 4 Aug 2008 23:16:37 +0000 (20:16 -0300)]
Avoid code repetition by adding a helper function Template.get_template()
Leandro Lucarella [Tue, 5 Aug 2008 00:21:29 +0000 (21:21 -0300)]
Avoid code repetition by adding Article.to_vars() method
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.
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
Leandro Lucarella [Fri, 8 Aug 2008 17:50:34 +0000 (14:50 -0300)]
Use text/css as Content-type when rendering the style sheet
Leandro Lucarella [Thu, 7 Aug 2008 16:10:25 +0000 (13:10 -0300)]
Use a fixed width in the default style sheet
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
Leandro Lucarella [Mon, 4 Aug 2008 01:36:00 +0000 (22:36 -0300)]
Make blitiri.cgi work as a symlink
Alberto Bertogli [Tue, 11 Mar 2008 20:14:29 +0000 (18:14 -0200)]
Add a "list" view to list all articles.
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>
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>
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>
Alberto Bertogli [Tue, 22 May 2007 04:54:55 +0000 (01:54 -0300)]
Initial commit.
Signed-off-by: Alberto Bertogli <albertito@gmail.com>