user-dashboard.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {% extends 'user-base.html' %}
  2. {% block content %}
  3. <!--cart-->
  4. <div class="row">
  5. <div class="col-sm-6 col-md-4">
  6. <div class="card text-white bg-secondary mb-3">
  7. <div class="card-header"><h5 class="card-title">Google <span><i class="fa fa-google" aria-hidden="true"></i></span></h5></div>
  8. <div class="card-body">
  9. <table class="table">
  10. <tr>
  11. <td><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Total Review</td>
  12. <td>200</td>
  13. </tr>
  14. <tr>
  15. <td><i class="fa fa-line-chart" aria-hidden="true"></i> Growth</td>
  16. <td>-2.4%</td>
  17. </tr>
  18. </table>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="col-sm-6 col-md-4">
  23. <div class="card text-white bg-danger mb-3">
  24. <div class="card-header"><h5 class="card-title">Yelp <span><i class="fa fa-yelp" aria-hidden="true"></i></span></h5></div>
  25. <div class="card-body">
  26. <table class="table">
  27. <tr>
  28. <td><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Total Review</td>
  29. <td>200</td>
  30. </tr>
  31. <tr>
  32. <td><i class="fa fa-line-chart" aria-hidden="true"></i> Growth</td>
  33. <td>-2.4%</td>
  34. </tr>
  35. </table>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-sm-6 col-md-4">
  40. <div class="card text-white bg-primary mb-3">
  41. <div class="card-header"><h5 class="card-title">Facebook <span><i class="fa fa-facebook" aria-hidden="true"></i></span></h5></div>
  42. <div class="card-body">
  43. <table class="table">
  44. <tr>
  45. <td><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Total Review</td>
  46. <td>200</td>
  47. </tr>
  48. <tr>
  49. <td><i class="fa fa-line-chart" aria-hidden="true"></i> Growth</td>
  50. <td>-2.4%</td>
  51. </tr>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- canvas-->
  58. <canvas class="my-4" id="myChart" width="900" height="300"></canvas>
  59. <h2>Section title</h2>
  60. <div class="table-responsive">
  61. <table class="table">
  62. <thead>
  63. <tr class="table-info">
  64. <th>Platform</th>
  65. <th>Total <br>Positive Review</th>
  66. <th>Positive <br> review Growth</th>
  67. <th>Total <br>Negative Review</th>
  68. <th>Negative <br> review Growth</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. <tr>
  73. <td>Google</td>
  74. <td>{{ google_pos }}</td>
  75. {% if google_pos_gr > 0 %}
  76. <td class="table-success"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ google_pos_gr }}</td>
  77. {% else %}
  78. <td class="table-danger"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ google_pos_gr }};</td>
  79. {% endif %}
  80. <td>{{ google_neg }}</td>
  81. {% if google_neg_gr < 0 %}
  82. <td class="table-success"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ google_pos_gr }}</td>
  83. {% else %}
  84. <td class="table-danger"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ google_pos_gr }};</td>
  85. {% endif %}
  86. </tr>
  87. <tr>
  88. <td>Yelp</td>
  89. <td>{{ yelp_pos }}</td>
  90. {% if yelp_pos_gr > 0 %}
  91. <td class="table-success"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ yelp_pos_gr }}</td>
  92. {% else %}
  93. <td class="table-danger"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ yelp_pos_gr }};</td>
  94. {% endif %}
  95. <td>{{ yelp_neg }}</td>
  96. {% if yelp_neg_gr < 0 %}
  97. <td class="table-success"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ yelp_pos_gr }}</td>
  98. {% else %}
  99. <td class="table-danger"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ yelp_pos_gr }};</td>
  100. {% endif %}
  101. </tr>
  102. <tr>
  103. <td>Facebook</td>
  104. <td>{{ facebook_pos }}</td>
  105. {% if facebook_pos_gr > 0 %}
  106. <td class="table-success"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ facebook_pos_gr }}</td>
  107. {% else %}
  108. <td class="table-danger"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ facebook_pos_gr }};</td>
  109. {% endif %}
  110. <td>{{ facebook_neg }}</td>
  111. {% if facebook_neg_gr < 0 %}
  112. <td class="table-success"><i class="fa fa-arrow-circle-o-down mr-2" aria-hidden="true"></i>{{ facebook_pos_gr }}</td>
  113. {% else %}
  114. <td class="table-danger"><i class="fa fa-arrow-circle-o-up mr-2" aria-hidden="true"></i>{{ facebook_pos_gr }};</td>
  115. {% endif %}
  116. </tr>
  117. </tbody>
  118. </table>
  119. </div>
  120. <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
  121. <script>
  122. var ctx = document.getElementById("myChart");
  123. var myChart = new Chart(ctx, {
  124. type: 'line',
  125. data: {
  126. labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  127. datasets: [{
  128. data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
  129. lineTension: 0,
  130. backgroundColor: 'transparent',
  131. borderColor: '#007bff',
  132. borderWidth: 4,
  133. pointBackgroundColor: '#007bff'
  134. }]
  135. },
  136. options: {
  137. scales: {
  138. yAxes: [{
  139. ticks: {
  140. beginAtZero: false
  141. }
  142. }]
  143. },
  144. legend: {
  145. display: false,
  146. }
  147. }
  148. });
  149. </script>
  150. {% endblock %}