aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-07-19 18:54:32 -0400
committerJoey Hess <joey@kitenet.net>2013-07-19 18:54:32 -0400
commit7d938559cb9994211d2917491c503f729d220abb (patch)
tree1b7e26783fb78089caa943b8d577160db35a163a /IkiWiki/Plugin
parent54cfc8936525f7964e8720dab77fefd84002d57f (diff)
downloadikiwiki-7d938559cb9994211d2917491c503f729d220abb.tar
ikiwiki-7d938559cb9994211d2917491c503f729d220abb.tar.gz
calendar: Display the popup mouseover when there is only 1 page for a given day, for better UI consistency.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/calendar.pm45
1 files changed, 17 insertions, 28 deletions
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index 8ca6dd826..682bfb6fb 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -223,38 +223,27 @@ EOF
$tag='month-calendar-day-link';
}
$calendar.=qq{\t\t<td class="$tag $downame{$wday}">};
- if (scalar(@{$linkcache{$key}}) == 1) {
- # Only one posting on this page
- my $page = $linkcache{$key}[0];
+ $calendar.=qq{<div class='popup'>$day<div class='balloon'>};
+ # Several postings on this page
+ $calendar.=qq{<ul>};
+ foreach my $page (@{$linkcache{$key}}) {
+ $calendar.= qq{\n\t\t\t<li>};
+ my $title;
+ if (exists $pagestate{$page}{meta}{title}) {
+ $title = "$pagestate{$page}{meta}{title}";
+ }
+ else {
+ $title = pagetitle(IkiWiki::basename($page));
+ }
$calendar.=htmllink($params{page}, $params{destpage},
$page,
noimageinline => 1,
- linktext => $day,
- title => pagetitle(IkiWiki::basename($page)));
- }
- else {
- $calendar.=qq{<div class='popup'>$day<div class='balloon'>};
- # Several postings on this page
- $calendar.=qq{<ul>};
- foreach my $page (@{$linkcache{$key}}) {
- $calendar.= qq{\n\t\t\t<li>};
- my $title;
- if (exists $pagestate{$page}{meta}{title}) {
- $title = "$pagestate{$page}{meta}{title}";
- }
- else {
- $title = pagetitle(IkiWiki::basename($page));
- }
- $calendar.=htmllink($params{page}, $params{destpage},
- $page,
- noimageinline => 1,
- linktext => $title,
- title => $title);
- $calendar.= '</li>';
- }
- $calendar.=qq{\n\t\t</ul>};
- $calendar.=qq{</div></div>};
+ linktext => $title,
+ title => $title);
+ $calendar.= '</li>';
}
+ $calendar.=qq{\n\t\t</ul>};
+ $calendar.=qq{</div></div>};
$calendar.=qq{</td>\n};
}
else {