update templates introduce request helper
This commit is contained in:
20533
templates/Froxlor/src/css/dark.css
Normal file
20533
templates/Froxlor/src/css/dark.css
Normal file
File diff suppressed because it is too large
Load Diff
20588
templates/Froxlor/src/css/main.css
Normal file
20588
templates/Froxlor/src/css/main.css
Normal file
File diff suppressed because it is too large
Load Diff
12
templates/Froxlor/src/templates/Froxlor/assets/css/dark.css
Normal file
12
templates/Froxlor/src/templates/Froxlor/assets/css/dark.css
Normal file
File diff suppressed because one or more lines are too long
12
templates/Froxlor/src/templates/Froxlor/assets/css/main.css
Normal file
12
templates/Froxlor/src/templates/Froxlor/assets/css/main.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* Bootstrap v5.1.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Sizzle CSS Selector Engine v2.3.6
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright JS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://js.foundation/
|
||||
*
|
||||
* Date: 2021-02-16
|
||||
*/
|
||||
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.6.0
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* https://sizzlejs.com/
|
||||
*
|
||||
* Copyright OpenJS Foundation and other contributors
|
||||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2021-03-02T17:08Z
|
||||
*/
|
||||
52
templates/Froxlor/table/table.html.twig
Normal file
52
templates/Froxlor/table/table.html.twig
Normal file
@@ -0,0 +1,52 @@
|
||||
{% macro table(table_options, api_response, action, title = "") %}
|
||||
|
||||
<form action="{{ action|default("") }}" method="post" enctype="application/x-www-form-urlencoded" class="form">
|
||||
{% if title is not empty %}
|
||||
<h3 class="page-header">
|
||||
{% if table_options.icon is not empty %}
|
||||
<i class="{{ table_options.icon }}"></i>
|
||||
{% endif %}
|
||||
{{ title }}
|
||||
</h3>
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
<table class="table table-borderless table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for column in table_options.visible_columns %}
|
||||
<th class="p-3">{{ table_options.columns[column].title }}</th>
|
||||
{% endfor %}
|
||||
{% if table_options.actions %}
|
||||
<th class="p-3 text-end">Actions</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in api_response.list %}
|
||||
<tr>
|
||||
{% for column in table_options.visible_columns %}
|
||||
<td class="p-3">{{ item[column] }}</td>
|
||||
{% endfor %}
|
||||
{% if table_options.actions %}
|
||||
<th class="p-3 text-end">
|
||||
{% for action in table_options.actions %}
|
||||
{% if action.href is not empty %}
|
||||
<a href="{{ action.href }}">{% if action.icon is not empty %}<i class="{{ action.icon }}"></i>{% endif %}{{ action.title }}</a>
|
||||
{% else %}
|
||||
{% if action.icon is not empty %}<i class="{{ action.icon }}"></i>{% endif %}{{ action.title }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card-footer">
|
||||
Pagination...
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endmacro %}
|
||||
9
templates/Froxlor/user/table.html.twig
Normal file
9
templates/Froxlor/user/table.html.twig
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends "Froxlor/userarea.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% import "Froxlor/table/table.html.twig" as table %}
|
||||
|
||||
{{ table.table(table_options, api_response, '#', table_options.title) }}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user