A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

93 lines
3.6 KiB

  1. {{define "base"}}<!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. {{ template "head" . }}
  5. <link rel="stylesheet" type="text/css" href="{{.Host}}/css/{{.Theme}}.css" />
  6. <link rel="shortcut icon" href="{{.Host}}/favicon.ico" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  8. <meta name="application-name" content="{{.SiteName}}">
  9. <meta name="application-url" content="{{.Host}}">
  10. <meta property="og:site_name" content="{{.SiteName}}" />
  11. </head>
  12. <body {{template "body-attrs" .}}>
  13. <div id="overlay"></div>
  14. <header>
  15. {{ if .Chorus }}<nav id="full-nav">
  16. <div class="left-side">
  17. <h2><a href="/">{{.SiteName}}</a></h2>
  18. </div>
  19. {{ else }}
  20. <h2><a href="/">{{.SiteName}}</a></h2>
  21. {{ end }}
  22. {{if not .SingleUser}}
  23. <nav id="user-nav">
  24. {{if .Username}}
  25. <nav class="dropdown-nav">
  26. <ul><li><a>{{.Username}}</a> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /><ul>
  27. {{if .IsAdmin}}<li><a href="/admin">Admin dashboard</a></li>{{end}}
  28. <li><a href="/me/settings">Account settings</a></li>
  29. <li><a href="/me/export">Export</a></li>
  30. {{if .CanInvite}}<li><a href="/me/invites">Invite people</a></li>{{end}}
  31. <li class="separator"><hr /></li>
  32. <li><a href="/me/logout">Log out</a></li>
  33. </ul></li>
  34. </ul>
  35. </nav>
  36. {{end}}
  37. <nav class="tabs">
  38. {{ if and .SimpleNav (not .SingleUser) }}
  39. {{if and (and .LocalTimeline .CanViewReader) .Chorus}}<a href="/"{{if eq .Path "/"}} class="selected"{{end}}>Home</a>{{end}}
  40. {{ end }}
  41. {{if or .Chorus (not .Username)}}<a href="/about"{{if eq .Path "/about"}} class="selected"{{end}}>About</a>{{end}}
  42. {{ if not .SingleUser }}
  43. {{ if .Username }}
  44. {{if or (not .Chorus) (gt .MaxBlogs 1)}}<a href="/me/c/"{{if eq .Path "/me/c/"}} class="selected"{{end}}>Blogs</a>{{end}}
  45. {{if and (and .Chorus (eq .MaxBlogs 1)) .Username}}<a href="/{{.Username}}/"{{if eq .Path (printf "/%s/" .Username)}} class="selected"{{end}}>My Posts</a>{{end}}
  46. {{if not .DisableDrafts}}<a href="/me/posts/"{{if eq .Path "/me/posts/"}} class="selected"{{end}}>Drafts</a>{{end}}
  47. {{ end }}
  48. {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}<a href="/read"{{if eq .Path "/read"}} class="selected"{{end}}>Reader</a>{{end}}
  49. {{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}}
  50. {{if 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}}
  51. {{ end }}
  52. </nav>
  53. {{if .Chorus}}{{if .Username}}<div class="right-side" style="font-size: 0.86em;">
  54. <a class="simple-btn" href="/new">New Post</a>
  55. </div>{{end}}
  56. </nav>
  57. {{end}}
  58. </nav>
  59. {{end}}
  60. </header>
  61. <div id="official-writing">
  62. {{ template "content" . }}
  63. </div>
  64. {{ template "footer" . }}
  65. {{if not .JSDisabled}}
  66. <script type="text/javascript">
  67. {{if .WebFonts}}
  68. try { // Google Fonts
  69. WebFontConfig = {
  70. custom: { families: [ 'Lora:400,700:latin', 'Open+Sans:400,700:latin' ], urls: [ '/css/fonts.css' ] }
  71. };
  72. (function() {
  73. var wf = document.createElement('script');
  74. wf.src = '/js/webfont.js';
  75. wf.type = 'text/javascript';
  76. wf.async = 'true';
  77. var s = document.getElementsByTagName('script')[0];
  78. s.parentNode.insertBefore(wf, s);
  79. })();
  80. } catch (e) { /* ¯\_(ツ)_/¯ */ }
  81. {{end}}
  82. </script>
  83. {{else}}
  84. {{if .WebFonts}}<link href="{{.Host}}/css/fonts.css" rel="stylesheet" type="text/css" />{{end}}
  85. {{end}}
  86. </body>
  87. </html>{{end}}
  88. {{define "body-attrs"}}{{end}}