Files
ihrm/horilla_backup/templates/backup/gdrive_setup_form.html

68 lines
2.3 KiB
HTML
Raw Normal View History

{% extends "settings.html" %}
{% block settings %}
{% load i18n %}
{% if form.errors %}
<!-- form errors -->
<div class="oh-wrapper">
<div class="oh-alert-container">
{% for error in form.non_field_errors %}
<div class="oh-alert oh-alert--animated oh-alert--danger">
{{ error }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<form method="post" action="{% url 'gdrive' %}" enctype="multipart/form-data">
{% csrf_token %}
{{form.as_p}}
</form>
<script>
$(document).ready(function() {
2025-02-14 10:01:07 +05:30
$('.oh-payslip__header').append(`<div class="d-flex">
{% if show %}
{% if active %}
<a class="oh-btn oh-btn--danger mr-2" href="{% url 'gdrive_start_stop' %}" title="Stop">Stop</a>
{% else %}
<a class="oh-btn oh-btn--success mr-2" href="{% url 'gdrive_start_stop' %}" title="Start">Start</a>
{% endif %}
<a class="oh-btn oh-btn--danger-outline" href="{% url 'gdrive_delete' %}" title="Remove">
<ion-icon name="trash-outline" role="img" class="md hydrated" aria-label="trash outline"></ion-icon>
</a>
{% endif %}
</div>`)
if (!$('#id_interval').is(':checked')) {
$('#id_seconds').parent().hide();
}
if (!$('#id_fixed').is(':checked')) {
$('#id_hour').parent().hide();``
$('#id_minute').parent().hide();
2025-02-14 10:01:07 +05:30
}
$('#id_interval').change(function() {
2025-02-14 10:01:07 +05:30
if ($(this).is(':checked')) {
$('#id_fixed4').prop('checked', false);
$('#id_hour').parent().hide();
$('#id_minute').parent().hide();
$('#id_seconds').parent().show();
} else {
$('#id_seconds').parent().hide();
}
});
$('#id_fixed').change(function() {
if ($(this).is(':checked')) {
$('#id_interval').prop('checked', false);
$('#id_seconds').parent().hide();
$('#id_hour').parent().show();
$('#id_minute').parent().show();
} else {
$('#id_hour').parent().hide();
$('#id_minute').parent().hide();
}
});
});
</script>
2025-02-14 10:01:07 +05:30
{% endblock settings %}