Skip to content

Commit

Permalink
Use Symfony UX Icons
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Sep 30, 2024
1 parent 22d4acf commit 4fb1046
Show file tree
Hide file tree
Showing 56 changed files with 192 additions and 64 deletions.
1 change: 1 addition & 0 deletions assets/icons/tabler/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/ban.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/brand-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/calendar-month.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/device-floppy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/id-badge-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/list.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/login.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/logout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/message.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/messages.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/rss.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/tags.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/tabler/user.svg
1 change: 1 addition & 0 deletions assets/icons/tabler/users-group.svg
1 change: 1 addition & 0 deletions assets/icons/tabler/world.svg
6 changes: 2 additions & 4 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ footer {
padding-bottom: 2em
}

footer p {
footer p, footer a {
color: var(--gray-700);
font-size: 13px;
margin-bottom: 0.25em
Expand All @@ -278,9 +278,7 @@ footer #footer-resources {
text-align: right
}

footer #footer-resources i {
color: var(--gray-700);
font-size: 28.5px;
footer #footer-resources svg {
margin-left: 0.5em
}

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"symfony/string": "7.1.*",
"symfony/translation": "7.1.*",
"symfony/twig-bundle": "7.1.*",
"symfony/ux-icons": "^2.20",
"symfony/ux-live-component": "^2.6",
"symfony/validator": "7.1.*",
"symfony/yaml": "7.1.*",
Expand Down
90 changes: 89 additions & 1 deletion composer.lock

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

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
];
8 changes: 8 additions & 0 deletions config/packages/ux_icons.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ux_icons:
default_icon_attributes:
width: 1.2em
height: 1.2em
style: 'position: relative; top: -2px;'

aliases:
'tabler:save-changes': 'tabler:device-floppy'
2 changes: 1 addition & 1 deletion templates/admin/blog/_delete_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<form action="{{ url('admin_post_delete', {id: post.id}) }}" method="post" data-confirmation="true" id="delete-form">
<input type="hidden" name="token" value="{{ csrf_token('delete') }}" />
<button type="submit" class="btn btn-block btn-danger">
<i class="fa fa-trash" aria-hidden="true"></i>
<twig:ux:icon name="tabler:trash"/>
{{ 'action.delete_post'|trans }}
</button>
</form>
4 changes: 2 additions & 2 deletions templates/admin/blog/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
{{ form_widget(form) }}

<button type="submit" class="{{ button_css|default("btn btn-primary") }}">
<i class="fa fa-save" aria-hidden="true"></i> {{ button_label|default('label.create_post'|trans) }}
<twig:ux:icon name="tabler:save-changes"/> {{ button_label|default('label.create_post'|trans) }}
</button>

{% if include_back_to_home_link|default(false) %}
<a href="{{ path('admin_post_index') }}" class="btn btn-link">
<i class="fa fa-list-alt" aria-hidden="true"></i> {{ 'action.back_to_list'|trans }}
<twig:ux:icon name="tabler:list"/> {{ 'action.back_to_list'|trans }}
</a>
{% endif %}
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/admin/blog/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% block sidebar %}
<div class="section">
<a href="{{ path('admin_post_show', {id: post.id}) }}" class="btn btn-lg btn-block btn-success">
<i class="fa fa-eye" aria-hidden="true"></i> {{ 'action.show_post'|trans }}
<twig:ux:icon name="tabler:eye"/> {{ 'action.show_post'|trans }}
</a>
</div>

Expand Down
10 changes: 5 additions & 5 deletions templates/admin/blog/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<thead>
<tr>
<th scope="col">{{ 'label.title'|trans }}</th>
<th scope="col"><i class="fa fa-calendar" aria-hidden="true"></i> {{ 'label.published_at'|trans }}</th>
<th scope="col" class="text-center"><i class="fa fa-cogs" aria-hidden="true"></i> {{ 'label.actions'|trans }}</th>
<th scope="col"><twig:ux:icon name="tabler:calendar-month"/> {{ 'label.published_at'|trans }}</th>
<th scope="col" class="text-center"><twig:ux:icon name="tabler:settings"/> {{ 'label.actions'|trans }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -24,11 +24,11 @@
<td class="text-right">
<div class="item-actions">
<a href="{{ path('admin_post_show', {id: post.id}) }}" class="btn btn-sm btn-secondary">
<i class="fa fa-eye" aria-hidden="true"></i> {{ 'action.show'|trans }}
<twig:ux:icon name="tabler:eye"/> {{ 'action.show'|trans }}
</a>

<a href="{{ path('admin_post_edit', {id: post.id}) }}" class="btn btn-sm btn-primary">
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit'|trans }}
<twig:ux:icon name="tabler:pencil"/> {{ 'action.edit'|trans }}
</a>
</div>
</td>
Expand All @@ -45,7 +45,7 @@
{% block sidebar %}
<div class="section actions">
<a href="{{ path('admin_post_new') }}" class="btn btn-lg btn-block btn-success">
<i class="fa fa-plus" aria-hidden="true"></i> {{ 'action.create_post'|trans }}
<twig:ux:icon name="tabler:pencil"/> {{ 'action.create_post'|trans }}
</a>
</div>

Expand Down
4 changes: 2 additions & 2 deletions templates/admin/blog/new.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
{{ form_row(form.tags) }}

<button type="submit" class="btn btn-primary">
<i class="fa fa-save" aria-hidden="true"></i> {{ 'label.create_post'|trans }}
<twig:ux:icon name="tabler:save-changes"/> {{ 'label.create_post'|trans }}
</button>
{{ form_widget(form.saveAndCreateNew, {label: 'label.save_and_create_new', attr: {class: 'btn btn-primary'}}) }}
<a href="{{ path('admin_post_index') }}" class="btn btn-link">
<i class="fa fa-list-alt" aria-hidden="true"></i> {{ 'action.back_to_list'|trans }}
<twig:ux:icon name="tabler:list"/> {{ 'action.back_to_list'|trans }}
</a>
{{ form_end(form) }}
{% endblock %}
Expand Down
6 changes: 3 additions & 3 deletions templates/admin/blog/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<h1>{{ post.title }}</h1>

<p class="post-metadata">
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
<span class="metadata"><twig:ux:icon name="tabler:calendar-month"/> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
<span class="metadata"><twig:ux:icon name="tabler:user"/> {{ post.author.fullName }}</span>
</p>

<div class="jumbotron">
Expand All @@ -22,7 +22,7 @@
{% block sidebar %}
<div class="section">
<a href="{{ path('admin_post_edit', {id: post.id}) }}" class="btn btn-lg btn-block btn-success">
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit_contents'|trans }}
<twig:ux:icon name="tabler:pencil"/> {{ 'action.edit_contents'|trans }}
</a>
</div>

Expand Down
Loading

0 comments on commit 4fb1046

Please sign in to comment.