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){ $('#userNewForm').validator().on('submit', function(e){
if(!e.isDefaultPrevented()){ if(!e.isDefaultPrevented()){
e.preventDefault(); e.preventDefault();
@ -161,6 +165,10 @@ $(document).ready(function (){
} }
}); });
$(document).on('click', '#btnUserEdit', function(e){
$('#userEditForm').submit();
});
$('#userEditForm').validator().on('submit', function(e){ $('#userEditForm').validator().on('submit', function(e){
if(!e.isDefaultPrevented()){ if(!e.isDefaultPrevented()){
e.preventDefault(); 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; return;
} }
// lets look for a page // 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 we have a page lets render it, else throw 404
if(page){ if(page){
res.render(`${config.themeViews}page`, { res.render(`${config.themeViews}page`, {

View File

@ -3,7 +3,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="page-header"> <div class="page-header">
<div class="float-right"> <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> </div>
<h2>{{ @root.__ "User edit" }}</h2> <h2>{{ @root.__ "User edit" }}</h2>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col-12"> <div class="col-12">
<div class="page-header"> <div class="page-header">
<div class="float-right"> <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> </div>
<h2>{{ @root.__ "New User" }}</h2> <h2>{{ @root.__ "New User" }}</h2>
</div> </div>