Skip to content

Commit

Permalink
Merge pull request #4240 from FAJ-Munich/master
Browse files Browse the repository at this point in the history
Ordo: new features
  • Loading branch information
APMarcello3 authored Jan 3, 2025
2 parents 81fb4d3 + 90d389a commit 7f03896
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
16 changes: 10 additions & 6 deletions web/cgi-bin/horas/kalendar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ package main;
use constant DAYNAMES => qw/Dom. F.II F.III F.IV F.V F.VI Sabb./;

# output html table with entries

sub kalendar_table {
my ($kyear, $kmonth, $mode) = @_;
my $background = (our $whitebground) ? ' class="contrastbg"' : '';
Expand All @@ -141,8 +142,11 @@ sub kalendar_table {
$output .= "<TR><TH>C.E.</TH><TH>D.L.</TH><TH></TH><TH>Dies</TH><TH></TH></TR>\n";
$cols = 5 + $compare;
} else {
$output .= "<TR><TH>Dies</TH><TH>de Tempore</TH><TH>Sanctorum</TH><TH>d.h.</TH></TR>\n";
$cols = 4;
$output .= "<TR><TH>Dies</TH><TH>de Tempore</TH><TH>Sanctorum</TH><TH>Vespera</TH><TH>d.h.</TH></TR>\n";
$cols = 5;

# $output .= "<TR><TH>Dies</TH><TH>de Tempore</TH><TH>Sanctorum</TH><TH>d.h.</TH></TR>\n";
# $cols = 4;
}

my $to = (MONTHLENGTH)[$kmonth];
Expand Down Expand Up @@ -172,10 +176,10 @@ sub kalendar_table {
}
}

$output .=
'<TR>'
. join('', map { '<TD' . (length($_) < 52 ? ' ALIGN="CENTER"' : '') . ">$_</TD>" } table_row($date1, $cday))
. "</TR>\n";
$output .= '<TR>'
. join('',
map { '<TD' . (length($_) < 20 || $_ =~ /\<A/ ? ' ALIGN="CENTER"' : '') . ">$_</TD>" } table_row($date1, $cday),
) . "</TR>\n";
}
$output .= note('nigra19') if $mode eq 'kal';
$output =~ s/{(.+?)}/ setfont('maroon', $1) /ge;
Expand Down
5 changes: 4 additions & 1 deletion web/cgi-bin/horas/kalendar/kal.pl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ sub findkalentry {
$rankname =~ s/IV. classis/Memoria/ if $ver =~ /Monastic|Ordo Praedicatorum/;

(
setfont(liturgical_color($srank[0]), $rank > 4 ? latin_uppercase($srank[0]) : $srank[0]),
setfont(
liturgical_color($srank[0]),
$rank > 4 && $srank[0] !~ /octava|vigilia/i ? latin_uppercase($srank[0]) : $srank[0],
),
setfont('1 maroon', ' ' . $rankname),
);
}
Expand Down
45 changes: 31 additions & 14 deletions web/cgi-bin/horas/kalendar/ordo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sub ordo_entry {
my ($date, $ver, $compare, $winneronly) = @_;

our $version = $ver;
our ($day, $month, $year, $dayname, %scriptura, %commemoratio);
our ($day, $month, $year, $dayname, %scriptura, @commemoentries);

precedence($date);

Expand All @@ -25,6 +25,15 @@ sub ordo_entry {
$c2 = setfont($smallblack, "$h1:") if $h1;
$c2 .= "<I>" . setfont(liturgical_color($h2), " $h2") . "</I>" if $h2;

if ($c2 && @commemoentries > 1) {
for my $ind (1 .. @commemoentries - 1) {
my %com = %{setupstring('Latin', "$commemoentries[$ind].txt")};
my $comname = $com{Rank};
$comname =~ s/\;\;.*//;
$c2 .= " <I>&amp; " . setfont(liturgical_color($comname), " $comname") . "</I>" if $comname;
}
}

$c2 =~ s/Hebdomadam/Hebd/i;
$c2 =~ s/Quadragesima/Quadr/i;

Expand Down Expand Up @@ -54,17 +63,19 @@ sub ordo_entry {
$c2 .= setfont($smallblack, ' m.t.v.');
}

if ( $version !~ /196/
&& $winner =~ /Sancti/
&& exists($winner{Lectio1})
&& $winner{Lectio1} !~ /\@Commune/i
&& $winner{Lectio1} !~ /\!(Matt|Marc|Luc|Joannes)\s+[0-9]+\:[0-9]+\-[0-9]+/i)
{
$c2 .= setfont($smallfont, " *L1*");
}
our $hora;
my $temphora = $hora;
$hora = 'Vespera';
precedence($date);
$hora = $temphora;
my $cv = $dayname[2];
$cv =~ s/.*?(Vespera|A capitulo|$)/$1/;

$c2 ||= '_' if $compare;
($c1, $c2);
if ($compare) {
$c2 ||= '_';
$cv ||= '_';
}
return ($c1, $c2, $cv);
}

# prepare row
Expand All @@ -73,14 +84,20 @@ sub table_row {
our ($version1, $compare, $version2, $dayofweek);

my $d = substr($date, 3, 2) + 0;
my ($c1, $c2) = ordo_entry($date, $version1, $compare);
my ($c1, $c2, $cv) = ordo_entry($date, $version1, $compare);

if ($compare) {
my ($c21, $c22) = ordo_entry($date, $version2, $compare);
my ($c21, $c22, $cv2) = ordo_entry($date, $version2, $compare);
$c1 .= "<br/>$c21";
$c2 .= "<br/>$c22";
$cv .= "<br/>$cv2";
}
(qq(<A HREF=# onclick="callbrevi('$date');">$d</A>), $c1, $c2, @{[(DAYNAMES)[$dayofweek]]});
(
qq(<A HREF=# onclick="callbrevi('$date');">$d</A>),
$c1, $c2,
qq(<FONT SIZE="-2">$cv</FONT>),
@{[(DAYNAMES)[$dayofweek]]},
);
}

# html_header_ordo
Expand Down

0 comments on commit 7f03896

Please sign in to comment.