diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-06-19 15:51:41 +0200 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-06-19 15:51:41 +0200 |
commit | 21181c518cf41828917d36005b726f9452fde657 (patch) | |
tree | 38fab1b3c86a41383e48be6b2686d92efd86db62 /web/templates | |
download | archives-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')
-rw-r--r-- | web/templates/home/home.tmpl | 117 | ||||
-rw-r--r-- | web/templates/layout/footer.tmpl | 36 | ||||
-rw-r--r-- | web/templates/layout/head.tmpl | 14 | ||||
-rw-r--r-- | web/templates/layout/header.tmpl | 6 | ||||
-rw-r--r-- | web/templates/layout/sitetitle.tmpl | 37 | ||||
-rw-r--r-- | web/templates/layout/tyriannav.tmpl | 39 | ||||
-rw-r--r-- | web/templates/list/browse.tmpl | 74 | ||||
-rw-r--r-- | web/templates/list/components/pagination.tmpl | 44 | ||||
-rw-r--r-- | web/templates/list/messages.tmpl | 50 | ||||
-rw-r--r-- | web/templates/list/show.tmpl | 35 | ||||
-rw-r--r-- | web/templates/list/threads.tmpl | 50 | ||||
-rw-r--r-- | web/templates/message/show.tmpl | 110 | ||||
-rw-r--r-- | web/templates/popular/threads.tmpl | 35 | ||||
-rw-r--r-- | web/templates/search/components/pagination.tmpl | 44 | ||||
-rw-r--r-- | web/templates/search/searchresults.tmpl | 57 |
15 files changed, 748 insertions, 0 deletions
diff --git a/web/templates/home/home.tmpl b/web/templates/home/home.tmpl new file mode 100644 index 0000000..b51e2ee --- /dev/null +++ b/web/templates/home/home.tmpl @@ -0,0 +1,117 @@ +<!DOCTYPE html> +<html lang="en"> +{{template "head"}} +<body> +{{template "header" "home"}} + +<div id="scroll-down-section" class="text-muted" style="z-index: 9999;"> + <br/><br/> + <i onclick="document.getElementById('lists-section').scrollIntoView(true);" class="fa fa-angle-down" aria-hidden="true"></i> +</div> + +<div class="container mb-5"> + <div class="row"> + <div id="landing-page-search-area" class="col-12 px-5"> + + <div class="jumbotron w-100 px-5" style="background-color: #FAFAFA;"> + <h2 class="site-welcome stick-top">Welcome to the Home<br/> of <span class="text-primary"> 1,111,111 </span> Gentoo Related Mails</h2> + + <form action="/search" method="get"> + <div class="typeahead-container"> + <div class="typeahead-field"> + <span class="typeahead-query"> + <input id="q" name="q" type="search" autocomplete="off" placeholder="Find Mails" aria-label="Find Mails" autofocus=""> + </span> + + <span class="typeahead-button"> + <button type="button" onclick="$('#searchHelp').modal('show')" title="Search for Threads only" aria-label="Search for Threads only"> + <span class="fa fa-comments-o" style="font-size: 15px;"></span><span class="sr-only">Search for Threads only</span> + </button> + </span> + <span class="typeahead-button"> + <button type="submit" title="Find" aria-label="Find"> + <span class="typeahead-search-icon"></span><span class="sr-only">Find</span> + </button> + </span> + </div> + </div> + </form> + <br> + <small class="mt-4 text-muted" style="font-size: 12px;">This is the new archives.gentoo.org site. If anything isn't working as expected, <a href="mailto:infra@gentoo.org">contact us</a>.<br> + You can search by <a href="/search?q=gentoo-dev">mailing list</a>, <a href="/search?q=Last+rites">author</a>, <a href="/search?q=Last+rites">subject</a> or <a href="/search?q=File+transfer+program+to+keep+remote+files+into+sync">message body</a>. Results similar to your query will be found as well.</small> + </div> + + <div id="landing-page-popular-threads" class="mx-5 text-muted"> + <div class="mx-auto text-center"> + <p class="mb-1"><a class="text-muted" href="/popular"><b>Recent Popular Threads</b></a></p> + {{range .PopularThreads}} + <p class="mb-1"><a href="/{{(makeMessage .Headers).GetListNameFromSubject}}/message/{{.Id}}" class="text-muted">{{(makeMessage .Headers).GetHeaderField "Subject"}}</a></p> + {{end}} + </div> + </div> + + </div> + + <div id="lists-section" class="col-12 pt-3"> + <p class="lead"> + Here you can find the archives of our most important mailing lists. + </p> + <p> + For a complete list of available archives, see the <a href="/lists" class="btn btn-primary btn-sm px-1 py-0"><i class="fa fa-fw fa-archive"></i> All Archives</a> section. + </p> + </div> + + <div class="col-12"> + {{range .MailingLists}} + <hr/> + <div class="row"> + <div class="col-12 col-md-4"> + <h2 class="stick-top">{{.Name}}</h2> + <p> + <tt>{{.Name}}</tt> {{.Description}}. + </p> + <p class="ag-index-actions"> + <a class="btn btn-primary btn-block" href="/{{.Name}}/threads/{{ $.CurrentMonth}}/"><span class="fa fa-fw fa-inbox"></span> This Month's Archives</a> + <a class="btn btn-outline-secondary text-dark btn-block" href="/{{.Name}}/"><span class="fa fa-fw fa-inbox"></span> Complete Archives</a> + </p> + </div> + <div class="col-12 col-md-8"> + <h3 class="ag-mostrecent-header">Most recent messages</h3> + <div class="table-responsive"> + <table class="table table-sm table-hover ag-mostrecent-table"> + <tbody> + <tr> + <th>Subject</th> + <th class="ag-mostrecent-table-author">Author</th> + </tr> + {{$listName:=.Name}} + {{range .Messages}} + <tr> + <td><a href="/{{$listName}}/message/{{.Id}}">{{.GetHeaderField "Subject"}}</a></td> + <td>{{.GetAuthorName}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + </div> + </div> + {{end}} + + <hr/> + <h2>Other Lists</h2> + <p> + All other archives are available here: <a href="/lists" class="btn btn-primary"><i class="fa fa-fw fa-archive"></i> All Archives</a> + </p> + + </div> + </div> +</div> + + +{{template "footer"}} + +<script src="/assets/index.js"></script> + +</body> +</html> diff --git a/web/templates/layout/footer.tmpl b/web/templates/layout/footer.tmpl new file mode 100644 index 0000000..a74b10a --- /dev/null +++ b/web/templates/layout/footer.tmpl @@ -0,0 +1,36 @@ +{{define "footer"}} + <footer> + <div class="container"> + <div class="row"> + <div class="col-12 offset-md-2 col-md-7"> + <p class="spacer"> + All times displayed are in UTC (GMT+0).<br> + Contents reflect the opinion of the author, not the Gentoo project or the Gentoo Foundation. + </p> + </div> + <div class="col-12 col-md-3"> + <h3 class="footerhead">Questions or comments?</h3> + Please feel free to <a href="https://www.gentoo.org/inside-gentoo/contact/">contact us</a>. + </div> + </div> + <div class="row"> + <div class="col-2 col-sm-3 col-md-2"> + <ul class="footerlinks three-icons"> + <li><a href="https://twitter.com/gentoo" title="@Gentoo on Twitter"><span class="fa fa-twitter fa-fw"></span></a></li> + <li><a href="https://www.facebook.com/gentoo.org" title="Gentoo on Facebook"><span class="fa fa-facebook fa-fw"></span></a></li> + <li><a href="https://www.reddit.com/r/Gentoo/" title="Gentoo on Reddit"><span class="fa fa-reddit-alien fa-fw"></span></a></li> + </ul> + </div> + <div class="col-10 col-sm-9 col-md-10"> + <strong>© 2001–2020 Gentoo Foundation, Inc.</strong><br> + <small> + Gentoo is a trademark of the Gentoo Foundation, Inc. + The contents of this document, unless otherwise expressly stated, are licensed under the + <a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="license">CC-BY-SA-4.0</a> license. + The <a href="https://www.gentoo.org/inside-gentoo/foundation/name-logo-guidelines.html">Gentoo Name and Logo Usage Guidelines</a> apply. + </small> + </div> + </div> + </div> + </footer> +{{end}} diff --git a/web/templates/layout/head.tmpl b/web/templates/layout/head.tmpl new file mode 100644 index 0000000..8408128 --- /dev/null +++ b/web/templates/layout/head.tmpl @@ -0,0 +1,14 @@ +{{define "head"}} + <head> + <title>Gentoo Mailing List Archives</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="theme-color" content="#54487a"> + <meta name="description" content="Gentoo Packages Database"> + <!-- link rel="stylesheet" media="screen" href="/packs/css/application-024b2074.css" /--> + <!-- script src="/packs/js/application-cfb73e71df8935c3a9ed.js"></script --> + <script src="/assets/stylesheets.js"></script> + <script src="/assets/application.js"></script> + <link rel="icon" href="https://packages.gentoo.org/favicon.ico" type="image/x-icon"> + </head> +{{end}} diff --git a/web/templates/layout/header.tmpl b/web/templates/layout/header.tmpl new file mode 100644 index 0000000..571a58b --- /dev/null +++ b/web/templates/layout/header.tmpl @@ -0,0 +1,6 @@ +{{define "header"}} + <header> + {{template "sitetitle"}} + {{template "tyrian-navbar" .}} + </header> +{{end}} diff --git a/web/templates/layout/sitetitle.tmpl b/web/templates/layout/sitetitle.tmpl new file mode 100644 index 0000000..ca65b27 --- /dev/null +++ b/web/templates/layout/sitetitle.tmpl @@ -0,0 +1,37 @@ +{{define "sitetitle"}} + <div class="site-title"> + <div class="container"> + <div class="row justify-content-between"> + <div class="logo"> + <a href="/" title="Back to the homepage" class="site-logo"> + <img src="https://assets.gentoo.org/tyrian/site-logo.png" alt="Gentoo" srcset="https://assets.gentoo.org/tyrian/site-logo.svg"> + </a> + <span class="site-label">Archives</span> + </div> + <div class="site-title-buttons"> + <div class="btn-group btn-group-sm"> + <a href="https://get.gentoo.org/" role="button" class="btn get-gentoo"><span class="fa fa-fw fa-download"></span> <strong>Get Gentoo!</strong></a> + <div class="btn-group btn-group-sm"> + <a class="btn gentoo-org-sites dropdown-toggle" data-toggle="dropdown" data-target="#" href="#"> + <span class="fa fa-fw fa-map-o"></span> <span class="d-none d-sm-inline">gentoo.org sites</span> <span class="caret"></span> + </a> + <div class="dropdown-menu dropdown-menu-right"> + <a class="dropdown-item" href="https://www.gentoo.org/" title="Main Gentoo website"><span class="fa fa-home fa-fw"></span> gentoo.org</a> + <a class="dropdown-item" href="https://wiki.gentoo.org/" title="Find and contribute documentation"><span class="fa fa-file-text-o fa-fw"></span> Wiki</a> + <a class="dropdown-item" href="https://bugs.gentoo.org/" title="Report issues and find common issues"><span class="fa fa-bug fa-fw"></span> Bugs</a> + <a class="dropdown-item" href="https://forums.gentoo.org/" title="Discuss with the community"><span class="fa fa-comments-o fa-fw"></span> Forums</a> + <a class="dropdown-item" href="https://packages.gentoo.org/" title="Find software for your Gentoo"><span class="fa fa-hdd-o fa-fw"></span> Packages</a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" href="https://planet.gentoo.org/" title="Find out what's going on in the developer community"><span class="fa fa-rss fa-fw"></span> Planet</a> + <a class="dropdown-item" href="https://archives.gentoo.org/" title="Read up on past discussions"><span class="fa fa-archive fa-fw"></span> Archives</a> + <a class="dropdown-item" href="https://sources.gentoo.org/" title="Browse our source code"><span class="fa fa-code fa-fw"></span> Sources</a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" href="https://infra-status.gentoo.org/" title="Get updates on the services provided by Gentoo"><span class="fa fa-server fa-fw"></span> Infra Status</a> + </div> + </div> + </div> + </div> + </div> + </div> + </div> +{{end}} diff --git a/web/templates/layout/tyriannav.tmpl b/web/templates/layout/tyriannav.tmpl new file mode 100644 index 0000000..f7c83da --- /dev/null +++ b/web/templates/layout/tyriannav.tmpl @@ -0,0 +1,39 @@ +{{define "tyrian-navbar"}} + <nav class="tyrian-navbar navbar navbar-dark navbar-expand-lg bg-primary" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-main-collapse" aria-controls="navbar-main-collapse" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + </div> + <div class="collapse navbar-collapse navbar-main-collapse" id="navbar-main-collapse"> + <ul class="navbar-nav mr-auto"> + + <li class="nav-item {{ if (eq . "home")}}active{{end}}"><a class="nav-link" href="/">Home</a></li> + <li class="nav-item {{ if (eq . "browse")}}active{{end}}"><a class="nav-link" href="/lists"><i class="fa fa-fw fa-archive"></i> All Archives</a></li> + {{ if not (eq . "home" "search" "browse" "popular") }} + <li class="nav-item active"><a class="nav-link" href="/{{.}}/"><i class="fa fa-fw fa-inbox"></i> {{.}}</a></li> + {{end}} + + </ul> + + {{ if ne . "home"}} + <form class="form-inline inlinesearch" role="search" action="/search" method="get"> + + <div class="input-group"> + + <div class="input-group-prepend"> + <span class="input-group-text" id="basic-addon1"><i class="fa fa-search" aria-hidden="true"></i></span> + </div> + + <input class="form-control" type="text" name="q" type="text" placeholder="Find Messages" aria-label="Find Messages"> + </div> + + </form> + {{end}} + + + </div> + </div> + </nav> +{{end}} 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">«</span> + </a> + {{else}} + <li class="page-item"> + <a class="page-link" href="{{ sub .CurrentPage 1 }}" aria-label="Previous"> + <span aria-hidden="true">«</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">»</span> + </a> + {{else}} + <li class="page-item"> + <a class="page-link" href="{{ add .CurrentPage 1 }}" aria-label="Next"> + <span aria-hidden="true">»</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> diff --git a/web/templates/message/show.tmpl b/web/templates/message/show.tmpl new file mode 100644 index 0000000..7b88c35 --- /dev/null +++ b/web/templates/message/show.tmpl @@ -0,0 +1,110 @@ +<!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> + + <div class="table-responsive"> + <table class="table table-sm ag-header-table"> + <tr> + <th class="ag-header-name-col">From:</th> + <td>{{formatAddr (.Message.GetHeaderField "From")}}</td> + </tr> + <tr> + <th>To:</th> + <td>{{formatAddr (.Message.GetHeaderField "To")}}</td> + </tr> + {{if .Message.HasHeaderField "Cc"}} + <tr> + <th>Cc:</th> + <td>{{formatAddr (.Message.GetHeaderField "Cc")}}</td> + </tr> + {{end}} + + <tr> + <th>Subject:</th> + <td><strong>{{.Message.GetHeaderField "Subject"}}</strong></td> + </tr> + <tr> + <th>Date:</th> + <td>{{.Message.Date.Format "Mon, 2 Jan 2006 15:04:05"}}</td> + </tr> + <tr> + <th>Message-Id:</th> + <td><tt>{{.Message.GetMessageId}}</tt></td> + </tr> + + {{if .InReplyTo}} + <tr> + <th>In Reply to:</th> + <td colspan="3"><a href="/{{.ListName}}/messages/{{.InReplyTo.Id}}">{{.InReplyTo.GetHeaderField "Subject"}}</a> by {{.InReplyTo.GetAuthorName}}</td> + </tr> + {{end}} + + </table> + </div> + + <pre class="ag-message-content">{{.Message.GetBody}}</pre> + + {{if .Message.HasAttachments }} + <h3>Attachments</h3> + + <div class="table-responsive"> + <table class="table table-sm ag-attachment-table"> + <tr> + <th>File name</th> + <th>MIME type</th> + </tr> + + {{range .Message.GetAttachments}} + <tr> + <td>{{.Filename}}</td> + <td>{{.Mime}}</td> + </tr> + {{end}} + </table> + </div> + {{end}} + + {{if .Replies}} + <div class="table-responsive"> + <table class="table table-sm ag-replies-table"> + <tbody><tr> + <th>Subject</th> + <th>Author</th> + </tr> + {{range .Replies}} + <tr> + <td><a href="{{.Id}}">{{.GetHeaderField "Subject"}}</a></td> + <td>{{formatAddr (.GetHeaderField "From")}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + {{end}} + + <div class="ag-message-actions"> + <a href="mailto:infra@gentoo.org?subject=Reporting mail {{.Message.Id}} on archives.g.o" class="btn btn-danger btn-sm"><span class="fa fa-fw fa-ban"></span> Report Message</a> + <div class="btn-group btn-group-sm ml-3"> + <a href="https://marc.info/?i={{.Message.GetMessageId}}" class="btn btn-outline-secondary"><span class="fa fa-fw fa-share-square"></span>Find on MARC</a> + <a href="https://groups.google.com/forum/#!search/messageid${{.Message.GetMessageId}}" class="btn btn-outline-secondary"><span class="fa fa-fw fa-share-square"></span>Find on Google Groups</a> + </div> + </div> + + </div> + </div> +</div> + + +{{template "footer"}} + +<script src="/assets/message.js"></script> + +</body> +</html> diff --git a/web/templates/popular/threads.tmpl b/web/templates/popular/threads.tmpl new file mode 100644 index 0000000..5b849eb --- /dev/null +++ b/web/templates/popular/threads.tmpl @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html lang="en"> +{{template "head"}} +<body> +{{template "header" "popular"}} + +<div class="container mb-5"> + <div class="row"> + <div class="col-12 pb-4"> + <h1 class="first-header">Popular Recent Threads:</h1> + + <table class="table"> + <tr> + <th>Thread</th> + <th>Number of messages</th> + </tr> + + {{range .}} + <tr> + <td><a href="/{{(makeMessage .Headers).GetListNameFromSubject}}/message/{{.Id}}/">{{(makeMessage .Headers).GetSubject}}</a></td> + <td>{{.Count}}</td> + </tr> + {{end}} + + </table> + + </div> + </div> +</div> + + +{{template "footer"}} + +</body> +</html> diff --git a/web/templates/search/components/pagination.tmpl b/web/templates/search/components/pagination.tmpl new file mode 100644 index 0000000..e4df856 --- /dev/null +++ b/web/templates/search/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">«</span> + </a> + {{else}} + <li class="page-item"> + <a class="page-link" href="/search?q={{.SearchQuery}}&page={{ sub .CurrentPage 1 }}" aria-label="Previous"> + <span aria-hidden="true">«</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="/search?q={{.SearchQuery}}&page=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="/search?q={{$.SearchQuery}}&page={{.}}">{{.}}</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="/search?q={{.SearchQuery}}&page={{.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">»</span> + </a> + {{else}} + <li class="page-item"> + <a class="page-link" href="/search?q={{.SearchQuery}}&page={{ add .CurrentPage 1 }}" aria-label="Next"> + <span aria-hidden="true">»</span> + </a> + {{end}} + </li> + </ul> + </nav> +{{end}} diff --git a/web/templates/search/searchresults.tmpl b/web/templates/search/searchresults.tmpl new file mode 100644 index 0000000..ecd64f0 --- /dev/null +++ b/web/templates/search/searchresults.tmpl @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html lang="en"> +{{template "head"}} +<body> +{{template "header" "search"}} + +<div class="container mb-5"> + <div class="row"> + <div class="col-12 pb-4"> + <h1 class="first-header">Search Results <small>{{.SearchQuery}}</small></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="/search?q={{.SearchQuery}}&page={{.CurrentPage}}&threads=true" class="btn {{if .ShowThreads}}btn-primary{{else}}btn-outline-secondary{{end}}">Threads</a> + <a href="/search?q={{.SearchQuery}}&page={{.CurrentPage}}" class="btn {{if not .ShowThreads}}btn-primary{{else}}btn-outline-secondary{{end}}">Messages</a> + </div> + + <div class="table-responsive mt-5"> + <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="/{{.GetListNameFromSubject}}/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> + + <div class="row"> + <div class="col-6"> + Showing {{add (mul (sub .CurrentPage 1) 50) 1}} to {{min (mul .CurrentPage 50) .SearchResultsCount}} of {{.SearchResultsCount}} entries + </div> + <div class="col-6"> + {{template "pagination" . }} + </div> + </div> + + </div> + </div> +</div> + + +{{template "footer"}} + +</body> +</html> |