Browse Source

eol versions in svg calendar

merge-requests/2/head
JamesRezo 4 years ago
parent
commit
29ab0928b1
  1. 4
      modeles/supported-versions.html
  2. 13
      supportedversions_fonctions.php

4
modeles/supported-versions.html

@ -62,7 +62,7 @@
<!-- Branch labels -->
<g class="branch-labels">
<BOUCLE_active_branches(DATA){source table, #NULL|branches_to_show}>
<BOUCLE_active_branches(DATA){source table, #VAL{true}|branches_to_show}>
<g[ class="(#VALEUR|state)"]>
<rect x="0" y="[(#BRANCH|top)]" width="[(#SVG{margin_left}|mult{0.5})]" height="#SVG{branch_height}" />
<text x="[(#SVG{margin_left}|mult{0.25})]" y="[(#BRANCH|top|top_for_text)]">
@ -74,7 +74,7 @@
<!-- Branch blocks -->
<g class="branches">
<BOUCLE_active_branches_2(DATA){source table, #NULL|branches_to_show}>
<BOUCLE_active_branches_2(DATA){source table, #VAL{true}|branches_to_show}>
<rect
class="stable"
x="[(#INITIAL_RELEASE|horiz_coord)]"

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

13
supportedversions_fonctions.php

@ -92,12 +92,15 @@ function releases() {
return $releases;
}
function branches_to_show() {
function branches_to_show($eol = false) {
$now = date('Y-m-d');
return array_reduce(
releases(),
function ($branches, $release) use ($now) {
if ($release['eol'] == '' || $release['eol'] > $now) {
function ($branches, $release) use ($eol, $now) {
if ($eol && $release['eol'] != '' && new DateTime($release['eol']) > min_date()) {
$branches[] = $release;
}
elseif ($release['eol'] == '' || $release['eol'] > $now) {
$branches[] = $release;
}
@ -114,7 +117,7 @@ function top($branch) {
function ($branch) {
return $branch['branch'];
},
branches_to_show()
branches_to_show(true)
);
$i = array_search($branch, $branches, true);
@ -138,5 +141,5 @@ function width($margin_left) {
function height($header_height) {
global $svg;
return $header_height + $svg['footer_height'] + (count(branches_to_show()) * $svg['branch_height']);
return $header_height + $svg['footer_height'] + (count(branches_to_show(true)) * $svg['branch_height']);
}

Loading…
Cancel
Save