diff --git a/src/Form/Type/ApiTokenType.php b/src/Form/Type/ApiTokenType.php index 3ea83cd0..9b41bebb 100644 --- a/src/Form/Type/ApiTokenType.php +++ b/src/Form/Type/ApiTokenType.php @@ -44,6 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('scores', ChoiceType::class, [ 'multiple' => true, 'expanded' => true, + 'attr' => ['with_value' => true], 'choices' => array_flip($this->getScores()) ]); diff --git a/templates/forms.html.twig b/templates/forms.html.twig index c6d81e0c..73a7091d 100644 --- a/templates/forms.html.twig +++ b/templates/forms.html.twig @@ -118,7 +118,7 @@ {%- for child in form %}
{{- form_widget(child) -}} - {{- form_label(child, null, {translation_domain: choice_translation_domain, with_value: true}) -}} + {{- form_label(child, null, {translation_domain: choice_translation_domain, with_value: attr['with_value'] is defined and attr['with_value']}) -}}
{% endfor -%} diff --git a/templates/profile/show.html.twig b/templates/profile/show.html.twig index ce263b72..9a5cfdda 100644 --- a/templates/profile/show.html.twig +++ b/templates/profile/show.html.twig @@ -17,10 +17,15 @@

You need to authenticate to access their Composer repository, for example to enter credentials run command:

+
composer config --global --auth http-basic.{{ app.request.getHttpHost() }} {{ user.userIdentifier }} {{ show_api_token(apiToken) }}
+

The storage can be done either globally in the COMPOSER_HOME/auth.json file

+ +

For continuous integration or deployment environments, you may use COMPOSER_AUTH environment variable

+
-composer config --global --auth http-basic.{{ app.request.getHttpHost() }} {{ user.userIdentifier }} {{ apiToken }}
-        
-

The storage can be done either globally in the COMPOSER_HOME/auth.json file


+COMPOSER_AUTH='{"http-basic": {"{{ app.request.getHttpHost() }}": {"username": "{{ user.userIdentifier }}", "password": "{{ show_api_token(user) }}"}}}' +
+ {%- endif %} {% if isMaintainer %}