From 986f2394262f14214cd3994660fc0660979c2cf2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 30 Sep 2024 17:39:55 +0200 Subject: [PATCH] Use Symfony UX Icons --- assets/app.js | 2 -- assets/icons/tabler/arrow-left.svg | 1 + assets/icons/tabler/arrow-right.svg | 1 + assets/icons/tabler/ban.svg | 1 + assets/icons/tabler/brand-x.svg | 1 + assets/icons/tabler/calendar-month.svg | 1 + assets/icons/tabler/code.svg | 1 + assets/icons/tabler/device-floppy.svg | 1 + assets/icons/tabler/eye.svg | 1 + assets/icons/tabler/home.svg | 1 + assets/icons/tabler/id-badge-2.svg | 1 + assets/icons/tabler/key.svg | 1 + assets/icons/tabler/list.svg | 1 + assets/icons/tabler/lock.svg | 1 + assets/icons/tabler/login.svg | 1 + assets/icons/tabler/logout.svg | 1 + assets/icons/tabler/message.svg | 1 + assets/icons/tabler/messages.svg | 1 + assets/icons/tabler/pencil.svg | 1 + assets/icons/tabler/rss.svg | 1 + assets/icons/tabler/search.svg | 1 + assets/icons/tabler/send.svg | 1 + assets/icons/tabler/settings.svg | 1 + assets/icons/tabler/tag.svg | 1 + assets/icons/tabler/tags.svg | 1 + assets/icons/tabler/trash.svg | 1 + assets/icons/tabler/user.svg | 1 + assets/icons/tabler/users-group.svg | 1 + assets/icons/tabler/world.svg | 1 + assets/styles/app.scss | 6 ++---- composer.json | 1 + config/bundles.php | 1 + config/packages/ux_icons.yaml | 8 ++++++++ importmap.php | 8 -------- templates/admin/blog/_delete_form.html.twig | 2 +- templates/admin/blog/_form.html.twig | 4 ++-- templates/admin/blog/edit.html.twig | 2 +- templates/admin/blog/index.html.twig | 10 +++++----- templates/admin/blog/new.html.twig | 4 ++-- templates/admin/blog/show.html.twig | 6 +++--- templates/admin/layout.html.twig | 4 ++-- templates/base.html.twig | 16 ++++++++-------- templates/blog/_comment_form.html.twig | 4 ++-- .../blog/_delete_post_confirmation.html.twig | 4 ++-- templates/blog/_post.html.twig | 4 ++-- templates/blog/_post_tags.html.twig | 2 +- templates/blog/_rss.html.twig | 2 +- templates/blog/index.html.twig | 8 ++++---- templates/blog/post_show.html.twig | 10 +++++----- .../TwigBundle/Exception/error403.html.twig | 2 +- templates/debug/source_code.html.twig | 4 ++-- templates/default/_language_selector.html.twig | 2 +- templates/default/homepage.html.twig | 4 ++-- templates/form/fields.html.twig | 4 ++-- templates/security/login.html.twig | 16 ++++++++++------ templates/user/change_password.html.twig | 4 ++-- templates/user/edit.html.twig | 4 ++-- 57 files changed, 103 insertions(+), 73 deletions(-) create mode 100644 assets/icons/tabler/arrow-left.svg create mode 100644 assets/icons/tabler/arrow-right.svg create mode 100644 assets/icons/tabler/ban.svg create mode 100644 assets/icons/tabler/brand-x.svg create mode 100644 assets/icons/tabler/calendar-month.svg create mode 100644 assets/icons/tabler/code.svg create mode 100644 assets/icons/tabler/device-floppy.svg create mode 100644 assets/icons/tabler/eye.svg create mode 100644 assets/icons/tabler/home.svg create mode 100644 assets/icons/tabler/id-badge-2.svg create mode 100644 assets/icons/tabler/key.svg create mode 100644 assets/icons/tabler/list.svg create mode 100644 assets/icons/tabler/lock.svg create mode 100644 assets/icons/tabler/login.svg create mode 100644 assets/icons/tabler/logout.svg create mode 100644 assets/icons/tabler/message.svg create mode 100644 assets/icons/tabler/messages.svg create mode 100644 assets/icons/tabler/pencil.svg create mode 100644 assets/icons/tabler/rss.svg create mode 100644 assets/icons/tabler/search.svg create mode 100644 assets/icons/tabler/send.svg create mode 100644 assets/icons/tabler/settings.svg create mode 100644 assets/icons/tabler/tag.svg create mode 100644 assets/icons/tabler/tags.svg create mode 100644 assets/icons/tabler/trash.svg create mode 100644 assets/icons/tabler/user.svg create mode 100644 assets/icons/tabler/users-group.svg create mode 100644 assets/icons/tabler/world.svg create mode 100644 config/packages/ux_icons.yaml diff --git a/assets/app.js b/assets/app.js index b5889042e..8fdc80c84 100644 --- a/assets/app.js +++ b/assets/app.js @@ -1,8 +1,6 @@ // start the Stimulus application import './bootstrap.js'; import './styles/app.scss'; -import '@fortawesome/fontawesome-free/css/all.css'; -import '@fortawesome/fontawesome-free/css/v4-shims.css'; import 'highlight.js/styles/github-dark-dimmed.css'; import 'lato-font/css/lato-font.css'; diff --git a/assets/icons/tabler/arrow-left.svg b/assets/icons/tabler/arrow-left.svg new file mode 100644 index 000000000..b59ef3715 --- /dev/null +++ b/assets/icons/tabler/arrow-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/arrow-right.svg b/assets/icons/tabler/arrow-right.svg new file mode 100644 index 000000000..3877b1967 --- /dev/null +++ b/assets/icons/tabler/arrow-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/ban.svg b/assets/icons/tabler/ban.svg new file mode 100644 index 000000000..f1b502345 --- /dev/null +++ b/assets/icons/tabler/ban.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/brand-x.svg b/assets/icons/tabler/brand-x.svg new file mode 100644 index 000000000..53be82259 --- /dev/null +++ b/assets/icons/tabler/brand-x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/calendar-month.svg b/assets/icons/tabler/calendar-month.svg new file mode 100644 index 000000000..1d9bbcd1f --- /dev/null +++ b/assets/icons/tabler/calendar-month.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/code.svg b/assets/icons/tabler/code.svg new file mode 100644 index 000000000..7f2615756 --- /dev/null +++ b/assets/icons/tabler/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/device-floppy.svg b/assets/icons/tabler/device-floppy.svg new file mode 100644 index 000000000..4bd284be8 --- /dev/null +++ b/assets/icons/tabler/device-floppy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/eye.svg b/assets/icons/tabler/eye.svg new file mode 100644 index 000000000..9c27074f6 --- /dev/null +++ b/assets/icons/tabler/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/home.svg b/assets/icons/tabler/home.svg new file mode 100644 index 000000000..9999cd394 --- /dev/null +++ b/assets/icons/tabler/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/id-badge-2.svg b/assets/icons/tabler/id-badge-2.svg new file mode 100644 index 000000000..eb41bdf85 --- /dev/null +++ b/assets/icons/tabler/id-badge-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/key.svg b/assets/icons/tabler/key.svg new file mode 100644 index 000000000..62346db1e --- /dev/null +++ b/assets/icons/tabler/key.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/list.svg b/assets/icons/tabler/list.svg new file mode 100644 index 000000000..a50599c6a --- /dev/null +++ b/assets/icons/tabler/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/lock.svg b/assets/icons/tabler/lock.svg new file mode 100644 index 000000000..f8cc3d5df --- /dev/null +++ b/assets/icons/tabler/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/login.svg b/assets/icons/tabler/login.svg new file mode 100644 index 000000000..56212963f --- /dev/null +++ b/assets/icons/tabler/login.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/logout.svg b/assets/icons/tabler/logout.svg new file mode 100644 index 000000000..885c1d45e --- /dev/null +++ b/assets/icons/tabler/logout.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/message.svg b/assets/icons/tabler/message.svg new file mode 100644 index 000000000..3b1eb4e89 --- /dev/null +++ b/assets/icons/tabler/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/messages.svg b/assets/icons/tabler/messages.svg new file mode 100644 index 000000000..74f7bfa37 --- /dev/null +++ b/assets/icons/tabler/messages.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/pencil.svg b/assets/icons/tabler/pencil.svg new file mode 100644 index 000000000..a9549e2ac --- /dev/null +++ b/assets/icons/tabler/pencil.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/rss.svg b/assets/icons/tabler/rss.svg new file mode 100644 index 000000000..84f1bdd74 --- /dev/null +++ b/assets/icons/tabler/rss.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/search.svg b/assets/icons/tabler/search.svg new file mode 100644 index 000000000..b11a38879 --- /dev/null +++ b/assets/icons/tabler/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/send.svg b/assets/icons/tabler/send.svg new file mode 100644 index 000000000..15091e8c0 --- /dev/null +++ b/assets/icons/tabler/send.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/settings.svg b/assets/icons/tabler/settings.svg new file mode 100644 index 000000000..24ffb1e32 --- /dev/null +++ b/assets/icons/tabler/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/tag.svg b/assets/icons/tabler/tag.svg new file mode 100644 index 000000000..f8eece41b --- /dev/null +++ b/assets/icons/tabler/tag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/tags.svg b/assets/icons/tabler/tags.svg new file mode 100644 index 000000000..0b6a43863 --- /dev/null +++ b/assets/icons/tabler/tags.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/trash.svg b/assets/icons/tabler/trash.svg new file mode 100644 index 000000000..d872bd7a6 --- /dev/null +++ b/assets/icons/tabler/trash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/user.svg b/assets/icons/tabler/user.svg new file mode 100644 index 000000000..5f3e0086e --- /dev/null +++ b/assets/icons/tabler/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/users-group.svg b/assets/icons/tabler/users-group.svg new file mode 100644 index 000000000..dbc75a0eb --- /dev/null +++ b/assets/icons/tabler/users-group.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/tabler/world.svg b/assets/icons/tabler/world.svg new file mode 100644 index 000000000..f8025684b --- /dev/null +++ b/assets/icons/tabler/world.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 619053b31..18d4308ae 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -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 @@ -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 } diff --git a/composer.json b/composer.json index fc0764dae..c0cad52e6 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ "symfony/string": "^7", "symfony/translation": "^7", "symfony/twig-bundle": "^7", + "symfony/ux-icons": "^2.20", "symfony/ux-live-component": "^2.6", "symfony/validator": "^7", "symfony/yaml": "^7", diff --git a/config/bundles.php b/config/bundles.php index e77aa4a4e..5b167b209 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -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], ]; diff --git a/config/packages/ux_icons.yaml b/config/packages/ux_icons.yaml new file mode 100644 index 000000000..a97d4055c --- /dev/null +++ b/config/packages/ux_icons.yaml @@ -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' diff --git a/importmap.php b/importmap.php index 3aee69b09..3cb51d537 100644 --- a/importmap.php +++ b/importmap.php @@ -71,18 +71,10 @@ 'version' => '11.9.0', 'type' => 'css', ], - '@fortawesome/fontawesome-free/css/all.css' => [ - 'version' => '6.5.1', - 'type' => 'css', - ], 'lato-font/css/lato-font.css' => [ 'version' => '3.0.0', 'type' => 'css', ], - '@fortawesome/fontawesome-free/css/v4-shims.css' => [ - 'version' => '6.5.1', - 'type' => 'css', - ], 'popper.js' => [ 'version' => '1.16.1', ], diff --git a/templates/admin/blog/_delete_form.html.twig b/templates/admin/blog/_delete_form.html.twig index 1fa5b7de5..c3c3b906b 100644 --- a/templates/admin/blog/_delete_form.html.twig +++ b/templates/admin/blog/_delete_form.html.twig @@ -2,7 +2,7 @@
diff --git a/templates/admin/blog/_form.html.twig b/templates/admin/blog/_form.html.twig index 13fe03462..1830e6687 100644 --- a/templates/admin/blog/_form.html.twig +++ b/templates/admin/blog/_form.html.twig @@ -15,12 +15,12 @@ {{ form_widget(form) }} {% if include_back_to_home_link|default(false) %} - {{ 'action.back_to_list'|trans }} + {{ 'action.back_to_list'|trans }} {% endif %} {{ form_end(form) }} diff --git a/templates/admin/blog/edit.html.twig b/templates/admin/blog/edit.html.twig index 404b0b520..4b9167cc6 100644 --- a/templates/admin/blog/edit.html.twig +++ b/templates/admin/blog/edit.html.twig @@ -15,7 +15,7 @@ {% block sidebar %}
- {{ 'action.show_post'|trans }} + {{ 'action.show_post'|trans }}
diff --git a/templates/admin/blog/index.html.twig b/templates/admin/blog/index.html.twig index d5f191153..e967982c3 100644 --- a/templates/admin/blog/index.html.twig +++ b/templates/admin/blog/index.html.twig @@ -9,8 +9,8 @@ {{ 'label.title'|trans }} - {{ 'label.published_at'|trans }} - {{ 'label.actions'|trans }} + {{ 'label.published_at'|trans }} + {{ 'label.actions'|trans }} @@ -24,11 +24,11 @@ @@ -45,7 +45,7 @@ {% block sidebar %} diff --git a/templates/admin/blog/new.html.twig b/templates/admin/blog/new.html.twig index de1dc4704..12f24949d 100644 --- a/templates/admin/blog/new.html.twig +++ b/templates/admin/blog/new.html.twig @@ -13,11 +13,11 @@ {{ form_row(form.tags) }} {{ form_widget(form.saveAndCreateNew, {label: 'label.save_and_create_new', attr: {class: 'btn btn-primary'}}) }} - {{ 'action.back_to_list'|trans }} + {{ 'action.back_to_list'|trans }} {{ form_end(form) }} {% endblock %} diff --git a/templates/admin/blog/show.html.twig b/templates/admin/blog/show.html.twig index 4465fdad9..902956282 100644 --- a/templates/admin/blog/show.html.twig +++ b/templates/admin/blog/show.html.twig @@ -6,8 +6,8 @@

{{ post.title }}

@@ -22,7 +22,7 @@ {% block sidebar %} diff --git a/templates/admin/layout.html.twig b/templates/admin/layout.html.twig index 9fb50d69e..dbc305e26 100644 --- a/templates/admin/layout.html.twig +++ b/templates/admin/layout.html.twig @@ -15,12 +15,12 @@ {% block header_navigation_links %}
  • - {{ 'menu.post_list'|trans }} + {{ 'menu.post_list'|trans }}
  • {% endblock %} diff --git a/templates/base.html.twig b/templates/base.html.twig index 1363f2b61..a063a26f1 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -42,36 +42,36 @@ {% block header_navigation_links %} {% if is_granted('ROLE_ADMIN') %} {% endif %} {% endblock %} {% if app.user %} @@ -121,10 +121,10 @@ diff --git a/templates/blog/_comment_form.html.twig b/templates/blog/_comment_form.html.twig index 68bc015b8..6bf239968 100644 --- a/templates/blog/_comment_form.html.twig +++ b/templates/blog/_comment_form.html.twig @@ -15,7 +15,7 @@
    - {{ 'title.add_comment'|trans }} + {{ 'title.add_comment'|trans }} {# Render any global form error (e.g. when a constraint on a public getter method failed) #} @@ -33,7 +33,7 @@
    diff --git a/templates/blog/_delete_post_confirmation.html.twig b/templates/blog/_delete_post_confirmation.html.twig index e26bb2a40..480ab9d31 100644 --- a/templates/blog/_delete_post_confirmation.html.twig +++ b/templates/blog/_delete_post_confirmation.html.twig @@ -8,10 +8,10 @@
    diff --git a/templates/blog/_post.html.twig b/templates/blog/_post.html.twig index a7465cbca..55ad734da 100644 --- a/templates/blog/_post.html.twig +++ b/templates/blog/_post.html.twig @@ -6,8 +6,8 @@

    {{ post.summary }}

    diff --git a/templates/blog/_post_tags.html.twig b/templates/blog/_post_tags.html.twig index 08e2531b8..81b88417b 100644 --- a/templates/blog/_post_tags.html.twig +++ b/templates/blog/_post_tags.html.twig @@ -4,7 +4,7 @@ - {{ tag.name }} + {{ tag.name }} {% endfor %}

    diff --git a/templates/blog/_rss.html.twig b/templates/blog/_rss.html.twig index 69d778b6d..4c2e7fe4b 100644 --- a/templates/blog/_rss.html.twig +++ b/templates/blog/_rss.html.twig @@ -1,5 +1,5 @@ diff --git a/templates/blog/index.html.twig b/templates/blog/index.html.twig index ccd28f613..83c934f6c 100644 --- a/templates/blog/index.html.twig +++ b/templates/blog/index.html.twig @@ -16,12 +16,12 @@ {% if paginator.hasPreviousPage %}
  • - {{ 'paginator.previous'|trans }} + {{ 'paginator.previous'|trans }}
  • {% else %}
  • - {{ 'paginator.previous'|trans }} + {{ 'paginator.previous'|trans }}
  • {% endif %} @@ -38,12 +38,12 @@ {% if paginator.hasNextPage %}
  • - {{ 'paginator.next'|trans }} + {{ 'paginator.next'|trans }}
  • {% else %}
  • - {{ 'paginator.next'|trans }} + {{ 'paginator.next'|trans }}
  • {% endif %} diff --git a/templates/blog/post_show.html.twig b/templates/blog/post_show.html.twig index aa189a620..928e2dc41 100644 --- a/templates/blog/post_show.html.twig +++ b/templates/blog/post_show.html.twig @@ -6,8 +6,8 @@

    {{ post.title }}

    {{ post.content|markdown_to_html|sanitize_html }} @@ -28,7 +28,7 @@ {% else %}

    - {{ 'action.sign_in'|trans }} + {{ 'action.sign_in'|trans }} {{ 'post.to_publish_a_comment'|trans }}

    @@ -36,7 +36,7 @@

    - {{ 'post.num_comments'|trans({ 'count': post.comments|length }) }} + {{ 'post.num_comments'|trans({ 'count': post.comments|length }) }}

    {% for comment in post.comments %} @@ -64,7 +64,7 @@ {% if is_granted('edit', post) %} {% endif %} diff --git a/templates/bundles/TwigBundle/Exception/error403.html.twig b/templates/bundles/TwigBundle/Exception/error403.html.twig index 6a05679b8..134d11e37 100644 --- a/templates/bundles/TwigBundle/Exception/error403.html.twig +++ b/templates/bundles/TwigBundle/Exception/error403.html.twig @@ -13,7 +13,7 @@ {% block body_id 'error' %} {% block main %} -

    {{ 'http_error.name'|trans({ 'status_code': 403 }) }}

    +

    {{ 'http_error.name'|trans({ 'status_code': 403 }) }}

    {{ 'http_error_403.description'|trans }} diff --git a/templates/debug/source_code.html.twig b/templates/debug/source_code.html.twig index 21fc3fbee..9aab406e7 100644 --- a/templates/debug/source_code.html.twig +++ b/templates/debug/source_code.html.twig @@ -4,14 +4,14 @@

    diff --git a/templates/security/login.html.twig b/templates/security/login.html.twig index 567b1bf7c..ec627e96d 100644 --- a/templates/security/login.html.twig +++ b/templates/security/login.html.twig @@ -20,7 +20,7 @@
    - {{ 'title.login'|trans }} + {{ 'title.login'|trans }}
    @@ -29,7 +29,7 @@
    - +
    @@ -41,7 +41,7 @@
    @@ -50,7 +50,7 @@

    - + {{ 'help.login_users'|trans }}

    @@ -69,7 +69,9 @@ kitten ROLE_USER ({{ 'help.role_user'|trans }}) - + @@ -77,7 +79,9 @@ kitten ROLE_ADMIN ({{ 'help.role_admin'|trans }}) - + diff --git a/templates/user/change_password.html.twig b/templates/user/change_password.html.twig index 82421c75d..f2cbf8b9d 100644 --- a/templates/user/change_password.html.twig +++ b/templates/user/change_password.html.twig @@ -11,7 +11,7 @@ {{ form_widget(form) }} {{ form_end(form) }} {% endblock %} @@ -19,7 +19,7 @@ {% block sidebar %} diff --git a/templates/user/edit.html.twig b/templates/user/edit.html.twig index 126635e39..dac13a7bb 100644 --- a/templates/user/edit.html.twig +++ b/templates/user/edit.html.twig @@ -9,7 +9,7 @@ {{ form_widget(form) }} {{ form_end(form) }} {% endblock %} @@ -17,7 +17,7 @@ {% block sidebar %}