proper prefix in templates: wikiqs -> qswiki

This commit is contained in:
Albert S. 2018-11-16 16:54:35 +01:00
parent 08968935a4
commit ebbea6c4f7
25 changed files with 104 additions and 104 deletions

View File

@ -93,7 +93,7 @@ Config::Config(const std::map<std::string, std::string> &map)
this->anon_permissions = Permissions(required("anon_permissions")); this->anon_permissions = Permissions(required("anon_permissions"));
this->templateprefix = "{wikiqs:"; this->templateprefix = "{qswiki:";

View File

@ -1 +1 @@
<li><a href="{wikiqs:var:href}">{wikiqs:var:value}</a></li> <li><a href="{qswiki:var:href}">{qswiki:var:value}</a></li>

View File

@ -1,15 +1,15 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Login</h2> <h2>Login</h2>
Register a new user Register a new user
<form action="{wikiqs:var:adminregisterurl}" method="POST"> <form action="{qswiki:var:adminregisterurl}" method="POST">
Username: <input type="text" name="user"></input><br> Username: <input type="text" name="user"></input><br>
Password: <input type="password" name="password"></input><br> Password: <input type="password" name="password"></input><br>
Repeat password: <input type="password" name="password2"></input><br> Repeat password: <input type="password" name="password2"></input><br>
<button type="submit" name="do" value="submit">Submit</button> <button type="submit" name="do" value="submit">Submit</button>
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"></input> <input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<div id="content" style="margin-top: 10px;"> <div id="content" style="margin-top: 10px;">
<h2>All categories</h2> <h2>All categories</h2>
{wikiqs:var:categorylist} {qswiki:var:categorylist}
</div> </div>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<div id="content" style="margin-top: 10px;"> <div id="content" style="margin-top: 10px;">
<h2>All pages</h2> <h2>All pages</h2>
{wikiqs:var:pagelist} {qswiki:var:pagelist}
</div> </div>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<div id="content" style="margin-top: 10px;"> <div id="content" style="margin-top: 10px;">
<h2>{wikiqs:var:errortitle}</h2><br> <h2>{qswiki:var:errortitle}</h2><br>
{wikiqs:var:errormessage} {qswiki:var:errormessage}
</div> </div>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,14 +1,14 @@
<footer> <footer>
<ul id="footer"> <ul id="footer">
<li><span style="padding-left: 10px"><a href="{wikiqs:config:linklogin}">{wikiqs:var:loginstatus}</a></span></li> <li><span style="padding-left: 10px"><a href="{qswiki:config:linklogin}">{qswiki:var:loginstatus}</a></span></li>
<li style="font-size: 10pt">Powered by wikiQS</li> <li style="font-size: 10pt">Powered by qswiki</li>
</ul> </ul>
</footer> </footer>
<script> <script>
function refreshSession() function refreshSession()
{ {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open("GET", "{wikiqs:config:refreshsessionurl}"); req.open("GET", "{qswiki:config:refreshsessionurl}");
req.send(); req.send();
setTimeout(refreshSession, 60*2*1000); setTimeout(refreshSession, 60*2*1000);
} }

View File

@ -2,20 +2,20 @@
<html><head> <html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{wikiqs:config:csspath}"> <link rel="stylesheet" type="text/css" href="{qswiki:config:csspath}">
<title>{wikiqs:var:title}</title> <title>{qswiki:var:title}</title>
<body> <body>
<nav> <nav>
<ul> <ul>
<li><a href="{wikiqs:config:linkindex}"><h2>{wikiqs:config:wikiname}</h2></a></li> <li><a href="{qswiki:config:linkindex}"><h2>{qswiki:config:wikiname}</h2></a></li>
</ul> </ul>
<ul id="nav"> <ul id="nav">
<li><a href="{wikiqs:config:linkrecent}">Recent changes</a></li> <li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{wikiqs:config:linkallpages}">All pages</a></li> <li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{wikiqs:config:linkallcats}">All categories</a></li> <li><a href="{qswiki:config:linkallcats}">All categories</a></li>
</ul> </ul>
<ul id="right" class="search"> <ul id="right" class="search">
<li><div><form action="{wikiqs:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" name="q"value="search here" onfocus="this.value=''"></form></div></li> <li><div><form action="{qswiki:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" name="q"value="search here" onfocus="this.value=''"></form></div></li>
</ul> </ul>
</nav> </nav>

View File

@ -1,11 +1,11 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Login</h2> <h2>Login</h2>
<form action="{wikiqs:var:loginurl}" method="POST"> <form action="{qswiki:var:loginurl}" method="POST">
Username: <input type="text" name="user" style="width: 25%;"></input><br> Username: <input type="text" name="user" style="width: 25%;"></input><br>
Password: <input type="password" name="password" style="width: 25%;"></input><br> Password: <input type="password" name="password" style="width: 25%;"></input><br>
<button type="submit" name="do" value="submit">Submit</button> <button type="submit" name="do" value="submit">Submit</button>
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"></input> <input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,7 +1,7 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Login</h2> <h2>Login</h2>
You are already logged in as <b>{wikiqs:var:username}</b><br> You are already logged in as <b>{qswiki:var:username}</b><br>
<a href="{wikiqs:config:linklogout}">Logout</a> <a href="{qswiki:config:linklogout}">Logout</a>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,14 +1,14 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
<form action="{wikiqs:var:actionurl}" method="POST"> <form action="{qswiki:var:actionurl}" method="POST">
<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>
<textarea name="content" style="width: 100%;" rows=70>{wikiqs: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><br>
<input type="hidden" name="csrf_token" value="{wikiqs: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>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,17 +1,17 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
This is a preview of your changes:<br> This is a preview of your changes:<br>
{wikiqs:var:preview_content} {qswiki:var:preview_content}
<hr> <hr>
<form action="{wikiqs:var:actionurl}" method="POST"> <form action="{qswiki:var:actionurl}" method="POST">
<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>
<textarea name="content" style="width: 100%;" rows=70>{wikiqs: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><br>
<input type="hidden" name="csrf_token" value="{wikiqs: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>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,10 +1,10 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
<h3>Page deletion</h3><br> <h3>Page deletion</h3><br>
Do you really want to delete page <b>{wikiqs:var:page}</b>? Do you really want to delete page <b>{qswiki:var:page}</b>?
<form action="{wikiqs:var:deletionurl}" method=POST> <form action="{qswiki:var:deletionurl}" method=POST>
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"/> <input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"/>
<button type="submit" name="do" value="submit">Yes, delete page</button> <button type="submit" name="do" value="submit">Yes, delete page</button>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,16 +1,16 @@
<footer> <footer>
<ul id="footer"> <ul id="footer">
<li><span style="padding-left: 10px"><a href="{wikiqs:config:linklogin}">{wikiqs:var:loginstatus}</a></span></li> <li><span style="padding-left: 10px"><a href="{qswiki:config:linklogin}">{qswiki:var:loginstatus}</a></span></li>
<li><a href="{wikiqs:var:historyurl}">Last edited by {wikiqs:var:editedby} on {wikiqs:var:editedon}</a></li> <li><a href="{qswiki:var:historyurl}">Last edited by {qswiki:var:editedby} on {qswiki:var:editedon}</a></li>
<li style="font-size: 10pt">Powered by wikiQS</li> <li style="font-size: 10pt">Powered by qswiki</li>
</ul> </ul>
</footer> </footer>
<script> <script>
function refreshSession() function refreshSession()
{ {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open("GET", "{wikiqs:config:refreshsessionurl}"); req.open("GET", "{qswiki:config:refreshsessionurl}");
req.send(); req.send();
setTimeout(refreshSession, 60*2*1000); setTimeout(refreshSession, 60*2*1000);
} }

View File

@ -2,24 +2,24 @@
<html><head> <html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{wikiqs:config:csspath}"> <link rel="stylesheet" type="text/css" href="{qswiki:config:csspath}">
<title>{wikiqs:var:title}</title> <title>{qswiki:var:title}</title>
<body> <body>
<nav> <nav>
<ul> <ul>
<li><a href="{wikiqs:config:linkindex}"><h2>{wikiqs:config:wikiname}</h2></a></li> <li><a href="{qswiki:config:linkindex}"><h2>{qswiki:config:wikiname}</h2></a></li>
</ul> </ul>
<ul id="nav"> <ul id="nav">
<li><a href="{wikiqs:config:linkrecent}">Recent changes</a></li> <li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{wikiqs:config:linkallpages}">All pages</a></li> <li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{wikiqs:config:linkallcats}">All categories</a></li> <li><a href="{qswiki:config:linkallcats}">All categories</a></li>
</ul> </ul>
<ul> <ul>
{wikiqs:var:headerlinks} {qswiki:var:headerlinks}
</ul> </ul>
<ul id="right" class="search"> <ul id="right" class="search">
<li><div><form action="{wikiqs:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" value="search here" onfocus="this.value=''" name="q"/></form></div></li> <li><div><form action="{qswiki:config:wikipath}" method="GET"><input type="hidden" name="action" value="search"/><input type="text" value="search here" onfocus="this.value=''" name="q"/></form></div></li>
</ul> </ul>
</nav> </nav>

View File

@ -1,8 +1,8 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
<table style="width: 100%"><tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Comment</b></td><td><b><a href="{wikiqs:var:linkrecentsort}">Date</a></b></td></tr> <table style="width: 100%"><tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Comment</b></td><td><b><a href="{qswiki:var:linkrecentsort}">Date</a></b></td></tr>
{wikiqs:var:revisionlist} {qswiki:var:revisionlist}
</table> </table>
{wikiqs:var:prevpage} {wikiqs:var:nextpage} {qswiki:var:prevpage} {qswiki:var:nextpage}
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,16 +1,16 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
<h2>Page settings: {wikiqs:var:page}</h2> <h2>Page settings: {qswiki:var:page}</h2>
<form action="{wikiqs:var:settingsurl}" method="POST"> <form action="{qswiki:var:settingsurl}" method="POST">
<h3>Categories:</h3><br> <h3>Categories:</h3><br>
<textarea cols=50 rows=20 name=categories>{wikiqs:var:categories}</textarea><br> <textarea cols=50 rows=20 name=categories>{qswiki:var:categories}</textarea><br>
<h3>Rename:</h3> <h3>Rename:</h3>
<input type="text" name="renameto"></input><br> <input type="text" name="renameto"></input><br>
<input type="checkbox" name="createredir" value="1" checked="checked" />Redirect old page <input type="checkbox" name="createredir" value="1" checked="checked" />Redirect old page
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"/><br> <input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"/><br>
<hr> <hr>
<input type="checkbox" name="showpage" value="1" {wikiqs:var:checked}/> Show page in lists etc. <input type="checkbox" name="showpage" value="1" {qswiki:var:checked}/> Show page in lists etc.
<br> <br>
<button type="submit" name="do" value="submit">Submit</button> <button type="submit" name="do" value="submit">Submit</button>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,11 +1,11 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<aside id="sidebar"> <aside id="sidebar">
<section id="index"> <section id="index">
<b>Index</b> <b>Index</b>
{wikiqs:var:index} {qswiki:var:index}
</section> </section>
</aside> </aside>
<main id="content"> <main id="content">
{wikiqs:var:content} {qswiki:var:content}
</main> </main>
{wikiqs:include:page_footer} {qswiki:include:page_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:page_header} {qswiki:include:page_header}
<main id="content"> <main id="content">
<b>Showing revision: {wikiqs:var:revision}</b><hr> <b>Showing revision: {qswiki:var:revision}</b><hr>
{wikiqs:var:content} {qswiki:var:content}
</main> </main>
{wikiqs:include:page_footer} {qswiki:include:page_footer}

View File

@ -1,8 +1,8 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<table style="width: 100%"><tr><td><b>Page</b></td><td><b>Revision</b></td><td><b>Author</b></td><td><b>Comment</b></td><td><b><a href="{wikiqs:var:linkrecentsort}">Date</a></b></td></tr> <table style="width: 100%"><tr><td><b>Page</b></td><td><b>Revision</b></td><td><b>Author</b></td><td><b>Comment</b></td><td><b><a href="{qswiki:var:linkrecentsort}">Date</a></b></td></tr>
{wikiqs:var:revisionlist} {qswiki:var:revisionlist}
</table> </table>
{wikiqs:var:prevpage} {wikiqs:var:nextpage} {qswiki:var:prevpage} {qswiki:var:nextpage}
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,7 +1,7 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Search for: {wikiqs:var:searchterm} </h2> <h2>Search for: {qswiki:var:searchterm} </h2>
{wikiqs:var:pagelist} {qswiki:var:pagelist}
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Category: {wikiqs:var:categoryname}</h2> <h2>Category: {qswiki:var:categoryname}</h2>
{wikiqs:var:pagelist} {qswiki:var:pagelist}
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,6 +1,6 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Links to: {wikiqs:var:pagename}</h2> <h2>Links to: {qswiki:var:pagename}</h2>
{wikiqs:var:pagelist} {qswiki:var:pagelist}
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -1,15 +1,15 @@
{wikiqs:include:general_header} {qswiki:include:general_header}
<main id="content"> <main id="content">
<h2>Login</h2> <h2>Login</h2>
Change your current password Change your current password
<form action="{wikiqs:var:userchangepwurl}" method="POST"> <form action="{qswiki:var:userchangepwurl}" method="POST">
Current password: <input type="text" name="password" style="width: 25%;"></input><br> Current password: <input type="text" name="password" style="width: 25%;"></input><br>
New Password: <input type="password" name="newpassword" style="width: 25%;"></input><br> New Password: <input type="password" name="newpassword" style="width: 25%;"></input><br>
Repeat password: <input type="password" name="newpassword2" style="width: 25%;"></input><br> Repeat password: <input type="password" name="newpassword2" style="width: 25%;"></input><br>
<button type="submit" name="do" value="submit">Submit</button> <button type="submit" name="do" value="submit">Submit</button>
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"></input> <input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"></input>
</form> </form>
</main> </main>
{wikiqs:include:general_footer} {qswiki:include:general_footer}

View File

@ -38,7 +38,7 @@ void TemplatePage::setVar(const std::string &key, std::string value)
std::string TemplatePage::render() const std::string TemplatePage::render() const
{ {
Varreplacer replacer("{wikiqs:"); Varreplacer replacer("{qswiki:");
replacer.addResolver("var", [&](std::string_view key) { return utils::getKeyOrEmpty(this->varsMap, std::string(key));}); replacer.addResolver("var", [&](std::string_view key) { return utils::getKeyOrEmpty(this->varsMap, std::string(key));});
return replacer.parse(this->content); return replacer.parse(this->content);
} }