1{{define "user-navigation"}} 2 <header class="{{if .SingleUser}}singleuser{{else}}multiuser{{end}}"> 3 <nav id="full-nav"> 4 {{if .SingleUser}} 5 <nav id="user-nav"> 6 <nav class="dropdown-nav"> 7 <ul><li><a href="/" title="View blog" class="title">{{.SiteName}}</a> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /> 8 <ul> 9 {{if .IsAdmin}}<li><a href="/admin">Admin dashboard</a></li>{{end}} 10 <li><a href="/me/settings">Account settings</a></li> 11 <li><a href="/me/import">Import posts</a></li> 12 <li><a href="/me/export">Export</a></li> 13 <li class="separator"><hr /></li> 14 <li><a href="/me/logout">Log out</a></li> 15 </ul></li> 16 </ul> 17 </nav> 18 <nav class="tabs"> 19 <a href="/me/c/{{.Username}}" {{if and (hasPrefix .Path "/me/c/") (hasSuffix .Path .Username)}}class="selected"{{end}}>Customize</a> 20 <a href="/me/c/{{.Username}}/stats" {{if hasSuffix .Path "/stats"}}class="selected"{{end}}>Stats</a> 21 <a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a> 22 </nav> 23 </nav> 24 <div class="right-side"> 25 <a class="simple-btn" href="/me/new">New Post</a> 26 </div> 27 {{else}} 28 <div class="left-side"> 29 <h1><a href="/" title="Return to editor">{{.SiteName}}</a></h1> 30 </div> 31 <nav id="user-nav"> 32 {{if .Username}} 33 <nav class="dropdown-nav"> 34 <ul><li class="has-submenu"><a>{{.Username}}</a> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /><ul> 35 {{if .IsAdmin}}<li><a href="/admin">Admin dashboard</a></li>{{end}} 36 <li><a href="/me/settings">Account settings</a></li> 37 <li><a href="/me/import">Import posts</a></li> 38 <li><a href="/me/export">Export</a></li> 39 {{if .CanInvite}}<li><a href="/me/invites">Invite people</a></li>{{end}} 40 <li class="separator"><hr /></li> 41 <li><a href="/me/logout">Log out</a></li> 42 </ul></li> 43 </ul> 44 </nav> 45 {{end}} 46 <nav class="tabs"> 47 {{if .SimpleNav}} 48 {{ if not .SingleUser }} 49 {{if and (and .LocalTimeline .CanViewReader) .Chorus}}<a href="/"{{if eq .Path "/"}} class="selected"{{end}}>Home</a>{{end}} 50 {{ end }} 51 <a href="/about">About</a> 52 {{ if not .SingleUser }} 53 {{ if .Username }} 54 {{if gt .MaxBlogs 1}}<a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a>{{end}} 55 {{if and .Chorus (eq .MaxBlogs 1)}}<a href="/{{.Username}}/"{{if eq .Path (printf "/%s/" .Username)}} class="selected"{{end}}>My Posts</a>{{end}} 56 {{if not .DisableDrafts}}<a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a>{{end}} 57 {{ end }} 58 {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}<a href="/read">Reader</a>{{end}} 59 {{if and (and (and .Chorus .OpenRegistration) (not .Username)) (or (not .Private) (ne .Landing ""))}}<a href="/signup"{{if eq .Path "/signup"}} class="selected"{{end}}>Sign up</a>{{end}} 60 {{if .Username}}<a href="/me/logout">Log out</a>{{else}}<a href="/login">Log in</a>{{end}} 61 {{ end }} 62 {{else}} 63 <a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a> 64 {{if not .DisableDrafts}}<a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a>{{end}} 65 {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}<a href="/read">Reader</a>{{end}} 66 {{end}} 67 </nav> 68 </nav> 69 {{if .Username}} 70 <div class="right-side"> 71 <a class="simple-btn" href="/{{if .CollAlias}}#{{.CollAlias}}{{end}}">New Post</a> 72 </div> 73 {{end}} 74 {{end}} 75 </nav> 76 </header> 77{{end}} 78{{define "header"}}<!DOCTYPE HTML> 79<html> 80<head> 81 <meta charset="utf-8"> 82 83 <title>{{.PageTitle}} {{if .Separator}}{{.Separator}}{{else}}—{{end}} {{.SiteName}}</title> 84 85 <link rel="stylesheet" type="text/css" href="/css/write.css" /> 86 <link rel="shortcut icon" href="/favicon.ico" /> 87 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 88 <meta name="theme-color" content="#888888" /> 89 <meta name="apple-mobile-web-app-title" content="{{.SiteName}}"> 90 <link rel="apple-touch-icon" sizes="152x152" href="/img/touch-icon-152.png"> 91 <link rel="apple-touch-icon" sizes="167x167" href="/img/touch-icon-167.png"> 92 <link rel="apple-touch-icon" sizes="180x180" href="/img/touch-icon-180.png"> 93</head> 94<body id="me"> 95 {{template "user-navigation" .}} 96 <div id="official-writing"> 97{{end}} 98 99{{define "admin-header"}} 100<header class="admin"> 101 <h1>Admin</h1> 102 <nav id="admin" class="pager"> 103 <a href="/admin" {{if eq .Path "/admin"}}class="selected"{{end}}>Dashboard</a> 104 <a href="/admin/settings" {{if eq .Path "/admin/settings"}}class="selected"{{end}}>Settings</a> 105 {{if not .SingleUser}} 106 <a href="/admin/users" {{if eq .Path "/admin/users"}}class="selected"{{end}}>Users</a> 107 <a href="/admin/pages" {{if eq .Path "/admin/pages"}}class="selected"{{end}}>Pages</a> 108 {{if .UpdateChecks}}<a href="/admin/updates" {{if eq .Path "/admin/updates"}}class="selected"{{end}}>Updates{{if .UpdateAvailable}}<span class="blip">!</span>{{end}}</a>{{end}} 109 {{end}} 110 {{if not .Forest}} 111 <a href="/admin/monitor" {{if eq .Path "/admin/monitor"}}class="selected"{{end}}>Monitor</a> 112 {{end}} 113 </nav> 114</header> 115{{end}} 116