handlerpageedit: Retain comment when clicking preview

Cette révision appartient à :
Albert S. 2021-03-08 11:37:45 +01:00
Parent 00392e2469
révision e4562809a0
3 fichiers modifiés avec 5 ajouts et 5 suppressions

Voir le fichier

@ -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;

Voir le fichier

@ -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}

Voir le fichier

@ -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}