Use issue tracker for ncdu + fixed a few minor bugs
This commit is contained in:
parent
605b0643d3
commit
05c36a1aef
3 changed files with 25 additions and 10 deletions
16
Issue.pm
16
Issue.pm
|
|
@ -45,6 +45,7 @@ sub dbListing {
|
||||||
my %o = (
|
my %o = (
|
||||||
results => 100,
|
results => 100,
|
||||||
page => 1,
|
page => 1,
|
||||||
|
@_
|
||||||
);
|
);
|
||||||
$o{reverse} = 1 if !$o{sort};
|
$o{reverse} = 1 if !$o{sort};
|
||||||
|
|
||||||
|
|
@ -122,6 +123,18 @@ sub htmlListing {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub _escape_url {
|
||||||
|
my $str = shift;
|
||||||
|
my $r = '';
|
||||||
|
my $last = 0;
|
||||||
|
while($str =~ m{((?:https?|ftp)://[^ ><"\n\s]+[\d\w=/-])}g) {
|
||||||
|
$r .= sprintf '%s<a href="%s">%2$s</a>', html_escape(substr $str, $last, (pos($str)-length($1))-$last), html_escape($1);
|
||||||
|
$last = pos $str;
|
||||||
|
}
|
||||||
|
return $r.html_escape(substr $str, $last);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub htmlItem {
|
sub htmlItem {
|
||||||
my($s, $d) = @_;
|
my($s, $d) = @_;
|
||||||
my $last = $d->[$#$d];
|
my $last = $d->[$#$d];
|
||||||
|
|
@ -149,8 +162,7 @@ sub htmlItem {
|
||||||
dd sprintf '"%s" to "%s"', $d->[$num-1]{closed}?'yes':'no', $m->{closed}?'yes':'no';
|
dd sprintf '"%s" to "%s"', $d->[$num-1]{closed}?'yes':'no', $m->{closed}?'yes':'no';
|
||||||
}
|
}
|
||||||
end;
|
end;
|
||||||
# TODO: link formatting and some way to link to other issues
|
p; lit _escape_url $m->{message}; end;
|
||||||
p; lit html_escape $m->{message}; end;
|
|
||||||
end;
|
end;
|
||||||
}
|
}
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
2
dat/tuwf
2
dat/tuwf
|
|
@ -61,4 +61,6 @@ TUWF is also available on a git repository at L<http://g.blicky.net/tuwf.git/>.
|
||||||
|
|
||||||
=item * L<Yorhel.nl|http://yorhel.nl/>
|
=item * L<Yorhel.nl|http://yorhel.nl/>
|
||||||
|
|
||||||
|
=item * L<333networks|http://333networks.com/>
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
|
||||||
17
index.cgi
17
index.cgi
|
|
@ -12,6 +12,7 @@ BEGIN { ($ROOT = abs_path $0) =~ s{index\.cgi$}{}; }
|
||||||
|
|
||||||
|
|
||||||
my @changes = (
|
my @changes = (
|
||||||
|
[ '2012-03-24', '/ncdu/issue', 'Moved issue tracker from sourceforge to this site' ],
|
||||||
[ '2012-03-17', '/ncdc/issue', 'Wrote a small issue tracker for ncdc' ],
|
[ '2012-03-17', '/ncdc/issue', 'Wrote a small issue tracker for ncdc' ],
|
||||||
[ '2012-03-14', '/ncdc', 'ncdc 1.9 released.' ],
|
[ '2012-03-14', '/ncdc', 'ncdc 1.9 released.' ],
|
||||||
[ '2012-02-15', '/doc/commvis', 'Added an article on my new communication system.' ],
|
[ '2012-02-15', '/doc/commvis', 'Added an article on my new communication system.' ],
|
||||||
|
|
@ -75,10 +76,10 @@ TUWF::register(
|
||||||
qr{dump/grenamr} => sub { podpage(shift, 'dump-grenamr', 'dump', 'grenamr', 'GTK+ Mass File Renamer') },
|
qr{dump/grenamr} => sub { podpage(shift, 'dump-grenamr', 'dump', 'grenamr', 'GTK+ Mass File Renamer') },
|
||||||
qr{dump/nccolour} => sub { podpage(shift, 'dump-nccolour', 'dump', 'nccolour', 'Colours in NCurses') },
|
qr{dump/nccolour} => sub { podpage(shift, 'dump-nccolour', 'dump', 'nccolour', 'Colours in NCurses') },
|
||||||
qr{feed\.atom} => \&atom,
|
qr{feed\.atom} => \&atom,
|
||||||
qr{(ncdc)/issue} => \&issue_list,
|
qr{(ncdc|ncdu)/issue} => \&issue_list,
|
||||||
qr{(ncdc)/issue/post} => \&issue_post,
|
qr{(ncdc|ncdu)/issue/post} => \&issue_post,
|
||||||
qr{(ncdc)/issue/new} => \&issue_new,
|
qr{(ncdc|ncdu)/issue/new} => \&issue_new,
|
||||||
qr{(ncdc)/issue/([1-9][0-9]*)} => \&issue_item,
|
qr{(ncdc|ncdu)/issue/([1-9][0-9]*)} => \&issue_item,
|
||||||
);
|
);
|
||||||
|
|
||||||
TUWF::set(
|
TUWF::set(
|
||||||
|
|
@ -213,7 +214,7 @@ sub _issue_init {
|
||||||
sub issue_list {
|
sub issue_list {
|
||||||
my($s, $p) = @_;
|
my($s, $p) = @_;
|
||||||
my $is = _issue_init(@_);
|
my $is = _issue_init(@_);
|
||||||
$s->htmlHeader(title => 'Ncdc Issue tracker', page => $p, sec => 'issue');
|
$s->htmlHeader(title => "\u$p Issue tracker", page => $p, sec => 'issue');
|
||||||
br; a href => "/$p/issue/new", 'Report new issue'; br; br;
|
br; a href => "/$p/issue/new", 'Report new issue'; br; br;
|
||||||
$is->htmlListing((scalar $is->dbListing()), sub { "/$p/issue/".shift });
|
$is->htmlListing((scalar $is->dbListing()), sub { "/$p/issue/".shift });
|
||||||
br; a href => "/$p/issue/new", 'Report new issue'; br; br;
|
br; a href => "/$p/issue/new", 'Report new issue'; br; br;
|
||||||
|
|
@ -224,7 +225,7 @@ sub issue_list {
|
||||||
sub issue_new {
|
sub issue_new {
|
||||||
my($s, $p) = @_;
|
my($s, $p) = @_;
|
||||||
my $is = _issue_init(@_);
|
my $is = _issue_init(@_);
|
||||||
$s->htmlHeader(title => 'Ncdc: Report new issue', page => $p, sec => 'issue');
|
$s->htmlHeader(title => "\u$p: Report new issue", page => $p, sec => 'issue');
|
||||||
br; a href => "/$p/issue", 'Back to the issue index'; br; br;
|
br; a href => "/$p/issue", 'Back to the issue index'; br; br;
|
||||||
$is->htmlForm(undef, "/$p/issue/post");
|
$is->htmlForm(undef, "/$p/issue/post");
|
||||||
$s->htmlFooter;
|
$s->htmlFooter;
|
||||||
|
|
@ -255,7 +256,7 @@ sub issue_item {
|
||||||
my $item = $is->dbItem($i);
|
my $item = $is->dbItem($i);
|
||||||
return $s->resNotFound if !@$item;
|
return $s->resNotFound if !@$item;
|
||||||
my $last = $item->[$#$item];
|
my $last = $item->[$#$item];
|
||||||
$s->htmlHeader(title => 'Ncdc: '.$last->{summary}, page => $p, sec => 'issue');
|
$s->htmlHeader(title => "\u$p: $last->{summary}", page => $p, sec => 'issue');
|
||||||
br; a href => "/$p/issue", 'Back to the issue index'; br; br;
|
br; a href => "/$p/issue", 'Back to the issue index'; br; br;
|
||||||
$is->htmlItem($item);
|
$is->htmlItem($item);
|
||||||
$is->htmlForm($last, "/$p/issue/post") if !$last->{closed};
|
$is->htmlForm($last, "/$p/issue/post") if !$last->{closed};
|
||||||
|
|
@ -403,7 +404,7 @@ sub htmlMenu {
|
||||||
$m->('/ncdu/man', 'Manual', $o{sec} eq 'man');
|
$m->('/ncdu/man', 'Manual', $o{sec} eq 'man');
|
||||||
$m->('/ncdu/changes', 'Changelog', $o{sec} eq 'changes');
|
$m->('/ncdu/changes', 'Changelog', $o{sec} eq 'changes');
|
||||||
$m->('/ncdu/scr', 'Screenshots', $o{sec} eq 'scr');
|
$m->('/ncdu/scr', 'Screenshots', $o{sec} eq 'scr');
|
||||||
$m->('http://sourceforge.net/tracker/?group_id=200175', 'Bug tracker ');
|
$m->('/ncdu/issue', 'Issue tracker', $o{sec} eq 'issue');
|
||||||
});
|
});
|
||||||
$m->('/ncdc', 'Ncdc', $o{page} eq 'ncdc', sub {
|
$m->('/ncdc', 'Ncdc', $o{page} eq 'ncdc', sub {
|
||||||
$m->('/ncdc', 'Info', !$o{sec});
|
$m->('/ncdc', 'Info', !$o{sec});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue