configstuff
This commit is contained in:
parent
ca0e7d300d
commit
c3411e5754
12 changed files with 243 additions and 121 deletions
|
@ -24,6 +24,9 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path('app_system_config_index') }}">System Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group ms-auto" role="group" aria-label="Mode selection">
|
||||
<input type="radio" class="btn-check" name="mode" id="normal" autocomplete="off" checked>
|
||||
|
|
4
templates/system_config/_form.html.twig
Normal file
4
templates/system_config/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
4
templates/system_config/_reset_form.html.twig
Normal file
4
templates/system_config/_reset_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_system_config_reset', {'id': system_config.id}) }}" onsubmit="return confirm('Are you sure you want to reset this setting to its default value?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('reset' ~ system_config.id) }}">
|
||||
<button class="btn">Reset</button>
|
||||
</form>
|
13
templates/system_config/edit.html.twig
Normal file
13
templates/system_config/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit System Setting{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit System Setting: {{ system_config.key.name }}</h1>
|
||||
|
||||
{{ include('system_config/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_system_config_index') }}">back to list</a>
|
||||
|
||||
{{ include('system_config/_reset_form.html.twig') }}
|
||||
{% endblock %}
|
32
templates/system_config/index.html.twig
Normal file
32
templates/system_config/index.html.twig
Normal file
|
@ -0,0 +1,32 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}System Settings{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>System Settings</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th>Value</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for system_config in system_configs %}
|
||||
<tr>
|
||||
<td>{{ system_config.description }}</td>
|
||||
<td>{{ system_config.value }}</td>
|
||||
<td>
|
||||
<a class="btn btn-primary" href="{{ path('app_system_config_edit', {'id': system_config.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue