mirror of
https://github.com/Balshgit/public.git
synced 2026-02-04 10:00:39 +03:00
initial commit
This commit is contained in:
24
examples/celery_progress_demo/templates/base.html
Normal file
24
examples/celery_progress_demo/templates/base.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Celery Progress Demo</title>
|
||||
<meta name="Celery Progress Demo" content="" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block demo %}{% endblock %}
|
||||
<!-- JQuery -->
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
|
||||
<!-- Celery Progress -->
|
||||
<script src="{% static 'celery_progress/celery_progress.js' %}"></script>
|
||||
|
||||
{% block progress_bar_js %}{% endblock progress_bar_js %}
|
||||
</body>
|
||||
</html>
|
||||
24
examples/celery_progress_demo/templates/download.html
Normal file
24
examples/celery_progress_demo/templates/download.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block demo %}
|
||||
<!-- Reset Form -->
|
||||
<a href="{% url 'download:demo' %}" role="button" class="btn btn-primary btn-lg btn-block" style="border-radius: 0px;"><b>RESET</b></a>
|
||||
|
||||
<!-- Download Form -->
|
||||
<div class="container text-center" style="padding-top: 20px;">
|
||||
<form action="{% url 'download:demo' %}" method="post" style="display: inline;">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-primary" type="submit" style="width:120px;">
|
||||
<strong>Download</strong>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Download Status -->
|
||||
<div class="container" style="padding-top: 20px;">
|
||||
<div class="card" style="height: 120px;">
|
||||
{% block progress %}{% endblock progress %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
examples/celery_progress_demo/templates/progress.html
Normal file
26
examples/celery_progress_demo/templates/progress.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "download.html" %}
|
||||
{% load static %}
|
||||
{% block progress %}
|
||||
<div class="text-center" style="font-size: 14px">
|
||||
<div id="progress-bar-message">
|
||||
Click the "Download" button
|
||||
</div>
|
||||
</div>
|
||||
<div class='progress-wrapper' style="padding-top: 10px;">
|
||||
<div id='progress-bar' class='progress-bar progress-bar-striped' role='progressbar' style="height:30px; width: 0%; border-radius: 5px"> </div>
|
||||
</div>
|
||||
<div id="celery-result">
|
||||
</div>
|
||||
{% endblock progress %}
|
||||
|
||||
{% block progress_bar_js %}
|
||||
{% if task_id %}
|
||||
<script type="text/javascript">
|
||||
// Progress Bar (JQuery)
|
||||
$(function () {
|
||||
var progressUrl = "{% url 'celery_progress:task_status' task_id %}";
|
||||
CeleryProgressBar.initProgressBar(progressUrl, {})
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock progress_bar_js %}
|
||||
Reference in New Issue
Block a user