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.
master
Simon McVittie 2008-12-11 00:22:34 +00:00
parent edb69335f2
commit 44a7d77a30
2 changed files with 9 additions and 9 deletions

View File

@ -242,10 +242,10 @@ sub sessioncgi ($$) { #{{{
my @buttons = (POST_COMMENT, PREVIEW, CANCEL); my @buttons = (POST_COMMENT, PREVIEW, CANCEL);
my $form = CGI::FormBuilder->new( my $form = CGI::FormBuilder->new(
fields => [qw{do sid page subject body type}], fields => [qw{do sid page subject editcontent type}],
charset => 'utf-8', charset => 'utf-8',
method => 'POST', method => 'POST',
required => [qw{body}], required => [qw{editcontent}],
javascript => 0, javascript => 0,
params => $cgi, params => $cgi,
action => $config{cgiurl}, action => $config{cgiurl},
@ -280,7 +280,7 @@ sub sessioncgi ($$) { #{{{
force => 1); force => 1);
$form->field(name => 'page', type => 'hidden'); $form->field(name => 'page', type => 'hidden');
$form->field(name => 'subject', type => 'text', size => 72); $form->field(name => 'subject', type => 'text', size => 72);
$form->field(name => 'body', type => 'textarea', rows => 10); $form->field(name => 'editcontent', type => 'textarea', rows => 10);
$form->field(name => "type", value => $type, force => 1, $form->field(name => "type", value => $type, force => 1,
type => 'select', options => \@page_types); type => 'select', options => \@page_types);
@ -334,9 +334,9 @@ sub sessioncgi ($$) { #{{{
my ($authorurl, $author) = linkuser(getcgiuser($session)); my ($authorurl, $author) = linkuser(getcgiuser($session));
my $body = $form->field('body') || ''; my $editcontent = $form->field('editcontent') || '';
$body =~ s/\r\n/\n/g; $editcontent =~ s/\r\n/\n/g;
$body =~ s/\r/\n/g; $editcontent =~ s/\r/\n/g;
# FIXME: check that the wiki is locked right now, because # FIXME: check that the wiki is locked right now, because
# if it's not, there are mad race conditions! # if it's not, there are mad race conditions!
@ -352,7 +352,7 @@ sub sessioncgi ($$) { #{{{
my $anchor = "${comments_pagename}${i}"; my $anchor = "${comments_pagename}${i}";
$body =~ s/"/\\"/g; $editcontent =~ s/"/\\"/g;
my $content = "[[!comment format=$type\n"; my $content = "[[!comment format=$type\n";
# FIXME: handling of double quotes probably wrong? # FIXME: handling of double quotes probably wrong?
@ -374,7 +374,7 @@ sub sessioncgi ($$) { #{{{
$content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n"; $content .= " date=\"" . IkiWiki::formattime(time, '%X %x') . "\"\n";
$content .= " content=\"\"\"\n$body\n\"\"\"]]\n"; $content .= " content=\"\"\"\n$editcontent\n\"\"\"]]\n";
# This is essentially a simplified version of editpage: # This is essentially a simplified version of editpage:
# - the user does not control the page that's created, only the parent # - the user does not control the page that's created, only the parent

View File

@ -5,7 +5,7 @@
<TMPL_VAR FIELD-SID> <TMPL_VAR FIELD-SID>
<TMPL_VAR FIELD-PAGE> <TMPL_VAR FIELD-PAGE>
Subject: <TMPL_VAR FIELD-SUBJECT><br /> Subject: <TMPL_VAR FIELD-SUBJECT><br />
<TMPL_VAR FIELD-BODY><br /> <TMPL_VAR FIELD-EDITCONTENT><br />
Page type: <TMPL_VAR FIELD-TYPE><br /> Page type: <TMPL_VAR FIELD-TYPE><br />
<TMPL_VAR FORM-SUBMIT><br /> <TMPL_VAR FORM-SUBMIT><br />
<TMPL_VAR HELPONFORMATTINGLINK><br /> <TMPL_VAR HELPONFORMATTINGLINK><br />