handlerpageedit: Retain comment when clicking preview

This commit is contained in:
Albert S. 2021-03-08 11:37:45 +01:00
parent 00392e2469
commit e4562809a0
3 changed files with 5 additions and 5 deletions

View File

@ -114,7 +114,7 @@ Response HandlerPageEdit::handleRequest(PageDao &pageDao, std::string pagename,
templatePage.setVar("content", newContent);
setPageVars(templatePage, pagename);
templatePage.setVar("title", createPageTitle("Preview: " + pagename));
templatePage.setVar("comment", r.post("comment"));
Response response;
response.setBody(templatePage.render());
return response;

View File

@ -5,10 +5,10 @@
<button type="submit" name="do" value="preview">Preview</button>
<textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea>
<br><b>Comment:</b><br>
<input type="text" name="comment" size=50><br>
<input type="text" name="comment" size="50" value="{qswiki:var:comment}"/><br>
<input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
<button type="submit" name="do" value="submit">Submit</button>
<button type="submit" name="do" value="preview">Preview</button>
</form>
</main>
{qswiki:include:general_footer}
{qswiki:include:general_footer}

View File

@ -8,10 +8,10 @@ This is a preview of your changes:<br>
<button type="submit" name="do" value="preview">Preview</button>
<textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea>
<br><b>Comment:</b><br>
<input type="text" name="comment" size=50><br>
<input type="text" name="comment" size="50" value="{qswiki:var:comment}"/><br>
<input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
<button type="submit" name="do" value="submit">Submit</button>
<button type="submit" name="do" value="preview">Preview</button>
</form>
</main>
{qswiki:include:general_footer}
{qswiki:include:general_footer}