Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Comptoir
Comptoir-srv
Commits
25cf37c1
Commit
25cf37c1
authored
May 29, 2020
by
Fabrice Gangler
🎨
Browse files
FEAT: add tag description (en/fr)
Refs: #892
parent
4db58b6c
Pipeline
#9833
passed with stage
in 3 minutes and 39 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Documentation/For_developers/Features/SILL/field_description/SILL-2020_description.sql
0 → 100644
View file @
25cf37c1
-- Tag SILL-2020 ---> [ID 258]
UPDATE
public
.
tags
SET
description_i18n_fr
=
'<p>
Co-construit par des communautés d’agents publics informaticiens de
l’État (les référents « SILL »), le <a href="https://sill.etalab.gouv.fr">socle interministériel des
logiciels libres</a> est le catalogue de référence des logiciels libres
recommandés par l’État. Tous ces logiciels sont utilisés dans un
cadre de production dans au moins l’une des administrations
contributrices.
</p>
<p>
Son périmètre - ne couvrant pas la totalité du système d’information
de l’État - classe les logiciels par thématiques : poste de travail,
gestion de parc, exploitation de serveurs et de bases de données et
environnements de développement.
</p>
<p>
Sous forme de <a href="https://sill.etalab.gouv.fr/fr/software?year=2020">site web</a>,
il permet d’identifier rapidement le
logiciel et la version minimale recommandée (toute administration
est libre d’utiliser une version plus récente). Il est également
possible de consulter l’état d’avancement du statut d’un logiciel,
selon qu’il est en cours d’observation ou recommandé.
</p>'
WHERE
id
=
258
;
config/Migrations/20200528010633_AlterTags_addDescriptionField.php
0 → 100644
View file @
25cf37c1
<?php
use
Migrations\AbstractMigration
;
/**
* Alter Tags table
* -----------------------------------
* Add "description" field
*/
class
AlterTagsAddDescriptionField
extends
AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public
function
change
()
{
$table
=
$this
->
table
(
'tags'
);
// --------------------------------------
$table
->
addColumn
(
'description_i18n_fr'
,
'text'
,
[
'default'
=>
null
,
'null'
=>
true
,
]);
$table
->
addColumn
(
'description_i18n_en'
,
'text'
,
[
'default'
=>
null
,
'null'
=>
true
,
]);
// --------------------------------------
$table
->
update
();
}
}
src/Model/Entity/Tag.php
View file @
25cf37c1
...
...
@@ -11,6 +11,8 @@ use Cake\ORM\Entity;
* @property string $name
* @property Time $created
* @property Time $modified
* @property string $description_i18n_en
* @property string $description_i18n_fr
*
* @property Software[] $softwares
*/
...
...
src/Model/Table/TagsTable.php
View file @
25cf37c1
...
...
@@ -106,6 +106,12 @@ class TagsTable extends Table
->
notEmpty
(
'name'
)
->
maxLength
(
'name'
,
100
,
"Provided value is too long (max : 100)."
);
$validator
->
allowEmpty
(
'description_i18n_fr'
);
$validator
->
allowEmpty
(
'description_i18n_en'
);
$validator
->
add
(
'name'
,
'alphaNumeric'
,
...
...
src/Template/Api/V1/Tags/list_all_software_for_a_given_tag.ctp
View file @
25cf37c1
...
...
@@ -9,7 +9,14 @@ $this->assign('title', $tag->name);
<li>
<h1>
<?=
__d
(
"Tags"
,
"Tag"
)
.
" "
.
$tag
->
name
?>
</h1>
</li>
<?php
if
(
$selectedLanguage
===
'fr'
&&
!
empty
(
$tag
->
description_i18n_fr
))
{
echo
"<li>
$tag->description_i18n_fr
</li>"
;
}
else
if
(
$selectedLanguage
===
'en'
&&
!
empty
(
$tag
->
description_i18n_en
))
{
echo
"<li>
$tag
-description_i18n_en</li>"
;
}
?>
</ul>
</section>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment