Re: [PATCH 5/7] gitweb: auxiliary functions to group data
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 16, 2010, 10:26 UTC
- Message-ID
- <AANLkTinU3dQnricwXsf_-b1skWMCaNGxSLYLpOJZ94cm@mail.gmail.com>
- In-Reply-To
- <1284629465-14798-6-git-send-email-giuseppe.bilotta@gmail.com>
On Thu, Sep 16, 2010 at 09:31, Giuseppe Bilotta <giuseppe.bilotta@gmail.com> wrote:
Show 21 quoted lines
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
> ---
> gitweb/gitweb.perl | 15 +++++++++++++++
> 1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 6138c6e..92551e4 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3765,6 +3765,21 @@ sub git_print_header_div {
> "\n</div>\n";
> }
>
> +sub git_begin_group {
> + my ($class, $id, @rest) = @_;
> +
> + $class = ' class="' . join(' ', 'group', $class) . '"';
> +
> + $id = ' id="' . $id . '"' if $id;
> +
> + print "<div$class$id>\n";Hrm, this would be better:
$cgi->div( { class => "group $class", $id ? (id => $id) : () } )Show 7 quoted lines
> + git_print_header_div(@rest);
> +}
> +
> +sub git_end_group {
> + print "</div>\n"
> +}
> +But obviously that won't fit if the closing element is being printed separately.