Bug 30808: Add support for version codenames
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 25 Nov 2022 15:20:58 +0000 (15:20 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 25 Nov 2022 18:20:00 +0000 (15:20 -0300)
This patch adds the 'Rosalie' codename to the 22.11 release and adds
corresponding support to the about page for displaying it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
about.pl
docs/teams.yaml
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index e92015f..f4d1c7a 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -722,6 +722,7 @@ my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0];
 my $short_version = substr($versions{'kohaVersion'},0,5);
 my $minor = substr($versions{'kohaVersion'},3,2);
 my $development_version = ( $minor eq '05' || $minor eq '11' ) ? 0 : 1;
+my $codename;
 $template->param( short_version => $short_version );
 $template->param( development_version => $development_version );
 
@@ -747,7 +748,16 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
                 }
             }
         }
-        elsif ( $role ne 'release_date' ) {
+        elsif ( $role eq 'release_date' ) {
+            $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
+        }
+        elsif ( $role eq 'codename' ) {
+            if ( $version == $short_version ) {
+                $codename = $teams->{team}->{$version}->{$role};
+            }
+            next;
+        }
+        else {
             my $name = $teams->{team}->{$version}->{$role}->{name};
             # Add role to contributors
             push @{ $contributors->{$name}->{roles}->{$normalized_role} },
@@ -758,9 +768,6 @@ for my $version ( sort { $a <=> $b } keys %{$teams->{team}} ) {
                   $contributors->{$name}->{openhub};
             }
         }
-        else {
-            $teams->{team}->{$version}->{$role} = DateTime->from_epoch( epoch => $teams->{team}->{$version}->{$role});
-        }
     }
 }
 
@@ -778,6 +785,7 @@ my @people = map {
   lc($a2last||"") cmp lc($b2last||"");
 } keys %$contributors;
 
+$template->param( kohaCodename  => $codename);
 $template->param( contributors => \@people );
 $template->param( maintenance_team => $teams->{team}->{$dev_team} );
 $template->param( release_team => $teams->{team}->{$short_version} );
index 7c94f07..717893f 100644 (file)
@@ -1098,6 +1098,7 @@ team:
       - name: Wainui Witika-Park
   22.11:
     release_date: 1669420799
+    codename: Rosalie
     manager:
       name: Tomás Cohen Arazi
     manager_assistants:
index 4bfbb00..b8ac65e 100644 (file)
@@ -45,7 +45,7 @@
 
         <table>
             <caption>Server information</caption>
-            <tr><th scope="row">Koha version: </th><td>[% kohaVersion | html %]</td></tr>
+            <tr><th scope="row">Koha version: </th><td>[% kohaVersion | html %][% IF kohaCodename %] <strong>[% kohaCodename | html %]</strong>[% END %]</td></tr>
             <tr><th scope="row">OS version ('uname -a'): </th><td>[% osVersion | html %]</td></tr>
             <tr><th scope="row">Perl interpreter: </th><td>[% perlPath | html %]</td></tr>
             <tr><th scope="row">Perl version: </th><td>[% perlVersion | html %]</td></tr>
             [% IF maintenance_team %]
                 <div class="row">
                     <div class="col-md-6">
-                        <h3>Koha [% short_version | html %] release team</h3>
+                        <h3>Koha [% short_version | html %][% IF kohaCodename %] ([% kohaCodename | html %])[% END %] release team</h3>
                         [% IF development_version %]
                             <p>You are running a development version of Koha</p>
                         [% ELSE %]