Small fixes

master
Mark Moffat 2020-03-07 19:48:06 +10:30
parent 1d4d75102a
commit e64905eddd
5 changed files with 12 additions and 4 deletions

View File

@ -122,6 +122,10 @@ $(document).ready(function (){
});
});
$(document).on('click', '#btnUserAdd', function(e){
$('#userNewForm').submit();
});
$('#userNewForm').validator().on('submit', function(e){
if(!e.isDefaultPrevented()){
e.preventDefault();
@ -161,6 +165,10 @@ $(document).ready(function (){
}
});
$(document).on('click', '#btnUserEdit', function(e){
$('#userEditForm').submit();
});
$('#userEditForm').validator().on('submit', function(e){
if(!e.isDefaultPrevented()){
e.preventDefault();

File diff suppressed because one or more lines are too long

View File

@ -827,7 +827,7 @@ router.get('/:page?', async (req, res, next) => {
return;
}
// lets look for a page
const page = db.pages.findOne({ pageSlug: req.params.page, pageEnabled: 'true' });
const page = await db.pages.findOne({ pageSlug: req.params.page, pageEnabled: 'true' });
// if we have a page lets render it, else throw 404
if(page){
res.render(`${config.themeViews}page`, {

View File

@ -3,7 +3,7 @@
<div class="col-md-12">
<div class="page-header">
<div class="float-right">
<button type="submit" class="btn btn-outline-success">{{ @root.__ "Update" }}</button>
<button type="submit" id="btnUserEdit" class="btn btn-outline-success">{{ @root.__ "Update" }}</button>
</div>
<h2>{{ @root.__ "User edit" }}</h2>
</div>

View File

@ -3,7 +3,7 @@
<div class="col-12">
<div class="page-header">
<div class="float-right">
<button type="submit" class="btn btn-outline-success">{{ @root.__ "Create" }}</button>
<button type="submit" id="btnUserAdd" class="btn btn-outline-success">{{ @root.__ "Create" }}</button>
</div>
<h2>{{ @root.__ "New User" }}</h2>
</div>