mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-04-14 14:53:21 +00:00
Editor: Make the textarea bigger
This commit is contained in:
parent
49b94074d1
commit
57efc3e848
@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "Редактирование «%s»",
|
||||
"title": "Редактирование %s",
|
||||
|
||||
"new_hypha": "Вы создаёте новую гифу.",
|
||||
"tag": "Опишите ваши правки:",
|
||||
|
@ -92,19 +92,15 @@ body { margin: 0; font-size:16px; font-family: sans-serif; color: black; }
|
||||
input, kbd { font: inherit; color: inherit; }
|
||||
textarea {font-size:16px; font-family: inherit; line-height: 150%; }
|
||||
|
||||
.edit { min-height: 80vh; }
|
||||
.edit { height: 90vh; }
|
||||
.edit__title { margin-top: 0; }
|
||||
.edit__preview { border: 2px dashed #ddd; padding: 10px; }
|
||||
.edit-form__textarea { width: 100%; height: calc(100% - 8rem); min-height: 4rem; }
|
||||
.edit-form__textarea { width: 100%; height: 80vh; min-height: 4rem; }
|
||||
.edit-form p { margin: .25rem 0; }
|
||||
.edit-form__message { width: 100%; margin: 0.25em 0; }
|
||||
.edit-form__save { font-weight: bold; }
|
||||
.edit-toolbar__buttons, .edit-toolbar__ad { margin: .5rem; }
|
||||
@media screen and (max-height: 500px) {
|
||||
.edit-form { height: 90vh; }
|
||||
}
|
||||
@media screen and (min-height: 501px) {
|
||||
.edit-form { height: 80vh; }
|
||||
}
|
||||
.edit-form { height: 100%; display: flex; flex-direction: column; }
|
||||
|
||||
.icon {margin-right: .25rem; vertical-align: bottom; }
|
||||
|
||||
|
@ -70,18 +70,19 @@
|
||||
lc := l18n.FromRequest(rq)
|
||||
%}
|
||||
<main class="main-width edit edit_no-preview">
|
||||
<h1 class="edit__title">{%s= fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)) %}</h1>
|
||||
{%s= warning %}
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/{%s hyphaName %}">
|
||||
<h1 class="edit__title">{%s= fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)) %}</h1>
|
||||
{%s= warning %}
|
||||
<textarea name="text" class="edit-form__textarea" autofocus>{%s textAreaFill %}</textarea>
|
||||
<br><br>
|
||||
<label for="text">{%s lc.Get("edit.tag") %}</label><br>
|
||||
<input id="text" type="text" name="message" class="edit-form__message">
|
||||
<br><br>
|
||||
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="Save">{%s lc.Get("edit.save") %}</button>
|
||||
<button type="submit" name="action" class="btn edit-form__preview" value="Preview">{%s lc.Get("edit.preview") %}</button>
|
||||
<a href="/hypha/{%s hyphaName %}" class="btn btn_weak">{%s lc.Get("ui.cancel") %}</a>
|
||||
<p class="edit-form__message-zone">
|
||||
<input id="text" type="text" name="message" class="edit-form__message" placeholder="{%s lc.Get("edit.tag") %}" aria-label="{%s lc.Get("edit.tag") %}">
|
||||
</p>
|
||||
<p class="edit-form__buttons">
|
||||
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="Save">{%s lc.Get("edit.save") %}</button>
|
||||
<button type="submit" name="action" class="btn edit-form__preview" value="Preview">{%s lc.Get("edit.preview") %}</button>
|
||||
<a href="/hypha/{%s hyphaName %}" class="btn btn_weak">{%s lc.Get("ui.cancel") %}</a>
|
||||
</p>
|
||||
</form>
|
||||
</main>
|
||||
{%s= Toolbar(user.FromRequest(rq), lc) %}
|
||||
|
@ -190,46 +190,50 @@ func StreamEditor(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAr
|
||||
//line views/mutators.qtpl:71
|
||||
qw422016.N().S(`
|
||||
<main class="main-width edit edit_no-preview">
|
||||
<h1 class="edit__title">`)
|
||||
//line views/mutators.qtpl:73
|
||||
qw422016.N().S(fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)))
|
||||
//line views/mutators.qtpl:73
|
||||
qw422016.N().S(`</h1>
|
||||
`)
|
||||
//line views/mutators.qtpl:74
|
||||
qw422016.N().S(warning)
|
||||
//line views/mutators.qtpl:74
|
||||
qw422016.N().S(`
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/`)
|
||||
//line views/mutators.qtpl:76
|
||||
//line views/mutators.qtpl:74
|
||||
qw422016.E().S(hyphaName)
|
||||
//line views/mutators.qtpl:76
|
||||
//line views/mutators.qtpl:74
|
||||
qw422016.N().S(`">
|
||||
<h1 class="edit__title">`)
|
||||
//line views/mutators.qtpl:75
|
||||
qw422016.N().S(fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)))
|
||||
//line views/mutators.qtpl:75
|
||||
qw422016.N().S(`</h1>
|
||||
`)
|
||||
//line views/mutators.qtpl:76
|
||||
qw422016.N().S(warning)
|
||||
//line views/mutators.qtpl:76
|
||||
qw422016.N().S(`
|
||||
<textarea name="text" class="edit-form__textarea" autofocus>`)
|
||||
//line views/mutators.qtpl:77
|
||||
qw422016.E().S(textAreaFill)
|
||||
//line views/mutators.qtpl:77
|
||||
qw422016.N().S(`</textarea>
|
||||
<br><br>
|
||||
<label for="text">`)
|
||||
<p class="edit-form__message-zone">
|
||||
<input id="text" type="text" name="message" class="edit-form__message" placeholder="`)
|
||||
//line views/mutators.qtpl:79
|
||||
qw422016.E().S(lc.Get("edit.tag"))
|
||||
//line views/mutators.qtpl:79
|
||||
qw422016.N().S(`</label><br>
|
||||
<input id="text" type="text" name="message" class="edit-form__message">
|
||||
<br><br>
|
||||
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="Save">`)
|
||||
qw422016.N().S(`" aria-label="`)
|
||||
//line views/mutators.qtpl:79
|
||||
qw422016.E().S(lc.Get("edit.tag"))
|
||||
//line views/mutators.qtpl:79
|
||||
qw422016.N().S(`">
|
||||
</p>
|
||||
<p class="edit-form__buttons">
|
||||
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="Save">`)
|
||||
//line views/mutators.qtpl:82
|
||||
qw422016.E().S(lc.Get("edit.save"))
|
||||
//line views/mutators.qtpl:82
|
||||
qw422016.N().S(`</button>
|
||||
<button type="submit" name="action" class="btn edit-form__preview" value="Preview">`)
|
||||
<button type="submit" name="action" class="btn edit-form__preview" value="Preview">`)
|
||||
//line views/mutators.qtpl:83
|
||||
qw422016.E().S(lc.Get("edit.preview"))
|
||||
//line views/mutators.qtpl:83
|
||||
qw422016.N().S(`</button>
|
||||
<a href="/hypha/`)
|
||||
<a href="/hypha/`)
|
||||
//line views/mutators.qtpl:84
|
||||
qw422016.E().S(hyphaName)
|
||||
//line views/mutators.qtpl:84
|
||||
@ -238,209 +242,210 @@ func StreamEditor(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAr
|
||||
qw422016.E().S(lc.Get("ui.cancel"))
|
||||
//line views/mutators.qtpl:84
|
||||
qw422016.N().S(`</a>
|
||||
</p>
|
||||
</form>
|
||||
</main>
|
||||
`)
|
||||
//line views/mutators.qtpl:87
|
||||
//line views/mutators.qtpl:88
|
||||
qw422016.N().S(Toolbar(user.FromRequest(rq), lc))
|
||||
//line views/mutators.qtpl:87
|
||||
//line views/mutators.qtpl:88
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:88
|
||||
//line views/mutators.qtpl:89
|
||||
streameditScripts(qw422016)
|
||||
//line views/mutators.qtpl:88
|
||||
//line views/mutators.qtpl:89
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
func WriteEditor(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, warning string) {
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
StreamEditor(qw422016, rq, hyphaName, textAreaFill, warning)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
func Editor(rq *http.Request, hyphaName, textAreaFill, warning string) string {
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
WriteEditor(qb422016, rq, hyphaName, textAreaFill, warning)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
qs422016 := string(qb422016.B)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
return qs422016
|
||||
//line views/mutators.qtpl:89
|
||||
//line views/mutators.qtpl:90
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:91
|
||||
//line views/mutators.qtpl:92
|
||||
func StreamPreview(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
|
||||
//line views/mutators.qtpl:91
|
||||
//line views/mutators.qtpl:92
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:93
|
||||
//line views/mutators.qtpl:94
|
||||
lc := l18n.FromRequest(rq)
|
||||
|
||||
//line views/mutators.qtpl:94
|
||||
//line views/mutators.qtpl:95
|
||||
qw422016.N().S(`
|
||||
<main class="main-width edit edit_with-preview">
|
||||
<h1 class="edit__title">`)
|
||||
//line views/mutators.qtpl:96
|
||||
//line views/mutators.qtpl:97
|
||||
qw422016.N().S(fmt.Sprintf(lc.Get("edit.title"), beautifulLink(hyphaName)))
|
||||
//line views/mutators.qtpl:96
|
||||
//line views/mutators.qtpl:97
|
||||
qw422016.N().S(`</h1>
|
||||
`)
|
||||
//line views/mutators.qtpl:97
|
||||
//line views/mutators.qtpl:98
|
||||
qw422016.N().S(warning)
|
||||
//line views/mutators.qtpl:97
|
||||
//line views/mutators.qtpl:98
|
||||
qw422016.N().S(`
|
||||
<form method="post" class="edit-form"
|
||||
action="/upload-text/`)
|
||||
//line views/mutators.qtpl:99
|
||||
//line views/mutators.qtpl:100
|
||||
qw422016.E().S(hyphaName)
|
||||
//line views/mutators.qtpl:99
|
||||
//line views/mutators.qtpl:100
|
||||
qw422016.N().S(`">
|
||||
<textarea name="text" class="edit-form__textarea" autofocus>`)
|
||||
//line views/mutators.qtpl:100
|
||||
//line views/mutators.qtpl:101
|
||||
qw422016.E().S(textAreaFill)
|
||||
//line views/mutators.qtpl:100
|
||||
//line views/mutators.qtpl:101
|
||||
qw422016.N().S(`</textarea>
|
||||
<br><br>
|
||||
<label for="text">`)
|
||||
//line views/mutators.qtpl:102
|
||||
//line views/mutators.qtpl:103
|
||||
qw422016.E().S(lc.Get("edit.tag"))
|
||||
//line views/mutators.qtpl:102
|
||||
//line views/mutators.qtpl:103
|
||||
qw422016.N().S(`</label><br>
|
||||
<input id="text" type="text" name="message" class="edit-form__message" value="`)
|
||||
//line views/mutators.qtpl:103
|
||||
//line views/mutators.qtpl:104
|
||||
qw422016.E().S(message)
|
||||
//line views/mutators.qtpl:103
|
||||
//line views/mutators.qtpl:104
|
||||
qw422016.N().S(`">
|
||||
<br><br>
|
||||
<button type="submit" name="action" class="btn btn_accent edit-form__save" value="Save">`)
|
||||
//line views/mutators.qtpl:105
|
||||
//line views/mutators.qtpl:106
|
||||
qw422016.E().S(lc.Get("edit.save"))
|
||||
//line views/mutators.qtpl:105
|
||||
//line views/mutators.qtpl:106
|
||||
qw422016.N().S(`</button>
|
||||
<button type="submit" name="action" class="btn edit-form__preview" value="Preview">`)
|
||||
//line views/mutators.qtpl:106
|
||||
//line views/mutators.qtpl:107
|
||||
qw422016.E().S(lc.Get("edit.preview"))
|
||||
//line views/mutators.qtpl:106
|
||||
//line views/mutators.qtpl:107
|
||||
qw422016.N().S(`</button>
|
||||
<a href="/hypha/`)
|
||||
//line views/mutators.qtpl:107
|
||||
//line views/mutators.qtpl:108
|
||||
qw422016.E().S(hyphaName)
|
||||
//line views/mutators.qtpl:107
|
||||
//line views/mutators.qtpl:108
|
||||
qw422016.N().S(`" class="btn btn_weak">`)
|
||||
//line views/mutators.qtpl:107
|
||||
//line views/mutators.qtpl:108
|
||||
qw422016.E().S(lc.Get("ui.cancel"))
|
||||
//line views/mutators.qtpl:107
|
||||
//line views/mutators.qtpl:108
|
||||
qw422016.N().S(`</a>
|
||||
</form>
|
||||
<p class="warning">`)
|
||||
//line views/mutators.qtpl:109
|
||||
//line views/mutators.qtpl:110
|
||||
qw422016.E().S(lc.Get("edit.preview_tip"))
|
||||
//line views/mutators.qtpl:109
|
||||
//line views/mutators.qtpl:110
|
||||
qw422016.N().S(`</p>
|
||||
<article class="edit__preview">`)
|
||||
//line views/mutators.qtpl:110
|
||||
//line views/mutators.qtpl:111
|
||||
qw422016.N().S(renderedPage)
|
||||
//line views/mutators.qtpl:110
|
||||
//line views/mutators.qtpl:111
|
||||
qw422016.N().S(`</article>
|
||||
</main>
|
||||
`)
|
||||
//line views/mutators.qtpl:112
|
||||
//line views/mutators.qtpl:113
|
||||
qw422016.N().S(Toolbar(user.FromRequest(rq), lc))
|
||||
//line views/mutators.qtpl:112
|
||||
//line views/mutators.qtpl:113
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:113
|
||||
//line views/mutators.qtpl:114
|
||||
streameditScripts(qw422016)
|
||||
//line views/mutators.qtpl:113
|
||||
//line views/mutators.qtpl:114
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
func WritePreview(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) {
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
StreamPreview(qw422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
func Preview(rq *http.Request, hyphaName, textAreaFill, message, warning string, renderedPage string) string {
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
WritePreview(qb422016, rq, hyphaName, textAreaFill, message, warning, renderedPage)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
qs422016 := string(qb422016.B)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
return qs422016
|
||||
//line views/mutators.qtpl:114
|
||||
//line views/mutators.qtpl:115
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:116
|
||||
//line views/mutators.qtpl:117
|
||||
func streameditScripts(qw422016 *qt422016.Writer) {
|
||||
//line views/mutators.qtpl:116
|
||||
//line views/mutators.qtpl:117
|
||||
qw422016.N().S(`
|
||||
<script src="/static/editor.js"></script>
|
||||
`)
|
||||
//line views/mutators.qtpl:118
|
||||
//line views/mutators.qtpl:119
|
||||
for _, scriptPath := range cfg.EditScripts {
|
||||
//line views/mutators.qtpl:118
|
||||
//line views/mutators.qtpl:119
|
||||
qw422016.N().S(`
|
||||
<script src="`)
|
||||
//line views/mutators.qtpl:119
|
||||
//line views/mutators.qtpl:120
|
||||
qw422016.E().S(scriptPath)
|
||||
//line views/mutators.qtpl:119
|
||||
//line views/mutators.qtpl:120
|
||||
qw422016.N().S(`"></script>
|
||||
`)
|
||||
//line views/mutators.qtpl:120
|
||||
//line views/mutators.qtpl:121
|
||||
}
|
||||
//line views/mutators.qtpl:120
|
||||
//line views/mutators.qtpl:121
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
func writeeditScripts(qq422016 qtio422016.Writer) {
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
streameditScripts(qw422016)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
}
|
||||
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
func editScripts() string {
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
writeeditScripts(qb422016)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
qs422016 := string(qb422016.B)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
return qs422016
|
||||
//line views/mutators.qtpl:121
|
||||
//line views/mutators.qtpl:122
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user