]> Softwares of Agnibho - librevax.git/commitdiff
Check duplicate in report
authorAgnibho Mondal <mondal@agnibho.com>
Fri, 22 Nov 2024 20:24:04 +0000 (01:54 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Fri, 22 Nov 2024 20:24:04 +0000 (01:54 +0530)
static/style.css
templates/report.html

index 262b3edb5f799b527713205103e2595ec2c50c5d..4b19c26cf8b9e1f2b2632bd85fd7dd24cd65cef1 100644 (file)
@@ -15,6 +15,10 @@ a {
        padding: 20px;
 }
 
+.duplicate > td {
+  background: LightYellow;
+}
+
 @media print {
        form, .navbar, .btn {
                display: none;
index cb39fe7257f2b7367f5690af525668f1418d3b7f..911f5d5b6e96090d42de80b9a95194e51176c03b 100644 (file)
@@ -27,7 +27,7 @@ You should have received a copy of the GNU General Public License along with Lib
   </table>
   <table class="table table-bordered">
     {% for i in data %}
-    <tr>
+    <tr class="index" data-cid="{{i["cid"]}}" data-iid="{{i["iid"]}}">
       <td>
         <a href="/vaccination/view/{{i["vid"]}}">
         {{loop.index}}<br>
@@ -60,4 +60,15 @@ You should have received a copy of the GNU General Public License along with Lib
   {% endfor %}
   </p>
 </div>
+<script>
+  indexList=document.querySelectorAll(".index");
+  vaccinationList=[]
+  indexList.forEach(i => {
+    ds=i.dataset;
+    if(vaccinationList.some(e => e.cid==ds.cid && e.iid==ds.iid)){
+      i.classList.add("duplicate");
+    }
+    vaccinationList.push(ds);
+  });
+</script>
 {% endblock %}