From 2d06abf5049e67e05c068461908c492f43ff4026 Mon Sep 17 00:00:00 2001
From: FChannel <>
Date: Sat, 3 Jul 2021 20:27:51 -0700
Subject: formating changes for local board grid when there is only 1 or 2
 boards

---
 static/index.html | 23 ++++++++++++++++-------
 static/main.html  |  4 +++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/static/index.html b/static/index.html
index bd90059..d7374f1 100644
--- a/static/index.html
+++ b/static/index.html
@@ -23,16 +23,25 @@
   <p style="text-align: justify">{{ .PreferredUsername }} is a federated image board based on activitypub. The current version of the code running the server is still a work in progress, expect a bumpy ride for the time being. Get the server code at <a href="https://github.com/FChannel0">https://github.com/FChannel0</a>.</p>
 
   {{ if .Boards }}
+  {{ $l := len .Boards }}      
   <div style="margin-top:50px;">
-    <div style="display: grid;border-right: 2px solid #820404">
+    <div style="display: grid;border-right: 2px solid #820404">    
+      {{ if lt $l 2 }}
+      <div style="display: inline-grid; border-bottom: 2px solid #820404;border-left: 2px solid #820404;border-top: 2px solid #820404;"><span style="font-size: 1.5em;font-weight: bold;">Local boards</span></div>
+      {{ else if eq $l 2 }}
+      <div style="display: inline-grid; grid-column: 1 / 3; border-bottom: 2px solid #820404;border-left: 2px solid #820404;border-top: 2px solid #820404;"><span style="font-size: 1.5em;font-weight: bold;">Local boards</span></div>
+      {{ else }}
       <div style="display: inline-grid;grid-column: 1 / 4;border-bottom: 2px solid #820404;border-left: 2px solid #820404;border-top: 2px solid #820404;"><span style="font-size: 1.5em;font-weight: bold;">Local boards</span></div>
-    {{ range .Boards }}
-      <div style="whitespace: nowrap;display: inline-grid;text-align: left;padding: 5px;border-bottom: 2px solid #820404;border-left: 2px solid #820404;"><a href="{{.Location}}"><b>{{.Name}}</b> - {{.PrefName}} {{ if not .Restricted }} [NSFW] {{ end }}</a></div>
-    {{ end }}
-    {{ range .BoardRemainer }}
+      {{ end }}      
+      {{ range .Boards }}
+      <div style="whitespace: nowrap;display: inline-grid;text-align: left;padding: 5px;border-bottom: 2px solid #820404;border-left: 2px solid #820404;"><a href="{{.Location}}"><b>/{{.Name}}/</b> - {{.PrefName}} {{ if not .Restricted }} [NSFW] {{ end }}</a></div>
+      {{ end }}
+      {{ if gt $l 2 }}      
+      {{ range .BoardRemainer }}
       <div style="whitespace: nowrap;display: inline-grid;text-align: left;padding: 5px;border-bottom: 2px solid #820404;border-left: 2px solid #820404;"></div>
-    {{ end }}
-    </div>
+      {{ end }}
+      {{ end }}
+    </div>      
   </div>
   {{ end }}
   
diff --git a/static/main.html b/static/main.html
index 00b395f..ba7e7f5 100644
--- a/static/main.html
+++ b/static/main.html
@@ -86,7 +86,9 @@
     <ul style="display: inline; padding:0;">
       {{ $l := len .Boards }}
       {{range $i, $e := .Boards}}
-      {{ if eq $i 0 }}
+      {{ if eq (sub $l 1) 0 }}
+      <li style="display: inline;">[ <a href="{{.Location}}">{{$e.Name}} </a>]</li>      
+      {{ else if eq $i 0 }}
       <li style="display: inline;">[<a href="{{.Location}}">{{$e.Name}} </a>/</li>
       {{ else if eq $i (sub $l 1) }}
       <li style="display: inline;"><a href="{{.Location}}">{{$e.Name}}</a>]</li>
-- 
cgit v1.2.3