123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- {% load static %}
- {% load crispy_forms_tags %}
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>SignatureCare Review Portal</title>
- <link rel="canonical" href="https://getbootstrap.com/docs/4.0/examples/dashboard/">
- <!-- Bootstrap core CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <!-- Custom styles for this template -->
- <link rel="stylesheet" type="text/css" href="{% static 'user-dashboard.css' %}">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
- <style>
- a:link {
- text-decoration: none;
- color: #050608;
- }
- a:visited {
- text-decoration: none;
- color: #013568;
- }
- a:hover {
- text-decoration: none;
- color: #51585e;
- }
- a:active {
- text-decoration: none;
- color: #272727;
- }
- </style>
- </head>
- <body>
- <nav class="navbar navbar-dark bg-dark">
- <div class="container">
- <ul class="navbar-nav px-3">
- <li class="nav-item text-nowrap">
- <a class="nav-link" href="{% url 'location-list' %}" style="color: white; font-size:20px">SignatureCare Review Portal</a>
- </li>
- </ul>
- <ul class="navbar-nav px-3">
- <li class="nav-item text-nowrap">
- <button style="background: center; border-color: dimgrey; padding: 7px;" type="button" class="nav-link btn btn-primary" data-toggle="modal" data-target="#fileUploadModal">Import staff</button>
- </li>
- </ul>
- <ul class="navbar-nav px-3">
- <li class="nav-item text-nowrap">
- <a class="nav-link" href="{% url 'logout' %}">Sign out</a>
- </li>
- </ul>
- </div>
- </nav>
- {% if messages %}
- {% for message in messages %}
- <div class="alert alert-{{ message.tags }} container">
- {{ message }}
- </div>
- {% endfor %}
- {% endif %}
- <div class="container">
- <div class="row">
- {% for loc in all_locations %}
- <div class="col-sm-4">
- <a href="{% url 'location-analytics-man' loc.location_id %}">
- <div class="card mt-2 mb-2 graph-card-shadow">
- <div class="card-header">
- <span style="font-size: larger; font-family: sans-serif; font-weight: bold;">{{ loc.care_name }}</span>
- <span style="float: right;">
- <i class="fa fa-hospital-o mr-2" aria-hidden="true"></i>
- </span>
- </div>
- <div class="card-body">
- <canvas class="my-4" id="id_canvas_{{ loc.care_name }}" width="250" height="150"></canvas>
- </div>
- </div>
- </a>
- </div>
- {% endfor %}
- </div>
- <!-- Modal -->
- <div class="modal fade" id="fileUploadModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel">Import Excel File</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <form method="POST" enctype="multipart/form-data">
- {% csrf_token %}
- <fieldset class="form-group">
- {{ file_upload_form|crispy }}
- </fieldset>
- <div class="form-group" style="display: grid;">
- <button class="btn btn-outline-info" type="submit">Submit</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js" integrity="sha256-TQq84xX6vkwR0Qs1qH5ADkP+MvH0W+9E7TdHJsoIQiM=" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
- <script>
- var endpoint = 'graphs/all_location';
- params = {
- "days": 10
- }
- $.ajax({
- type: "get",
- url: endpoint,
- data: params,
- dataType: 'json',
- success: function(data) {
- review_counts = data.review_counts;
- for (let i = 0; i < review_counts.length; i++) {
- var ctx = document.getElementById("id_canvas_"+review_counts[i].name);
- var myBarChart = new Chart(ctx, {
- type: 'bar',
- data: {
- labels: data.labels,
- datasets: [
- {
- label: 'Positive',
- data: review_counts[i].positive,
- borderColor: 'rgb(52, 128, 0 )',
- backgroundColor: 'rgb(52, 128, 0 )',
- borderWidth: 1,
- fill: false
- },
- {
- label: 'Negative',
- data: review_counts[i].negative,
- borderColor: 'rgb(200, 0, 21)',
- backgroundColor: 'rgb(200, 0, 21)',
- borderWidth: 1,
- fill: false
- }]
- },
- options: {
- legend: {
- display: false,
- },
- scales: {
- yAxes: [{
- display: true,
- scaleLabel: {
- display: true,
- fontSize: 12,
- fontStyle: 'italic',
- labelString: 'Review count'
- },
- ticks: {
- beginAtZero: true,
- stepSize: 1,
- }
- }],
- xAxes: [{
- display: true,
- scaleLabel: {
- display: false,
- fontSize: 16,
- fontStyle: 'italic',
- labelString: 'Day of the month'
- },
- gridLines: {
- drawOnChartArea:false
- }
- }]
- },
- title: {
- display: false,
- fontSize: 16,
- text: "Review of this month in all platforms."
- }
- }
- });
- }
- },
- error: function(error_data) {
- console.log(error_data);
- }
- });
- </script>
- <nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap mt-4">
- <span style="color: white;">©2020 SignatureCare Review Portal. - Developed by Byte Trek Ltd. </span>
- </nav>
- </body>
- </html>
|