Reworded template, which also called the commit message a "comment".
decode_cgi_utf8($q);
- my @fields=qw(do rcsinfo subpage from page type editcontent editmessage);
+ my @fields=qw(do rcsinfo subpage from page type editcontent
+ editmessage subscribe);
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder};
error($@) if $@;
noimageinline => 1,
linktext => "FormattingHelp"));
+ my $cansubscribe=IkiWiki::Plugin::notifyemail->can("subscribe")
+ && IkiWiki::Plugin::comments->can("import")
+ && defined $session->param('name');
+ if ($cansubscribe) {
+ $form->field(name => "subscribe", type => "checkbox",
+ options => [gettext("email comments to me")]);
+ }
+ else {
+ $form->field(name => "subscribe", type => 'hidden');
+ }
+
my $previewing=0;
if ($form->submitted eq "Cancel") {
if ($form->field("do") eq "create" && defined $from) {
# caches and get the most recent version of the page.
redirect($q, $baseurl."?updated");
}
+
+ if ($cansubscribe && length $form->field("subscribe")) {
+ my $subspec="comment($page)";
+ IkiWiki::Plugin::notifyemail::subscribe(
+ $session->param('name'), $subspec);
+ }
}
exit;
* meta: Export author information in html <meta> tag. Closes: #664779
Thanks, Martin Michlmayr
* notifyemail: New plugin, sends email notifications about new and
- changed pages.
+ changed pages, and allows subscribing to comments.
* Added a "changes" hook. Renamed the "change" hook to "rendered", but
the old hook name is called for now for back-compat.
* meta: Support keywords header. Closes: #664780
the page, and a link to the page on the web.
To make it easy to subscribe to comment threads when posting a comment,
-there is a check box that can be used to subscribe, without needing to
-manually edit the [[ikiwiki/PageSpec]].
+or a page, there is a check box that can be used to subscribe, without
+needing to manually edit the [[ikiwiki/PageSpec]].
<TMPL_VAR FIELD-EDITCONTENT><br />
</div>
<TMPL_IF NAME="CAN_COMMIT">
-<label for="editmessage" class="block">Optional comment about this change:</label>
+<label for="editmessage" class="block">Optional description of this change:</label>
<TMPL_VAR FIELD-EDITMESSAGE><br />
</TMPL_IF>
<TMPL_VAR FORM-SUBMIT>
<TMPL_VAR HELPONFORMATTINGLINK>
<TMPL_IF NAME="FIELD-ATTACHMENT">
<a class="toggle" href="#attachments">Attachments</a>
+</TMPL_IF>
+<TMPL_VAR FIELD-SUBSCRIBE>
+<TMPL_IF NAME="FIELD-ATTACHMENT">
<div class="<TMPL_VAR ATTACHMENTS-CLASS>" id="attachments">
<div id="fileupload">
<script>