handlerpageedit: Retain comment when clicking preview

Tento commit je obsažen v:
Albert S. 2021-03-08 11:37:45 +01:00
rodič 00392e2469
revize e4562809a0
3 změnil soubory, kde provedl 5 přidání a 5 odebrání

Zobrazit soubor

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

Zobrazit soubor

@ -5,7 +5,7 @@
<button type="submit" name="do" value="preview">Preview</button> <button type="submit" name="do" value="preview">Preview</button>
<textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea> <textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea>
<br><b>Comment:</b><br> <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> <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="submit">Submit</button>
<button type="submit" name="do" value="preview">Preview</button> <button type="submit" name="do" value="preview">Preview</button>

Zobrazit soubor

@ -8,7 +8,7 @@ This is a preview of your changes:<br>
<button type="submit" name="do" value="preview">Preview</button> <button type="submit" name="do" value="preview">Preview</button>
<textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea> <textarea name="content" style="width: 100%;" rows=70>{qswiki:var:content}</textarea>
<br><b>Comment:</b><br> <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> <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="submit">Submit</button>
<button type="submit" name="do" value="preview">Preview</button> <button type="submit" name="do" value="preview">Preview</button>