diff --git a/assets/app.js b/assets/app.js index 17e1647..29f729d 100644 --- a/assets/app.js +++ b/assets/app.js @@ -38,6 +38,7 @@ import './styles/main/desktop.scss'; import './styles/main/reset.scss'; import './styles/prize/prize-index.scss'; +import './styles/prize/prize-form.scss'; import './styles/gameplayed.scss'; import './styles/leaderboard.scss'; diff --git a/assets/styles/event/event-form.scss b/assets/styles/event/event-form.scss index 378ea4b..62d0ffd 100644 --- a/assets/styles/event/event-form.scss +++ b/assets/styles/event/event-form.scss @@ -6,6 +6,7 @@ flex-direction: column; justify-content: center; align-items: center; + gap: .5rem; form { @@ -23,7 +24,6 @@ } .big-btn { - // margin-top: 2.5rem; width: 50%; } } @@ -38,10 +38,6 @@ .container { form { width: 70%; - - & > div { - - } } } } diff --git a/assets/styles/forms/global.scss b/assets/styles/forms/global.scss index 89fc4a2..e5816d1 100644 --- a/assets/styles/forms/global.scss +++ b/assets/styles/forms/global.scss @@ -30,9 +30,14 @@ form textarea:hover { display: flex; flex-direction: column; align-items: center; + gap: 1rem; & > div { - // width: 50%; + .vich-file { + div, a { + display: none; + } + } label, input { cursor: pointer; @@ -41,7 +46,7 @@ form textarea:hover { label { display: none; - margin-top: 1rem; + margin-bottom: .5rem; text-align: center; font-size: 1.2rem; @@ -67,7 +72,7 @@ form textarea:hover { box-shadow: $shadow; padding: .25rem 1.25rem; - margin-top: .5rem; + // margin-top: .5rem; &:hover { border: 1px solid #06CCF8; diff --git a/assets/styles/game/game-form.scss b/assets/styles/game/game-form.scss index 8ad1542..ecfa0ad 100644 --- a/assets/styles/game/game-form.scss +++ b/assets/styles/game/game-form.scss @@ -2,6 +2,12 @@ #game-form .content .container { form { + .vich-file { + div, a { + display: none; + } + } + input:hover, textarea:hover { border: 1px solid #0982cd; @@ -36,12 +42,6 @@ height: 46px; } - .vich-file { - div, a { - display: none; - } - } - select { option { color: #5755ce; @@ -72,19 +72,8 @@ align-items: center; } - button#add-edit-game { - border-radius: $borderRadiusMedium; - border: 0.5px $colorGradient1; - background: $colorGradient5; - color : #020051; - width: 288px; - height: 50px; - text-align: center; - font-size: 18px; - margin-left: calc(50% - 144px); - margin-top: 24px; - - cursor: pointer; + .big-btn { + width: 30%; } } } diff --git a/assets/styles/main/app.scss b/assets/styles/main/app.scss index 8308f00..0219046 100644 --- a/assets/styles/main/app.scss +++ b/assets/styles/main/app.scss @@ -261,8 +261,6 @@ button { &:hover { transform: scale(102%); } - - transition: background-color ease-in-out 100ms; } h2:hover { diff --git a/assets/styles/prize/prize-form.scss b/assets/styles/prize/prize-form.scss new file mode 100644 index 0000000..b85200d --- /dev/null +++ b/assets/styles/prize/prize-form.scss @@ -0,0 +1,43 @@ +@import "../main/_variables"; + +#prize-form { + .container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + form { + + & > div { + width: 100%; + + label { + display: block; + } + + & > div { + display: flex; + gap: 1rem; + } + } + + .big-btn { + width: 50%; + } + } + } +} + +// + +@media screen and (min-width: $desktopWidth) { + + #prize-form { + .container { + form { + width: 70%; + } + } + } +} diff --git a/migrations/Version20240207152234.php b/migrations/Version20240207155635.php similarity index 99% rename from migrations/Version20240207152234.php rename to migrations/Version20240207155635.php index d3fb76e..bcd674e 100644 --- a/migrations/Version20240207152234.php +++ b/migrations/Version20240207155635.php @@ -10,7 +10,7 @@ /** * Auto-generated Migration: Please modify to your needs! */ -final class Version20240207152234 extends AbstractMigration +final class Version20240207155635 extends AbstractMigration { public function getDescription(): string { diff --git a/src/Form/PrizeFormType.php b/src/Form/PrizeFormType.php index 961830b..d056210 100644 --- a/src/Form/PrizeFormType.php +++ b/src/Form/PrizeFormType.php @@ -31,6 +31,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], ]) ->add('description', TextareaType::class, [ + 'attr' => [ + 'rows' => 3 + ], 'constraints' => [ new NotBlank([ 'message' => 'Please enter the description', diff --git a/templates/event/_delete_form.html 2.twig b/templates/event/_delete_form.html 2.twig deleted file mode 100644 index 2352fc7..0000000 --- a/templates/event/_delete_form.html 2.twig +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
\ No newline at end of file diff --git a/templates/event/_form.html 2.twig b/templates/event/_form.html 2.twig deleted file mode 100644 index d2e93cc..0000000 --- a/templates/event/_form.html 2.twig +++ /dev/null @@ -1,11 +0,0 @@ -{{ form_start(form) }} - {# {{ form_widget(form) }} #} - {{ form_row(form.label) }} - {{ form_row(form.description) }} - {{ form_row(form.startDate) }} - {{ form_row(form.endDate) }} - {{ form_row(form.isVisible, {'attr': {'class': 'switch'}}) }} - {{ form_row(form.game) }} - - -{{ form_end(form) }} \ No newline at end of file diff --git a/templates/event/edit.html 2.twig b/templates/event/edit.html 2.twig deleted file mode 100644 index a2fe96f..0000000 --- a/templates/event/edit.html 2.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block content %} - -
-
-

{{ event.label }}

- - {# back to list #} - -
- {% include 'event/_form.html.twig' %} - {% include 'event/_delete_form.html.twig' %} -
-
-
- -{% endblock %} diff --git a/templates/event/index.html 2.twig b/templates/event/index.html 2.twig deleted file mode 100644 index 004ef2d..0000000 --- a/templates/event/index.html 2.twig +++ /dev/null @@ -1,128 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block javascript %} - {{ parent() }} - {{ encore_entry_script_tags('carousel-big') }} - {{ encore_entry_script_tags('inputs') }} - - {% if is_granted('ROLE_ADMIN') %} - {{ encore_entry_script_tags('toggle') }} - {% endif %} -{% endblock javascript %} - -{% block content %} - - {% if is_granted('ROLE_ADMIN') %} -
- -

Hidden // Visible

-
- - {{ form_start(isVisibleForm) }} - {{ form_widget(isVisibleForm.isVisible, {'attr': {'class': 'isVisible'}}) }} - {{ form_end(isVisibleForm) }} - -
-
- - Add new game icon -

New event

-
-
-
- {% endif %} - - {% if events is not empty %} - - {% set nbSlides = (events|length / 6)|format_number({rounding_mode: 'ceiling', fraction_digit: 0}) %} - - - - - {% else %} - - {% endif %} - -{% endblock %} diff --git a/templates/event/new.html 2.twig b/templates/event/new.html 2.twig deleted file mode 100644 index 5d51ec4..0000000 --- a/templates/event/new.html 2.twig +++ /dev/null @@ -1,19 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block content %} - -
-
-

Event details

- - {# Back to list #} - -
- - {% include 'event/_form.html.twig' %} - -
-
-
- -{% endblock %} diff --git a/templates/event/show.html 2.twig b/templates/event/show.html 2.twig deleted file mode 100644 index 3c63412..0000000 --- a/templates/event/show.html 2.twig +++ /dev/null @@ -1,42 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block content %} - -
-
-

{{ event.label|upper }}

- -
- -

{{ event.description }}

-
    -
  • -
    {{ event.startDate ? event.startDate|date('D') : '' }}
    -
    {{ event.startDate ? event.startDate|date('d M Y') : '' }}
    -
    {{ event.startDate ? event.startDate|date('H:i') : '' }}
    -
  • -
  • -
    {{ event.endDate ? event.endDate|date('D') : '' }}
    -
    {{ event.endDate ? event.endDate|date('d M Y') : '' }}
    -
    {{ event.endDate ? event.endDate|date('H:i') : '' }}
    -
  • -
- - {# back to list #} - - {% if is_granted('ROLE_ADMIN') %} - {% include 'event/_delete_form.html.twig' %} - - - - {% else %} - - - - {% endif %} -
- -
-
- -{% endblock %} diff --git a/templates/game/_form.html.twig b/templates/game/_form.html.twig index b0406f1..fd35adf 100644 --- a/templates/game/_form.html.twig +++ b/templates/game/_form.html.twig @@ -51,8 +51,6 @@ {{ form_widget(gameForm.isVirtual, {'attr': {'class': 'switch'}}) }}

Do you want to make this game visible ?

{{ form_widget(gameForm.isVisible, {'attr': {'class': 'switch'}}) }} -
- -
+ {{ form_end(gameForm) }} diff --git a/templates/prize/_form.html.twig b/templates/prize/_form.html.twig index d347cf2..cac3379 100644 --- a/templates/prize/_form.html.twig +++ b/templates/prize/_form.html.twig @@ -1,18 +1,18 @@ -
+{#
#} {{ form_start(prizeForm) }} -
- {{ form_errors(prizeForm) }} + {#
#} + {{ form_errors(prizeForm) }} - {{ form_row(prizeForm.label) }} - {{ form_row(prizeForm.description, {'attr': {'class': 'description'}}) }} - {{ form_row(prizeForm.posterFile) }} - {{ form_row(prizeForm.value) }} - {{ form_row(prizeForm.quantity) }} + {{ form_row(prizeForm.label) }} + {{ form_row(prizeForm.description, {'attr': {'class': 'description'}}) }} + {{ form_row(prizeForm.posterFile) }} + {{ form_row(prizeForm.value) }} + {{ form_row(prizeForm.quantity) }} -
- -
-
+ {#
+ +
#} + + {#
#} {{ form_end(prizeForm) }} - - +{#
#} \ No newline at end of file diff --git a/templates/prize/edit.html.twig b/templates/prize/edit.html.twig index 382b5cf..721354c 100644 --- a/templates/prize/edit.html.twig +++ b/templates/prize/edit.html.twig @@ -1,10 +1,14 @@ {% extends 'base.html.twig' %} {% block content %} -
+ +
-

Edit Game

- {{ include('prize/_form.html.twig') }} +

Prize Details

+ +
+ {{ include('prize/_form.html.twig') }} +
{% endblock %} \ No newline at end of file diff --git a/templates/prize/new.html.twig b/templates/prize/new.html.twig index 0d62fc9..9026d1a 100644 --- a/templates/prize/new.html.twig +++ b/templates/prize/new.html.twig @@ -2,12 +2,14 @@ {% block content %} -
+

Add New Prize

- {{ include('prize/_form.html.twig') }} +
+ {{ include('prize/_form.html.twig') }} +