dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

forum-search.gohtml (2979B)


      1 {{ define "extra-head" }}
      2 <style>
      3     .timestamp {
      4         color: #aaa;
      5         font-size: 11px;
      6     }
      7 </style>
      8 {{ end }}
      9 
     10 {{ define "title" }}dkf - forum{{ end }}
     11 
     12 {{ define "content" }}
     13 
     14 <div class="container-fluid">
     15     <nav aria-label="breadcrumb">
     16         <ol class="breadcrumb">
     17             <li class="breadcrumb-item"><a href="/forum">Forum</a></li>
     18             <li class="breadcrumb-item active">{{ t "Search" . }}</li>
     19         </ol>
     20     </nav>
     21 
     22     <div class="pb-2 mb-4 border-bottom">
     23         <form method="get" class="d-inline">
     24             <div class="input-group" style="width: 250px;">
     25                 <input type="text" name="search" class="form-control form-control-sm d-inline" value="{{ .Data.Search }}" placeholder="Search" />
     26                 <div class="input-group-append">
     27                     <button class="btn btn-secondary btn-sm">search</button>
     28                 </div>
     29             </div>
     30         </form>
     31     </div>
     32 
     33     <table class="table table-striped">
     34         <tr>
     35             <th>Thread name</th>
     36             <th class="text-center">Messages</th>
     37             <th>Author</th>
     38             <th>Last Message</th>
     39         </tr>
     40         {{ range .Data.ForumThreads }}
     41             <tr>
     42                 <td>
     43                     <a href="/t/{{ .UUID }}">{{ .Name }}</a>
     44                 </td>
     45                 <td class="text-center" style="vertical-align: middle;">{{ .RepliesCount }}</td>
     46                 <td>
     47                     <a style="color: {{ .AuthorChatColor }};" href="/u/{{ .Author }}">{{ .Author }}</a><br />
     48                     <span class="timestamp">{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</span>
     49                 </td>
     50                 <td>
     51                     <a style="color: {{ .LastMsgChatColor }};" href="/u/{{ .LastMsgAuthor }}">{{ .LastMsgAuthor }}</a><br />
     52                     <span class="timestamp">{{ .LastMsgCreatedAt.Format "Jan 02, 2006 15:04:05" }}</span>
     53                 </td>
     54             </tr>
     55         {{ else }}
     56             <tr>
     57                 <td colspan="4"><em>No thread to display</em></td>
     58             </tr>
     59         {{ end }}
     60     </table>
     61 
     62     <table class="table table-striped">
     63         <tr>
     64             <th>Thread name</th>
     65             <th>Snippet</th>
     66             <th>Author</th>
     67         </tr>
     68         {{ range .Data.ForumMessages }}
     69             <tr>
     70                 <td><a href="/t/{{ .ThreadUUID }}#{{ .UUID }}">{{ .ThreadName }}</a></td>
     71                 <td>
     72                     <a href="/t/{{ .ThreadUUID }}#{{ .UUID }}">{{ .Snippet }}</a>
     73                 </td>
     74                 <td>
     75                     <a style="color: {{ .AuthorChatColor }};" href="/u/{{ .Author }}">{{ .Author }}</a><br />
     76                     <span class="timestamp">{{ .CreatedAt.Format "Jan 02, 2006 15:04:05" }}</span>
     77                 </td>
     78             </tr>
     79         {{ else }}
     80             <tr>
     81                 <td colspan="3"><em>No messages to display</em></td>
     82             </tr>
     83         {{ end }}
     84     </table>
     85 </div>
     86 
     87 {{ end }}