Browse Source

make a gradient if end date is unknown

merge-requests/4/head
JamesRezo 4 years ago
parent
commit
d151294a49
  1. 26
      modeles/supported-versions.html
  2. 20
      supportedversions_fonctions.php

26
modeles/supported-versions.html

@ -3,6 +3,20 @@
width="[(#SVG{margin_left}|width)]"
height="[(#SVG{header_height}|height)]"
>
<defs>
<linearGradient id="gradient-stable"
x1="0" y1="0" x2="100%" y2="0">
<stop offset="0%" stop-color="#c3e2c5" />
<stop offset="100%" stop-color="#fff" />
</linearGradient>
</defs>
<defs>
<linearGradient id="gradient-security"
x1="0" y1="0" x2="100%" y2="0">
<stop offset="0%" stop-color="#fceaae" />
<stop offset="100%" stop-color="#fff" />
</linearGradient>
</defs>
<style type="text/css">
<![CDATA[
text {
@ -24,11 +38,19 @@
fill: #fceaae;
}
.branches rect.security-gradient {
fill: url(#gradient-security);
}
g.stable rect,
.branches rect.stable {
fill: #c3e2c5;
}
.branches rect.stable-gradient {
fill: url(#gradient-stable);
}
g.future rect,
.branches rect.future {
fill: #edcbdc;
@ -76,14 +98,14 @@
<g class="branches">
<BOUCLE_active_branches_2(DATA){source table, #VAL{true}|branches_to_show}>
<rect
class="stable"
class="[(#ACTIVE_SUPPORT|stable_or_gradient)]"
x="[(#INITIAL_RELEASE|horiz_coord)]"
y="[(#BRANCH|top)]"
width="[(#ACTIVE_SUPPORT|horiz_coord|strmoins{#INITIAL_RELEASE|horiz_coord})]"
height="#SVG{branch_height}"
/>
<rect
class="security"
class="[(#EOL|security_or_gradient)]"
x="[(#ACTIVE_SUPPORT|horiz_coord)]"
y="[(#BRANCH|top)]"
width="[(#EOL|horiz_coord|strmoins{#ACTIVE_SUPPORT|horiz_coord})]"

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

20
supportedversions_fonctions.php

@ -143,3 +143,23 @@ function height($header_height) {
return $header_height + $svg['footer_height'] + (count(branches_to_show(true)) * $svg['branch_height']);
}
function stable_or_gradient($date) {
$gradient = '';
if ($date == '' || new DateTime($date) > max_date()) {
$gradient .= '-gradient';
}
return 'stable'.$gradient;
}
function security_or_gradient($date) {
$gradient = '';
if ($date == '' || new DateTime($date) > max_date()) {
$gradient .= '-gradient';
}
return 'security'.$gradient;
}

Loading…
Cancel
Save