mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-05 17:40:26 +00:00
commit
b39f3e0862
@ -16,14 +16,22 @@ import (
|
|||||||
"github.com/bouncepaw/mycorrhiza/user"
|
"github.com/bouncepaw/mycorrhiza/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UploadText(h *hyphae.Hypha, data []byte, u *user.User) (hop *history.HistoryOp, errtitle string) {
|
func UploadText(h *hyphae.Hypha, data []byte, message string, u *user.User) (hop *history.HistoryOp, errtitle string) {
|
||||||
hop = history.Operation(history.TypeEditText)
|
hop = history.Operation(history.TypeEditText)
|
||||||
|
var action string
|
||||||
if h.Exists {
|
if h.Exists {
|
||||||
hop.WithMsg(fmt.Sprintf("Edit ‘%s’", h.Name))
|
action = "Edit"
|
||||||
} else {
|
} else {
|
||||||
hop.WithMsg(fmt.Sprintf("Create ‘%s’", h.Name))
|
action = "Create"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if message == "" {
|
||||||
|
hop.WithMsg(fmt.Sprintf("%s ‘%s’", action, h.Name))
|
||||||
|
} else {
|
||||||
|
hop.WithMsg(fmt.Sprintf("%s ‘%s’ with message: ‘%s’", action, h.Name, message))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if err, errtitle := CanEdit(u, h); err != nil {
|
if err, errtitle := CanEdit(u, h); err != nil {
|
||||||
return hop.WithErrAbort(err), errtitle
|
return hop.WithErrAbort(err), errtitle
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ textarea {font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif;
|
|||||||
.edit__title { margin-top: 0; }
|
.edit__title { margin-top: 0; }
|
||||||
.edit__preview { border: 2px dashed #ddd; }
|
.edit__preview { border: 2px dashed #ddd; }
|
||||||
.edit-form {height:70vh;}
|
.edit-form {height:70vh;}
|
||||||
.edit-form textarea {width:100%;height:95%;}
|
.edit-form textarea {width:100%;height:calc(100% - 6rem);}
|
||||||
.edit-form__save { font-weight: bold; }
|
.edit-form__save { font-weight: bold; }
|
||||||
.edit-toolbar__buttons, .edit-toolbar__ad { margin: .5rem; }
|
.edit-toolbar__buttons, .edit-toolbar__ad { margin: .5rem; }
|
||||||
|
|
||||||
@ -404,4 +404,4 @@ kbd {
|
|||||||
.dialog {
|
.dialog {
|
||||||
background-color: #343434;
|
background-color: #343434;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,10 @@
|
|||||||
<form method="post" class="edit-form"
|
<form method="post" class="edit-form"
|
||||||
action="/upload-text/{%s hyphaName %}">
|
action="/upload-text/{%s hyphaName %}">
|
||||||
<textarea name="text" class="edit-form__textarea" autofocus>{%s textAreaFill %}</textarea>
|
<textarea name="text" class="edit-form__textarea" autofocus>{%s textAreaFill %}</textarea>
|
||||||
<br/>
|
<br/><br/>
|
||||||
|
<label for="text">Edit description:</label>
|
||||||
|
<input id="text" type="text" name="message" class="edit-form__message">
|
||||||
|
<br/><br/>
|
||||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||||
<a href="/hypha/{%s hyphaName %}" class="edit-form__cancel">Cancel</a>
|
<a href="/hypha/{%s hyphaName %}" class="edit-form__cancel">Cancel</a>
|
||||||
@ -88,7 +91,7 @@
|
|||||||
{%= editScripts() %}
|
{%= editScripts() %}
|
||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
{% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) %}
|
{% func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) %}
|
||||||
{%s= NavHTML(rq, hyphaName, "edit") %}
|
{%s= NavHTML(rq, hyphaName, "edit") %}
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<main class="main-width edit edit_with-preview">
|
<main class="main-width edit edit_with-preview">
|
||||||
@ -97,7 +100,10 @@
|
|||||||
<form method="post" class="edit-form"
|
<form method="post" class="edit-form"
|
||||||
action="/upload-text/{%s hyphaName %}">
|
action="/upload-text/{%s hyphaName %}">
|
||||||
<textarea class="edit-form__textarea" name="text">{%s textAreaFill %}</textarea>
|
<textarea class="edit-form__textarea" name="text">{%s textAreaFill %}</textarea>
|
||||||
<br/>
|
<br/><br/>
|
||||||
|
<label for="text">Edit description:</label>
|
||||||
|
<input id="text" type="text" name="message" class="edit-form__message" value="{%s message %}">
|
||||||
|
<br/><br/>
|
||||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||||
<a href="/hypha/{%s hyphaName %}" class="edit-form__cancel">Cancel</a>
|
<a href="/hypha/{%s hyphaName %}" class="edit-form__cancel">Cancel</a>
|
||||||
|
@ -204,191 +204,201 @@ func StreamEditHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, text
|
|||||||
qw422016.E().S(textAreaFill)
|
qw422016.E().S(textAreaFill)
|
||||||
//line views/mutators.qtpl:79
|
//line views/mutators.qtpl:79
|
||||||
qw422016.N().S(`</textarea>
|
qw422016.N().S(`</textarea>
|
||||||
<br/>
|
<br/><br/>
|
||||||
|
<label for="text">Edit description:</label>
|
||||||
|
<input id="text" type="text" name="message" class="edit-form__message">
|
||||||
|
<br/><br/>
|
||||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||||
<a href="/hypha/`)
|
<a href="/hypha/`)
|
||||||
//line views/mutators.qtpl:83
|
//line views/mutators.qtpl:83
|
||||||
qw422016.E().S(hyphaName)
|
qw422016.E().S(hyphaName)
|
||||||
//line views/mutators.qtpl:83
|
//line views/mutators.qtpl:86
|
||||||
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:86
|
//line views/mutators.qtpl:89
|
||||||
qw422016.N().S(Toolbar(user.FromRequest(rq)))
|
qw422016.N().S(Toolbar(user.FromRequest(rq)))
|
||||||
//line views/mutators.qtpl:86
|
//line views/mutators.qtpl:89
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:88
|
//line views/mutators.qtpl:91
|
||||||
streameditScripts(qw422016)
|
streameditScripts(qw422016)
|
||||||
//line views/mutators.qtpl:88
|
//line views/mutators.qtpl:91
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
|
func WriteEditHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
|
StreamEditHTML(qw422016, rq, hyphaName, textAreaFill, warning)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
|
func EditHTML(rq *http.Request, hyphaName, textAreaFill, warning string) string {
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
|
WriteEditHTML(qb422016, rq, hyphaName, textAreaFill, warning)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
return qs422016
|
return qs422016
|
||||||
//line views/mutators.qtpl:89
|
//line views/mutators.qtpl:92
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:91
|
//line views/mutators.qtpl:94
|
||||||
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
|
func StreamPreviewHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
|
||||||
//line views/mutators.qtpl:91
|
//line views/mutators.qtpl:94
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:92
|
//line views/mutators.qtpl:95
|
||||||
qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
|
qw422016.N().S(NavHTML(rq, hyphaName, "edit"))
|
||||||
//line views/mutators.qtpl:92
|
//line views/mutators.qtpl:95
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<main class="main-width edit edit_with-preview">
|
<main class="main-width edit edit_with-preview">
|
||||||
<h1>Edit `)
|
<h1>Edit `)
|
||||||
//line views/mutators.qtpl:95
|
//line views/mutators.qtpl:98
|
||||||
qw422016.E().S(util.BeautifulName(hyphaName))
|
qw422016.E().S(util.BeautifulName(hyphaName))
|
||||||
//line views/mutators.qtpl:95
|
//line views/mutators.qtpl:98
|
||||||
qw422016.N().S(` (preview)</h1>
|
qw422016.N().S(` (preview)</h1>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:96
|
//line views/mutators.qtpl:99
|
||||||
qw422016.N().S(warning)
|
qw422016.N().S(warning)
|
||||||
//line views/mutators.qtpl:96
|
//line views/mutators.qtpl:99
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<form method="post" class="edit-form"
|
<form method="post" class="edit-form"
|
||||||
action="/upload-text/`)
|
action="/upload-text/`)
|
||||||
//line views/mutators.qtpl:98
|
//line views/mutators.qtpl:101
|
||||||
qw422016.E().S(hyphaName)
|
qw422016.E().S(hyphaName)
|
||||||
//line views/mutators.qtpl:98
|
//line views/mutators.qtpl:101
|
||||||
qw422016.N().S(`">
|
qw422016.N().S(`">
|
||||||
<textarea class="edit-form__textarea" name="text">`)
|
<textarea class="edit-form__textarea" name="text">`)
|
||||||
//line views/mutators.qtpl:99
|
//line views/mutators.qtpl:102
|
||||||
qw422016.E().S(textAreaFill)
|
qw422016.E().S(textAreaFill)
|
||||||
//line views/mutators.qtpl:99
|
//line views/mutators.qtpl:102
|
||||||
qw422016.N().S(`</textarea>
|
qw422016.N().S(`</textarea>
|
||||||
<br/>
|
<br/><br/>
|
||||||
|
<label for="text">Edit description:</label>
|
||||||
|
<input id="text" type="text" name="message" class="edit-form__message" value="`)
|
||||||
|
//line views/mutators.qtpl:105
|
||||||
|
qw422016.E().S(message)
|
||||||
|
//line views/mutators.qtpl:105
|
||||||
|
qw422016.N().S(`">
|
||||||
|
<br/><br/>
|
||||||
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
<input type="submit" name="action" value="Save" class="edit-form__save"/>
|
||||||
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
<input type="submit" name="action" value="Preview" class="edit-form__preview">
|
||||||
<a href="/hypha/`)
|
<a href="/hypha/`)
|
||||||
//line views/mutators.qtpl:103
|
//line views/mutators.qtpl:103
|
||||||
qw422016.E().S(hyphaName)
|
qw422016.E().S(hyphaName)
|
||||||
//line views/mutators.qtpl:103
|
//line views/mutators.qtpl:109
|
||||||
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
qw422016.N().S(`" class="edit-form__cancel">Cancel</a>
|
||||||
</form>
|
</form>
|
||||||
<p class="warning">Note that the hypha is not saved yet. You can preview the changes ↓</p>
|
<p class="warning">Note that the hypha is not saved yet. You can preview the changes ↓</p>
|
||||||
<article class="edit__preview">`)
|
<article class="edit__preview">`)
|
||||||
//line views/mutators.qtpl:106
|
//line views/mutators.qtpl:112
|
||||||
qw422016.N().S(renderedPage)
|
qw422016.N().S(renderedPage)
|
||||||
//line views/mutators.qtpl:106
|
//line views/mutators.qtpl:112
|
||||||
qw422016.N().S(`</article>
|
qw422016.N().S(`</article>
|
||||||
</main>
|
</main>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:108
|
//line views/mutators.qtpl:114
|
||||||
qw422016.N().S(Toolbar(user.FromRequest(rq)))
|
qw422016.N().S(Toolbar(user.FromRequest(rq)))
|
||||||
//line views/mutators.qtpl:108
|
//line views/mutators.qtpl:114
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:110
|
//line views/mutators.qtpl:116
|
||||||
streameditScripts(qw422016)
|
streameditScripts(qw422016)
|
||||||
//line views/mutators.qtpl:110
|
//line views/mutators.qtpl:116
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) {
|
func WritePreviewHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, warning, renderedPage)
|
StreamPreviewHTML(qw422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, warning string, renderedPage string) string {
|
func PreviewHTML(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) string {
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, warning, renderedPage)
|
WritePreviewHTML(qb422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
return qs422016
|
return qs422016
|
||||||
//line views/mutators.qtpl:111
|
//line views/mutators.qtpl:117
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:113
|
//line views/mutators.qtpl:119
|
||||||
func streameditScripts(qw422016 *qt422016.Writer) {
|
func streameditScripts(qw422016 *qt422016.Writer) {
|
||||||
//line views/mutators.qtpl:113
|
//line views/mutators.qtpl:119
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:114
|
//line views/mutators.qtpl:120
|
||||||
for _, scriptPath := range cfg.EditScripts {
|
for _, scriptPath := range cfg.EditScripts {
|
||||||
//line views/mutators.qtpl:114
|
//line views/mutators.qtpl:120
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<script src="`)
|
<script src="`)
|
||||||
//line views/mutators.qtpl:115
|
//line views/mutators.qtpl:121
|
||||||
qw422016.E().S(scriptPath)
|
qw422016.E().S(scriptPath)
|
||||||
//line views/mutators.qtpl:115
|
//line views/mutators.qtpl:121
|
||||||
qw422016.N().S(`"></script>
|
qw422016.N().S(`"></script>
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:116
|
//line views/mutators.qtpl:122
|
||||||
}
|
}
|
||||||
//line views/mutators.qtpl:116
|
//line views/mutators.qtpl:122
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
func writeeditScripts(qq422016 qtio422016.Writer) {
|
func writeeditScripts(qq422016 qtio422016.Writer) {
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
streameditScripts(qw422016)
|
streameditScripts(qw422016)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
}
|
}
|
||||||
|
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
func editScripts() string {
|
func editScripts() string {
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
writeeditScripts(qb422016)
|
writeeditScripts(qb422016)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
return qs422016
|
return qs422016
|
||||||
//line views/mutators.qtpl:117
|
//line views/mutators.qtpl:123
|
||||||
}
|
}
|
||||||
|
@ -173,13 +173,14 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) {
|
|||||||
h = hyphae.ByName(hyphaName)
|
h = hyphae.ByName(hyphaName)
|
||||||
textData = rq.PostFormValue("text")
|
textData = rq.PostFormValue("text")
|
||||||
action = rq.PostFormValue("action")
|
action = rq.PostFormValue("action")
|
||||||
|
message = rq.PostFormValue("message")
|
||||||
u = user.FromRequest(rq)
|
u = user.FromRequest(rq)
|
||||||
hop *history.HistoryOp
|
hop *history.HistoryOp
|
||||||
errtitle string
|
errtitle string
|
||||||
)
|
)
|
||||||
|
|
||||||
if action != "Preview" {
|
if action != "Preview" {
|
||||||
hop, errtitle = shroom.UploadText(h, []byte(textData), u)
|
hop, errtitle = shroom.UploadText(h, []byte(textData), message, u)
|
||||||
if hop.HasErrors() {
|
if hop.HasErrors() {
|
||||||
httpErr(w, http.StatusForbidden, hyphaName,
|
httpErr(w, http.StatusForbidden, hyphaName,
|
||||||
errtitle,
|
errtitle,
|
||||||
@ -199,6 +200,7 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) {
|
|||||||
rq,
|
rq,
|
||||||
hyphaName,
|
hyphaName,
|
||||||
textData,
|
textData,
|
||||||
|
message,
|
||||||
"",
|
"",
|
||||||
mycomarkup.BlocksToHTML(ctx, mycomarkup.BlockTree(ctx))),
|
mycomarkup.BlocksToHTML(ctx, mycomarkup.BlockTree(ctx))),
|
||||||
u))
|
u))
|
||||||
|
Loading…
Reference in New Issue
Block a user