From: Eric Wong Date: Tue, 12 Jan 2016 20:45:58 +0000 (+0000) Subject: repobrowse: common html_start method X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=acfa05d57be0a15a0d7357f66d97f877c02b5219;p=thirdparty%2Fpublic-inbox.git repobrowse: common html_start method We will want a common UI/UX for all repobrowse HTML pages. --- diff --git a/lib/PublicInbox/RepoBrowseBase.pm b/lib/PublicInbox/RepoBrowseBase.pm index 8e45bac8d..2ff5680af 100644 --- a/lib/PublicInbox/RepoBrowseBase.pm +++ b/lib/PublicInbox/RepoBrowseBase.pm @@ -4,7 +4,7 @@ package PublicInbox::RepoBrowseBase; use strict; use warnings; require PublicInbox::RepoBrowseQuery; -require PublicInbox::Hval; +use PublicInbox::Hval; sub new { bless {}, shift } @@ -53,4 +53,14 @@ sub mime_type { (defined($ct) && $ct =~ m!\A(?:image|audio|video)/!) ? $ct : undef; } +# starts an HTML page for Repobrowse in a consistent way +sub html_start { + my ($self, $req, $title_html) = @_; + my $desc = $req->{repo_info}->{desc_html}; + + "$title_html" . + PublicInbox::Hval::STYLE . + "
$desc";
+}
+
 1;