Simon McVittie
1942fc3bd6
comments: Store dates in GMT and in ISO-8601
...
The [[!_comment]] directive is a serialization format, not something for
presentation to users, so we should use the least ambiguous possible
representation.
2008-12-12 11:02:41 +00:00
Joey Hess
8d3a3c6a1e
simplifiy logic
2008-12-11 17:31:57 -05:00
Simon McVittie
f2d5ead6af
comments: Change internal-use-only directive from [[!comment]] to [[!_comment]]
2008-12-11 21:23:55 +00:00
Simon McVittie
dd1fa13bce
comments: Use new feedfile, emptyfeeds options to inline
2008-12-11 21:19:50 +00:00
Simon McVittie
3560460eb6
comments: don't interpolate IP into anonymous user's "name"
...
If an admin wants the IP in the comment display template they can still
get it (the default template shows it).
2008-12-11 21:14:05 +00:00
Simon McVittie
1698364da0
comments: fix invocation of possibly_foolish_untaint
2008-12-11 21:14:05 +00:00
Simon McVittie
fbf145ca3f
comments: avoid warning if there's no subject
2008-12-11 21:14:05 +00:00
Simon McVittie
a5889912b3
comments: Optionally allow anonymous commenters to set their name/URL.
...
Also provide a way for the comment template to pick up the verified
username/IP.
2008-12-11 21:14:05 +00:00
Simon McVittie
0a69c7ed56
comments: Remove some dead code
2008-12-11 21:14:05 +00:00
Simon McVittie
44a7d77a30
comments: rename main field to "editcontent" consistent with editpage
...
This has the side-effect that Ikiwiki's default style.css gives the text
box 100% width.
2008-12-11 21:14:05 +00:00
Simon McVittie
edb69335f2
comments: instead of hard-coding mdwn, allow any supported page format
2008-12-11 21:14:05 +00:00
Simon McVittie
9af0f04df3
comments: Save comments as a file with one big [[!comment]] directive.
...
This delays all comment formatting until the last possible time, allows
us to set metadata without worrying that commenters may be able to evade
it, and means that changes to how a comment is saved can be handled
gracefully. It also gives us somewhere to put the commenter's username
or IP address for later reference.
2008-12-11 21:14:05 +00:00
Simon McVittie
6a986a8a0b
Remove dead code for preprocessing [[!comments]]
2008-12-11 21:14:05 +00:00
Simon McVittie
1d696aef2c
comments: Duplicate logic and CGI hook from recentchanges to link user pages correctly
2008-12-11 21:14:05 +00:00
Simon McVittie
f88870f102
Qualify name of formattime() correctly
2008-12-11 21:14:04 +00:00
Simon McVittie
80e84e32bf
Delay checking for session expiry til we actually post a comment
2008-12-11 21:14:04 +00:00
Simon McVittie
24bfc3fdc5
comments: record the time at which each comment was posted
2008-12-11 21:14:04 +00:00
Simon McVittie
e66e2c2a7e
comments: Use a checkconfig hook to get the default value of comments_pagename
2008-12-11 21:14:04 +00:00
Simon McVittie
4ff161ba0b
comments: render comments/commenturl in page.tmpl
2008-12-11 21:14:04 +00:00
Simon McVittie
49eabc676a
comments: use global config to decide whether commenting is allowed, and for name of page
...
Also:
* decide comment page name sooner
* set permalink on it
2008-12-11 21:14:04 +00:00
Simon McVittie
a9b0b3da5f
comments: use global configuration for allow_directives, commit, and pagename
2008-12-11 21:14:04 +00:00
Simon McVittie
d35a2bd2de
comments: Add some global configuration
2008-12-11 21:14:04 +00:00
Simon McVittie
4972baac4d
comments: make preprocess a no-op
2008-12-11 21:14:04 +00:00
Simon McVittie
c9bb8b03a4
comments: document what linkuser does
2008-12-11 21:14:03 +00:00
Simon McVittie
404792c618
comments: add a stub pagetemplate hook to show the comments
2008-12-11 21:14:03 +00:00
Simon McVittie
3abfc1d71c
comments: Use HTML entities to escape directives
2008-12-11 21:14:03 +00:00
Simon McVittie
430ac61f21
Embed comments into comments_embed.tmpl rather than concatenating in perl
2008-12-11 21:14:03 +00:00
Simon McVittie
286dbb0541
comments: use CGI module's checksessionexpiry
2008-12-11 21:14:03 +00:00
Simon McVittie
9a6005a212
editpage: factor out checksessionexpiry into IkiWiki::CGI
2008-12-11 21:14:03 +00:00
Simon McVittie
cb5aaa3cee
htmlbalance: don't compact whitespace, and set misc other options
...
Not compacting whitespace is the most important one: now that we run
sanitize hooks on individual posted comments in the comments plugin,
whitespace that is significant to Markdown (but not HTML) is lost.
2008-12-11 21:14:03 +00:00
Simon McVittie
249ea2ed75
comments: remove allowhtml option, just switch it on all the time
...
Now that posts are individually sanitized, that should be safe.
2008-12-11 21:14:03 +00:00
Simon McVittie
4663f364bb
comments: load inline and mdwn lazily
2008-12-11 21:14:03 +00:00
Simon McVittie
9d92fd5eb0
comments: don't rely on mdwn getting loaded first
2008-12-11 21:14:03 +00:00
Simon McVittie
ebe140201e
comments: sanitize the body of each comment before posting it
...
This should ensure that users can't "break out" from the enclosing
<div>, making it impossible to forge comments (assuming htmlscrubber
is enabled, and so is either htmlbalance or htmltidy).
2008-12-11 21:14:03 +00:00
Simon McVittie
57e40b9ce5
Fix typo that led to comments being blanked
2008-12-11 21:14:02 +00:00
Simon McVittie
3d4aa065d6
postcomment: Rename plugin to comments, use *._comment files
...
The PageSpec is still called "postcomment" since that's what it means.
2008-12-11 21:14:02 +00:00
Simon McVittie
3c9ccb406b
Rename smcvpostcomment plugin to postcomment to propose for inclusion
2008-12-11 21:14:02 +00:00
Simon McVittie
b7db3444a5
smcvpostcomment: allow commenting to be closed
2008-12-11 21:14:02 +00:00
Simon McVittie
f49603bf86
smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI
2008-12-11 21:14:02 +00:00
Simon McVittie
442e4e7e12
smcvpostcomment: allow inlining to be disabled, and pass through atom etc. better
2008-12-11 21:14:02 +00:00
Simon McVittie
bb4eb07bdd
smcvpostcomment: make allowhtml etc. configurable, and don't allow commenting on pages where comments have never been allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
d18adfb1ad
smcvpostcomment: indicate in form whether HTML and directives are allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
1bd1b03766
smcvpostcomment: remove HTML if not allowed
2008-12-11 21:14:02 +00:00
Simon McVittie
660a4ef151
smcvpostcomment: always allow wikilinks, and do access control
...
wikilinks are harmless, so we might as well allow them.
Access control for this plugin is a bit odd, since we specifically
don't want to allow comments to be edited - so the check is whether the
user is allowed to edit a deliberately invalid page name,
page/commented/on[smcvpostcomment]. You can put smcvpostcomment(*)
or smcvpostcomment(some/subdir/*) in $config{anonok_pagespec}
or the opposite in $config{locked_pages} to allow "editing" (really
just posting) comments.
2008-12-11 21:14:02 +00:00
Simon McVittie
798dea2033
smcvpostcomment: reduce length of subject field
2008-12-11 21:14:02 +00:00
Simon McVittie
29862a8cc8
smcvpostcomment: explain what $fake is for
2008-12-11 21:14:01 +00:00
Simon McVittie
42b15f7633
smcvpostcomment: avoid warnings if form field 'body' is undef
2008-12-11 21:14:01 +00:00
Simon McVittie
e65c7b73af
smcvpostcomment: load inline plugin more forcibly
2008-12-11 21:14:01 +00:00
Simon McVittie
49835784d8
smcvpostcomment: use better names for special comment files
2008-12-11 21:14:01 +00:00
Simon McVittie
bd8c4674a8
smcvpostcomment: use gettext where appropriate
2008-12-11 21:14:01 +00:00
Simon McVittie
f77f7a02a6
Add initial version of a postcomment plugin (temporarily namespaced as smcvpostcomment)
2008-12-11 21:14:01 +00:00
Joey Hess
b67632cdcd
inline: Support feedfile option to change the filename of the feed generated.
2008-12-11 15:01:26 -05:00
Joey Hess
63eb9d834e
inline: Support emptyfeeds=no option to skip generating empty feeds.
2008-12-11 14:04:38 -05:00
Joey Hess
38f5e3ba69
move feedpages application up
...
I wanted this nearer to the top, but decided to put it after the
add_depends. Reasoning: It's possible with a combinaton of feedpages and
show options to make @list and @feedlist contain completly differing sets
of pages. We want to add_depends all pages in both sets. We could combine
the two lists and add_depends that, but it's slightly more efficient to
defer reducing @feedlist, and add_depends whichever list is longer.
2008-12-11 13:58:40 -05:00
intrigeri
5eed0fd97d
po(change): reset renamed pages status at a better time
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 04:37:26 +01:00
intrigeri
d795a295c9
po: initial infrastructure to deal with renamed master page
...
This is a skeleton that does nothing yet.
See the comments in the code for an overview of the issue that arises, due to
the renamepage hook never being called globally.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 03:55:55 +01:00
intrigeri
c390056eb2
po(delete): added hook, and function skeleton
...
Not implemented yet, 'cos the renamepage hook has to come first.
Else translations would be deleted on rename, what a shame.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:38:22 +01:00
intrigeri
cb1fe44f5d
po(change): avoid losing information before guessing the same...
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:07:52 +01:00
intrigeri
8745d67f06
po(istranslatablefile): extracted this from istranslatable
...
... will need this soon to deal with master file deletion.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 00:56:23 +01:00
intrigeri
190c641c8a
po(otherlanguages): return pages that should exist
...
... instead of already existing ones.
This fixes the "missing otherlanguages links on master pages just created via
the CGI" bug.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 23:27:30 +01:00
intrigeri
36312b13b4
po: memoized istranslatable, eventually
...
And enjoy a 10% rebuild time enhancement on a complex wiki full of maps and
other pseudo-dynamic content, with some other costly plugins enabled. So it
could well mean 20% on a more usual wiki.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 22:32:47 +01:00
intrigeri
10c4e858b8
po(change): flush Memoize cache, to fix bug after rename/remove
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 21:18:48 +01:00
intrigeri
c440a39ba4
po(htmlize): ignore PO files not managed by this plugin
...
This way, the po plugin will not appropriate PO files it is not responsible for,
and PO files existing before this plugin was enabled can coexist peacefully with
our own ones.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 18:06:04 +01:00
intrigeri
2f27eb9693
po: ooops, fixed just introduced bug
...
(I just removed in istranslation and _istranslation the dependency on
istranslatable... which broke things in a subtle way, hard to see at the first
glance.)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:52:00 +01:00
intrigeri
e18a9d9a88
parentlinks: fixed links when po plugin is enabled
...
(and usedirs is disabled)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:36:00 +01:00
intrigeri
aed42eb34a
po: fix istranslation/istranslatable for pages starting with /
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:29:12 +01:00
intrigeri
f4815e3b12
po(mybestlink): fixed when fed with path beginning with /
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 16:54:51 +01:00
intrigeri
eba2dee941
po: compute internal links from a slave page relative to its master page
...
e.g. a link appearing on a slave page links to its masterpage's subpages.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 15:04:50 +01:00
intrigeri
b19d0d3d24
Merge commit 'upstream/po' into prv/po
2008-11-12 01:08:57 +01:00
Joey Hess
0d1593a201
Merge commit 'intrigeri/po' into po
2008-11-11 17:52:51 -05:00
Joey Hess
2a56ec6644
Merge branch 'master' into po
2008-11-11 17:52:32 -05:00
intrigeri
40ffc92953
po: fixed bug when a new translatable page is created
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 23:04:58 +01:00
intrigeri
2b4e76a961
po: change a bit the way links are generated
...
This will soon enable usage of translated page titles in link.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 22:29:47 +01:00
Joey Hess
6611f3a2d9
bzr: Fix dates for recentchanges.
2008-11-11 13:44:47 -05:00
intrigeri
f0abaa9fc9
po: fixed link to home page when po_link_to=negotiated, added testcase
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 18:42:14 +01:00
intrigeri
f0e796d9a1
po(change): fix uninitialized variables when running IkiWiki::refresh()
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 16:04:40 +01:00
intrigeri
43a1d36378
po: added HOMEPAGEURL template variable, documented when to use it
...
Hopefully all links should now be consistent with the chosen linking behavior,
but who knows...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:27:39 +01:00
intrigeri
cfe101fff9
po: fixed link to homepage from non-translation page
...
Added testcases for this bug.
It remains broken when generated from <TMPL_VAR BASEURL>, though.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:06:26 +01:00
intrigeri
6b82ef44b0
po: some code simplification/clarification
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 14:11:34 +01:00
intrigeri
3d8d47d785
Merge commit 'upstream/master' into prv/po
2008-11-11 04:40:24 +01:00
intrigeri
0d8cbfc5e0
po(scan): make more clear what's being done
...
Mostly comments, and also a small code change: simplification and implementation
details hiding.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:32:20 +01:00
intrigeri
d57ef86380
po: reorder nearly all of the module code
...
It has grown up incrementally and new helper functions were added right in the
middle of the hooks, most often near the place they were used, which is
practical when doing initial development, but quite ugly afterwards, when helper
functions are useful to separate logic and implementation details.
Today's refactoring commits have brought the code to a much more maintainable
state, IMHO.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:05:39 +01:00
Joey Hess
53752bcb5d
remove redundant link munge
...
This is not needed now that tagpage returns a page name starting with a
slash.
(Also fixes a minor bug that the edit links started with double slashes due
to the hack.)
2008-11-10 21:47:29 -05:00
Joey Hess
f8a09ba105
tag: Normalize tagbase so leading/trailing slashes in it don't break things.
2008-11-10 19:48:58 -05:00
Joey Hess
f0e58faefa
Add rel=nofollow to recentchanges_links for the same (weak) reasons it was earlier added to edit links.
2008-11-10 18:05:30 -05:00
intrigeri
a7d329c173
po(match_lang, match_currentlang): use the lang() function
...
... now that it exists, instead of duplicating it.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:30:06 +01:00
intrigeri
b4ab0d0b9e
po: rewrote otherlanguagesloop()
...
It is now more elegant IMHO, and the output is now sorted according to the
language name (instead of code).
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:19:21 +01:00
intrigeri
c5513548c9
po: factorize extraction of a slave page's masterpage and lang
...
The very same code was repeated at dozens of places.
NB: the real work is now done is _istranslation(), which is memoized,
so the additional function calls overhead should be compensated.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 20:40:44 +01:00
intrigeri
864bc2d9d0
po(otherlanguagesloop): start factorizing
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 18:38:25 +01:00
intrigeri
1255acc02c
po: finish abstracting %filtered by putting it into a blackbox
...
i.e. it is invisible for everyone but its accessors/mutators
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:30:49 +01:00
intrigeri
38cdda66d7
po: actually use pofiles() function, to enhance code clarity
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:09:56 +01:00
intrigeri
5575786803
po: abstract "doing something for the same page in every other language"
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 14:55:21 +01:00
intrigeri
532ec56a5f
po: abstract implementation details for %translations building and resetting
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:56:46 +01:00
intrigeri
3174b4c6f3
po: abstract %filtered implementation details
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:51:00 +01:00
intrigeri
00732f19b9
po: clarify error messages
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:22:50 +01:00
intrigeri
6fc898df75
po: clarify code with some comments
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:14:42 +01:00
intrigeri
aef1b0f503
po: prevent a slave page to depend on itself
...
It has never caused harm yet, but it might in the future.
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 12:48:27 +01:00
intrigeri
646d7bf6a3
po(refreshpot): define the input charset before read()'ing
...
... to prevent the use of Encode::Guess::guess_encoding() in
Locale::Po4a::Transtractor (just a minor security measure, dependent on po4a
internals, but we have no reason to think Encode::Guess is not safe).
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-08 21:32:04 +01:00
intrigeri
f652af11fd
Merge commit 'upstream/master' into pub/po
2008-11-07 22:19:34 +01:00
intrigeri
a0ac346079
po: finished backlinks implementation
...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07 22:17:54 +01:00