diff --git a/account.go b/account.go index 236dfb3..ba013c2 100644 --- a/account.go +++ b/account.go @@ -49,6 +49,7 @@ type ( Separator template.HTML IsAdmin bool CanInvite bool + CollAlias string } ) @@ -840,6 +841,7 @@ func viewEditCollection(app *App, u *User, w http.ResponseWriter, r *http.Reques Collection: c, Silenced: silenced, } + obj.UserPage.CollAlias = c.Alias showUserPage(w, "collection", obj) return nil @@ -1019,6 +1021,7 @@ func viewStats(app *App, u *User, w http.ResponseWriter, r *http.Request) error TopPosts: topPosts, Silenced: silenced, } + obj.UserPage.CollAlias = c.Alias if app.cfg.App.Federation { folls, err := app.db.GetAPFollowers(c) if err != nil { diff --git a/less/admin.less b/less/admin.less index d9d659e..86dc9ff 100644 --- a/less/admin.less +++ b/less/admin.less @@ -32,6 +32,19 @@ nav#admin { display: flex; justify-content: center; + &:not(.pages) { + display: block; + margin: 0.5em 0; + a { + margin-left: 0; + .rounded(.25em); + + &+a { + margin-left: 0.5em; + } + } + } + a { color: #333; font-family: @sansFont; diff --git a/less/core.less b/less/core.less index b502c5d..b085241 100644 --- a/less/core.less +++ b/less/core.less @@ -10,6 +10,8 @@ @proSelectedCol: #71D571; @textLinkColor: rgb(0, 0, 238); +@accent: #767676; + body { font-family: @serifFont; font-size-adjust: 0.5; @@ -743,6 +745,18 @@ input, button, select.inputform, textarea.inputform, a.btn { } } +.btn.pager { + border: 1px solid @lightNavBorder; + font-size: .86em; + padding: .5em 1em; + white-space: nowrap; + font-family: @sansFont; + &:hover { + text-decoration: none; + background: @lightNavBorder; + } +} + div.flat-select { display: inline-block; position: relative; @@ -965,7 +979,12 @@ footer.contain-me { } ul { &.collections { + padding-left: 0; margin-left: 0; + h3 { + margin-top: 0; + font-weight: normal; + } li { &.collection { a.title { @@ -1095,7 +1114,8 @@ body#pad-sub #posts, .atoms { } .electron { font-weight: normal; - margin-left: 0.5em; + font-size: 0.86em; + margin-left: 0.75rem; } } h3, h4 { @@ -1245,7 +1265,7 @@ header { } } &.singleuser { - margin: 0.5em 0.25em; + margin: 0.5em 1em 0.5em 0.25em; nav#user-nav { nav > ul > li:first-child { img { @@ -1253,6 +1273,9 @@ header { } } } + .right-side { + padding-top: 0.5em; + } } .dash-nav { font-weight: bold; @@ -1547,3 +1570,26 @@ div.row { pre.code-block { overflow-x: auto; } + +#org-nav { + font-family: @sansFont; + font-size: 1.1em; + color: #888; + + em, strong { + color: #000; + } + &+h1 { + margin-top: 0.5em; + } + a:link, a:visited, a:hover { + color: @accent; + } + a:first-child { + margin-right: 0.25em; + } + a.coll-name { + font-weight: bold; + margin-left: 0.25em; + } +} \ No newline at end of file diff --git a/less/new-core.less b/less/new-core.less index 87d8158..c9e7a17 100644 --- a/less/new-core.less +++ b/less/new-core.less @@ -127,7 +127,6 @@ textarea { &.collection { a.title { font-size: 1.3em; - font-weight: bold; } } } diff --git a/templates.go b/templates.go index be1412c..846c5d8 100644 --- a/templates.go +++ b/templates.go @@ -11,6 +11,7 @@ package writefreely import ( + "errors" "html/template" "io" "io/ioutil" @@ -38,6 +39,9 @@ var ( "localhtml": localHTML, "tolower": strings.ToLower, "title": strings.Title, + "hasPrefix": strings.HasPrefix, + "hasSuffix": strings.HasSuffix, + "dict": dict, } ) @@ -109,6 +113,7 @@ func initUserPage(parentDir, path, key string) { filepath.Join(parentDir, templatesDir, "user", "include", "header.tmpl"), filepath.Join(parentDir, templatesDir, "user", "include", "footer.tmpl"), filepath.Join(parentDir, templatesDir, "user", "include", "silenced.tmpl"), + filepath.Join(parentDir, templatesDir, "user", "include", "nav.tmpl"), )) } @@ -206,3 +211,19 @@ func localHTML(term, lang string) template.HTML { s = strings.Replace(s, "write.as", "writefreely", 1) return template.HTML(s) } + +// from: https://stackoverflow.com/a/18276968/1549194 +func dict(values ...interface{}) (map[string]interface{}, error) { + if len(values)%2 != 0 { + return nil, errors.New("dict: invalid number of parameters") + } + dict := make(map[string]interface{}, len(values)/2) + for i := 0; i < len(values); i += 2 { + key, ok := values[i].(string) + if !ok { + return nil, errors.New("dict: keys must be strings") + } + dict[key] = values[i+1] + } + return dict, nil +} diff --git a/templates/user/admin/users.tmpl b/templates/user/admin/users.tmpl index 714fa24..4b2404e 100644 --- a/templates/user/admin/users.tmpl +++ b/templates/user/admin/users.tmpl @@ -26,7 +26,7 @@ {{end}} -