From 594f7d64d0ee5610e73a34b3274f874e1f023509 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Apr 2019 13:35:22 +0100 Subject: [PATCH] Bug 21662: Use contributors.yaml for contributors list Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- about.pl | 41 ++- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 419 +++------------------- 2 files changed, 83 insertions(+), 377 deletions(-) diff --git a/about.pl b/about.pl index b5edf56..8b1a55b 100755 --- a/about.pl +++ b/about.pl @@ -32,7 +32,7 @@ use XML::Simple; use Config; use Search::Elasticsearch; use Try::Tiny; -use YAML; +use YAML::XS qw/LoadFile/; use C4::Output; use C4::Auth; @@ -520,9 +520,7 @@ $template->param( table => $table ); ## ------------------------------------------ -## Koha time line code - -#get file location +## Koha contributions my $docdir; if ( defined C4::Context->config('docdir') ) { $docdir = C4::Context->config('docdir'); @@ -532,6 +530,41 @@ if ( defined C4::Context->config('docdir') ) { $docdir = C4::Context->config('intranetdir') . '/docs'; } +## Contributors +my $contributors = LoadFile("$docdir"."/contributors.yaml"); +my @people = map { + { + name => $_, + ( + exists( $contributors->{$_}->{openhub} ) + ? ( openhub => $contributors->{$_}->{openhub} ) + : () + ), + ( + exists( $contributors->{$_}->{roles} ) + ? ( roles => $contributors->{$_}->{roles} ) + : () + ), + ( + exists( $contributors->{$_}->{commits} ) + ? ( commits => $contributors->{$_}->{commits} ) + : () + ), + ( + exists( $contributors->{$_}->{notes} ) + ? ( notes => $contributors->{$_}->{notes} ) + : () + ) + } +} sort { + my ($alast) = $a =~ /(\S+)$/; + my ($blast) = $b =~ /(\S+)$/; + lc($alast) cmp lc($blast) +} keys %{$contributors}; + +$template->param( contributors => \@people ); + +## Timeline if ( open( my $file, "<:encoding(UTF-8)", "$docdir" . "/history.txt" ) ) { my $i = 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 7aa2584..7232490 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -470,380 +470,12 @@

Koha development team

+
+

Contributing companies and institutions

  • Allen Ginsberg Library, USA
  • @@ -1163,3 +795,44 @@ [% END %] [% INCLUDE 'intranet-bottom.inc' %] + +[%- BLOCK role -%] + [%- SWITCH role.key -%] + [%- CASE 'manager' -%]Release manager + [%- CASE 'manager_assistant' -%]Release manager assistant + [%- CASE 'manager_assistants' -%]Release manager assistant + [%- CASE 'qa_manager' -%]Quality assurance manager + [%- CASE 'qa' -%]Quality assurance team + [%- CASE 'documentation' -%]Documentation manager + [%- CASE 'documentation_team' -%]Documentation team + [%- CASE 'translation' -%]Translation manager + [%- CASE 'translations' -%]Translation manager + [%- CASE 'translation_assistant' -%]Translation manager assistant + [%- CASE 'te' -%]Topic expert + [%- CASE 'bugwrangler' -%]Bug wrangler + [%- CASE 'maintainer' -%]Release maintainer + [%- CASE 'maintainer_assistant' -%]Release maintainer assistant + [%- CASE 'maintainer_assistants' -%]Release maintainer assistant + [%- CASE 'wiki' -%]Wiki curator + [%- CASE 'ci' -%]Continious integration manager + [%- CASE 'packaging' -%]Packaging manager + [%- CASE 'packaging_assistant' -%]Packaging manager assistant + [%- CASE 'chairperson' -%]Meetings chairperson + [%- CASE 'newsletter' -%]Newsletter editor + [%- CASE 'mm' -%]Module maintainer + [%- CASE 'vm' -%]Virtual machine maintainer + [%- CASE 'database' -%]Documentation specialist + [%- CASE 'live_cd' -%]Live CD maintainer + [%- END -%] +[%- END -%] +[%- BLOCK person -%] +[% IF p.openhub %][% p.name | html %][% ELSE %][% p.name | html %][% END %] +[%- END -%] +[%- BLOCK contributions -%] +[%- IF p.roles || p.notes -%] +
      + [% FOREACH r IN p.roles %]
    • [% INCLUDE role role=r %] ([% r.value.join(', ') | html %])
    • [% END %] + [% IF p.notes %]
    • [% p.notes | html %]
    • [% END %] +
    +[%- END -%] +[%- END -%] -- 1.7.2.5