Browse Source

svg years

merge-requests/1/head
JamesRezo 4 years ago
parent
commit
068fea32c1
  1. 1
      .gitignore
  2. 4
      composer.json
  3. 19
      composer.lock
  4. 12
      modeles/supported-versions.html
  5. 1
      phpcs.xml.dist
  6. 15
      supportedversions_fonctions.php

1
.gitignore vendored

@ -1 +1,2 @@
/vendor/
.php_cs.cache

4
composer.json

@ -9,5 +9,7 @@
"email": "james@rezo.net"
}
],
"require": {}
"require": {
"php": "^5.4 || ^7.0"
}
}

19
composer.lock generated

@ -0,0 +1,19 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "734ec23e9f8619162fa9e322b1ca9983",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^5.4 || ^7.0"
},
"platform-dev": []
}

12
modeles/supported-versions.html

@ -80,11 +80,21 @@
</BOUCLE_active_branches_2>
</g>
<!-- Year lines -->
<g class="years">
<BOUCLE_years(DATA){source table, #NULL|years}>
<line x1="[(#VALEUR|horiz_coord)]" y1="#SVG{header_height}" x2="[(#VALEUR|horiz_coord)]" y2="[(#SVG{header_height}|height)]" />
<text x="[(#VALEUR|horiz_coord)]" y="[(#SVG{header_height}|mult{0.8})]">
[(#VALEUR|affdate)]
</text>
</BOUCLE_years>
</g>
<!-- Today -->
<g class="today">
<line x1="[(#DATE|affdate{Y-m-d}|horiz_coord)]" y1="#SVG{header}" x2="[(#DATE|affdate{Y-m-d}|horiz_coord)]" y2="[(#SVG{header_height}|height)]" />
<text x="[(#DATE|affdate{Y-m-d}|horiz_coord)]" y="[(#SVG{header_height}|height|strplus{#SVG{footer_height}|mult{0.8}})]">
Today: [(#DATE|affdate{j M Y})]
Today: [(#DATE|affdate)]
</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

1
phpcs.xml.dist

@ -4,7 +4,6 @@
<file>./</file>
<exclude-pattern>lang/*</exclude-pattern>
<exclude-pattern>css/*</exclude-pattern>
<!-- Appliquer PSR-2 moins nos exceptions -->
<rule ref="PSR2" >

15
supportedversions_fonctions.php

@ -70,22 +70,25 @@ function years() {
static $years = [];
if (empty($years)) {
$years = iterator_to_array(new DatePeriod(min_date(), new DateInterval('P1Y'), max_date()));
$years = array_map(
function ($year) {
return $year->format('Y-m-d');
},
iterator_to_array(new DatePeriod(min_date(), new DateInterval('P1Y'), max_date()))
);
}
return $years;
}
function balise_YEARS_dist($p) {
return balise_ENV_dist($p, 'years()');
}
function branches() {
static $branches = [];
if (empty($branches)) {
$branches = array_map(
function ($branch) { return $branch['branch']; },
function ($branch) {
return $branch['branch'];
},
json_decode(file_get_contents(find_in_path('data/releases.json')), true)
);
}

Loading…
Cancel
Save