From f35d35abe36166893f68061a1fcb2a26bc056fbc Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Sat, 30 Jan 2010 18:22:32 +0100 Subject: Automatically create tag pages, if "tag_autocreate=1" is set in the configuration. The pages will be created in tagbase, if and only if they do not exist in the srcdir yet. Tag pages will be create from "autotag.tmpl". At this stage a second refresh is needed for the tag pages to be rendered. Add autotag.tmpl template. --- templates/autotag.tmpl | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 templates/autotag.tmpl (limited to 'templates') diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl new file mode 100644 index 000000000..754e0b35b --- /dev/null +++ b/templates/autotag.tmpl @@ -0,0 +1,3 @@ +## Pagest tagged ## + +[[!inline pages="tagged()" actions="no" archive="yes"]] -- cgit v1.2.3 From 9330b91703ba245ceb9c36e0682b8cfc0d225eaa Mon Sep 17 00:00:00 2001 From: David Riebenbauer Date: Tue, 2 Feb 2010 16:29:27 +0100 Subject: fix typo in autotag.tmpl --- templates/autotag.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl index 754e0b35b..a8824171b 100644 --- a/templates/autotag.tmpl +++ b/templates/autotag.tmpl @@ -1,3 +1,3 @@ -## Pagest tagged ## +## Pages tagged ## [[!inline pages="tagged()" actions="no" archive="yes"]] -- cgit v1.2.3 From 21997387d40326e623cddb10a93dcb208025b77a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Feb 2010 19:23:09 -0500 Subject: optimise whitespace in feed templates --- templates/atomitem.tmpl | 80 ++++++++++++++++++++++++------------------------- templates/atompage.tmpl | 34 ++++++++++----------- templates/rssitem.tmpl | 34 ++++++++++----------- 3 files changed, 74 insertions(+), 74 deletions(-) (limited to 'templates') diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl index 768695a2c..87cbee9e0 100644 --- a/templates/atomitem.tmpl +++ b/templates/atomitem.tmpl @@ -1,48 +1,48 @@ <TMPL_VAR TITLE> - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + " type="text/html" /> - - + + " type="application/atom+xml" /> - + diff --git a/templates/atompage.tmpl b/templates/atompage.tmpl index dcb89ab5c..fc0088ae8 100644 --- a/templates/atompage.tmpl +++ b/templates/atompage.tmpl @@ -6,31 +6,31 @@ - + - + - - - - - - - - + + + + - - - - - + + + + + + + + + - + - + ikiwiki diff --git a/templates/rssitem.tmpl b/templates/rssitem.tmpl index a61b92b61..069ae1997 100644 --- a/templates/rssitem.tmpl +++ b/templates/rssitem.tmpl @@ -1,29 +1,29 @@ - + <TMPL_VAR AUTHOR ESCAPE=HTML>: <TMPL_VAR TITLE> - + <TMPL_VAR TITLE> - - - - - - + + + + + + - - + + - - + + - + - + - - + + - + -- cgit v1.2.3 From b72757b6aecfd2a5d8d3789bc0cdb6fb5783f8fb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 11 Mar 2010 18:15:44 +0000 Subject: Add missing to change.tmpl COMMITDATE, fixing well-formedness This only affects people who don't use either htmltidy or htmlbalance. Bug: http://ikiwiki.info/bugs/templateForRecentChangesMissingCloseSpan/ --- templates/change.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/change.tmpl b/templates/change.tmpl index 0e61a80f4..c9f6ce42b 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -27,7 +27,7 @@
Commit type:

Date:
- +
-- cgit v1.2.3 From 4dcea6207d03fcdc25bc1c172d69c30673b7254a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 31 Mar 2010 17:51:46 -0400 Subject: page.tmpl: Add Cache-Control must-revalidate to ensure that users (especially of Firefox) see fresh page content. Since Firefox version 3, it's done aggressive caching of visited pages, and does not, by default, check if the cached content is still valid when reloading or revisiting a page. By default, Firefox seems to not re-contact the web server at all. Compare with eg, Epiphany and Chromium, which appear to always check, and get back a 304 when the page is unchanged. This header makes Firefox do the right thing, at least for html files. It still over-caches if css, javascript, images, etc, are changed. --- debian/changelog | 2 ++ templates/page.tmpl | 1 + 2 files changed, 3 insertions(+) (limited to 'templates') diff --git a/debian/changelog b/debian/changelog index 5ec52d3c0..bbca7cffe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low * openid: Use Openid Simple Registration or OpenID Attribute Exchange to get the user's email address and username. (Neither is yet used, but they are available in the session object now.) + * page.tmpl: Add Cache-Control must-revalidate to ensure that users + (especially of Firefox) see fresh page content. -- Joey Hess Sat, 13 Mar 2010 14:48:10 -0500 diff --git a/templates/page.tmpl b/templates/page.tmpl index 968066a19..c24f88823 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -3,6 +3,7 @@ + <TMPL_VAR TITLE> -- cgit v1.2.3 From baaa848f6c06b0b3a59677d3551e130c65e5fde7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Apr 2010 15:04:17 -0400 Subject: CSS and templates for sidebar changed to use a class, not an id. Multiple sidebars should be possible; also, I want to add a sidebar template. --- debian/changelog | 3 ++- doc/examples/blog.mdwn | 2 +- doc/examples/blog/index.mdwn | 1 - doc/examples/blog/sidebar.mdwn | 7 ------- doc/style.css | 2 +- templates/page.tmpl | 2 +- 6 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 doc/examples/blog/sidebar.mdwn (limited to 'templates') diff --git a/debian/changelog b/debian/changelog index c2b0c3c23..03361e6a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.20100410) UNRELEASED; urgency=low +ikiwiki (3.20100415) UNRELEASED; urgency=low [ Joey Hess ] * bzr: Fix bzr log parsing to work with bzr 2.0. (liw) @@ -36,6 +36,7 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low * pagestats: Use style=list to get a list of tags, scaled by use like in a tag cloud. This is useful to put in a sidebar. * Rework example blog front page. + * CSS and templates for sidebar changed to use a class, not an id. -- Joey Hess Sun, 04 Apr 2010 12:17:11 -0400 diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn index b9b57b944..33637e57d 100644 --- a/doc/examples/blog.mdwn +++ b/doc/examples/blog.mdwn @@ -14,7 +14,7 @@ Some additional configuration you might want to do: \[[!tag tags/life]] * Enable the [[sidebar|plugins/sidebar]] plugin to get a sidebar listing all - the categories you've tagged posts with. + the categories you've tagged posts with, and other navigation links. * Enable the [[pagestats|plugins/pagestats]] plugin to get a tag cloud to display on the [[index]]. diff --git a/doc/examples/blog/index.mdwn b/doc/examples/blog/index.mdwn index b273ba1a9..da95e7660 100644 --- a/doc/examples/blog/index.mdwn +++ b/doc/examples/blog/index.mdwn @@ -4,7 +4,6 @@ * [[Recent_Comments|comments]] * [[Archives]] -[[!if test="enabled(calendar)" then=""" [[!calendar pages="./posts/* and !*/Discussion"]] """]] diff --git a/doc/examples/blog/sidebar.mdwn b/doc/examples/blog/sidebar.mdwn deleted file mode 100644 index a9fac388e..000000000 --- a/doc/examples/blog/sidebar.mdwn +++ /dev/null @@ -1,7 +0,0 @@ -Example sidebar - -* [[Blog|index]] -* [[Archive|posts]] - -Categories: -[[!map pages="./tags/* and !*/Discussion"]] diff --git a/doc/style.css b/doc/style.css index 317d4c7aa..af0fc230c 100644 --- a/doc/style.css +++ b/doc/style.css @@ -228,7 +228,7 @@ div.recentchanges { .bigPC { font-size: 115%; } .biggestPC { font-size: 130%; } -#sidebar { +.sidebar { line-height: 3ex; width: 20ex; float: right; diff --git a/templates/page.tmpl b/templates/page.tmpl index c24f88823..7e850a56b 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -92,7 +92,7 @@
- - + -- cgit v1.2.3 From 91c57b03c93a0b86f09cf8b066eadd7cecb73b65 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 15:32:30 -0400 Subject: limit feeds for tag pages to including ten posts With archive=yes, feeds default to including all, but that is expensive for automatically created tag pages. --- templates/autotag.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/autotag.tmpl b/templates/autotag.tmpl index f670982b6..6bc809d22 100644 --- a/templates/autotag.tmpl +++ b/templates/autotag.tmpl @@ -1,3 +1,4 @@ [[!meta title="tag "]] -[[!inline pages="tagged()" actions="no" archive="yes"]] +[[!inline pages="tagged()" actions="no" archive="yes" +feedshow=10]] -- cgit v1.2.3 From 704263534ab645d34bc58261eb8d488413f1d80e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 19:33:24 -0400 Subject: apply simonrvn patch to quote attributes --- templates/change.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/change.tmpl b/templates/change.tmpl index c9f6ce42b..5f277a0fb 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -29,7 +29,7 @@
Date:
-
+

@@ -37,7 +37,7 @@
-
+
 
 
-- cgit v1.2.3 From 930a60ae1dfa6c376b4d4b43f6383967d37f7f17 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 19:37:27 -0400 Subject: apply simonrvn patch adding labels for radio buttons and other minor html improvement --- templates/commentmoderation.tmpl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/templates/commentmoderation.tmpl b/templates/commentmoderation.tmpl index e91d3146d..297886407 100644 --- a/templates/commentmoderation.tmpl +++ b/templates/commentmoderation.tmpl @@ -4,23 +4,26 @@ -Reject -all comments marked Defer -
+ + +
-Defer -Accept -Reject + + + + + +

-Reject -all comments marked Defer + +

-- cgit v1.2.3 From a547d2685866898665fad221939b0b820a42a088 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 20:40:31 -0400 Subject: html5 option * Ikiwiki can be configured to generate html5 instead of the default xhtml 1.0. The html5 output mode is experimental, not yet fully standards compliant, and will be subject to rapid change. --- IkiWiki.pm | 8 ++++++++ IkiWiki/Render.pm | 1 + debian/changelog | 5 ++++- doc/bugs/html5_support.mdwn | 12 +++++++----- doc/roadmap.mdwn | 1 + templates/misc.tmpl | 5 ++++- templates/page.tmpl | 5 ++++- 7 files changed, 29 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ff1a5ae6..1e11d34e2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -234,6 +234,13 @@ sub getsetup () { safe => 1, rebuild => 1, }, + html5 => { + type => "boolean", + default => 0, + description => "generate HTML5? (experimental)", + safe => 1, + rebuild => 1, + }, sslcookie => { type => "boolean", default => 0, @@ -1725,6 +1732,7 @@ sub misctemplate ($$;@) { wikiname => $config{wikiname}, pagebody => $pagebody, baseurl => baseurl(), + html5 => $config{html5}, @_, ); run_hooks(pagetemplate => sub { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7e3d78861..5923f5e74 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -138,6 +138,7 @@ sub genpage ($$) { mtime => displaytime($pagemtime{$page}), ctime => displaytime($pagectime{$page}), baseurl => baseurl($page), + html5 => $config{html5}, ); run_hooks(pagetemplate => sub { diff --git a/debian/changelog b/debian/changelog index 8bf6f89b6..fc5a6124b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low - * template: Fix typo. * TMPL_INCLUDE re-enabled for templates read from the templatedir. (But not in-wiki templates.) * Version dependency on liburi-perl to >= 1.36; previous versions did not support building urls from utf-8 strings. Closes: #579713 + * Ikiwiki can be configured to generate html5 instead of the default xhtml + 1.0. The html5 output mode is experimental, not yet fully standards + compliant, and will be subject to rapid change. * htmlscrubber: Allow html5 semantic tags: section, nav, article, aside hgroup, header, footer, figure, figcaption, time, mark * htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, @@ -16,6 +18,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low and form. (Also the form* override attributes for input and buttons.) * htmlscrubber: Allow additional misc html5 attributes: reversed, spellcheck, and hidden. + * template: Fix typo. -- Joey Hess Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 2d27ac803..bf782a3bf 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -20,13 +20,14 @@ HTML5](http://www.w3.org/TR/html5-diff/). > What has been done so far, can be extended. Basically works > in browsers, if you don't care about standards. A good prerequisite > for anything else, anyway. -> 2. Switch to html5 in eg, ikiwiki 4; users have to deal with +> 2. Have both a html5 and a xhtml mode, allow user to select. +> 3. Switch to html5 in eg, ikiwiki 4; users have to deal with > any custom markup on their pages/templates that breaks then. -> 3. Have both a html5 and a xhtml mode, allow user to select. -> -> The third option seems fairly tractable from what I see here and in +> +> The second option seems fairly tractable from what I see here and in > your branch. You made only relatively minor changes to 10 templates. -> It would probably not be too dreadful to put them in ifdefs. +> It would probably not be too dreadful to put them in ifdefs. I've made a +> small start at doing that. > > Some of your changes are obvious, like using the new `time` and > and `article` elements. Others less so, and I'm particularly @@ -70,6 +71,7 @@ HTML5](http://www.w3.org/TR/html5-diff/). > [[this_todo|Add_label_to_search_form_input_field]] > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) +> > --[[Joey]] # htmlscrubber.pm needs to not scrub new HTML5 elements diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index c126fd585..4b5f01c45 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -80,6 +80,7 @@ Probably incomplete list: * YADA format setup files per default? * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. +* html5 on by default (some day..) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that diff --git a/templates/misc.tmpl b/templates/misc.tmpl index 535a6f06b..0b7fefa08 100644 --- a/templates/misc.tmpl +++ b/templates/misc.tmpl @@ -1,6 +1,9 @@ - + + + diff --git a/templates/page.tmpl b/templates/page.tmpl index 7e850a56b..661d4a515 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -1,6 +1,9 @@ - + + + -- cgit v1.2.3 From 0dc6235659b4638f148af2d570d470e47ce9eb76 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 21:14:05 -0400 Subject: use styled divs instead of center tags More could be done to modernize this html, but I don't want to diverge too far from the one in xapian. --- templates/searchquery.tmpl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/searchquery.tmpl b/templates/searchquery.tmpl index 782b12cab..5b9fbbf7f 100644 --- a/templates/searchquery.tmpl +++ b/templates/searchquery.tmpl @@ -33,7 +33,7 @@ $def{NEXT,$if{$ne{$last,$msize},}}

-
+
$env{HELPLINK} @@ -54,7 +54,7 @@ $if{$not{$msizeexact}, $nice{$add{$topdoc,1}}$if{$ne{$add{$topdoc,1},$last},-$nice{$last}} of exactly $nice{$msize} matches} }
-
+
$list{$map{$queryterms,$list{$html{$uniq{$unstem{$_}}},,/,}: $nice{$freq{$_}}},Term frequencies: ,$. ,}
Search took $time seconds @@ -77,8 +77,9 @@ $percentage% relevant$. matching: $list{$map{$terms,$html{$prettyterm{$_}}},$. , and }${for lynx:}

}

-
+
+
${suppress next, prev, and page links if there's only one page} $if{$ne{$lastpage,1}, $set{a,$if{$opt{pagelink_height}, HEIGHT=$opt{pagelink_height}}$if{$opt{pagelink_width}, WIDTH=$opt{pagelink_width}}} @@ -97,7 +98,7 @@ $if{$ne{$opt{y},$lastpage},...} $NEXT } }} -

+

$if{$dbname,} $if{$ne{$topdoc,0},} $if{$ne{$hitsperpage,10},} -- cgit v1.2.3 From b21df5029b94c5680d8a3e5f0c1ed40a660a1594 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 13:49:56 -0400 Subject: Add placeholder text in search form (in html5 mode only). --- IkiWiki/Plugin/google.pm | 1 + IkiWiki/Plugin/search.pm | 1 + debian/changelog | 1 + doc/bugs/html5_support.mdwn | 3 --- doc/todo/Add_label_to_search_form_input_field.mdwn | 2 ++ templates/googleform.tmpl | 3 ++- templates/searchform.tmpl | 3 ++- 7 files changed, 9 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 85467fa0b..68cde261c 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -42,6 +42,7 @@ sub pagetemplate (@) { if (! defined $form) { my $searchform = template("googleform.tmpl", blind_cache => 1); $searchform->param(url => $config{url}); + $searchform->param(html5 => $config{html5}); $form=$searchform->output; } diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index be39fdf1e..9e875c79c 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -58,6 +58,7 @@ sub pagetemplate (@) { if (! defined $form) { my $searchform = template("searchform.tmpl", blind_cache => 1); $searchform->param(searchaction => $config{cgiurl}); + $searchform->param(html5 => $config{html5}); $form=$searchform->output; } diff --git a/debian/changelog b/debian/changelog index 8158429a0..c9fc2e657 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low * Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. + * Add placeholder text in search form (in html5 mode only). -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 386a3094a..5530b29db 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -64,11 +64,8 @@ HTML5](http://www.w3.org/TR/html5-diff/). > > Other ideas: > -> * Add pubdate attribute to time elements as appropriate. > * Use aside for the sidebar? Or for the [[templates/note]] template? > * Use nav for the actionbar -> * Use placeholder in the search box. Allows closing -> [[this_todo|Add_label_to_search_form_input_field]] > * Use details tag instead of the javascript in the toggle plugin. > (Need to wait on browser support probably.) > diff --git a/doc/todo/Add_label_to_search_form_input_field.mdwn b/doc/todo/Add_label_to_search_form_input_field.mdwn index 281ab48e2..514108fba 100644 --- a/doc/todo/Add_label_to_search_form_input_field.mdwn +++ b/doc/todo/Add_label_to_search_form_input_field.mdwn @@ -51,4 +51,6 @@ The patch below adds a label for the field to improve usability: > element. already works in eg, chromium. However, ikiwiki does not use > html5 yet. --[[Joey]] +>> [[Done]], placeholder added, in html5 mode only. + [[!tag wishlist bugs/html5_support]] diff --git a/templates/googleform.tmpl b/templates/googleform.tmpl index bcf1004a4..f39b46540 100644 --- a/templates/googleform.tmpl +++ b/templates/googleform.tmpl @@ -1,6 +1,7 @@
- + placeholder="search" />
diff --git a/templates/searchform.tmpl b/templates/searchform.tmpl index afae2ebf5..cb65d124c 100644 --- a/templates/searchform.tmpl +++ b/templates/searchform.tmpl @@ -1,5 +1,6 @@
- +placeholder="search" />
-- cgit v1.2.3 From d69f6057d1e1787fa3c19cc13c40eb3e9b822283 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 15:09:33 -0400 Subject: use html5 semantic markup in page.tmpl This is a first pass, it avoids needing to change style.css except where it refers to tag types. This goes a bit off the rails at the pageheader with its nested header. Semantically, there should be an article around the whole page header, content, and footer. Just as there will be an article around a whole comment or inlined page header, content, and footer. But that will mean changing the css that currently refers to pageheader to refer to the enclosing article instead. --- debian/changelog | 3 +++ doc/style.css | 5 +---- templates/page.tmpl | 49 +++++++++++++++++++++++++------------------------ 3 files changed, 29 insertions(+), 28 deletions(-) (limited to 'templates') diff --git a/debian/changelog b/debian/changelog index c9fc2e657..789fda1ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low * Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. * Add placeholder text in search form (in html5 mode only). + * In html5 mode, use all the nice new semantic tags. Care was taken + to not change the id/class named used in the CSS, so only CSS + that refers to tag types needed to be changed. -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/style.css b/doc/style.css index 7ffcf9fe2..69c7f80d8 100644 --- a/doc/style.css +++ b/doc/style.css @@ -60,15 +60,12 @@ div.inlinecontent { clear: both; } -.tags { -} - #pageinfo { margin: 1em 0; border-top: 1px solid #000; } -div.tags { +.tags { margin-top: 1em; } diff --git a/templates/page.tmpl b/templates/page.tmpl index 661d4a515..0176b0116 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -5,7 +5,7 @@
- + <TMPL_VAR TITLE> @@ -26,8 +26,8 @@ - - -
+
-
-
+
-
+ +
+
- + -- cgit v1.2.3 From 0aad1794ad27da6ab41001e335eba952c2e0ac88 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 15:41:12 -0400 Subject: improve semantic markup Now the toplevel layout is:
content
comments
And I managed to preserve all CSS ids and names in their prior structure, so CSS should not need changed. --- templates/page.tmpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index 0176b0116..195ce7886 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -26,7 +26,9 @@ - + -- cgit v1.2.3 From 154732dc4235b7b31191975da50d780a2765fa02 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 16:12:08 -0400 Subject: adapt comment.tmpl to html5 Note that I put comment-header in a
despite it being below the comment. Using a
would be confusing given the class name. Also, the content is semantically closer to a header than a footer. --- IkiWiki/Plugin/comments.pm | 1 + IkiWiki/Plugin/inline.pm | 1 + doc/style.css | 2 +- templates/comment.tmpl | 29 ++++++++++++++--------------- 4 files changed, 17 insertions(+), 16 deletions(-) (limited to 'templates') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 02f1d9301..89560c88b 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -673,6 +673,7 @@ sub previewcomment ($$$) { my $template = template("comment.tmpl"); $template->param(content => $preview); $template->param(ctime => displaytime($time, undef, 1)); + $template->param(html5 => $config{html5}); IkiWiki::run_hooks(pagetemplate => sub { shift->(page => $location, diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 2df59f414..933e30646 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -362,6 +362,7 @@ sub preprocess_inline (@) { $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat})); $template->param(first => 1) if $page eq $list[0]; $template->param(last => 1) if $page eq $list[$#list]; + $template->param(html5 => $config{html5}); if ($actions) { my $file = $pagesources{$page}; diff --git a/doc/style.css b/doc/style.css index 69c7f80d8..c857157b6 100644 --- a/doc/style.css +++ b/doc/style.css @@ -49,7 +49,7 @@ border-bottom: 1px solid #000; } -div.inlinecontent { +.inlinecontent { margin-top: .4em; } diff --git a/templates/comment.tmpl b/templates/comment.tmpl index fb76ea004..39cba0ff9 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,20 +1,20 @@ -
+
+
-
+
-
+
-
+
-
+
-
+
Comment by - @@ -29,10 +29,10 @@ Comment by - + - + @@ -41,19 +41,18 @@ Comment by - - + — -
+
- -
+
-- cgit v1.2.3 From 677d2af18aaafdfa1532e9eaff3c39107ec169f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 16:36:10 -0400 Subject: adapt inlinepage.tmpl to html5 Needed to force tags to display inline, since
+ -
+
-
+
- -- cgit v1.2.3 From 43eef80b46e157ec32037d198f7341adef338c50 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 2 May 2010 16:58:29 -0400 Subject: bugfix --- templates/inlinepage.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/inlinepage.tmpl b/templates/inlinepage.tmpl index b32a7e497..1e0a1674e 100644 --- a/templates/inlinepage.tmpl +++ b/templates/inlinepage.tmpl @@ -16,14 +16,14 @@ -
+ -
+
-
+
Posted -- cgit v1.2.3 From 2f22ee85e547dfe408fc0ec520aed6a6e137e136 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 3 May 2010 12:15:40 -0400 Subject: Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary links to the action bar without modifying the template further. (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) --- IkiWiki/Plugin/skeleton.pm.example | 9 +++++++++ IkiWiki/Render.pm | 9 ++++++++- debian/changelog | 4 ++++ doc/plugins/write.mdwn | 9 +++++++++ templates/page.tmpl | 9 +++++++-- 5 files changed, 37 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index ddf2996d6..a404e24af 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -24,6 +24,7 @@ sub import { hook(type => "format", id => "skeleton", call => \&format); hook(type => "pagetemplate", id => "skeleton", call => \&pagetemplate); hook(type => "templatefile", id => "skeleton", call => \&templatefile); + hook(type => "pageactions", id => "skeleton", call => \&pageactions); hook(type => "delete", id => "skeleton", call => \&delete); hook(type => "change", id => "skeleton", call => \&change); hook(type => "cgi", id => "skeleton", call => \&cgi); @@ -146,6 +147,14 @@ sub templatefile (@) { debug("skeleton plugin running as a templatefile hook"); } +sub pageactions (@) { + my %params=@_; + my $page=$params{page}; + + debug("skeleton plugin running as a pageactions hook"); + return (); +} + sub delete (@) { my @files=@_; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index cf6943e7d..a824ba539 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -112,7 +112,14 @@ sub genpage ($$) { } } - if ($actions) { + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => $page); + }); + $template->param(actions => \@actions); + + if ($actions || @actions) { $template->param(have_actions => 1); } diff --git a/debian/changelog b/debian/changelog index 789fda1ce..e03375bd3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,10 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low * In html5 mode, use all the nice new semantic tags. Care was taken to not change the id/class named used in the CSS, so only CSS that refers to tag types needed to be changed. + * Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary + links to the action bar without modifying the template further. + (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but + are kept separate for now to avoid breaking modified templates.) -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 5e7042c3b..3b1d770eb 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -319,6 +319,15 @@ should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default ("page.tmpl"). +### pageactions + + hook(type => "pageactions", id => "foo", call => \&pageactions); + +This hook allows plugins to add arbitrary actions to the action bar on a +page (next to Edit, RecentChanges, etc). The hook is passed a "page" +parameter, and can return a list of html fragments to add to the action +bar. + ### sanitize hook(type => "sanitize", id => "foo", call => \&sanitize); diff --git a/templates/page.tmpl b/templates/page.tmpl index 195ce7886..8a9911fae 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -66,11 +66,16 @@
  • Preferences
  • + + +
  • +
    +
    -

  • +
  • -

  • +
  • -- cgit v1.2.3 From 2a2976f7ff281687b5e69a3963fc9c9fe03ef859 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:18:50 -0400 Subject: add the setting as in misc.tmpl; only ever do it if not ispage Also, add FOOTER, to allow disabling the footer. --- templates/misc.tmpl | 43 ------------------------------------------- templates/page.tmpl | 11 +++++++++++ 2 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 templates/misc.tmpl (limited to 'templates') diff --git a/templates/misc.tmpl b/templates/misc.tmpl deleted file mode 100644 index 5654cab61..000000000 --- a/templates/misc.tmpl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - -<TMPL_VAR TITLE> - - - - - - - - -
    - -
    - -
    - -
    - - - diff --git a/templates/page.tmpl b/templates/page.tmpl index 8a9911fae..b6c751a3a 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -5,6 +5,15 @@ + + + + + + + + + <TMPL_VAR TITLE> @@ -124,6 +133,7 @@
    +
    +
    -- cgit v1.2.3 From 58a07f9e5436ec815c0cb5736a9680096c977eed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:27:09 -0400 Subject: on second thought, remove FOOTER variable We always want a footer, just not a pagefooter when doing misctemplate. --- templates/page.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index b6c751a3a..f5257058c 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -133,8 +133,8 @@ -
    +
    -
    -- cgit v1.2.3 From 5971a731e98b9b6543d78572c181ffc1bb7e1dd1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:42:18 -0400 Subject: allow search form visibility to be controlled on the template hide extrafooter from misctemplate display per default --- IkiWiki.pm | 1 - templates/page.tmpl | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/IkiWiki.pm b/IkiWiki.pm index d20a3709c..54271becc 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1757,7 +1757,6 @@ sub misctemplate ($$;@) { baseurl => baseurl(), html5 => $config{html5}, have_actions => 0, # force off - searchform => 0, # ditto parentlinks => [{ # override url => $config{url}, page => $config{wikiname}, diff --git a/templates/page.tmpl b/templates/page.tmpl index f5257058c..eb76cafa6 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -52,9 +52,11 @@ + + @@ -184,8 +186,8 @@ Last edited - + -- cgit v1.2.3 From f52f395437a946478da2a126015c05e3e0afdc1f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 21:08:41 -0400 Subject: consistently drop NAME= in templates also add template syntax smoke test --- doc/ikiwiki/directive/template.mdwn | 8 ++--- doc/templates.mdwn | 4 +-- doc/templates/gitbranch.mdwn | 2 +- doc/templates/note.mdwn | 2 +- doc/templates/plugin.mdwn | 2 +- doc/templates/popup.mdwn | 2 +- templates/aggregatepost.tmpl | 18 +++++------ templates/archivepage.tmpl | 6 ++-- templates/atomitem.tmpl | 24 +++++++------- templates/atompage.tmpl | 10 +++--- templates/blogpost.tmpl | 8 ++--- templates/change.tmpl | 18 +++++------ templates/comment.tmpl | 30 ++++++++--------- templates/commentmoderation.tmpl | 4 +-- templates/editcomment.tmpl | 12 +++---- templates/editpage.tmpl | 12 +++---- templates/feedlink.tmpl | 8 ++--- templates/googleform.tmpl | 1 + templates/inlinepage.tmpl | 18 +++++------ templates/microblog.tmpl | 4 +-- templates/page.tmpl | 64 ++++++++++++++++++------------------- templates/pocreatepage.tmpl | 4 +-- templates/renamesummary.tmpl | 4 +-- templates/rssitem.tmpl | 14 ++++---- templates/titlepage.tmpl | 2 +- 25 files changed, 141 insertions(+), 140 deletions(-) (limited to 'templates') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index 052ca7873..6c50fa32e 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -53,21 +53,21 @@ few things: * To insert the raw value of a variable, with wiki markup not yet converted to html, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` Here's a sample template: Name: \[[]]
    Age:
    - + Favorite color:
    No favorite color.
    - +
    diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 2444cf14d..8f6561fcf 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -12,9 +12,9 @@ easy to learn. All you really need to know to modify templates is this: * To insert the value of a template variable, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` [[!if test="enabled(template)" then=""" ## template pages diff --git a/doc/templates/gitbranch.mdwn b/doc/templates/gitbranch.mdwn index fcce925d9..962420940 100644 --- a/doc/templates/gitbranch.mdwn +++ b/doc/templates/gitbranch.mdwn @@ -3,7 +3,7 @@ Available in a [[!taglink /git]] repository.
    Branch:
    Author:
    - + This template is used to create an infobox for a git branch. It uses these parameters: diff --git a/doc/templates/note.mdwn b/doc/templates/note.mdwn index 4cc323c0e..9ef5ad942 100644 --- a/doc/templates/note.mdwn +++ b/doc/templates/note.mdwn @@ -1,7 +1,7 @@
    - + Use this template to insert a note into a page. The note will be styled to float to the right of other text on the page. This template has one parameter: diff --git a/doc/templates/plugin.mdwn b/doc/templates/plugin.mdwn index c1d1974d6..322c49445 100644 --- a/doc/templates/plugin.mdwn +++ b/doc/templates/plugin.mdwn @@ -8,7 +8,7 @@ Currently enabled: [[!if test="enabled()" then="yes" else="no"]]< [[!if test="sourcepage(plugins/contrib/*)" then="""[[!meta title=" (third party plugin)"]]"""]] [[!tag plugins/type/core]] - + This template is used to create an infobox for an ikiwiki plugin. It uses these parameters:
      diff --git a/doc/templates/popup.mdwn b/doc/templates/popup.mdwn index b355daa2e..92455eb21 100644 --- a/doc/templates/popup.mdwn +++ b/doc/templates/popup.mdwn @@ -1,4 +1,4 @@ - + Use this template to create a popup window that is displayed when the mouse is over part of the page. This template has two parameters:
        diff --git a/templates/aggregatepost.tmpl b/templates/aggregatepost.tmpl index 8b8936733..4e89efe32 100644 --- a/templates/aggregatepost.tmpl +++ b/templates/aggregatepost.tmpl @@ -1,15 +1,15 @@ - + [[!tag ]] - -[[!meta title=""]] + +[[!meta title=""]] - -[[!meta permalink=""]] + +[[!meta permalink=""]] - -[[!meta copyright=""]] + +[[!meta copyright=""]] -[[!meta author=""]] -[[!meta authorurl=""]] +[[!meta author=""]] +[[!meta authorurl=""]] diff --git a/templates/archivepage.tmpl b/templates/archivepage.tmpl index 28800e763..93bdd9ce0 100644 --- a/templates/archivepage.tmpl +++ b/templates/archivepage.tmpl @@ -1,14 +1,14 @@

        - +

        Posted - + by - + diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl index 87cbee9e0..4ed17bc62 100644 --- a/templates/atomitem.tmpl +++ b/templates/atomitem.tmpl @@ -1,17 +1,17 @@ <TMPL_VAR TITLE> - + - + - + - + @@ -19,30 +19,30 @@ - + - - + + - + - - " type="text/html" /> + + - - " type="application/atom+xml" /> + + diff --git a/templates/atompage.tmpl b/templates/atompage.tmpl index fc0088ae8..e82b59827 100644 --- a/templates/atompage.tmpl +++ b/templates/atompage.tmpl @@ -5,15 +5,15 @@ - + - + - + @@ -21,13 +21,13 @@ - + - + diff --git a/templates/blogpost.tmpl b/templates/blogpost.tmpl index 7eeede603..5a31e3f8a 100644 --- a/templates/blogpost.tmpl +++ b/templates/blogpost.tmpl @@ -1,10 +1,10 @@

        - -RSS + +RSS - -Atom + +Atom diff --git a/templates/change.tmpl b/templates/change.tmpl index 5f277a0fb..671b9e483 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -2,15 +2,15 @@ [[!meta authorurl=""""""]] -[[!meta title="""change to on """]] +[[!meta title="""change to on """]] [[!meta permalink=""]]
        - - -
        + + +
        - +
        -
        +
         
        diff --git a/templates/comment.tmpl b/templates/comment.tmpl index 39cba0ff9..fa90e6d26 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,5 +1,5 @@ -
        -
        +
        +
        @@ -15,40 +15,40 @@
        Comment by - - + + - + - - + + - + - - + + - - + + - +
        - +
        @@ -183,7 +183,7 @@ Last edited
        - +
        -- cgit v1.2.3 From 931045301a3a5be917b775277f2a3088209a00f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 May 2010 21:45:17 -0400 Subject: Gave comment and page editing forms some CSS and accessability love. In particular, added
      + -- cgit v1.2.3 From c3e9215e1fcb604c3ee01119fdf7cf13724c3812 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 15:57:39 -0400 Subject: moved non-openid signin form into same page as openid selector; show/hide as buttons are pressed --- IkiWiki/CGI.pm | 23 ++++++++++++---- IkiWiki/Plugin/openid.pm | 6 +---- templates/openid-selector.tmpl | 31 ++++++++++++---------- .../ikiwiki/openid/openid-jquery.js | 27 ++++++++++++++----- 4 files changed, 57 insertions(+), 30 deletions(-) (limited to 'templates') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 49a505514..b98e9e0a1 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -22,7 +22,7 @@ sub printheader ($) { } } -sub showform ($$$$;@) { +sub prepform { my $form=shift; my $buttons=shift; my $session=shift; @@ -35,6 +35,16 @@ sub showform ($$$$;@) { }); } + return $form; +} + +sub showform ($$$$;@) { + my $form=prepform(@_); + shift; + my $buttons=shift; + my $session=shift; + my $cgi=shift; + printheader($session); print misctemplate($form->title, $form->render(submit => $buttons), @_); } @@ -90,9 +100,10 @@ sub needsignin ($$) { } } -sub cgi_signin ($$) { +sub cgi_signin ($$;$) { my $q=shift; my $session=shift; + my $returnhtml=shift; decode_cgi_utf8($q); eval q{use CGI::FormBuilder}; @@ -112,9 +123,6 @@ sub cgi_signin ($$) { ); my $buttons=["Login"]; - if ($q->param("do") ne "signin" && !$form->submitted) { - $form->text(gettext("You need to log in first.")); - } $form->field(name => "do", type => "hidden", value => "signin", force => 1); @@ -129,6 +137,11 @@ sub cgi_signin ($$) { $form->validate; } + if ($returnhtml) { + $form=prepform($form, $buttons, $session, $q); + return $form->render(submit => $buttons); + } + showform($form, $buttons, $session, $q); } diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index d75099ce9..e10e21f4d 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -62,17 +62,13 @@ sub openid_selector { $openid_error=shift; }); } - elsif ($q->param("do") eq "signin" && $real_cgi_signin) { - $real_cgi_signin->($q, $session); - exit; - } my $template=IkiWiki::template("openid-selector.tmpl"); $template->param( cgiurl => $config{cgiurl}, (defined $openid_error ? (openid_error => $openid_error) : ()), (defined $openid_url ? (openid_url => $openid_url) : ()), - ($real_cgi_signin ? (nonopenidurl => IkiWiki::cgiurl(do => "signin")) : ()), + ($real_cgi_signin ? (nonopenidform => $real_cgi_signin->($q, $session, 1)) : ()), ); IkiWiki::printheader($session); diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl index 7e5ae9a01..b4d0e314f 100644 --- a/templates/openid-selector.tmpl +++ b/templates/openid-selector.tmpl @@ -2,21 +2,18 @@ - + + +
      Select your account provider - -
      + +
      + +
      + +
      + +
      diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js index 59a59c084..bf14fd3d5 100644 --- a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -82,8 +82,9 @@ var openid = { input_id: null, provider_url: null, provider_id: null, + localsignin_id: null, - init: function(input_id, localloginurl) { + init: function(input_id, localsignin_id) { var openid_btns = $('#openid_btns'); @@ -105,13 +106,14 @@ var openid = { openid_btns.append(this.getBoxHTML(providers_small[id], 'small')); } } - if (localloginurl != "") { + if (localsignin_id != "") { + this.localsignin_id=localsignin_id; openid_btns.append( - '' + + 'class="localsignin openid_small_btn">' + '' + - ' Local Account' + + ' other' + '' ); } @@ -143,7 +145,20 @@ var openid = { }, /* Provider image click */ signin: function(box_id, onload) { - + + if (box_id == 'localsignin') { + this.highlight(box_id); + $('#openid_input_area').empty(); + $('#'+this.localsignin_id).show(); + this.setCookie(box_id); + return; + } + else { + if (this.localsignin_id) { + $('#'+this.localsignin_id).hide(); + } + } + var provider = providers[box_id]; if (! provider) { return; -- cgit v1.2.3 From bf19c01f29a7e740f47354318629e61ad4ee5175 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 16:16:38 -0400 Subject: use labels --- templates/openid-selector.tmpl | 5 ++++- underlays/openid-selector/ikiwiki/openid/openid-jquery.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl index b4d0e314f..c12df519f 100644 --- a/templates/openid-selector.tmpl +++ b/templates/openid-selector.tmpl @@ -12,7 +12,9 @@ $(document).ready(function() {
      - Select your account provider + @@ -20,6 +22,7 @@ $(document).ready(function() {
      +
      diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js index bf14fd3d5..4eaa613d9 100644 --- a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -246,14 +246,14 @@ var openid = { var label = provider['label']; var style = ''; - if (label) { - html = '

      ' + label + '

      '; - } if (provider['name'] == 'OpenID') { id = this.input_id; value = ''; style = 'background:#FFF url(wikiicons/openidlogin-bg.gif) no-repeat scroll 0 50%; padding-left:18px;'; } + if (label) { + html = ''; + } html += '' + ''; -- cgit v1.2.3 From 8d80ad0c173f8d0fbd888a25486ac3f919337d78 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 May 2010 16:18:55 -0400 Subject: wording --- templates/openid-selector.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl index c12df519f..0659ee583 100644 --- a/templates/openid-selector.tmpl +++ b/templates/openid-selector.tmpl @@ -36,7 +36,7 @@ $(document).ready(function() {
      -- cgit v1.2.3 From 5a4c95cc352d6895c11542245981c62a5c003370 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:04:02 -0400 Subject: enable action bar on misctemplates So RecentChanges shows on the action bar there, convert recentchanges to use new pageactions hook, with compatability code to avoid breaking old templates. --- IkiWiki.pm | 11 ++++++++++- IkiWiki/Plugin/recentchanges.pm | 18 ++++++++++++++++-- templates/page.tmpl | 3 --- 3 files changed, 26 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/IkiWiki.pm b/IkiWiki.pm index 33e4e1d1f..46c29abe3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1748,7 +1748,6 @@ sub misctemplate ($$;@) { $template->param( dynamic => 1, - have_actions => 0, # force off title => $title, wikiname => $config{wikiname}, content => $content, @@ -1756,6 +1755,16 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); + + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => ""); + }); + $template->param(actions => \@actions); + if (@actions) { + $template->param(have_actions => 1); + } return $template->output; } diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 5c7b71aaa..65044080f 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,6 +11,7 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); + hook(type => "pageactions", id => "recentchanges", call => \&pageactions); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -61,14 +62,27 @@ sub refresh ($) { } # Enable the recentchanges link on wiki pages. +sub pageactions (@) { + my %params=@_; + my $page=$params{page}; + + if (defined $config{recentchangespage} && $config{rcs} && + $page ne $config{recentchangespage}) { + return htmllink($page, $page, $config{recentchangespage}, + gettext("RecentChanges")); + } +} + +# Backwards compatability for templates still using +# RECENTCHANGESURL. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; my $page=$params{page}; if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage} && - $template->query(name => "recentchangesurl")) { + $template->query(name => "recentchangesurl") && + $page ne $config{recentchangespage}) { $template->param(recentchangesurl => urlto($config{recentchangespage}, $page)); $template->param(have_actions => 1); } diff --git a/templates/page.tmpl b/templates/page.tmpl index 3bb7197f0..049d31ad5 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,9 +61,6 @@
    • Edit
    • - -
    • RecentChanges
    • -
    • History
    • -- cgit v1.2.3 From 3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:38:08 -0400 Subject: put back recentchangesurl On second thought, misctemplate can use pagetemplate hooks to provide it, so it's better to keep back-compat, and allow full customisation of how it's displayed via the template. --- IkiWiki/Plugin/recentchanges.pm | 17 +---------------- templates/page.tmpl | 3 +++ 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'templates') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 0ee8f0e66..e546e4702 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -11,8 +11,6 @@ sub import { hook(type => "getsetup", id => "recentchanges", call => \&getsetup); hook(type => "checkconfig", id => "recentchanges", call => \&checkconfig); hook(type => "refresh", id => "recentchanges", call => \&refresh); - hook(type => "pageactions", id => "recentchanges", call => \&pageactions, - first => 1); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); # Load goto to fix up links from recentchanges @@ -62,20 +60,7 @@ sub refresh ($) { } } -# Enable the recentchanges link on wiki pages. -sub pageactions (@) { - my %params=@_; - my $page=$params{page}; - - if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage}) { - return htmllink($page, $page, $config{recentchangespage}, - linktext => gettext("RecentChanges")); - } -} - -# Backwards compatability for templates still using -# RECENTCHANGESURL. +# Enable the recentchanges link. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; diff --git a/templates/page.tmpl b/templates/page.tmpl index 049d31ad5..3bb7197f0 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -61,6 +61,9 @@
    • Edit
    • + +
    • RecentChanges
    • +
    • History
    • -- cgit v1.2.3 From 827e092b58771e5c5efdbc1cf04a62a1d039a015 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 20:40:42 -0400 Subject: show search form on dynamic pages --- templates/page.tmpl | 2 -- 1 file changed, 2 deletions(-) (limited to 'templates') diff --git a/templates/page.tmpl b/templates/page.tmpl index 3bb7197f0..f7944e40e 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,11 +48,9 @@ - - -- cgit v1.2.3 From 4c6fa6413fc26ddbb1f8dc2c73f97a105c5002f8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:42:48 -0400 Subject: avoid showing redundant search box on search results page --- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index cc26b7ac1..a9089620b 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -228,7 +228,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. - my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0"); + my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", + searching => 1); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index f7944e40e..a7d200466 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,9 +48,11 @@ + + -- cgit v1.2.3 From c8b34aa31c7d146adf4210c6171dfea2988a7688 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 May 2010 21:45:22 -0400 Subject: allow misctemplate callers to pass params to suppress actions etc Suppress disiplay of small search for on search results page, and of Prefrences link on prefs page. --- IkiWiki.pm | 3 +-- IkiWiki/CGI.pm | 4 +++- IkiWiki/Plugin/search.pm | 3 ++- templates/page.tmpl | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/IkiWiki.pm b/IkiWiki.pm index a42f56bf0..699ad13da 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1745,6 +1745,7 @@ sub misctemplate ($$;@) { run_hooks(pagetemplate => sub { shift->(page => "", destpage => "", template => $template); }); + templateactions($template, ""); $template->param( dynamic => 1, @@ -1755,8 +1756,6 @@ sub misctemplate ($$;@) { html5 => $config{html5}, @_, ); - - templateactions($template, ""); return $template->output; } diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b98e9e0a1..28020b500 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -247,7 +247,9 @@ sub cgi_prefs ($$) { $form->text(gettext("Preferences saved.")); } - showform($form, $buttons, $session, $q); + showform($form, $buttons, $session, $q, + prefsurl => "", # avoid showing the preferences link + ); } sub cgi_custom_failure ($$$) { diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index a9089620b..ff5d0ccbe 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -229,7 +229,8 @@ sub setupfiles () { # Avoid omega interpreting anything in the misctemplate # as an omegascript command. my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0", - searching => 1); + searchform => "", # avoid showing the small search form + ); eval q{use HTML::Entities}; error $@ if $@; $misctemplate=encode_entities($misctemplate, '\$'); diff --git a/templates/page.tmpl b/templates/page.tmpl index a7d200466..f7944e40e 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -48,11 +48,9 @@ - - -- cgit v1.2.3 From ffcd2da8274b44663207bb866007ee3bc8d8a15f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 May 2010 00:03:35 -0400 Subject: page.tmpl: Accidentially broke po plugin's otherlanguages list styling when modifying for html5; now fixed. --- debian/changelog | 7 +++++++ templates/page.tmpl | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/debian/changelog b/debian/changelog index 50b1fddff..918970a3c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100516) UNRELEASED; urgency=low + + * page.tmpl: Accidentially broke po plugin's otherlanguages list styling + when modifying for html5; now fixed. + + -- Joey Hess Sun, 16 May 2010 00:03:06 -0400 + ikiwiki (3.20100515) unstable; urgency=low * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise diff --git a/templates/page.tmpl b/templates/page.tmpl index f7944e40e..235b693fe 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -88,7 +88,7 @@ -