CRUD for domains & playing with symfony stimulus

This commit is contained in:
2023-10-14 03:15:46 -06:00
parent 3ed53ac05e
commit 39e94d8bdc
13 changed files with 622 additions and 368 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
<i class="fas fa-comments fa-fw me-3"></i>
<span>Comments</span>
</a>
<a href="#" class="list-group-item list-group-item-action py-2 ripple">
<a href="{{ path('app_domain_index') }}" class="list-group-item list-group-item-action py-2 ripple">
<i class="fas fa-globe fa-fw me-3"></i>
<span>Domains</span>
</a>
+4
View File
@@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_domain_delete', {'id': domain.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ domain.id) }}">
<button class="btn">Delete</button>
</form>
+4
View File
@@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
+13
View File
@@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit Domain{% endblock %}
{% block body %}
<h1>Edit Domain</h1>
{{ include('domain/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_domain_index') }}">back to list</a>
{{ include('domain/_delete_form.html.twig') }}
{% endblock %}
+43
View File
@@ -0,0 +1,43 @@
{% extends 'base.html.twig' %}
{% block title %}Domain List{% endblock %}
{% block body %}
<h1>Domain List</h1>
<table class="table">
<thead>
<tr>
<th>Domain</th>
<th>Name</th>
<th>Enabled</th>
<th>DefaultSortPolicy</th>
<th>UpdatedAt</th>
<th>CreatedAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for domain in domains %}
<tr>
<td>{{ domain.domain }}</td>
<td>{{ domain.name }}</td>
<td>{{ domain.enabled ? 'Yes' : 'No' }}</td>
<td>{{ domain.getDefaultSortPolicyName }}</td>
<td>{{ domain.updatedAt ? domain.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ domain.createdAt ? domain.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>
<a href="{{ path('app_domain_show', {'id': domain.id}) }}">show</a>
<a href="{{ path('app_domain_edit', {'id': domain.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="9">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_domain_new') }}">Create new</a>
{% endblock %}
+11
View File
@@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New Domain{% endblock %}
{% block body %}
<h1>Create new Domain</h1>
{{ include('domain/_form.html.twig') }}
<a href="{{ path('app_domain_index') }}">back to list</a>
{% endblock %}
+50
View File
@@ -0,0 +1,50 @@
{% extends 'base.html.twig' %}
{% block title %}Domain{% endblock %}
{% block body %}
<h1>Domain</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ domain.id }}</td>
</tr>
<tr>
<th>Domain</th>
<td>{{ domain.domain }}</td>
</tr>
<tr>
<th>OwnerToken</th>
<td>{{ domain.ownerToken }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ domain.name }}</td>
</tr>
<tr>
<th>Enabled</th>
<td>{{ domain.enabled ? 'Yes' : 'No' }}</td>
</tr>
<tr>
<th>DefaultSortPolicy</th>
<td>{{ domain.getDefaultSortPolicyName }}</td>
</tr>
<tr>
<th>UpdatedAt</th>
<td>{{ domain.updatedAt ? domain.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ domain.createdAt ? domain.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_domain_index') }}">back to list</a>
<a href="{{ path('app_domain_edit', {'id': domain.id}) }}">edit</a>
{{ include('domain/_delete_form.html.twig') }}
{% endblock %}