Skip to content

Commit

Permalink
feature #38 Make it easier to set the github token
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow authored May 9, 2024
1 parent 56395d5 commit 59a4a74
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 34 deletions.
43 changes: 23 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 16 16">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" {{ attributes.defaults({class: 'inline-block text-green-700'}) }} viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
<path d="m10.97 4.97-.02.022-3.473 4.425-2.093-2.094a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05"/>
</svg>
4 changes: 4 additions & 0 deletions templates/components/Icon/XCircle.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" {{ attributes.defaults({class: 'inline-block text-red-700'}) }} viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"/>
</svg>
17 changes: 10 additions & 7 deletions templates/profile/edit.token.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
{% block title %}Update GitHub Token{% endblock %}

{% block body %}
<div>
<article>
<h1>{{ app.user.displayName }}'s Profile</h1>

{{ form_errors(form) }}

{{ form_start(form) }}
{{ form_start(form, {attr: {id: 'token-form'}}) }}
{{ form_row(form.token) }}

<div>
<button type="submit">Update Token</button>
<button type="reset">Reset</button>
</div>
{{ form_end(form) }}
</div>

{{ include('_form_controls.html.twig', {
'cancel_redirect': 'app_profile_me',
'has_delete_btn': false,
'submit_form_id': 'token-form',
'submit_button_label': 'Update Token',
}) }}
</article>
{% endblock %}
16 changes: 10 additions & 6 deletions templates/profile/me.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
{% block title %}My Profile{% endblock %}

{% block body %}
<div>
<article>
<h1>{{ app.user.displayName }}'s Profile</h1>

<div>
<section>
{% if app.user.gitHubToken is null %}
GitHub Token: <span>{{ include('svg/x-circle.html.twig') }}</span>
GitHub Token: <twig:Icon:XCircle />
{% else %}
GitHub Token: <span>{{ include('svg/check-mark.html.twig') }}</span>
GitHub Token: <twig:Icon:CheckMark />
{% endif %}
</div>
</div>
</section>

<section>
<a href="{{ path('app_profile_update_github_token') }}" class="p-2 underline decoration-cyan-500 hover:text-cyan-500 hover:decoration-gray-500">Edit Token</a>
</section>
</article>
{% endblock %}

0 comments on commit 59a4a74

Please sign in to comment.