Didn't have the chance to migrate //all// templates just yet. We'll get there.
* Implement yet another template system
* Move orphans to the new system and fix a bug in it
* Link orphans in the admin panel
* Move the backlink handlers to the web package
* Move auth routing to web
* Move /user-list to the new system
* Move change password and translate it
* Move stuff
* Move admin-related stuff to the web
* Move a lot of files into internal dir
Outside of it are web and stuff that needs further refactoring
* Fix static not loading and de-qtpl tree
* Move tree to internal
* Keep the globe on the same line #230
* Revert "Keep the globe on the same line #230"
This reverts commit ae78e5e459.
* Migrate templates from hypview: delete, edit, start empty and existing WIP
The delete media view was removed, I didn't even know it still existed as a GET. A rudiment.
* Make views multi-file and break compilation
* Megarefactoring of hypha views
* Auth-related stuffs
* Fix some of those weird imports
* Migrate cat views
* Fix cat js
* Lower standards
* Internalize trauma
108 lines
6.0 KiB
HTML
108 lines
6.0 KiB
HTML
{{define "toolbar"}}
|
|
<aside class="edit-toolbar markup-toolbar layout-card">
|
|
<h2 class="edit-toolbar__title layout-card__title">{{block "markup" .}}Markup{{end}}</h2>
|
|
<section class="edit-toolbar__buttons">
|
|
<button class="btn edit-toolbar__btn edit-toolbar__link">[[{{block "link" .}}Link{{end}}]]</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__titlelink">[[{{template "link" .}} | {{block "link title" .}}Title{{end}}]]</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__heading1">= {{block "heading" .}}Heading{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__heading2">== {{template "heading" .}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__bold"><b>**{{block "bold" .}}Bold{{end}}**</b></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__italic"><i>//{{block "italic" .}}Italic{{end}}//</i></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__highlighted"><mark>++{{block "highlight" .}}Highlight{{end}}++</mark></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__underline"><u>__{{block "underline" .}}Underline{{end}}__</u></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__monospace"><code>`{{block "mono" .}}Monospace{{end}}`</code></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__lifted"><sup>^^{{block "super" .}}Supertext{{end}}^^</sup></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__lowered"><sub>,,{{block "sub" .}}Subtext{{end}},,</sub></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__strikethrough"><s>~~{{block "strike" .}}Strikethrough{{end}}~~</s></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__rocket">=> {{block "rocket" .}}Rocketlink{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__xcl"><= {{block "transclude" .}}Transclusion{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__img"><code>img {}</code></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__table"><code>table {}</code></button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__hr">{{block "hr" .}}Horizontal bar{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__codeblock">{{block "code" .}}Code block{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__bulletedlist">* {{block "bullets" .}}Bullet list{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__numberedlist">*. {{block "numbers" .}}Number list{{end}}</button>
|
|
</section>
|
|
<p class="edit-toolbar__help">
|
|
{{block "mycomarkup help" .}}
|
|
<a href="/help/en/mycomarkup" target="_blank" class="shy-link">Learn more</a> about Mycomarkup
|
|
{{end}}
|
|
</p>
|
|
</aside>
|
|
<aside class="edit-toolbar action-toolbar layout-card">
|
|
<h2 class="edit-toolbar__title layout-card__title">{{block "actions" .}}Actions{{end}}</h2>
|
|
<section class="edit-toolbar__buttons">
|
|
<button class="btn edit-toolbar__btn edit-toolbar__date-local">{{block "current date local" .}}Current local date{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__time-local">{{block "current time local" .}}Current local time{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__date-utc">{{block "current date utc" .}}Current date UTC{{end}}</button>
|
|
<button class="btn edit-toolbar__btn edit-toolbar__time-utc">{{block "current time utc" .}}Current time UTC{{end}}</button>
|
|
{{if .Meta.U.Group | ne "anon"}}
|
|
<button class="btn edit-toolbar__btn edit-toolbar__user-link">{{block "selflink" .}}Link yourself{{end}}</button>
|
|
{{end}}
|
|
</section>
|
|
</aside>
|
|
<script src="/static/toolbar.js"></script>
|
|
{{end}}
|
|
|
|
{{define "editing hypha"}}Edit {{beautifulName .}}{{end}}
|
|
{{define "previewing hypha"}}Preview of {{beautifulName .}}{{end}}
|
|
{{define "title"}}
|
|
{{- if .Preview -}}
|
|
{{template "previewing hypha" .HyphaName}}
|
|
{{- else -}}
|
|
{{template "editing hypha" .HyphaName}}
|
|
{{- end -}}
|
|
{{end}}
|
|
{{define "body"}}
|
|
<main class="main-width edit {{if .Preview}}edit_with-preview{{else}}edit_no-preview{{end}}">
|
|
<form method="post" class="edit-form" action="/upload-text/{{.HyphaName}}">
|
|
<h1 class="edit__title">
|
|
{{if .IsNew}}
|
|
{{block "creating [[hypha]]" .HyphaName}}
|
|
Create <a href="/hypha/{{.}}">{{beautifulName .}}</a>
|
|
{{end}}
|
|
{{else}}
|
|
{{block "editing [[hypha]]" .HyphaName}}
|
|
Edit <a href="/hypha/{{.}}">{{beautifulName .}}</a>
|
|
{{end}}
|
|
{{end}}
|
|
</h1>
|
|
<textarea name="text" class="edit-form__textarea" autofocus>{{.Content}}</textarea>
|
|
<p class="edit-form__message-zone">
|
|
<input
|
|
id="text"
|
|
type="text"
|
|
name="message"
|
|
class="edit-form__message"
|
|
value="{{.Message}}"
|
|
placeholder="{{block "describe your changes" .}}Describe your changes{{end}}"
|
|
aria-label="{{template "describe your changes" .}}">
|
|
</p>
|
|
<p class="edit-form__buttons">
|
|
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="save">
|
|
{{template "save" .}}
|
|
</button>
|
|
<button type="submit" name="action" class="btn edit-form__preview" value="preview">
|
|
{{block "preview" .}}Preview{{end}}
|
|
</button>
|
|
<a href="/hypha/{{.HyphaName}}" class="btn btn_weak">
|
|
{{template "cancel" .}}
|
|
</a>
|
|
</p>
|
|
</form>
|
|
{{if .Preview}}
|
|
<p class="warning">
|
|
{{block "preview tip" .}}Note that the hypha hasn't been saved yet. Here's the preview:{{end}}
|
|
</p>
|
|
<article class="edit__preview">
|
|
{{.Preview}}
|
|
</article>
|
|
{{end}}
|
|
</main>
|
|
{{template "toolbar" .}}
|
|
<script src="/static/editor.js"></script>
|
|
{{range .EditScripts}}
|
|
<script src="{{.}}"></script>
|
|
{{end}}
|
|
{{end}}
|