diff --git a/shroom/upload.go b/shroom/upload.go index 92fb51d..9fa0530 100644 --- a/shroom/upload.go +++ b/shroom/upload.go @@ -16,14 +16,22 @@ import ( "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) + var action string if h.Exists { - hop.WithMsg(fmt.Sprintf("Edit ‘%s’", h.Name)) + action = "Edit" } 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 { return hop.WithErrAbort(err), errtitle } diff --git a/static/default.css b/static/default.css index 3e554d6..836784d 100644 --- a/static/default.css +++ b/static/default.css @@ -111,7 +111,7 @@ textarea {font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif; .edit__title { margin-top: 0; } .edit__preview { border: 2px dashed #ddd; } .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-toolbar__buttons, .edit-toolbar__ad { margin: .5rem; } @@ -389,4 +389,4 @@ kbd { .dialog { background-color: #343434; } -} \ No newline at end of file +} diff --git a/views/mutators.qtpl b/views/mutators.qtpl index 139dccb..0e15f55 100644 --- a/views/mutators.qtpl +++ b/views/mutators.qtpl @@ -77,7 +77,10 @@