diff --git a/main.go b/main.go
index 88c9d1a..288ff7f 100644
--- a/main.go
+++ b/main.go
@@ -10,12 +10,10 @@ import (
"math/rand"
"net/http"
"os"
- "path/filepath"
"strings"
"github.com/bouncepaw/mycorrhiza/history"
"github.com/bouncepaw/mycorrhiza/hyphae"
- "github.com/bouncepaw/mycorrhiza/mimetype"
"github.com/bouncepaw/mycorrhiza/shroom"
"github.com/bouncepaw/mycorrhiza/templates"
"github.com/bouncepaw/mycorrhiza/user"
@@ -48,15 +46,7 @@ func HttpErr(w http.ResponseWriter, status int, name, title, errMsg string) {
// Show all hyphae
func handlerList(w http.ResponseWriter, rq *http.Request) {
log.Println(rq.URL)
- var (
- tbody string
- pageCount = hyphae.Count()
- u = user.FromRequest(rq)
- )
- for h := range hyphae.YieldExistingHyphae() {
- tbody += views.HyphaListRowHTML(h.Name, mimetype.FromExtension(filepath.Ext(h.BinaryPath)), h.BinaryPath != "")
- }
- util.HTTP200Page(w, base("List of pages", views.HyphaListHTML(tbody, pageCount), u))
+ util.HTTP200Page(w, base("List of pages", views.HyphaListHTML(), user.FromRequest(rq)))
}
// This part is present in all html documents.
diff --git a/templates/asset.qtpl.go b/templates/asset.qtpl.go
index 7125101..7e951aa 100644
--- a/templates/asset.qtpl.go
+++ b/templates/asset.qtpl.go
@@ -23,12 +23,19 @@ func StreamDefaultCSS(qw422016 *qt422016.Writer) {
qw422016.N().S(`
`)
//line templates/asset.qtpl:2
- qw422016.N().S(`/* General element positions, from small to big */
-.modal__title { font-size: 2rem; }
+ qw422016.N().S(`.modal__title { font-size: 2rem; }
.modal__confirmation-msg { margin: 0 0 .5rem 0; }
.modal__action { display: inline-block; font-size: 1rem; padding: .25rem; border-radius: .25rem; }
.modal__submit { border: 1px #999 solid; }
.modal__cancel { border: 1px #999 dashed; text-decoration: none; }
+
+.hypha-list { padding-left: 0; }
+.hypha-list__entry { list-style-type: none; }
+.hypha-list__link { text-decoration: none; display: inline-block; padding: .25rem; }
+.hypha-list__link:hover { text-decoration: underline; }
+.hypha-list__amnt-type { font-size: smaller; color: #999; }
+
+/* General element positions, from small to big */
/* Phones and whatnot */
.layout { display: grid; row-gap: 1rem; }
header { width: 100%; margin-bottom: 1rem; }
diff --git a/templates/default.css b/templates/default.css
index c5d3001..31c7313 100644
--- a/templates/default.css
+++ b/templates/default.css
@@ -1,9 +1,16 @@
-/* General element positions, from small to big */
.modal__title { font-size: 2rem; }
.modal__confirmation-msg { margin: 0 0 .5rem 0; }
.modal__action { display: inline-block; font-size: 1rem; padding: .25rem; border-radius: .25rem; }
.modal__submit { border: 1px #999 solid; }
.modal__cancel { border: 1px #999 dashed; text-decoration: none; }
+
+.hypha-list { padding-left: 0; }
+.hypha-list__entry { list-style-type: none; }
+.hypha-list__link { text-decoration: none; display: inline-block; padding: .25rem; }
+.hypha-list__link:hover { text-decoration: underline; }
+.hypha-list__amnt-type { font-size: smaller; color: #999; }
+
+/* General element positions, from small to big */
/* Phones and whatnot */
.layout { display: grid; row-gap: 1rem; }
header { width: 100%; margin-bottom: 1rem; }
diff --git a/views/stuff.qtpl b/views/stuff.qtpl
index fed2faa..5fbdc25 100644
--- a/views/stuff.qtpl
+++ b/views/stuff.qtpl
@@ -1,5 +1,7 @@
-{% import "github.com/bouncepaw/mycorrhiza/util" %}
+{% import "path/filepath" %}
+{% import "github.com/bouncepaw/mycorrhiza/hyphae" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %}
+{% import "github.com/bouncepaw/mycorrhiza/util" %}
{% func BaseHTML(title, body string, u *user.User, headElements ...string) %}
@@ -70,37 +72,25 @@ for u := range user.YieldUsers() {
{% endfunc %}
-{% func HyphaListHTML(tbody string, pageCount int) %}
+{% func HyphaListHTML() %}
List of hyphae
- This wiki has {%d pageCount %} hyphae.
-
-
-
- | Full name |
- Binary part type |
-
-
-
- {%s= tbody %}
-
-
+ This wiki has {%d hyphae.Count() %} hyphae.
+
+ {% for h := range hyphae.YieldExistingHyphae() %}
+ -
+ {%s util.BeautifulName(h.Name) %}
+ {% if h.BinaryPath != "" %}
+ {%s filepath.Ext(h.BinaryPath)[1:] %}
+ {% endif %}
+
+ {% endfor %}
+
{% endfunc %}
-{% func HyphaListRowHTML(hyphaName, binaryMime string, binaryPresent bool) %}
-
- | {%s hyphaName %} |
- {% if binaryPresent %}
- {%s binaryMime %} |
- {% else %}
- |
- {% endif %}
-
-{% endfunc %}
-
{% func AboutHTML() %}
diff --git a/views/stuff.qtpl.go b/views/stuff.qtpl.go
index 7c63324..7780726 100644
--- a/views/stuff.qtpl.go
+++ b/views/stuff.qtpl.go
@@ -5,27 +5,33 @@
package views
//line views/stuff.qtpl:1
-import "github.com/bouncepaw/mycorrhiza/util"
+import "path/filepath"
//line views/stuff.qtpl:2
+import "github.com/bouncepaw/mycorrhiza/hyphae"
+
+//line views/stuff.qtpl:3
import "github.com/bouncepaw/mycorrhiza/user"
//line views/stuff.qtpl:4
+import "github.com/bouncepaw/mycorrhiza/util"
+
+//line views/stuff.qtpl:6
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
-//line views/stuff.qtpl:4
+//line views/stuff.qtpl:6
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
-//line views/stuff.qtpl:4
+//line views/stuff.qtpl:6
func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User, headElements ...string) {
-//line views/stuff.qtpl:4
+//line views/stuff.qtpl:6
qw422016.N().S(`
@@ -34,18 +40,18 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
`)
-//line views/stuff.qtpl:11
+//line views/stuff.qtpl:13
qw422016.E().S(title)
-//line views/stuff.qtpl:11
+//line views/stuff.qtpl:13
qw422016.N().S(`
`)
-//line views/stuff.qtpl:12
+//line views/stuff.qtpl:14
for _, el := range headElements {
-//line views/stuff.qtpl:12
+//line views/stuff.qtpl:14
qw422016.N().S(el)
-//line views/stuff.qtpl:12
+//line views/stuff.qtpl:14
}
-//line views/stuff.qtpl:12
+//line views/stuff.qtpl:14
qw422016.N().S(`
@@ -53,76 +59,76 @@ func StreamBaseHTML(qw422016 *qt422016.Writer, title, body string, u *user.User,
`)
-//line views/stuff.qtpl:25
+//line views/stuff.qtpl:27
qw422016.N().S(body)
-//line views/stuff.qtpl:25
+//line views/stuff.qtpl:27
qw422016.N().S(`