83 lines
2.9 KiB
HTML
83 lines
2.9 KiB
HTML
{% extends 'base_structure/layout/base_template.html' %}
|
|
{% load static %}
|
|
{% block stylesheet %}
|
|
<!-- include required css cdn link through html here -->
|
|
|
|
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="row layout-top-spacing">
|
|
<div class="col-lg-12">
|
|
<div class="row mb-2">
|
|
<div class="col">
|
|
<a href="{% url 'module_cms:faq'%}" style="height: fit-content;width: fit-content;display: inline-block;">
|
|
<h3 class="card-title m-2 d-flex align-items-center gap-2" style="width: fit-content;"><span class="fw-bold material-symbols-outlined">
|
|
arrow_back
|
|
</span><span>{{operation}} Faq</span></h3>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="row layout-spacing">
|
|
<div class="col-lg-12">
|
|
<div class="statbox widget box box-shadow">
|
|
<div class="widget-content widget-content-area">
|
|
|
|
<form method="POST" id="faqs_form">
|
|
{% csrf_token %}
|
|
{% include 'base_structure/includes/dynamic_template_form.html' with form=form %}
|
|
<div class="mt-4 mb-0">
|
|
<div class="d-grid"><button class="btn btn-primary btn-block" type="submit">Submit</button></div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{% endblock content %}
|
|
|
|
{% block javascript %}
|
|
<!-- include required js cdn link through html here -->
|
|
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Initialize form validation
|
|
$("#faqs_form").validate({
|
|
rules: {
|
|
question: {
|
|
required: true
|
|
},
|
|
answer: {
|
|
required: true
|
|
}
|
|
},
|
|
messages: {
|
|
question: {
|
|
required: "Please enter a question."
|
|
},
|
|
answer: {
|
|
required: "Please enter an answer."
|
|
}
|
|
},
|
|
errorElement: 'div',
|
|
errorPlacement: function(error, element) {
|
|
error.addClass('invalid-feedback');
|
|
$(element).closest('.form-group').append(error);
|
|
},
|
|
highlight: function(element, errorClass, validClass) {
|
|
$(element).addClass('is-invalid').removeClass('is-valid');
|
|
},
|
|
unhighlight: function(element, errorClass, validClass) {
|
|
$(element).removeClass('is-invalid').addClass('is-valid');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %} |