-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b67fa0d
commit 620d828
Showing
28 changed files
with
394 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
|
||
export default class extends Controller { | ||
async show(e) { | ||
const seeMediasBlock = document.getElementById('see-medias-block'); | ||
seeMediasBlock.style.display = 'none'; | ||
const dNone = document.querySelectorAll('.d-none'); | ||
dNone.forEach((element) => { | ||
element.classList.remove('d-none'); | ||
}); | ||
e.preventDefault(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20240126180522 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql('ALTER TABLE trick ADD main_image_id INT DEFAULT NULL'); | ||
$this->addSql('ALTER TABLE trick ADD CONSTRAINT FK_D8F0A91EE4873418 FOREIGN KEY (main_image_id) REFERENCES image (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); | ||
$this->addSql('CREATE INDEX IDX_D8F0A91EE4873418 ON trick (main_image_id)'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql('CREATE SCHEMA public'); | ||
$this->addSql('ALTER TABLE trick DROP CONSTRAINT FK_D8F0A91EE4873418'); | ||
$this->addSql('DROP INDEX IDX_D8F0A91EE4873418'); | ||
$this->addSql('ALTER TABLE trick DROP main_image_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<form method="post" action="{{ action }}"> | ||
<input type="hidden" name="_token" value="{{ value }}"> | ||
<button class="btn btn-danger">{{ content }}</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<button type="button" class="btn {{ btn_class }}" data-bs-toggle="modal" data-bs-target="#{{ target }}"> | ||
{{ content }} | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
{% block title %}Edit {{ name|capitalize }}{% endblock %} | ||
|
||
{% block body %} | ||
<div class="container"> | ||
<h1>Edit {{ name|capitalize }}</h1> | ||
|
||
{{ include(name ~ '/_form.html.twig', { | ||
'button_label': 'Update', | ||
delete: true | ||
}) }} | ||
|
||
<p class="text-center"> | ||
<a href="{{ path('app_' ~ name ~ '_index') }}">back to list</a> | ||
</p> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
{% block title %}New {{ name|capitalize }}{% endblock %} | ||
|
||
{% block body %} | ||
<div class="container"> | ||
<h1>Create new {{ name|capitalize }}</h1> | ||
|
||
{{ include(name ~ '/_form.html.twig') }} | ||
|
||
<p class="text-center"> | ||
<a href="{{ path('app_' ~ name ~ '_index') }}">back to list</a> | ||
</p> | ||
</div> | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
{{ form_start(form) }} | ||
{{ form_widget(form) }} | ||
<button class="btn">{{ button_label|default('Save') }}</button> | ||
|
||
<div class="d-flex justify-content-between"> | ||
<button class="btn btn-{% if delete is defined %}warning{% else %}primary{% endif %}">{{ button_label|default('Save') }}</button> | ||
{% if delete is defined %} | ||
{{ include('_inc/_modal_button.html.twig', { | ||
btn_class: 'btn-danger', | ||
content: 'Delete', | ||
target: 'image-' ~ image.id | ||
}) }} | ||
{% endif %} | ||
</div> | ||
{{ form_end(form) }} | ||
|
||
{% if delete is defined %} | ||
{{ include('_inc/_modal.html.twig', { | ||
id: image.id, | ||
htmlName: 'image', | ||
name: image.name, | ||
includeForm: include('_inc/_delete_form.html.twig', { | ||
action: path('app_image_delete', {'id': image.id}), | ||
content: 'Delete', | ||
value: csrf_token('delete' ~ image.id), | ||
}) | ||
}) }} | ||
{% endif %} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.