comment removal question
[ikiwiki] / doc / todo / comments.mdwn
1 # Known issues with the [[plugins/comments]] plugin
2
3 ## Unimplemented
4
5 * Instead of just a link to add a comment, it could have a form to enter
6   the title, similar to the form for adding a new blog post.
7
8   > I'm not sure this is so useful? On Livejournal titles are allowed on
9   > comments, but very rarely used (and indeed usually not very useful);
10   > it's hard enough to get some people to title their blog posts :-)
11   > --[[smcv]]
12
13 * Having enabled anonok and leads to the undesirable situation, that everybody is able to remove every comment. Is there an easy workaround, or am I missing something? --[[wiebel]]
14
15 ## Won't fix
16
17 * Because IkiWiki generates static HTML, we can't have a form inlined in
18   page.tmpl where the user fills in an entire comment and can submit it in
19   a single button-press, without being vulnerable to cross-site request forgery.
20   So I'll put this in as wontfix. --[[smcv]]
21
22   > Surely there's a way around that?
23   > A web 2.0 way comes to mind: The user clicks on a link
24   > to open the comment post form. While the nasty web 2.0 javascript :)
25   > is manipulating the page to add the form to it, it looks at the cookie
26   > and uses that to insert a sid field.
27   > 
28   > Or, it could have a mandatory preview page and do the CSRF check then.
29   > --[[Joey]]
30
31 * It would be useful to have a pagespec that always matches all comments on
32   pages matching a glob. Something like `comment(blog/*)`.
33   Perhaps postcomment could also be folded into this? Then the pagespec
34   would match both existing comments, as well as new comments that are
35   being posted.
36
37   > Please see [[plugins/comments/discussion]]. If I've convinced you that
38   > internal pages are the way forward, then sure, we can do that, because
39   > people who can comment still won't be able to edit others' comments
40   > (one of my goals is that commenters can't put words into each other's
41   > mouths :-) )
42   >
43   > On the other hand, if you still want me to switch this plugin to "real"
44   > pages, or if internal pages might become editable in future, then
45   > configuring lockedit/anonok so a user X can add comments to blog pages
46   > would also let X edit/delete comments on blog pages (including those
47   > written by others) in arbitrary ways, which doesn't seem good. --[[smcv]]
48
49   > I had a look at implementing comment() and fell afoul of
50   > some optimisations that assume only internal() will be used to match
51   > internal pages. So probably this isn't worth doing. --[[Joey]]
52
53 ## Done
54
55 * There is some common code cargo-culted from other plugins (notably inline and editpage) which
56   should probably be shared
57
58   > Actually, there's less of this now than there used to be - a lot of simple
59   > things that were shared have become unshareable as they became more
60   > complex. --[[smcv]]
61
62   > There's still goto. You have a branch for that. --[[Joey]] 
63
64   >> Now merged --[[smcv]]
65
66 * The default template should have a (?) icon next to unauthenticated users (with the IP address
67   as title) and an OpenID icon next to OpenIDs
68
69   > Done in my comments git branch, at least as a mockup (using the (?),
70   > {x} and {*} smileys for anonymous, OpenID and login respectively).
71   > --[[smcv]]
72
73   >> I've improved this to use independent icons from the wikiicons
74   >> directory (untested!) --[[smcv]]
75
76   >>> The new code produces links like /wikiisons/openid.png, which
77   >>> fail if ikiwiki is not at the root of the web server. --[[Joey]]
78
79   >>>> Sorry, I should have spotted that (the assumption failed on my demo
80   >>>> site, but the push to that site was when I was on the way out, so I
81   >>>> didn't have time to investigate). As a note for other ikiwiki hackers,
82   >>>> I should have used
83   >>>> `<img src="<TMPL_VAR NAME=BASEURL>wikiicons/openid.png" />`. --[[smcv]]
84
85   >>> I got to wondering if the icons are needed. On my comments branch
86   >>> (not master), I've dropped the icons and info can be seen by hovering
87   >>> over the author's name. Idea being that you probably don't care how
88   >>> they authenticated unless something is weird, and in that case you
89   >>> can hover to check. Does that make sense, should I merge it?
90   >>> --[[Joey]]
91
92   >>>> Yeah, go ahead. I preferred my layout with the author before the
93   >>>> comment - perhaps that's Livejournal's influence :-) - but I can always
94   >>>> edit the templates for my own site. As long as the default is something
95   >>>> reasonable and both layouts are possible, I don't really mind.
96   >>>> Minimizing the number of "resource" files in the basewiki also seems
97   >>>> a good goal. --[[smcv]]
98
99 * Previews always say "unknown IP address"
100
101   > Fixed in my comments branch by commits bc66a00b and 95b3bbbf --[[smcv]]
102
103 * The Comments link in the "toolbar" is to `index.html#comments`, not the
104   desired `./#comments`
105
106   > Fixed in my comments branch by commit 0844bd0b; commits 5b1cf21a
107   > and c42f174e fix another `beautify_urlpath` bug and add a regression test
108   > --[[smcv]]
109
110
111 * Now that inline has some comments-specific functionality anyway, it would
112   be good to output `<link rel="comments">` in Atom and the equivalent in RSS.
113
114   > Fixed in my comments branch by d0d598e4, 3feebe31, 9e5f504e --[[smcv]]
115
116
117 * Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
118
119   > Done in my comments git branch --[[smcv]]
120
121   > Not seeing it there, which branch? --[[Joey]]
122
123   >> Bah, git push --all is not the default... 'comments' branch now (I've also rebased it).
124   >> Sorry, I'm on mobile Internet at the moment... --[[smcv]]
125
126   >>> merged by [[Joey]] in commit 0f03af38 --[[smcv]]
127
128 * Should the comments be visually set off more from the page above?
129   Rather than just a horizontal rule, I'm thinking put the comments
130   in a box like is used for inlined pages.
131
132   > I did put them in a box in the CSS... I agree the default template
133   > could do with visual improvement though. --[[smcv]]
134
135   >> I'll consider this solved by [[Joey]]'s changes. --[[smcv]]
136
137 * One can use inline to set up a feed of all comments posted to any page.
138   Using template=comment they are displayed right. Only problem
139   is there is no indication in that template of what page each comment in the
140   feed is a comment on. So, if a comment is inlined into a different page,
141   I think it should show a link back to the page commented on.
142   (BTW, the rss feed in this situation seems ok; there the link element
143   points back to the parent page.
144
145   > done --[[Joey]]
146
147 * One of Joey's commit messages says "Not ideal, it would be nicer to jump to
148   the actual comment posted, but no anchor is available". In fact there is
149   an anchor - the `\[[_comment]]` preprocessing wraps the comment in a `<div>`
150   with id="comment_123" or something. I'll fix this, unless Joey gets there
151   first. --[[smcv]]
152
153   > done --[[Joey]]
154
155 * If a spammer posts a comment, it is either impossible or hard to clean
156   up via the web. Would be nice to have some kind of link on the comment
157   that allows trusted users to remove it (using the remove plugin of
158   course).
159
160   > Won't the remove plugin refuse to remove internal pages? This would be
161   > a good feature to have, though. --[[smcv]]
162
163   > Here, FWIW, is the first ikiwiki comment spam I've seen:
164   > <http://waldeneffect.org/blog/Snake_bite_information/#blog/Snake_bite_information/comment_1>
165   > So that took about 10 days...
166   > --[[Joey]] 
167
168   >> Implemented in my 'comments' branch, please review. It turns out
169   >> [[plugins/remove]] is happy to remove internal pages, so it was quite
170   >> easy to do. --[[smcv]]
171
172   >>> done --[[Joey]]