2023-03-28 15:47:09 -04:00
{% extends 'extras/script/base.html' %}
2019-08-09 12:33:33 -04:00
{% load helpers %}
{% load form_helpers %}
{% load log_levels %}
2022-01-05 09:09:39 -05:00
{% block content %}
2023-03-28 15:47:09 -04:00
< div class = "row" >
< div class = "col" >
{% if not perms.extras.run_script %}
< div class = "alert alert-warning" >
< i class = "mdi mdi-alert" > < / i >
You do not have permission to run scripts.
< / div >
{% endif %}
< form action = "" method = "post" enctype = "multipart/form-data" class = "form form-object-edit" >
{% csrf_token %}
< div class = "field-group my-4" >
2023-07-10 20:00:51 +05:30
{# Render grouped fields according to declared fieldsets #}
{% for group, fields in script.get_fieldsets %}
{% if fields %}
2023-04-17 11:53:05 -04:00
< div class = "field-group mb-5" >
< div class = "row mb-2" >
< h5 class = "offset-sm-3" > {{ group }}< / h5 >
2023-03-14 15:50:49 -04:00
< / div >
2023-04-17 11:53:05 -04:00
{% for name in fields %}
{% with field=form|getfield:name %}
{% render_field field %}
{% endwith %}
{% endfor %}
2022-01-05 09:09:39 -05:00
< / div >
2023-07-10 20:00:51 +05:30
{% endif %}
{% endfor %}
2023-03-28 15:47:09 -04:00
< / div >
< div class = "float-end" >
< a href = "{% url 'extras:script_list' %}" class = "btn btn-outline-danger" > Cancel< / a >
< button type = "submit" name = "_run" class = "btn btn-primary" { % if not perms . extras . run_script % } disabled = "disabled" { % endif % } > < i class = "mdi mdi-play" > < / i > Run Script< / button >
< / div >
< / form >
2019-08-09 12:33:33 -04:00
< / div >
2021-08-13 09:43:23 -04:00
< / div >
2022-01-05 09:09:39 -05:00
{% endblock content %}