proper prefix in templates: wikiqs -> qswiki

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

View File

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

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">
<h2>Login</h2>
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>
Password: <input type="password" name="password"></input><br>
Repeat password: <input type="password" name="password2"></input><br>
<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>
</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;">
<h2>All categories</h2>
{wikiqs:var:categorylist}
{qswiki:var:categorylist}
</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;">
<h2>All pages</h2>
{wikiqs:var:pagelist}
{qswiki:var:pagelist}
</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;">
<h2>{wikiqs:var:errortitle}</h2><br>
{wikiqs:var:errormessage}
<h2>{qswiki:var:errortitle}</h2><br>
{qswiki:var:errormessage}
</div>
{wikiqs:include:general_footer}
{qswiki:include:general_footer}

View File

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

View File

@ -2,20 +2,20 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{wikiqs:config:csspath}">
<title>{wikiqs:var:title}</title>
<link rel="stylesheet" type="text/css" href="{qswiki:config:csspath}">
<title>{qswiki:var:title}</title>
<body>
<nav>
<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 id="nav">
<li><a href="{wikiqs:config:linkrecent}">Recent changes</a></li>
<li><a href="{wikiqs:config:linkallpages}">All pages</a></li>
<li><a href="{wikiqs:config:linkallcats}">All categories</a></li>
<li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{qswiki:config:linkallcats}">All categories</a></li>
</ul>
<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>
</nav>

View File

@ -1,11 +1,11 @@
{wikiqs:include:general_header}
{qswiki:include:general_header}
<main id="content">
<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>
Password: <input type="password" name="password" style="width: 25%;"></input><br>
<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>
</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">
<h2>Login</h2>
You are already logged in as <b>{wikiqs:var:username}</b><br>
<a href="{wikiqs:config:linklogout}">Logout</a>
You are already logged in as <b>{qswiki:var:username}</b><br>
<a href="{qswiki:config:linklogout}">Logout</a>
</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">
<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="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>
<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="preview">Preview</button>
</form>
</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">
This is a preview of your changes:<br>
{wikiqs:var:preview_content}
{qswiki:var:preview_content}
<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="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>
<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="preview">Preview</button>
</form>
</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">
<h3>Page deletion</h3><br>
Do you really want to delete page <b>{wikiqs:var:page}</b>?
<form action="{wikiqs:var:deletionurl}" method=POST>
<input type="hidden" name="csrf_token" value="{wikiqs:var:csrf_token}"/>
Do you really want to delete page <b>{qswiki:var:page}</b>?
<form action="{qswiki:var:deletionurl}" method=POST>
<input type="hidden" name="csrf_token" value="{qswiki:var:csrf_token}"/>
<button type="submit" name="do" value="submit">Yes, delete page</button>
</form>
</main>
{wikiqs:include:general_footer}
{qswiki:include:general_footer}

View File

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

View File

@ -2,24 +2,24 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{wikiqs:config:csspath}">
<title>{wikiqs:var:title}</title>
<link rel="stylesheet" type="text/css" href="{qswiki:config:csspath}">
<title>{qswiki:var:title}</title>
<body>
<nav>
<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 id="nav">
<li><a href="{wikiqs:config:linkrecent}">Recent changes</a></li>
<li><a href="{wikiqs:config:linkallpages}">All pages</a></li>
<li><a href="{wikiqs:config:linkallcats}">All categories</a></li>
<li><a href="{qswiki:config:linkrecent}">Recent changes</a></li>
<li><a href="{qswiki:config:linkallpages}">All pages</a></li>
<li><a href="{qswiki:config:linkallcats}">All categories</a></li>
</ul>
<ul>
{wikiqs:var:headerlinks}
{qswiki:var:headerlinks}
</ul>
<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>
</nav>

View File

@ -1,8 +1,8 @@
{wikiqs:include:page_header}
{qswiki:include:page_header}
<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>
{wikiqs:var:revisionlist}
<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>
{qswiki:var:revisionlist}
</table>
{wikiqs:var:prevpage} {wikiqs:var:nextpage}
{qswiki:var:prevpage} {qswiki:var:nextpage}
</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">
<h2>Page settings: {wikiqs:var:page}</h2>
<form action="{wikiqs:var:settingsurl}" method="POST">
<h2>Page settings: {qswiki:var:page}</h2>
<form action="{qswiki:var:settingsurl}" method="POST">
<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>
<input type="text" name="renameto"></input><br>
<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>
<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>
<button type="submit" name="do" value="submit">Submit</button>
</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">
<section id="index">
<b>Index</b>
{wikiqs:var:index}
{qswiki:var:index}
</section>
</aside>
<main id="content">
{wikiqs:var:content}
{qswiki:var:content}
</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">
<b>Showing revision: {wikiqs:var:revision}</b><hr>
{wikiqs:var:content}
<b>Showing revision: {qswiki:var:revision}</b><hr>
{qswiki:var:content}
</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">
<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>
{wikiqs:var:revisionlist}
<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>
{qswiki:var:revisionlist}
</table>
{wikiqs:var:prevpage} {wikiqs:var:nextpage}
{qswiki:var:prevpage} {qswiki:var:nextpage}
</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">
<h2>Search for: {wikiqs:var:searchterm} </h2>
{wikiqs:var:pagelist}
<h2>Search for: {qswiki:var:searchterm} </h2>
{qswiki:var:pagelist}
</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">
<h2>Category: {wikiqs:var:categoryname}</h2>
{wikiqs:var:pagelist}
<h2>Category: {qswiki:var:categoryname}</h2>
{qswiki:var:pagelist}
</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">
<h2>Links to: {wikiqs:var:pagename}</h2>
{wikiqs:var:pagelist}
<h2>Links to: {qswiki:var:pagename}</h2>
{qswiki:var:pagelist}
</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">
<h2>Login</h2>
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>
New Password: <input type="password" name="newpassword" 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>
<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>
</main>
{wikiqs:include:general_footer}
{qswiki:include:general_footer}

View File

@ -37,7 +37,7 @@ void TemplatePage::setVar(const std::string &key, std::string value)
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)); });
return replacer.parse(this->content);