<& '/widgets/wrappers/sharky/table_top.mc',
    caption => "Version Notes",
    number  => $number,
&>
<table class="containerProf">
<tr>
    <th class="name">Version</th>
    <th>Notes</th>
</tr>

% my $count = 0;
% foreach my $n (@notes) {
%	if ( $n->{id} && $n->{note} ) {
<tr class="<% (++$count % 2 == 0) ? 'even' : 'odd' %>">
    <td class="name"><% $n->{id} %></td>
    <td><% $n->{note} |h %></td>
</tr>
% 	}
% }

% unless ($count) {
<tr>
    <td colspan="2"><% $lang->maketext('No existing notes.') %></td>
</tr>
% }
</table>

% $m->comp("/widgets/wrappers/sharky/table_bottom.mc");

<form>
<& '/widgets/buttons/submit.mc',
    disp    => 'Return',
    widget  => $widget,
    cb      => 'return_cb',
    button  => 'return_dgreen',
    useTable    => 0,
&>
</form>

<%args>
$widget
$number
</%args>

<%init>
my $notes = get_state_data($widget, 'notes');
my @notes = map { { id => $_, note => $notes->{$_} } }
            sort { $b <=> $a } keys %$notes;
</%init>
