aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-06-19 15:51:41 +0200
committerMax Magorsch <arzano@gentoo.org>2020-06-19 15:51:41 +0200
commit21181c518cf41828917d36005b726f9452fde657 (patch)
tree38fab1b3c86a41383e48be6b2686d92efd86db62 /web/templates/list
downloadarchives-21181c518cf41828917d36005b726f9452fde657.tar.gz
archives-21181c518cf41828917d36005b726f9452fde657.tar.bz2
archives-21181c518cf41828917d36005b726f9452fde657.zip
Initial version
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'web/templates/list')
-rw-r--r--web/templates/list/browse.tmpl74
-rw-r--r--web/templates/list/components/pagination.tmpl44
-rw-r--r--web/templates/list/messages.tmpl50
-rw-r--r--web/templates/list/show.tmpl35
-rw-r--r--web/templates/list/threads.tmpl50
5 files changed, 253 insertions, 0 deletions
diff --git a/web/templates/list/browse.tmpl b/web/templates/list/browse.tmpl
new file mode 100644
index 0000000..9c2ea3f
--- /dev/null
+++ b/web/templates/list/browse.tmpl
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html lang="en">
+{{template "head"}}
+<body>
+{{template "header" "browse"}}
+
+<div class="container mb-5">
+ <div class="row">
+ <div class="col-12">
+ <h1 class="first-header">Gentoo Mailing List Archives</h1>
+
+ <h2>Current Mailing Lists</h2>
+
+ <div class="row">
+ <div class="col-12 col-md-6">
+ <div class="list-group">
+ {{range .CurrentMailingLists}}
+ <a href="/{{.Name}}/" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
+ <span>
+ <span class="fa fa-fw fa-archive"></span>
+ {{.Name}}
+ </span>
+ <h4 class="mb-0">
+ <span class="badge badge-secondary badge-pill">{{.MessageCount}}</span>
+ </h4>
+ </a>
+ {{end}}
+ </div>
+ </div>
+ <div class="col-12 col-md-6">
+ <div class="alert alert-info" role="alert">
+ <strong>How to Participate</strong><br>
+ Please see our <a href="https://www.gentoo.org/main/en/lists.xml" class="alert-link">Mailing List information page</a> for more information on
+ how you can subscribe and participate in the discussions.
+ </div>
+ </div>
+ </div>
+
+ <h2 class="mt-5">Frozen Archives</h2>
+
+ <div class="row">
+ <div class="col-12 col-md-6">
+ <div class="list-group">
+ {{range .FrozenArchives}}
+ <a href="/{{.Name}}/" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
+ <span>
+ <span class="fa fa-fw fa-archive"></span>
+ {{.Name}}
+ </span>
+ <h4 class="mb-0">
+ <span class="badge badge-secondary badge-pill">{{.MessageCount}}</span>
+ </h4>
+ </a>
+ {{end}}
+ </div>
+ </div>
+ <div class="col-12 col-md-6">
+ <div class="alert alert-warning" role="alert">
+ <strong>Inactive Lists</strong><br>
+ These mailing lists are inactive. You can not post or subscribe to them any more.
+ Archives are provided for future reference.
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</div>
+
+
+{{template "footer"}}
+
+</body>
+</html>
diff --git a/web/templates/list/components/pagination.tmpl b/web/templates/list/components/pagination.tmpl
new file mode 100644
index 0000000..5ff13bd
--- /dev/null
+++ b/web/templates/list/components/pagination.tmpl
@@ -0,0 +1,44 @@
+{{define "pagination"}}
+ <nav class="pull-right">
+ <ul class="pagination ag-pager">
+ {{ if eq .CurrentPage 1}}
+ <li class="page-item disabled">
+ <a class="page-link" href="#" aria-label="Previous">
+ <span aria-hidden="true">&laquo;</span>
+ </a>
+ {{else}}
+ <li class="page-item">
+ <a class="page-link" href="{{ sub .CurrentPage 1 }}" aria-label="Previous">
+ <span aria-hidden="true">&laquo;</span>
+ </a>
+ {{end}}
+ </li>
+ {{ $min := max 1 (sub .CurrentPage 3) }}
+ {{ $max := min .MaxPages (add .CurrentPage 3) }}
+ {{if gt $min 3 }}
+ <li class="page-item"><a class="page-link" href="1">1</a></li>
+ <li class="page-item disabled"><a class="page-link" href="#">…</a></li>
+ {{end}}
+
+ {{range (makeRange $min $max)}}
+ <li {{if eq . $.CurrentPage}}class="page-item active"{{end}}><a class="page-link" href="{{.}}">{{.}}</a></li>
+ {{end}}
+ {{if gt (sub .MaxPages $max) 3}}
+ <li class="page-item disabled"><a class="page-link" href="#">…</a></li>
+ <li class="page-item"><a class="page-link" href="{{.MaxPages}}">{{.MaxPages}}</a></li>
+ {{end}}
+ {{if eq .CurrentPage .MaxPages}}
+ <li class="page-item disabled">
+ <a class="page-link" href="#" aria-label="Next">
+ <span aria-hidden="true">&raquo;</span>
+ </a>
+ {{else}}
+ <li class="page-item">
+ <a class="page-link" href="{{ add .CurrentPage 1 }}" aria-label="Next">
+ <span aria-hidden="true">&raquo;</span>
+ </a>
+ {{end}}
+ </li>
+ </ul>
+ </nav>
+{{end}}
diff --git a/web/templates/list/messages.tmpl b/web/templates/list/messages.tmpl
new file mode 100644
index 0000000..31084bd
--- /dev/null
+++ b/web/templates/list/messages.tmpl
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+{{template "head"}}
+<body>
+{{template "header" .ListName}}
+
+<div class="container mb-5">
+ <div class="row">
+ <div class="col-12 pb-4">
+ <h1 class="first-header">Gentoo Archives: {{.ListName}} in {{.Date}}</h1>
+
+ <div class="d-none d-sm-block">
+ {{template "pagination" . }}
+ </div>
+
+ <div class="btn-group ag-view-selection" role="group" aria-label="Message view selection">
+ <a href="/{{.ListName}}/threads/{{.Date}}/" class="btn btn-outline-secondary">Threads</a>
+ <a href="/{{.ListName}}/messages/{{.Date}}/" class="btn btn-primary">Messages</a>
+ </div>
+
+ <div class="table-responsive">
+ <table class="table table-sm table-hover ag-message-table">
+ <tr>
+ <th class="ag-message-table-subject">Subject</th>
+ <th class="ag-message-table-from">From</th>
+ <th class="ag-message-table-date">Date</th>
+ </tr>
+
+ {{range .Messages}}
+ <tr>
+ <td><a href="../../message/{{.Id}}">{{.GetHeaderField "Subject"}}</a></td>
+ <td>{{.GetAuthorName}}</td>
+ <td><span class="ag-date">{{.Date.Format "Mon, 2 Jan 2006 15:04:05"}}</span></td>
+ </tr>
+ {{end}}
+
+ </table>
+ </div>
+
+ {{template "pagination" . }}
+
+ </div>
+ </div>
+</div>
+
+
+{{template "footer"}}
+
+</body>
+</html>
diff --git a/web/templates/list/show.tmpl b/web/templates/list/show.tmpl
new file mode 100644
index 0000000..40b01ef
--- /dev/null
+++ b/web/templates/list/show.tmpl
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en">
+{{template "head"}}
+<body>
+{{template "header" .ListName}}
+
+<div class="container mb-5">
+ <div class="row">
+ <div class="col-12 pb-4">
+ <h1 class="first-header">Gentoo Archives: {{.ListName}}</h1>
+
+ <table class="table">
+ <tr>
+ <th>Month</th>
+ <th>Number of messages</th>
+ </tr>
+
+ {{range .MessageData}}
+ <tr>
+ <td><a href="threads/{{.CombinedDate}}/">{{.CombinedDate}}</a></td>
+ <td>{{.MessageCount}}</td>
+ </tr>
+ {{end}}
+
+ </table>
+
+ </div>
+ </div>
+</div>
+
+
+{{template "footer"}}
+
+</body>
+</html>
diff --git a/web/templates/list/threads.tmpl b/web/templates/list/threads.tmpl
new file mode 100644
index 0000000..ec07e49
--- /dev/null
+++ b/web/templates/list/threads.tmpl
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+{{template "head"}}
+<body>
+{{template "header" .ListName}}
+
+<div class="container mb-5">
+ <div class="row">
+ <div class="col-12 pb-4">
+ <h1 class="first-header">Gentoo Archives: {{.ListName}} in {{.Date}}</h1>
+
+ <div class="d-none d-sm-block">
+ {{template "pagination" . }}
+ </div>
+
+ <div class="btn-group ag-view-selection" role="group" aria-label="Message view selection">
+ <a href="/{{.ListName}}/threads/{{.Date}}/" class="btn btn-primary">Threads</a>
+ <a href="/{{.ListName}}/messages/{{.Date}}/" class="btn btn-outline-secondary">Messages</a>
+ </div>
+
+ <div class="table-responsive">
+ <table class="table table-sm table-hover ag-message-table">
+ <tr>
+ <th class="ag-message-table-subject">Subject</th>
+ <th class="ag-message-table-from">From</th>
+ <th class="ag-message-table-date">Date</th>
+ </tr>
+
+ {{range .Messages}}
+ <tr>
+ <td><a href="../../message/{{.Id}}">{{.GetHeaderField "Subject"}}</a></td>
+ <td>{{.GetAuthorName}}</td>
+ <td><span class="ag-date">{{.Date.Format "Mon, 2 Jan 2006 15:04:05"}}</span></td>
+ </tr>
+ {{end}}
+
+ </table>
+ </div>
+
+ {{template "pagination" . }}
+
+ </div>
+ </div>
+</div>
+
+
+{{template "footer"}}
+
+</body>
+</html>