From b8e9a02a14a2ce6d3b1d5bb67b6738ffa6e32943 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 24 May 2025 23:03:21 +0200 Subject: [PATCH 1/3] style stylee style --- config/bundles.php | 66 +++++++++++++++---- config/packages/asset_mapper.php | 4 +- config/packages/symfonycasts_tailwind.php | 4 +- importmap.php | 2 +- .../Controller/FoodOrderControllerTest.php | 15 ++++- tests/Unit/ExampleTest.php | 19 ++++-- 6 files changed, 80 insertions(+), 30 deletions(-) diff --git a/config/bundles.php b/config/bundles.php index 7738f19..6a662f2 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,16 +1,56 @@ - ['all' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Liip\TestFixturesBundle\LiipTestFixturesBundle::class => ['dev' => true, 'test' => true], - Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true], + FrameworkBundle::class => [ + 'all' => true, + ], + MakerBundle::class => [ + 'dev' => true, + ], + DoctrineBundle::class => [ + 'all' => true, + ], + DoctrineMigrationsBundle::class => [ + 'all' => true, + ], + TwigBundle::class => [ + 'all' => true, + ], + DoctrineFixturesBundle::class => [ + 'dev' => true, + 'test' => true, + ], + WebProfilerBundle::class => [ + 'dev' => true, + 'test' => true, + ], + SecurityBundle::class => [ + 'all' => true, + ], + NelmioCorsBundle::class => [ + 'all' => true, + ], + ApiPlatformBundle::class => [ + 'all' => true, + ], + LiipTestFixturesBundle::class => [ + 'dev' => true, + 'test' => true, + ], + SymfonycastsTailwindBundle::class => [ + 'all' => true, + ], ]; diff --git a/config/packages/asset_mapper.php b/config/packages/asset_mapper.php index 4b68e6a..3a3cc5f 100644 --- a/config/packages/asset_mapper.php +++ b/config/packages/asset_mapper.php @@ -1,6 +1,4 @@ -filter('tbody tr'); - $tdContent = $rows->eq(0)->filter('td')->eq(2)->text(); + $tdContent = $rows->eq(0) + ->filter('td') + ->eq(2) + ->text(); $this->assertEquals('A', $tdContent); - $tdContent = $rows->eq(1)->filter('td')->eq(2)->text(); + $tdContent = $rows->eq(1) + ->filter('td') + ->eq(2) + ->text(); $this->assertEquals('B', $tdContent); - $tdContent = $rows->eq(2)->filter('td')->eq(2)->text(); + $tdContent = $rows->eq(2) + ->filter('td') + ->eq(2) + ->text(); $this->assertEquals('C', $tdContent); }); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 9ff5eae..029be1b 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,15 +2,20 @@ test('example test', function (): void { // This is a simple example test - expect(true)->toBeTrue(); - expect(1 + 1)->toBe(2); - expect('hello world')->toContain('world'); + expect(true) + ->toBeTrue(); + expect(1 + 1) + ->toBe(2); + expect('hello world') + ->toContain('world'); }); test('array operations', function (): void { $array = [1, 2, 3]; - - expect($array)->toHaveCount(3); - expect($array)->toContain(2); + + expect($array) + ->toHaveCount(3); + expect($array) + ->toContain(2); expect($array[0])->toBe(1); -}); \ No newline at end of file +}); From ab9f1bfeec32477da4e284f6906b22586c377723 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 24 May 2025 23:11:42 +0200 Subject: [PATCH 2/3] implement darkmode --- tailwind.config.js | 1 + templates/_form.html.twig | 12 ++-- templates/base.html.twig | 31 +++++---- templates/food_order/index.html.twig | 28 ++++---- templates/food_order/new.html.twig | 6 +- templates/food_order/show.html.twig | 86 ++++++++++++------------ templates/food_order/table_row.html.twig | 12 ++-- templates/food_vendor/index.html.twig | 24 +++---- templates/username.html.twig | 4 +- 9 files changed, 104 insertions(+), 100 deletions(-) diff --git a/tailwind.config.js b/tailwind.config.js index bb226fb..531385f 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,6 +4,7 @@ module.exports = { "./assets/**/*.js", "./templates/**/*.html.twig", ], + darkMode: 'media', // Use 'media' to respect the user's system preference theme: { extend: {}, }, diff --git a/templates/_form.html.twig b/templates/_form.html.twig index ed94f7a..6fe4982 100644 --- a/templates/_form.html.twig +++ b/templates/_form.html.twig @@ -2,23 +2,23 @@ {% for field in form %} {% if field.vars.name != '_token' %}
- {{ form_label(field, null, {'label_attr': {'class': 'block text-sm font-medium leading-6 text-gray-900'}}) }} + {{ form_label(field, null, {'label_attr': {'class': 'block text-sm font-medium leading-6 text-gray-900 dark:text-gray-100'}}) }}
- {{ form_widget(field, {'attr': {'class': 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6'}}) }} + {{ form_widget(field, {'attr': {'class': 'block w-full rounded-md border-0 py-1.5 text-gray-900 dark:text-gray-100 bg-white dark:bg-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-600 placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-500 sm:text-sm sm:leading-6'}}) }}
{% if field.vars.errors|length > 0 %} -
+
{{ form_errors(field) }}
{% endif %} {% if field.vars.help is defined and field.vars.help %} -

{{ field.vars.help }}

+

{{ field.vars.help }}

{% endif %}
{% endif %} {% endfor %}
- Cancel - + Cancel +
{{ form_end(form) }} diff --git a/templates/base.html.twig b/templates/base.html.twig index e988ac8..a594641 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,8 +1,11 @@ - + + + + {% block title %}Welcome!{% endblock %} - Futtern @@ -13,9 +16,9 @@ {{ importmap() }} {% endblock %} - +
-
@@ -26,27 +26,27 @@
-
- - +
+
+ - - - - + + + + - + {% for food_order in food_orders %} {{ include('food_order/table_row.html.twig') }} {% endfor %} {% if food_orders|length < 10 %} - @@ -60,10 +60,10 @@
{% if prev_page > 0 %} - Previous Page + Previous Page {% endif %} {% if next_page > current_page %} - Next Page + Next Page {% endif %}
{% endblock %} diff --git a/templates/food_order/new.html.twig b/templates/food_order/new.html.twig index 5ce374f..3447325 100644 --- a/templates/food_order/new.html.twig +++ b/templates/food_order/new.html.twig @@ -1,7 +1,7 @@ -
+
-

Create New Order

-
+

Create New Order

+

Fill out the form below to create a new food order.

diff --git a/templates/food_order/show.html.twig b/templates/food_order/show.html.twig index 2590d51..9ab1ef2 100644 --- a/templates/food_order/show.html.twig +++ b/templates/food_order/show.html.twig @@ -5,91 +5,91 @@ {% block header %}Order Details{% endblock %} {% block body %} -
+
-

Order Information

-

Details about the food order from {{ food_order.foodVendor.name }}.

+

Order Information

+

Details about the food order from {{ food_order.foodVendor.name }}.

-
+
-
-
Vendor
-
{{ food_order.foodVendor.name }}
+
+
Vendor
+
{{ food_order.foodVendor.name }}
-
-
Vendor Phone
-
{{ food_order.foodVendor.phone }}
+
+
Vendor Phone
+
{{ food_order.foodVendor.phone }}
-
-
Created By
-
{{ food_order.createdBy }}
+
+
Created By
+
{{ food_order.createdBy }}
-
-
Created At
-
{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}
+
+
Created At
+
{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}
-
-
Closed At
-
{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s', 'Europe/Berlin') : 'Not closed yet' }}
+
+
Closed At
+
{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s', 'Europe/Berlin') : 'Not closed yet' }}
- + Back to list {% if(food_order.isClosed) %} - + Reopen Order {% else %} - + Close Order {% endif %}
-
+
-

Order Items

-

Items included in this order.

+

Order Items

+

Items included in this order.

-
-
Created ByVendorCreated AtClosed AtCreated ByVendorCreated AtClosed At Actions
- Check the archive + + Check the archive for older orders
- +
+
+ - - - - + + + + - + {% for item in food_order.orderItemsSortedByName %} - - - - - + + + + + diff --git a/templates/food_order/table_row.html.twig b/templates/food_order/table_row.html.twig index 07da5d7..a3d9817 100644 --- a/templates/food_order/table_row.html.twig +++ b/templates/food_order/table_row.html.twig @@ -1,9 +1,9 @@ - - - - - + + + + + diff --git a/templates/food_vendor/index.html.twig b/templates/food_vendor/index.html.twig index 39e216e..53f50c1 100644 --- a/templates/food_vendor/index.html.twig +++ b/templates/food_vendor/index.html.twig @@ -7,12 +7,12 @@ {% block body %}
-

+

Manage your food vendors and create new ones.

@@ -21,28 +21,28 @@
-
-
#UsernameItem NameExtras#UsernameItem NameExtras Actions
{{ loop.index }}{{ item.createdBy }}{{ item.name }}{{ item.extras }}
{{ loop.index }}{{ item.createdBy }}{{ item.name }}{{ item.extras }} {% if(food_order.isClosed) %} - Order closed + Order closed {% else %} - Edit - Copy - Remove + Edit + Copy + Remove {% endif %}
{{ food_order.createdBy }}{{ food_order.foodVendor.name }}{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}
{{ food_order.createdBy }}{{ food_order.foodVendor.name }}{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }} - View, order from {{ food_order.createdBy }} + View, order from {{ food_order.createdBy }}
- +
+
+ - + - + {% for food_vendor in food_vendors %} - - + + {% else %} - + {% endfor %} diff --git a/templates/username.html.twig b/templates/username.html.twig index e9bc18b..a7e85d3 100644 --- a/templates/username.html.twig +++ b/templates/username.html.twig @@ -5,9 +5,9 @@ {% block header %}Tell me your name{% endblock %} {% block body %} -
+
-
+

By submitting the form, you agree that your username will be stored as a cookie.

{{ include('_form.html.twig') }} From 4e1ea20fe7bebd6fbceb764c636a84215432df31 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 24 May 2025 23:14:13 +0200 Subject: [PATCH 3/3] remove useless console.log --- assets/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/app.js b/assets/app.js index 6174cc6..05ff425 100644 --- a/assets/app.js +++ b/assets/app.js @@ -6,4 +6,3 @@ */ import './styles/app.css'; -console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');
NameName Actions
{{ food_vendor.name }}
{{ food_vendor.name }} - View - Edit + View + Edit
No vendors foundNo vendors found