Use normal nav on user pages when SimpleNav

This shows About, Reader, Log out links on backend user pages when
logged in. It also adds "New post" buttons on the backend pages and
blogs.
pull/155/head
Matt Baer 5 years ago
parent 81847fbbcc
commit 90ad50c7f5
  1. 25
      less/core.less
  2. 2
      templates/base.tmpl
  3. 1
      templates/collection.tmpl
  4. 23
      templates/user/include/header.tmpl

@ -405,6 +405,31 @@ body {
} }
} }
nav#full-nav {
margin: 0;
.left-side {
display: inline-block;
a:first-child {
margin-left: 0;
}
}
.right-side {
float: right;
}
}
nav#full-nav a.simple-btn {
font-family: @sansFont;
border: 1px solid #ccc !important;
padding: .5rem 1rem;
margin: 0;
.rounded(.25em);
text-decoration: none;
}
.post-title { .post-title {
a { a {
&:link { &:link {

@ -19,7 +19,7 @@
<nav class="tabs"> <nav class="tabs">
<a href="/about"{{if eq .Path "/about"}} class="selected"{{end}}>About</a> <a href="/about"{{if eq .Path "/about"}} class="selected"{{end}}>About</a>
{{if and (and (not .SingleUser) .LocalTimeline) .CanViewReader}}<a href="/read"{{if eq .Path "/read"}} class="selected"{{end}}>Reader</a>{{end}} {{if and (and (not .SingleUser) .LocalTimeline) .CanViewReader}}<a href="/read"{{if eq .Path "/read"}} class="selected"{{end}}>Reader</a>{{end}}
{{if and (not .SingleUser) (not .Username)}}<a href="/login"{{if eq .Path "/login"}} class="selected"{{end}}>Log in</a>{{end}} {{if and (not .SingleUser) (not .Username)}}<a href="/login"{{if eq .Path "/login"}} class="selected"{{end}}>Log in</a>{{else if .SimpleNav}}<a href="/me/logout">Log out</a>{{end}}
</nav> </nav>
</nav> </nav>
{{end}} {{end}}

@ -48,6 +48,7 @@
{{else}} {{else}}
<li><a href="/#{{.Alias}}" class="write">{{.SiteName}}</a></li> <li><a href="/#{{.Alias}}" class="write">{{.SiteName}}</a></li>
{{end}} {{end}}
{{if .SimpleNav}}<li><a href="/new#{{.Alias}}">New Post</a></li>{{end}}
<li><a href="/me/c/{{.Alias}}">Customize</a></li> <li><a href="/me/c/{{.Alias}}">Customize</a></li>
<li><a href="/me/c/{{.Alias}}/stats">Stats</a></li> <li><a href="/me/c/{{.Alias}}/stats">Stats</a></li>
<li class="separator"><hr /></li> <li class="separator"><hr /></li>

@ -38,7 +38,13 @@
</nav> </nav>
</nav> </nav>
{{else}} {{else}}
<h1><a href="/" title="Return to editor">{{.SiteName}}</a></h1> {{ if .SimpleNav }}<nav id="full-nav">
<div class="left-side">
<h1><a href="/" title="Return to editor">{{.SiteName}}</a></h1>
</div>
{{ else }}
<h1><a href="/" title="Return to editor">{{.SiteName}}</a></h1>
{{ end }}
<nav id="user-nav"> <nav id="user-nav">
<nav class="dropdown-nav"> <nav class="dropdown-nav">
<ul><li><a>{{.Username}}</a> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /><ul> <ul><li><a>{{.Username}}</a> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /><ul>
@ -52,10 +58,21 @@
</ul> </ul>
</nav> </nav>
<nav class="tabs"> <nav class="tabs">
<a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a> {{if .SimpleNav}}
<a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a> <a href="/about">About</a>
{{if and (and (not .SingleUser) .LocalTimeline) .CanViewReader}}<a href="/read">Reader</a>{{end}}
<a href="/me/logout">Log out</a>
{{else}}
<a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a>
<a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a>
{{end}}
</nav> </nav>
</nav> </nav>
{{if .SimpleNav}}<div class="right-side">
<a class="simple-btn" href="/new">New Post</a>
</div>
</nav>
{{end}}
{{end}} {{end}}
</header> </header>
<div id="official-writing"> <div id="official-writing">

Loading…
Cancel
Save