Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'trunk' into stable

This is the final step of the conversion from svn to git.

Incidentally, merged all remaining unmerged changes from trunk

Conflicts:
	lib/Act/Handler/Event/Edit.pm
	lib/Act/Handler/Talk/Schedule.pm
	lib/Act/Handler/Wiki.pm
	lib/Act/I18N.pm
	lib/Act/Manual/Organizer/Configuration.pod
	lib/Act/Manual/Organizer/Schedule.pod
	lib/Act/Util.pm
	po/en.po
	po/hr.po
	po/ja.po
	t/02config.t
	t/04i18n.t
	t/05util.t
	templates/core/talk/schedule
	templates/talk/talk_list
  • Loading branch information...
commit 2319532c71fd020d943ae4396789df58c61b6219 2 parents 83f2cc7 + 756659f
@book authored
View
3  lib/Act/Dispatcher.pm
@@ -207,6 +207,9 @@ sub _set_language
# last resort, use our default language
$language ||= $Config->general_default_language;
+ # use optional variant
+ $language = $Config->language_variants->{$language} || $language;
+
# remember it for this request
$Request{language} = $language;
View
4 lib/Act/Handler/Event/Edit.pm
@@ -20,7 +20,7 @@ my $form = Act::Form->new(
url_abstract => 'url',
date => 'date',
time => 'time',
- room => sub { exists $Config->rooms->{$_[0]} or $_[0] =~ /^(?:out|venue)$/},
+ room => sub { exists $Config->rooms->{$_[0]} or $_[0] =~ /^(?:out|venue|sidetrack)$/},
}
);
@@ -127,7 +127,7 @@ sub handler {
return_url => $Request{args}{return_url},
dates => \@dates, defined $event ? ( %$event ) : ( %$fields ),
rooms => { %{ $Config->rooms },
- map { $_ => localize("room_$_") } qw(venue out),
+ map { $_ => localize("room_$_") } qw(venue out sidetrack),
},
);
$template->process('event/add');
View
8 lib/Act/Handler/Talk/Schedule.pm
@@ -31,7 +31,6 @@ sub compute_schedule {
my (%table, %index, %room, %time); # helpful structures
my ($todo, $globals) = ([],[]); # events lists
-
# sort and separate global and normal items
# compute the times to show in the chart
for ( sort {
@@ -75,7 +74,7 @@ sub compute_schedule {
my $dt = $_->datetime;
my $day = $dt->ymd;
my $row = $table{$day};
-
+
# skip to find where to put this event
$index{$day}++ while $row->[ $index{$day} ][0] < $dt;
my $i = $index{$day};
@@ -111,7 +110,7 @@ sub compute_schedule {
my $n = 1;
while($i < @$row and $row->[$i][0] < $_->{end}) {
# if a global talk starts in the middle
- if( @{ $row->[$i][2] } ) {
+ if( @{ $row->[$i][2] } && $r ne 'sidetrack' ) {
# split the talk in two
my $new = bless { %$_, height => 1 }, 'Act::TimeSlot';
$new->{datetime} = $row->[$i][2][-1]->{end}->clone;
@@ -162,7 +161,8 @@ sub compute_schedule {
$width{$r}{$day} = $max || 0;
}
$maxwidth{$day} = 0;
- $maxwidth{$day} += $width{$_}{$day} for keys %room;
+ $maxwidth{$day} += $width{$_}{$day}
+ for grep { $_ ne 'sidetrack' } keys %room;
}
# finish line
View
32 lib/Act/Handler/Wiki.pm
@@ -110,48 +110,62 @@ sub wiki_history
);
$template->process('wiki/history');
}
+
sub wiki_diff
{
my ($wiki, $template) = @_;
my $node = $Request{args}{node};
+
unless ($node && $Request{args}{r1} && $Request{args}{r2}) {
$Request{status} = NOT_FOUND;
return;
}
+
my %versions;
for my $r (qw(r1 r2)) {
my %v = $wiki->retrieve_node(name => Act::Wiki::make_node_name($node), version => $Request{args}{$r});
+
unless ($v{version} == $Request{args}{$r}) {
$Request{status} = NOT_FOUND;
return;
}
+
$v{user} = Act::User->new(user_id => $v{metadata}{user_id}[0]);
$v{last_modified} = DateTime::Format::Pg->parse_datetime($v{last_modified});
+ $v{content} .= "\n" if index($v{content}, "\n") == -1;
+
$versions{$r} = \%v;
}
+ my $diff = Text::Diff::diff(
+ \$versions{r1}{content},
+ \$versions{r2}{content},
+ {
+ FILENAME_A => "$node v$Request{args}{r1}",
+ FILENAME_B => "$node v$Request{args}{r2}",
+ FILENAME_PREFIX_A => "---",
+ FILENAME_PREFIX_B => "+++",
+ }
+ );
+
$template->variables(
node => $node,
r1 => $Request{args}{r1},
r2 => $Request{args}{r2},
versions => \%versions,
- diff => Text::Diff::diff(\$versions{r1}{content}, \$versions{r2}{content},
- {
- FILENAME_A => "$node v$Request{args}{r1}",
- FILENAME_B => "$node v$Request{args}{r2}",
- FILENAME_PREFIX_A => "---",
- FILENAME_PREFIX_B => "+++",
- }
- ),
+ diff => $diff,
);
+
$template->process('wiki/diff');
}
+
sub wiki_help
{
my ($wiki, $template) = @_;
$template->process('wiki/help');
}
+
sub wiki_tags
{
my ($wiki, $template, $tag) = @_;
@@ -190,7 +204,9 @@ sub wiki_tags
);
$template->process('wiki/tags');
}
+
1;
+
__END__
=head1 NAME
View
10 lib/Act/I18N.pm
@@ -29,11 +29,17 @@ sub failure_handler
{
my ($self, $key, @params) = @_;
- # look up in the default_language lexicon, then in the English lexicon,
+ # look up in the default_language lexicon,
+ # then in the superordinate (if variant, e.g; en_US => en)
+ # then in the English lexicon,
# avoiding infinite recursion
my $lang = $self->language_tag();
if ($lang ne 'en') {
- for my $fallback ($Config->general_default_language, 'en') {
+ my @fallbacks = ($Config->general_default_language, 'en');
+ if ($lang =~ /^((\w+)[-_].+)$/) { # $1 = en_US, $2 = en
+ unshift @fallbacks, $2;
+ }
+ for my $fallback (@fallbacks) {
if ($lang ne $fallback) {
return Act::I18N->get_handle($fallback)->maketext($key, @params);
}
View
3  lib/Act/Manual/Organizer/Configuration.pod
@@ -64,6 +64,9 @@ file F<act.ini>.
# is the schedule publically visible?
show_schedule = 1
+ # schedule date to show when none specified
+ schedule_default = 2004-06-06
+
# show accepted talks, or all
show_all = 0
View
12 lib/Act/Manual/Organizer/Schedule.pod
@@ -67,8 +67,8 @@ at the same time in the same place) in a nice way.
The HTML table uses as many styles as you have rooms, plus three. Imagine
you have three rooms, the table will use the following styles: C<header>,
-C<out>, C<venue>, C<r1>, C<r2>, C<r3> and C<r4>. (If you have five rooms, a
-style C<r5> will automatically be used, and so on.)
+C<out>, C<sidetrack>, C<venue>, C<r1>, C<r2>, C<r3> and C<r4>.
+(If you have five rooms, a style C<r5> will automatically be used, and so on.)
You can either define those styles in your stylesheet, or simply load the
style located at F</css/schedule.css> with
@@ -95,7 +95,7 @@ defined. It should gracefully show overlapping talks, so that you can detect
there is a problem.
Events are basically talks without a speaker. Only events can happen in
-rooms C<out> and C<venue>.
+rooms C<out>, C<venue> and C<sidetrack>.
Rooms C<out> and C<venue> are special in the sense that events occuring
there prevent talks from happening and actually "cut" any overlapping
@@ -104,6 +104,12 @@ the remaining time after.
Only hour-long tutorials should be cut by events.
+Room C<sidetrack> is also special. Like C<out> and C<venue>, these are
+events happening outside of the standard rooms. They denotes events
+happening elsewhere, and in parallel (for example, a trip as part of the
+"partner program"). Obviously, it shouldn't be "cut" by anything happening
+in the C<out> and C<venue> rooms.
+
There may be some cases for which Act does not display the schedule
properly (this should not happen once your schedule is finished, since
you shouldn't have any overlapping talks). Please let us know when
View
7 lib/Act/Util.pm
@@ -196,6 +196,11 @@ sub date_format
my $lang = $Request{language} || $Config->general_default_language;
my $variant = $Config->language_variants->{$lang} || $lang;
$dt->set(locale => $variant);
+
+ if ($variant =~ /^((\w+)_.*)$/) { # $1 = en_US, $2 = en
+ $variant = $2 unless exists $Act::Config::Languages{$variant};
+ }
+
return $dt->strftime($Act::Config::Languages{$variant}{"fmt_$fmt"} || $fmt);
}
@@ -237,7 +242,7 @@ sub usort(&@)
return map { $_->[1] }
sort { $collator->cmp( $a->[0], $b->[0] ) }
- map { [ $getkey->($_->{name}), $_ ] }
+ map { [ $getkey->($_), $_ ] }
@_;
};
# fallback to normalize()
View
19 po/de_AT.po
@@ -0,0 +1,19 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Mime-Version: 1.0"
+"Last-Translator: Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 <daxim@cpan.org>\n"
+"PO-Revision-Date: 2010-08-12 14:25+0200\n"
+"Project-Id-Version: \n"
+"Language-Team: German <>\n"
+"X-Generator: Lokalize 1.0\n"
+"MIME-Version: 1.0\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+msgid "Treasurer"
+msgstr "Kassier"
+
+msgid "Treasurer (payment management)"
+msgstr "Kassier (Zahlungsverwaltung)"
+
View
3  po/en.po
@@ -23,6 +23,9 @@ msgstr "Free"
msgid "room_out"
msgstr "Outside"
+msgid "room_sidetrack"
+msgstr "Meanwhile, elsewhere"
+
msgid "room_venue"
msgstr "Venue"
View
4 po/hr.po
@@ -618,8 +618,8 @@ msgstr ""
msgid "No user was found with this login or email address"
msgstr "Korisnik takvog korisničkog imena ili email-a nije pronađen."
-msgid "Specify a login, or an email address, but not both"
-msgstr "Navedite korisničko ime ili email adresu, ali ne oboje."
+msgid "Specify your login or email address"
+msgstr "Navedite korisničko ime ili email adresu."
msgid "Generate password"
msgstr "Resetirajte password"
View
4 po/ja.po
@@ -1344,7 +1344,7 @@ msgid "Promotion code"
msgstr "クーポン番号"
msgid "Confirm Attendance"
-msgstr "来場確認"
+msgstr "チェックイン"
msgid "Attendance confirmed for <user>"
msgstr "%1 の来場を確認しました"
@@ -1358,3 +1358,5 @@ msgstr "記録にないオーダーIDです。"
msgid "User is not registered."
msgstr "登録されていません。"
+msgid "Order ID"
+msgstr "オーダーID"
View
13 t/02config.t
@@ -73,7 +73,18 @@ for my $conf (sort keys %{$Config->conferences}) {
ok($Languages{$lang}, "$conf $lang is in %Languages");
}
for my $lang (sort values %{$cfg->language_variants}) {
- ok($Languages{$lang}, "$conf $lang is in %Languages");
+ if ($lang =~ /^((\w+)_.*)$/) { # $1 = en_US, $2 = en
+ my ($variant, $lang) = ($1, $2);
+ if (exists $Languages{$variant}) {
+ ok($Languages{$variant}, "$conf $variant is in %Languages");
+ }
+ else {
+ ok($Languages{$lang}, "$conf $variant => $lang is in %Languages");
+ }
+ }
+ else {
+ ok($Languages{$lang}, "$conf $lang is in %Languages");
+ }
}
# names
isa_ok($cfg->name, 'HASH', "$conf name");
View
6 t/04i18n.t
@@ -25,9 +25,14 @@ our %Lexicon = ( 'jour' => '[quant,_1,jour]',
'flux' => '[quant,_1,flux,flux]',
);
+package Act::I18N::xx_xx;
+use base 'Act::I18N';
+our %Lexicon = ( 'bar' => 'xxbar' );
+
package main;
my @tests = (
# request default id expected
+ [ 'xx_XX', 'en', 'baz', 'xxfoo' ], # fallback to xx
[ 'yy', 'xx', 'bar', 'yyfoo' ],
[ 'yy', 'xx', 'baz', 'xxfoo' ],
[ 'yy', 'xx', 'foo', 'enfoo' ],
@@ -38,6 +43,7 @@ my @tests = (
[ 'xx', 'en', 'qux', 'TRANSLATEME' ],
[ 'en', 'en', 'foo', 'enfoo' ],
[ 'en', 'en', 'qux', 'TRANSLATEME' ],
+ [ 'xx_XX', 'en', 'bar', 'xxbar' ],
);
my @tests_fr = (
[ 'jour', 0, '0 jour', 'fr - 0 is singular' ],
View
9 t/05util.t
@@ -5,7 +5,7 @@ use utf8;
use DateTime;
use Test::MockObject;
use constant NBPASS => 100;
-use Test::More tests => 78 + 5 * NBPASS;
+use Test::More tests => 79 + 5 * NBPASS;
use Act::Config;
BEGIN { use_ok('Act::Util') }
@@ -87,6 +87,9 @@ is(Act::Util::date_format($dt, 'datetime_full'), 'Thursday, 15 February 2007 13:
$variants{en} = 'en_US';
is(Act::Util::date_format($dt, 'datetime_full'), 'Thursday, February 15, 2007 01:00 PM', 'date_format en_US');
+$variants{en} = 'en_NZ'; # not in %Languages, fallback to 'en'
+is(Act::Util::date_format($dt, 'datetime_full'), 'Thursday, 15 February 2007 13:00', 'date_format en_NZ (aka en aka en_GB)');
+
# normalize
use charnames ();
@@ -108,8 +111,8 @@ while (my ($n, $dlist) = splice(@t, 0, 2)) {
is (Act::Util::normalize('йéйè'), 'йeйe', charnames::viacode(ord('й')));
# usort
-my @sorted = Act::Util::usort { $_ } qw(éb ec eà);
-is_deeply(\@sorted, [qw(eà éb ec)], 'usort');
+my @sorted = Act::Util::usort { $_->{foo} } ( { foo => 'éb' }, { foo => 'ec' }, { foo => '' } );
+is_deeply(\@sorted, [ { foo => '' }, { foo => 'éb' }, { foo => 'ec' } ], 'usort');
# ua_isa_bot
$headers{'User-Agent'} = 'Mozilla/4.76 [en] (X11; U; FreeBSD 4.4-STABLE i386)';
View
4 templates/core/talk/schedule
@@ -52,7 +52,7 @@
USE date; # default to today
day = date.format(date.now, "%F");
UNLESS table.$day.size; # if not valid default to first day
- day = table.keys.sort.0;
+ day = global.config.talks_schedule_default || table.keys.sort.0;
END;
END;
IF table.keys.size > 1;
@@ -81,7 +81,7 @@
</th>
[% FOREACH r IN room.keys.sort %]
[% IF width.$r.$d %]
- <th colspan="[% width.$r.$d %]">[% global.config.rooms.$r %]</th>
+ <th colspan="[% width.$r.$d %]">[% r == 'sidetrack' ? loc('room_sidetrack') : global.config.rooms.$r %]</th>
[% END %]
[% END %]
</tr>
View
17 templates/talk/talk_list
@@ -1,4 +1,5 @@
[% RETURN UNLESS talks.size %]
+[% INCLUDE js/mytalks.js %]
<table border="1" cellspacing="0" cellpadding="4">
<tr>
<th>{{Speaker}}</th>
@@ -19,7 +20,21 @@
<td>
[% user_info(t.user) %]
</td>
- <td>[% talk_link(t) %]
+ <td>
+ [% IF global.request.user.has_registered %]
+ <input type="checkbox"
+ name="mt-[% t.talk_id %]"
+ value="[% t.talk_id %]"
+ [% IF global.request.user.is_my_talk(t.talk_id) %]
+ title = "{{remove from personal schedule}}"
+ checked = "checked"
+ [% ELSE %]
+ title = "{{add to personal schedule}}"
+ [% END %]
+ />
+ [% END %]
+
+ [% talk_link(t) %]
[% talk_modify_link(t) %]
[% IF t.url_abstract || t.url_talk %]<br />[[% END %]
[% IF t.url_abstract %]
Please sign in to comment.
Something went wrong with that request. Please try again.