Skip to content
Snippets Groups Projects
Commit a73694b7 authored by Pierre Fleutot's avatar Pierre Fleutot
Browse files

AJout des champs source et url dans les exemples des entrées

Fix annotation ApiLabelController.
parent 40afcc04
No related branches found
No related tags found
No related merge requests found
......@@ -544,3 +544,11 @@ li.nav-item {
.text-toggle[aria-expanded=true] .show-collapsed {
display: none;
}
.example-source {
font-style: normal;
font-size: .7rem;
}
.example-source a {
color: #0A53BE;
}
\ No newline at end of file
......@@ -76,7 +76,7 @@ class ApiLabelController extends AppBaseController
* @OA\Property(property="category", type="string", example="morphological OR general OR list OR milestone OR institutional"),
* @OA\Property(property="masters_type", type="string", example="user OR group OR public"),
* @OA\Property(property="master_id", type="integer"),
* @OA\Property(property="milestone", type="date")
* @OA\Property(property="milestone", type="date"),
* @OA\Property(property="language", type="string")
* )
* )
......
......@@ -15,6 +15,7 @@ use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
......@@ -26,6 +27,12 @@ class ExampleType extends AbstractType
->add('example', TextareaType::class, [
'label' => "Exemple",
])
->add('source', TextareaType::class, [
'label' => "Source",
])
->add('url', UrlType::class, [
'label' => "Url",
])
;
$builder
->add('submit', SubmitType::class, [
......
......@@ -117,6 +117,7 @@
{{ example.example }}
{{ _self.actions(entry, exampleKey, ['comment'], "", 'Comments') }}
{{ _self.actions(entry, exampleKey, ['edit', 'delete'], "", 'Examples') }}
{{ _self.exampleSourceAndUrl(example) }}
</p>
{{ _self.comments(entry, example, exampleKey) }}
</div>
......@@ -151,6 +152,7 @@
{{ subexample.example }}
{{ _self.actions(entry, subexampleKey, ['comment'], "", 'Comments') }}
{{ _self.actions(entry, subexampleKey, ['edit', 'delete'], "", 'Examples') }}
{{ _self.exampleSourceAndUrl(subexample) }}
</p>
{{ _self.comments(entry, subexample, subexampleKey) }}
</div>
......@@ -281,3 +283,10 @@
{% endmacro %}
{% macro exampleSourceAndUrl(example) %}
<div class="example-source">
{% if example.source is defined %}<strong>- {{ "Référence"|trans }}:</strong> {{ example.source }}{% endif %}
{% if example.url is defined %}<a href="{{ example.url }}" target="_blank">{{ "lien"|trans }} <i class="fa fa-external-link"></i> </a>{% endif %}
</div>
{% endmacro %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment