1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 05:20:26 +00:00

DarkTheme edit page

This commit is contained in:
Dan Konshin 2020-06-24 18:32:59 +05:00
parent 42d963b19d
commit 4ee2841896
5 changed files with 48 additions and 30 deletions

View File

@ -11,17 +11,17 @@ import (
// EditHyphaPage returns HTML page of hypha editor. // EditHyphaPage returns HTML page of hypha editor.
func EditHyphaPage(name, textMime, content, tags string) string { func EditHyphaPage(name, textMime, content, tags string) string {
keys := map[string]string{
"Title": fmt.Sprintf(cfg.TitleEditTemplate, name),
"Header": renderFromString(name, "Hypha/edit/header.html"),
"Sidebar": renderFromString("", "Hypha/edit/sidebar.html"),
}
page := map[string]string{ page := map[string]string{
"Text": content, "Text": content,
"TextMime": textMime, "TextMime": textMime,
"Name": name, "Name": name,
"Tags": tags, "Tags": tags,
} }
keys := map[string]string{
"Title": fmt.Sprintf(cfg.TitleEditTemplate, name),
"Header": renderFromString(name, "Hypha/edit/header.html"),
"Sidebar": renderFromMap(page, "Hypha/edit/sidebar.html"),
}
return renderBase(renderFromMap(page, "Hypha/edit/index.html"), keys) return renderBase(renderFromMap(page, "Hypha/edit/index.html"), keys)
} }

View File

@ -1,36 +1,16 @@
<div class="naviwrapper"> <div class="naviwrapper">
<form class="naviwrapper__edit edit-box" <form class="naviwrapper__edit edit-box"
method="POST" method="POST"
id="editform"
enctype="multipart/form-data" enctype="multipart/form-data"
action="?action=update"> action="?action=update">
<div class="naviwrapper__buttons">
<input type="submit" value="update"/>
</div>
<div class="edit-box__left"> <div class="edit-box__left">
<h4>Edit box</h4> <h4 class="">Edit box</h4>
<!-- It is important that there is no indent ↓ --> <!-- It is important that there is no indent ↓ -->
<textarea class="edit-box__text" name="text" cols="80" rows="25"> <textarea class="edit-box__text" name="text" cols="80" rows="25">
{{ .Text }} {{ .Text }}
</textarea> </textarea>
<h4>Upload file</h4>
<p>If this hypha has a file like that, the text above is meant to be a description of it</p>
<input type="file" name="binary"/>
</div>
<div class="edit-box__right">
<h4>Text MIME-type</h4>
<p>Good types are <code>text/markdown</code> and <code>text/plain</code></p>
<input type="text" name="text_mime" value="{{ .TextMime }}"/>
<h4>Revision comment</h4>
<p>Please make your comment helpful</p>
<input type="text" name="comment" value="Update {{ .Name }}"/>
<h4>Edit tags</h4>
<p>Tags are separated by commas, whitespace is ignored</p>
<input type="text" name="tags" value="{{ .Tags }}"/>
</div> </div>
</form> </form>
</div> </div>

View File

@ -0,0 +1,19 @@
<div style=""><h4>Text MIME-type</h4>
<p>Good types are <code>text/markdown</code> and <code>text/plain</code></p>
<input type="text" name="text_mime" value="{{ .TextMime }}"/>
<h4>Revision comment</h4>
<p>Please make your comment helpful</p>
<input type="text" name="comment" value="Update {{ .Name }}"/>
<h4>Edit tags</h4>
<p>Tags are separated by commas, whitespace is ignored</p>
<input type="text" name="tags" value="{{ .Tags }}"/>
<h4>Upload file</h4>
<p>If this hypha has a file like that, the text above is meant to be a description of it</p>
<input type="file" name="binary"/>
<p><input type="submit" value="update"/></p>
</div>

View File

@ -0,0 +1,19 @@
{
"views": 0,
"deleted": false,
"revisions": {
"1": {
"tags": [
""
],
"name": "sidebar.html",
"comment": "Create Templates/default-dark/Hypha/edit/sidebar.html",
"author": "",
"time": 1593003792,
"text_mime": "text/html",
"binary_mime": "",
"text_name": "1.html",
"binary_name": ""
}
}
}

View File

@ -182,7 +182,7 @@ footer a, footer a:visited {
position: fixed; position: fixed;
top: 0; top: 0;
bottom: 0; bottom: 0;
width: 274px; min-width: 274px;
right: 0; right: 0;
} }
@ -192,7 +192,7 @@ footer a, footer a:visited {
} }
.sidebar { .sidebar {
padding: 16px 0; padding: 16px;
border-radius: 1rem; border-radius: 1rem;
background-color: rgba(255,255,255,.05); background-color: rgba(255,255,255,.05);
} }