From 79b2f8ffed7815c43fe1b5fbeadff440cb749c77 Mon Sep 17 00:00:00 2001
From: unknown <santosh.2@iitj.ac.in>
Date: Fri, 29 Jul 2022 03:42:54 +0530
Subject: [PATCH] Changed day list page | Redesigned table | Added search box
 for quick search | Added pagination

---
 .../mailarchives/templates/datelist.html      | 39 +++++++-------
 .../templates/datelist_topandbottom.html      | 21 +++++---
 django/media/css/main.css                     | 54 +++++++++++++++++++
 3 files changed, 90 insertions(+), 24 deletions(-)

diff --git a/django/archives/mailarchives/templates/datelist.html b/django/archives/mailarchives/templates/datelist.html
index df0fb50..db2c641 100644
--- a/django/archives/mailarchives/templates/datelist.html
+++ b/django/archives/mailarchives/templates/datelist.html
@@ -10,35 +10,38 @@
 {%include "searchform.html"%}
 
 {%include "datelist_topandbottom.html"%}
-
 {%for m in messages%}
   {%ifchanged m.date.date%}
     {%if not forloop.first%}
-        </tbody>
+      </tbody>
       </table>
     {%endif%}
     <h2>{{m.date.date}}</h2>
-    <table class="table table-striped table-sm thread-list">
-      <thead>
+    <table
+      id="table"
+      data-toggle="table"
+      data-pagination="true"
+      data-page-list="[10, 20, 50, 100, all]"
+      data-buttons-class="primary"
+      data-search="true">
+      <thead class="list-header">
         <tr>
-          <th scope="col" style="width: 70%;">Thread</th>
-          <th scope="col" style="width: 25%;">Author</th>
-          <th scope="col" style="width: 5%;">Time</th>
+          <th class="list-table-header-text" data-field="threadname">Thread</th>
         </tr>
       </thead>
       <tbody>
   {%endifchanged%}
-  <tr>
-    <th scope="row">
-      <a href="/message-id/{{m.messageid|urlencode}}">{{m.subject|default:"[No subject]"}}{% if m.has_attachment %} &#x1f4ce;{% endif %}</a>
-    </th>
-    <td>{{m.mailfrom|nameonly}}</td>
-    <td>{{m.date.time|time:"H:i"}}</td>
-  </tr>
-  {%if forloop.last%}
-      </tbody>
-    </table>
-  {%endif%}
+      <tr class="daylist_data">
+        <th scope="row" style="padding: 3px;">
+          <a href="/message-id/{{m.messageid|urlencode}}">{{m.subject|default:"[No subject]"}} {% if m.has_attachment %} &#x1f4ce;{% endif %}</a>
+          <br>
+          <p style="margin-top: 0.5rem;"><i class="fa fa-user" aria-hidden="true" style="color: #004b87;"></i> {{m.mailfrom|nameonly}} | <i style="color: #004b87;" class="fa">&#xf017;</i> {{m.date.time|time:"H:i"}}</p>
+        </th>
+      </tr>
+      {%if forloop.last%}
+    </tbody>
+  </table>
+{%endif%}
 {%endfor%}
 
 {%include "datelist_topandbottom.html"%}
diff --git a/django/archives/mailarchives/templates/datelist_topandbottom.html b/django/archives/mailarchives/templates/datelist_topandbottom.html
index 097f138..d8b4c6e 100644
--- a/django/archives/mailarchives/templates/datelist_topandbottom.html
+++ b/django/archives/mailarchives/templates/datelist_topandbottom.html
@@ -1,14 +1,23 @@
 {%if messages%}
 <h3>Browse Archives</h3>
+<nav aria-label="...">
+<ul class="pagination" style="padding-left: 0px; margin-bottom: 15px;">
 {%with messages|first as firstmsg%}
-<a href="/list/{{list.listname}}/before/{{firstmsg.shortdate}}">Prev</a>
+<a class="daylinks-pagination-prev" href="/list/{{list.listname}}/before/{{firstmsg.shortdate}}" tabindex="-1"><i class="fa fa-angle-double-left" aria-hidden="true"></i> Prev </a>
 {%endwith%}
-|
 {%with messages|last as lastmsg%}
-<a href="/list/{{list.listname}}/since/{{lastmsg.shortdate}}">Next</a>
+<a class="daylinks-pagination-next" href="/list/{{list.listname}}/since/{{lastmsg.shortdate}}"> Next <i class="fa fa-angle-double-right" aria-hidden="true"></i></a>
 {%endwith%}
-{%endif%}
-
+</ul>
+</nav>
+{%endif%} 
 {%if daysinmonth%}
-<div class="daylinks">Jump to day: {%for d in daysinmonth%}<a href="/list/{{list.listname}}/since/{{yearmonth}}{{d|stringformat:"02d"}}0000/">{{d}}</a> {%endfor%}</div>
+<div class="daylinks">
+    <p>Jump to day: </p>
+    <div class="daylist_pagination">
+    {%for d in daysinmonth%}
+        <a class="daylink_pagination" href="/list/{{list.listname}}/since/{{yearmonth}}{{d|stringformat:"02d"}}0000/">{{d}}</a> 
+    {%endfor%}
+    </div>
+</div>
 {%endif%}
diff --git a/django/media/css/main.css b/django/media/css/main.css
index 0236157..05e9911 100644
--- a/django/media/css/main.css
+++ b/django/media/css/main.css
@@ -162,6 +162,60 @@ hr {
   margin: 1em 0 2em 0;
 }
 
+/** Day Links */
+.daylinks-pagination-prev {
+  color: #326690 !important;
+  padding: 7px;
+  border: 2px solid #8d8f91;
+  border-radius: 8px 0px 0px 8px;
+  margin-right: 3px;
+  font-size: 14px;
+}
+
+.daylinks-pagination-prev:hover {
+  color: #ffffff !important;
+  background-color: #326690;
+}
+
+
+.daylinks-pagination-prev:hover i {
+  color: #ffffff !important;
+}
+
+.daylinks-pagination-next {
+  color: #326690 !important;
+  padding: 7px;
+  border: 2px solid #8d8f91;
+  border-radius: 0px 8px 8px 0px;
+  font-size: 14px;
+}
+
+.daylinks-pagination-next:hover {
+  color: #ffffff !important;
+  background-color: #326690;
+}
+
+.daylinks-pagination-next:hover i {
+  color: #ffffff !important;
+}
+
+.daylink_pagination {
+  background: #f1f3f4;
+  padding: 5px;
+  text-align: center;
+  border: 1px solid #9e9d9d;
+  color: #326690 !important;
+}
+
+.daylink_pagination:hover {
+  color: #326690 !important;
+  background-color: #e1f0ff;
+}
+
+.daylist_data:hover {
+  background-color: #d9f3ff !important;
+}
+
 /** HOME PAGE */
 .panel-default>.panel-heading {
     color: #333;
-- 
2.26.2.windows.1

