Merge branch 'master' into commentreorg
authorJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 16:42:38 +0000 (12:42 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 7 May 2010 16:42:38 +0000 (12:42 -0400)
Conflicts:
debian/changelog

19 files changed:
IkiWiki/CGI.pm
IkiWiki/Plugin/editdiff.pm
IkiWiki/Plugin/goto.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/remove.pm
IkiWiki/Plugin/rename.pm
IkiWiki/Plugin/search.pm
IkiWiki/Plugin/skeleton.pm.example
IkiWiki/Plugin/websetup.pm
IkiWiki/Render.pm
debian/changelog
doc/bugs/comments_not_searchable.mdwn
doc/bugs/pagetitle_function_does_not_respect_meta_titles.mdwn
doc/plugins/po/discussion.mdwn
doc/plugins/write.mdwn
doc/style.css
doc/users/KarlMW/discussion.mdwn
templates/editcomment.tmpl
templates/editpage.tmpl

index 07369ac1076e748f8cd95e1aab5c2354a33877c8..49a505514310be1be0e1b36c6064906964cb8f1a 100644 (file)
@@ -108,7 +108,7 @@ sub cgi_signin ($$) {
                action => $config{cgiurl},
                header => 0,
                template => {type => 'div'},
-               stylesheet => baseurl()."style.css",
+               stylesheet => 1,
        );
        my $buttons=["Login"];
        
@@ -187,7 +187,7 @@ sub cgi_prefs ($$) {
                params => $q,
                action => $config{cgiurl},
                template => {type => 'div'},
-               stylesheet => baseurl()."style.css",
+               stylesheet => 1,
                fieldsets => [
                        [login => gettext("Login")],
                        [preferences => gettext("Preferences")],
index d8f53a42ee6031b072dab134ec6c6740c156be3c..015ce9c148d554c29a3db6a04227a2a50c88f02e 100644 (file)
@@ -71,7 +71,7 @@ sub formbuilder_setup {
                $content=~s/\r/\n/g;
 
                my $diff = diff(srcfile($pagesources{$page}), $content);
-               $form->tmpl_param("page_preview", $diff);
+               $form->tmpl_param("page_diff", $diff);
        }
 }
 
index 03bd682b3fed5114d6d43a52d603feb6c3e11348..669211691028b90f748f0d1489e0380a7d97b253 100644 (file)
@@ -41,14 +41,15 @@ sub cgi_goto ($;$) {
 
        IkiWiki::loadindex();
 
-       # If the page is internal (like a comment), see if it has a
-       # permalink. Comments do.
-       if (IkiWiki::isinternal($page) &&
-           defined $pagestate{$page}{meta}{permalink}) {
-               IkiWiki::redirect($q, $pagestate{$page}{meta}{permalink});
+       my $link;
+       if (! IkiWiki::isinternal($page)) {
+               $link = bestlink("", $page);
+       }
+       elsif (defined $pagestate{$page}{meta}{permalink}) {
+               # Can only redirect to an internal page if it has a
+               # permalink.
+               IkiWiki::redirect($q, $pagestate{$page}{meta}{permalink});
        }
-
-       my $link = bestlink("", $page);
 
        if (! length $link) {
                IkiWiki::cgi_custom_failure(
index 933e30646d51bc22fb377df5d288245008c94b38..715a3d6523cfcee4e57c125425d19cfdab110298 100644 (file)
@@ -476,6 +476,13 @@ sub get_inline_content ($$) {
                       filter($page, $destpage,
                       readfile(srcfile($file))))));
                $nested--;
+               if (isinternal($page)) {
+                       # make inlined text of internal pages searchable
+                       run_hooks(indexhtml => sub {
+                               shift->(page => $page, destpage => $page,
+                                       content => $ret);
+                       });
+               }
        }
        
        if ($cached_destpage ne $destpage) {
index 0fc180f699ce0b2071067404bf3845b2a60b3a9e..a46294e788815f30358bdba535b107bd78c24ba4 100644 (file)
@@ -103,7 +103,7 @@ sub confirmation_form ($$) {
                javascript => 0,
                params => $q,
                action => $config{cgiurl},
-               stylesheet => IkiWiki::baseurl()."style.css",
+               stylesheet => 1,
                fields => [qw{do page}],
        );
        
index 69e615eadbda5d29834c9a37e9acf3f7127d8688..537e913178f42cb93270a60bd6b2560cc6dda33a 100644 (file)
@@ -126,7 +126,7 @@ sub rename_form ($$$) {
                javascript => 0,
                params => $q,
                action => $config{cgiurl},
-               stylesheet => IkiWiki::baseurl()."style.css",
+               stylesheet => 1,
                fields => [qw{do page new_name attachment}],
        );
        
index 9e875c79cc6008e4a5bca4d294a659e2fac21acd..cc26b7ac18df88d8c336fbe4b1b3f709d3fe696f 100644 (file)
@@ -10,7 +10,7 @@ sub import {
        hook(type => "getsetup", id => "search", call => \&getsetup);
        hook(type => "checkconfig", id => "search", call => \&checkconfig);
        hook(type => "pagetemplate", id => "search", call => \&pagetemplate);
-       hook(type => "postscan", id => "search", call => \&index);
+       hook(type => "indexhtml", id => "search", call => \&indexhtml);
        hook(type => "delete", id => "search", call => \&delete);
        hook(type => "cgi", id => "search", call => \&cgi);
 }
@@ -68,7 +68,7 @@ sub pagetemplate (@) {
 
 my $scrubber;
 my $stemmer;
-sub index (@) {
+sub indexhtml (@) {
        my %params=@_;
 
        setupfiles();
@@ -112,12 +112,17 @@ sub index (@) {
        }
        $sample=~s/\n/ /g;
        
+       my $url=urlto($params{destpage}, "");
+       if (defined $pagestate{$params{page}}{meta}{permalink}) {
+               $url=$pagestate{$params{page}}{meta}{permalink}
+       }
+
        # data used by omega
        # Decode html entities in it, since omega re-encodes them.
        eval q{use HTML::Entities};
        error $@ if $@;
        $doc->set_data(
-               "url=".urlto($params{page}, "")."\n".
+               "url=".$url."\n".
                "sample=".decode_entities($sample)."\n".
                "caption=".decode_entities($caption)."\n".
                "modtime=$IkiWiki::pagemtime{$params{page}}\n".
index a404e24af074ad3be5b75f7b9b2c0cf5e4bf7393..34713c73bfd8c729fd09523edbaedf0c560d0735 100644 (file)
@@ -20,7 +20,7 @@ sub import {
        hook(type => "scan", id => "skeleton", call => \&scan);
        hook(type => "htmlize", id => "skeleton", call => \&htmlize);
        hook(type => "sanitize", id => "skeleton", call => \&sanitize);
-       hook(type => "postscan", id => "skeleton", call => \&postscan);
+       hook(type => "indexhtml", id => "skeleton", call => \&indexhtml);
        hook(type => "format", id => "skeleton", call => \&format);
        hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate);
        hook(type => "templatefile", id => "skeleton", call => \&templatefile);
@@ -118,10 +118,10 @@ sub sanitize (@) {
        return $params{content};
 }
 
-sub postscan (@) {
+sub indexhtml (@) {
        my %params=@_;
        
-       debug("skeleton plugin running as postscan");
+       debug("skeleton plugin running as indexhtml");
 }
 
 sub format (@) {
index 4d2e611ebe17af3bbbaaed3b54002df89aaf811d..9cb5eb13c13740ed6e609679c49b0468458ec115 100644 (file)
@@ -293,7 +293,7 @@ sub showform ($$) {
                ],
                action => $config{cgiurl},
                template => {type => 'div'},
-               stylesheet => IkiWiki::baseurl()."style.css",
+               stylesheet => 1,
        );
        
        $form->field(name => "do", type => "hidden", value => "setup",
index e5ba0079b7b74706ebc1723a9206de3de3770ba1..c9ba95363a8a60b49b609a59a7617f79bb22c96f 100644 (file)
@@ -62,8 +62,8 @@ sub genpage ($$) {
        my $page=shift;
        my $content=shift;
        
-       run_hooks(postscan => sub {
-               shift->(page => $page, content => $content);
+       run_hooks(indexhtml => sub {
+               shift->(page => $page, destpage => $page, content => $content);
        });
 
        my $templatefile;
@@ -800,8 +800,8 @@ sub refresh () {
        render_backlinks($backlinkchanged);
        remove_unrendered();
 
-       if (@$del) {
-               run_hooks(delete => sub { shift->(@$del) });
+       if (@$del || @$internal_del) {
+               run_hooks(delete => sub { shift->(@$del, @$internal_del) });
        }
        if (%rendered) {
                run_hooks(change => sub { shift->(keys %rendered) });
index 5b51a74f9d3190f59cda369687945fb54af84fe5..7f024a84b923ef1a0ed418d2586e0e1f772971d8 100644 (file)
@@ -12,6 +12,12 @@ ikiwiki (3.20100505) UNRELEASED; urgency=low
     comments, which makes it easy to add a feed of them, or a counter
     indicating how many there are.
   * Belatedly added a `comment()` pagespec.
+  * Gave comment and page editing forms some CSS and accessability love.
+  * Renamed postscan hook to indexhtml, to reflect its changed position,
+    and typical use.
+  * inline: Call indexhtml when inlining internal pages, so their
+    text can be indexed for searching.
+  * Delete hooks are passed deleted internal pages. 
 
  -- Joey Hess <joeyh@debian.org>  Wed, 05 May 2010 18:07:29 -0400
 
index 72f7bf30f18a9da2e1b7b33efe09afbc7cbbda0d..6fda89bd2683eaa1d6d4b236e29c58c8593bc4a3 100644 (file)
@@ -15,3 +15,5 @@ However, the search postscan hook tells xapian the page url,
 and uses `urlto($page)` to do it. And that won't work for
 an internal page. Guess it could be modified to tell xapian the
 permalink. --[[Joey]] 
+
+> [[done]] --[[Joey]] 
index be14e5126eae8d2d67168741222b6c525bddd5c4..c6e3cd4fd3326c09c08e629ab795318e7cb1a67f 100644 (file)
@@ -144,7 +144,7 @@ So, looking at your meta branch: --[[Joey]]
   has no title, then A will display the link as "B". Now page B is modified
   and a title is added. Nothing updates "A".
   The added overhead of rebuilding every page that links to B when B is
-  changed (as the `postscan` hook of the po plugin does) is IMHO a killer.
+  changed (as the `indexhtml` hook of the po plugin does) is IMHO a killer.
   That could be hundreds or thousands of pages, making interactive editing
   way slow. This is probably the main reason I had not attempted this whole
   thing myself. IMHO this calls for some kind of intellegent dependency
index ab822e76cca14c6bfd066bdb386791aa16c40285..27683f1eae22ddce2fca8c01155fee976f35c273 100644 (file)
@@ -513,7 +513,7 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]]
 >>>>
 >>>>> Done. --[[intrigeri]]
 >>> 
-> * I'm very fearful of the `add_depends` in `postscan`. 
+> * I'm very fearful of the `add_depends` in `indexhtml`. 
 >   Does this make every page depend on every page that links
 >   to it? Won't this absurdly bloat the dependency pagespecs
 >   and slow everything down? And since nicepagetitle is given
index 3b1d770ebcd951004866c9cb1002088fa2eb6ab8..1930055658b93a245cecff2cf5114fe882a065d5 100644 (file)
@@ -39,7 +39,7 @@ built.
 Now that it knows what pages it needs to build, ikiwiki runs two
 compile passes. First, it runs `scan` hooks, which collect metadata about
 the pages. Then it runs a page rendering pipeline, by calling in turn these
-hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `postscan`,
+hooks: `filter`, `preprocess`, `linkify`, `htmlize`, `indexhtml`,
 `pagetemplate`, `sanitize`, `format`.
 
 After all necessary pages are built, it calls the `change` hook. Finally,
@@ -282,16 +282,16 @@ like `Makefile` that have no extension.
 If `hook` is passed an optional "longname" parameter, this value is used
 when prompting a user to choose a page type on the edit page form.
 
-### postscan
+### indexhtml
 
-       hook(type => "postscan", id => "foo", call => \&postscan);
+       hook(type => "indexhtml", id => "foo", call => \&indexhtml);
 
 This hook is called once the page has been converted to html (but before
 the generated html is put in a template). The most common use is to
 update search indexes. Added in ikiwiki 2.54.
 
-The function is passed named parameters "page" and "content". Its return
-value is ignored.
+The function is passed named parameters "page", "destpage", and "content".
+Its return value is ignored.
 
 ### pagetemplate
 
index f2f558497341574b1bd5f6676bddde8666072620..5f77037e402bf852dbdc59305e817b9ead05cb44 100644 (file)
@@ -4,6 +4,7 @@
  * local.css and use it to override or change settings in this one.
  */
 
+/* html5 compat */
 article,
 header,
 footer,
@@ -164,7 +165,6 @@ div.recentchanges {
        width: 60%;
 }
 
-/* Used for adding a blog page. */
 #blogform {
        padding: 10px 10px;
        border: 1px solid #aaa;
@@ -189,53 +189,6 @@ div.recentchanges {
        color: #C00;
 }
 
-/* Used for invalid form fields. */
-.fb_invalid {
-       color: red;
-       background: white !important;
-}
-
-/* Used for required form fields. */
-.fb_required {
-       font-weight: bold;
-}
-
-/* Orange feed button. */
-.feedbutton {
-       background: #ff6600;
-       color: white !important;
-       border-left: 1px solid #cc9966;
-       border-top: 1px solid #ccaa99;
-       border-right: 1px solid #993300;
-       border-bottom: 1px solid #331100;
-       padding: 0px 0.5em 0px 0.5em;
-       font-family: sans-serif;
-       font-weight: bold;
-       font-size: small;
-       text-decoration: none;
-       margin-top: 1em;
-}
-.feedbutton:hover {
-       color: white !important;
-       background: #ff9900;
-}
-
-/* Tag cloud. */
-.pagecloud {
-       float: right;
-       width: 30%;
-       text-align: center;
-       padding: 10px 10px;
-       border: 1px solid #aaa;
-       background: #eee;
-       color: black !important;
-}
-.smallestPC { font-size: 70%; }
-.smallPC { font-size: 85%; }
-.normalPC { font-size: 100%; }
-.bigPC { font-size: 115%; }
-.biggestPC { font-size: 130%; }
-
 .sidebar {
        width: 30ex;
        float: right;
@@ -248,32 +201,6 @@ div.recentchanges {
        color: black !important;
 }
 
-/* outlines */
-li.L1 {
-       list-style: upper-roman;
-}
-li.L2 {
-       list-style: decimal;
-}
-li.L3 {
-       list-style: lower-alpha;
-}
-li.L4 {
-       list-style: disc;
-}
-li.L5 {
-       list-style: square;
-}
-li.L6 {
-       list-style: circle;
-}
-li.L7 {
-       list-style: lower-roman;
-}
-li.L8 {
-       list-style: upper-alpha;
-}
-
 hr.poll {
        height: 10pt;
        color: white !important;
@@ -287,6 +214,27 @@ div.poll {
        border: 1px solid #aaa;
 }
 
+span.color {
+       padding: 2px;
+}
+
+.comment-header,
+.microblog-header {
+       font-style: italic;
+       margin-top: .3em;
+}
+.comment .author,
+.microblog .author {
+       font-weight: bold;
+}
+.comment-subject {
+       font-weight: bold;
+}
+.comment {
+       border: 1px solid #aaa;
+       padding: 3px;
+}
+
 div.progress {
        margin-top: 1ex;
        margin-bottom: 1ex;
@@ -303,23 +251,7 @@ div.progress-done {
        padding: 1px;
 }
 
-input#openid_url {
-       background: url(wikiicons/openidlogin-bg.gif) no-repeat;
-       background-color: #fff;
-       background-position: 0 50%;
-       color: #000;
-       padding-left: 18px;
-}
-
-input#searchbox {
-       background: url(wikiicons/search-bg.gif) no-repeat;
-       background-color: #fff;
-       background-position: 100% 50%;
-       color: #000;
-       padding-right: 16px;
-}
-
-/* Things to hide in printouts. */
+/* things to hide in printouts */
 @media print {
        .actions { display: none; }
        .tags { display: none; }
@@ -329,7 +261,7 @@ input#searchbox {
        #backlinks { display: none; }
 }
 
-/* Provided for use by template plugin for floating info boxes. */
+/* infobox template */
 .infobox {
        float: right;
        margin-left: 2ex;
@@ -341,7 +273,7 @@ input#searchbox {
        color: black !important;
 }
 
-/* Provided for use by template plugin for floating note boxes. */
+/* notebox template */
 .notebox {
        float: right;
        margin-left: 2ex;
@@ -354,7 +286,7 @@ input#searchbox {
        color: black !important;
 }
 
-/* Used by the popup template and for backlinks hiding. */
+/* popup template and backlinks hiding */
 .popup {
        border-bottom: 1px dotted #366;
        color: #366;
@@ -375,7 +307,7 @@ input#searchbox {
        color: black;
 }
 
-/* Formbuilder styling */
+/* form styling */
 fieldset {
        margin: 1ex 0;
        border: 1px solid black;
@@ -397,29 +329,44 @@ legend {
        background: #eee; 
        color: black !important;
 }
-
-span.color {
-       padding: 2px;
+label.block {    
+       display: block;   
 }
-
-.comment-header,
-.microblog-header {
-       font-style: italic;
-       margin-top: .3em;
+label.inline {    
+       display: inline;
 }
-.comment .author,
-.microblog .author {
-       font-weight: bold;
+ol.form {
+       list-style: none;
+       padding: 0;
 }
-.comment-subject {
-       font-weight: bold;
+li.form {
+       padding-bottom: 1em;
 }
-.comment {
-       border: 1px solid #aaa;
-       padding: 3px;
+input#openid_url {
+       background: url(wikiicons/openidlogin-bg.gif) no-repeat;
+       background-color: #fff;
+       background-position: 0 50%;
+       color: #000;
+       padding-left: 18px;
+}
+input#searchbox {
+       background: url(wikiicons/search-bg.gif) no-repeat;
+       background-color: #fff;
+       background-position: 100% 50%;
+       color: #000;
+       padding-right: 16px;
+}
+/* invalid form fields */
+.fb_invalid {
+       color: red;
+       background: white !important;
+}
+/* required form fields */
+.fb_required {
+       font-weight: bold;
 }
 
-/* Used by the highlight plugin. */
+/* highlight plugin */
 pre.hl { color:#000000; background-color:#ffffff; }
 .hl.num { color:#2928ff; }
 .hl.esc { color:#ff00ff; }
@@ -436,7 +383,7 @@ pre.hl { color:#000000; background-color:#ffffff; }
 .hl.kwc { color:#000000; font-weight:bold; }
 .hl.kwd { color:#010181; }
 
-/* For the calendar plugin. */
+/* calendar plugin */
 .month-calendar-day-this-day { background-color: #eee; }
 .year-calendar-this-month { background-color: #eee; }
 .month-calendar-arrow A:link,
@@ -447,3 +394,49 @@ pre.hl { color:#000000; background-color:#ffffff; }
        font-weight: normal;
        font-size: 150%;
 }
+
+/* outlines */
+li.L1 { list-style: upper-roman; }
+li.L2 { list-style: decimal; }
+li.L3 { list-style: lower-alpha; }
+li.L4 { list-style: disc; }
+li.L5 { list-style: square; }
+li.L6 { list-style: circle; }
+li.L7 { list-style: lower-roman; }
+li.L8 { list-style: upper-alpha; }
+
+/* tag cloud */
+.pagecloud {
+       float: right;
+       width: 30%;
+       text-align: center;
+       padding: 10px 10px;
+       border: 1px solid #aaa;
+       background: #eee;
+       color: black !important;
+}
+.smallestPC { font-size: 70%; }
+.smallPC { font-size: 85%; }
+.normalPC { font-size: 100%; }
+.bigPC { font-size: 115%; }
+.biggestPC { font-size: 130%; }
+
+/* orange feed button */
+.feedbutton {
+       background: #ff6600;
+       color: white !important;
+       border-left: 1px solid #cc9966;
+       border-top: 1px solid #ccaa99;
+       border-right: 1px solid #993300;
+       border-bottom: 1px solid #331100;
+       padding: 0px 0.5em 0px 0.5em;
+       font-family: sans-serif;
+       font-weight: bold;
+       font-size: small;
+       text-decoration: none;
+       margin-top: 1em;
+}
+.feedbutton:hover {
+       color: white !important;
+       background: #ff9900;
+}
index 9117abcabfce2375266bffff2e27a7490677971b..4a111a3f9c1c00fcf77e18df10d0810cd0068ee5 100644 (file)
@@ -23,3 +23,5 @@ things that need changing then I will probably need help/guidance.
 >> I suspect that asciidoc can't really be made to play nice to the extent that I would want casual users/abusers to have it as a markup option on a live wiki - it's fine for a personal site where you can look at the output before putting it online, but I think it would be a hideously gaping integrity hole for anything more than that.  However, for a personal site (as I am using it), it does seem to have its uses.
 
 >> I'll keep an eye on the format_escape plugin, and assuming it is accepted into ikiwiki, will see if I can apply it to asciidoc. --[[KarlMW]]
+
+Is there any way to enable latexmath rendering? It semes that ikiwiki strips the necessary javascript and/or style sheet information from the HTML page generated by asciidoc. --Peter
index 51ab10f2c7a0e115ff75110fc4ebc9deee882da4..f3a8e7395244e09d917d40fdc60954616bca9463 100644 (file)
@@ -4,22 +4,37 @@
 <TMPL_VAR FIELD-DO>
 <TMPL_VAR FIELD-SID>
 <TMPL_VAR FIELD-PAGE>
-<TMPL_UNLESS USERNAME>
-<TMPL_IF ALLOWAUTHOR>
-Name: <TMPL_VAR FIELD-AUTHOR> (optional, or
-<a href="<TMPL_VAR SIGNINURL>">signin</a>)<br />
-Website: <TMPL_VAR FIELD-URL> (optional)<br />
+<ol class="form">
+<TMPL_UNLESS NAME=USERNAME>
+<TMPL_IF NAME=ALLOWAUTHOR>
+<li>
+<label for="author" class="block">Name:</label>
+<TMPL_VAR NAME=FIELD-AUTHOR> (optional, or <a href="<TMPL_VAR SIGNINURL>">signin</a>)
+</li>
+<li>
+<label for="url" class="block">Website:</label>
+<TMPL_VAR NAME=FIELD-URL> (optional)
+</li>
 <TMPL_ELSE>
-(You might want to <a href="<TMPL_VAR SIGNINURL>">Signin</a> first?)<br />
+<li>
+(You might want to <a href="<TMPL_VAR SIGNINURL>">Signin</a> first?)
+</li>
 </TMPL_IF>
 </TMPL_UNLESS>
-Subject: <TMPL_VAR FIELD-SUBJECT><br />
+<li>
+<label for="subject" class="block">Subject:</label>
+<TMPL_VAR FIELD-SUBJECT><br />
+</li>
+<li>
+<label for="editcontent" class="block">Comment:</label>
 <TMPL_VAR FIELD-EDITCONTENT><br />
+</li>
+</ol>
 <TMPL_VAR FORM-SUBMIT> <TMPL_VAR FIELD-TYPE> <TMPL_VAR HELPONFORMATTINGLINK><br />
-<TMPL_VAR FORM-END>
+<TMPL_VAR NAME="FORM-END">
 <TMPL_VAR WMD_PREVIEW>
 
-<TMPL_IF PAGE_PREVIEW>
+<TMPL_IF NAME="PAGE_PREVIEW">
 <hr />
 <div class="header">
 <span>Comment preview:</span>
index 6d8a902a23c656a8d40f4d535eb27c09c486157e..118ca455046ad414f1e41366d7fbb16b33e984e4 100644 (file)
@@ -1,4 +1,3 @@
-<br />
 <TMPL_VAR JAVASCRIPT>
 <TMPL_VAR MESSAGE>
 <TMPL_VAR FORM-START>
@@ -7,30 +6,37 @@
 <TMPL_VAR FIELD-FROM>
 <TMPL_VAR FIELD-RCSINFO>
 <TMPL_VAR FIELD-NEWFILE>
-<TMPL_IF PAGE_SELECT>
-Page location: <TMPL_VAR FIELD-PAGE>
-Page type: <TMPL_VAR FIELD-TYPE>
+<ol class="form">
+<TMPL_IF NAME="PAGE_SELECT">
+<li>
+<label for="page" class="inline">Page location:</label><TMPL_VAR FIELD-PAGE>
+<label for="type" class="inline">Page type:</label><TMPL_VAR FIELD-TYPE>
+</li>
 <TMPL_ELSE>
-<br />
 <TMPL_VAR FIELD-PAGE>
 <TMPL_VAR FIELD-TYPE>
 </TMPL_IF>
+<li>
 <TMPL_VAR FIELD-EDITCONTENT><br />
-<TMPL_IF CAN_COMMIT>
-Optional comment about this change:<br />
+</li>
+<TMPL_IF NAME="CAN_COMMIT">
+<li>
+<label for="comments" class="block">Optional comment about this change:</label>
 <TMPL_VAR FIELD-COMMENTS><br />
+</li>
 </TMPL_IF>
+</ol>
 <TMPL_VAR FORM-SUBMIT>
 <TMPL_VAR HELPONFORMATTINGLINK>
-<TMPL_IF FIELD-ATTACHMENT>
+<TMPL_IF NAME="FIELD-ATTACHMENT">
 <a class="toggle" href="#attachments">Attachments</a>
 <div class="<TMPL_VAR ATTACHMENTS-CLASS>" id="attachments">
 <table>
 <tr><td colspan="5"><TMPL_VAR FIELD-ATTACHMENT><TMPL_VAR FIELD-UPLOAD></td></tr>
-<TMPL_LOOP ATTACHMENT_LIST>
+<TMPL_LOOP NAME="ATTACHMENT_LIST">
 <tr><td><TMPL_VAR FIELD-SELECT><TMPL_VAR LINK></td><td><TMPL_VAR SIZE></td><td><TMPL_VAR MTIME></td></tr>
 </TMPL_LOOP>
-<TMPL_IF ATTACHMENT_LIST>
+<TMPL_IF NAME="ATTACHMENT_LIST">
 <tr><td colspan="2"><TMPL_VAR FIELD-LINK><TMPL_VAR FIELD-RENAME><TMPL_VAR FIELD-REMOVE></td></tr>
 </TMPL_IF>
 </table>
@@ -39,7 +45,7 @@ Optional comment about this change:<br />
 <TMPL_VAR FORM-END>
 <TMPL_VAR WMD_PREVIEW>
 
-<TMPL_IF PAGE_PREVIEW>
+<TMPL_IF NAME="PAGE_PREVIEW">
 <hr />
 <div class="header">
 <span>Page preview:</span>
@@ -48,3 +54,12 @@ Optional comment about this change:<br />
 <TMPL_VAR PAGE_PREVIEW>
 </div>
 </TMPL_IF>
+<TMPL_IF NAME="PAGE_DIFF">
+<hr />
+<div class="header">
+<span>Diff:</span>
+</div>
+<div id="diff">
+<TMPL_VAR PAGE_DIFF>
+</div>
+</TMPL_IF>