Skip to content

Commit

Permalink
Fix display choice labels and api token
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed May 17, 2023
1 parent b6b8013 commit 58692d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Form/Type/ApiTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
]);

Expand Down
2 changes: 1 addition & 1 deletion templates/forms.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{%- for child in form %}
<div class="choice-widget-expanded">
{{- 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']}) -}}
</div>
{% endfor -%}
</div>
Expand Down
11 changes: 8 additions & 3 deletions templates/profile/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@
</div>

<p>You need to authenticate to access their Composer repository, for example to enter credentials run command:</p>
<pre>composer config --global --auth http-basic.{{ app.request.getHttpHost() }} {{ user.userIdentifier }} {{ show_api_token(apiToken) }}</pre>
<p>The storage can be done either globally in the <code>COMPOSER_HOME/auth.json </code> file</p>

<p>For continuous integration or deployment environments, you may use <code>COMPOSER_AUTH</code> environment variable</p>

<pre>
composer config --global --auth http-basic.{{ app.request.getHttpHost() }} {{ user.userIdentifier }} {{ apiToken }}
</pre>
<p>The storage can be done either globally in the <code>COMPOSER_HOME/auth.json </code> file</p> <hr>
COMPOSER_AUTH='{"http-basic": {"{{ app.request.getHttpHost() }}": {"username": "{{ user.userIdentifier }}", "password": "{{ show_api_token(user) }}"}}}'</pre>
<hr>

{%- endif %}

{% if isMaintainer %}
Expand Down

0 comments on commit 58692d6

Please sign in to comment.