More optimisations and cleanup. Removed accidental adding of compiled admin assets
This commit is contained in:
parent
bc3aecb5d4
commit
8ebc67d2e7
11 changed files with 72 additions and 3252 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -63,4 +63,3 @@ package-lock.json
|
||||||
public/assets/app.js
|
public/assets/app.js
|
||||||
public/assets/app.css
|
public/assets/app.css
|
||||||
public/assets/app.css.map
|
public/assets/app.css.map
|
||||||
|
|
||||||
|
|
46
app/api/article.p.js
Normal file
46
app/api/article.p.js
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
const common = require('./common')
|
||||||
|
|
||||||
|
exports.getAllArticlesPagination = function(options) {
|
||||||
|
let extra = ''
|
||||||
|
|
||||||
|
if (options.sort) {
|
||||||
|
extra += '&sort=' + options.sort
|
||||||
|
}
|
||||||
|
if (options.per_page) {
|
||||||
|
extra += '&perPage=' + options.per_page
|
||||||
|
}
|
||||||
|
if (options.page) {
|
||||||
|
extra += '&page=' + options.page
|
||||||
|
}
|
||||||
|
if (options.includes) {
|
||||||
|
extra += '&includes=' + options.includes.join(',')
|
||||||
|
}
|
||||||
|
|
||||||
|
return '/api/articles?' + extra
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.getAllPageArticlesPagination = function(pageId, options) {
|
||||||
|
let extra = ''
|
||||||
|
|
||||||
|
if (options.sort) {
|
||||||
|
extra += '&sort=' + options.sort
|
||||||
|
}
|
||||||
|
if (options.per_page) {
|
||||||
|
extra += '&perPage=' + options.per_page
|
||||||
|
}
|
||||||
|
if (options.page) {
|
||||||
|
extra += '&page=' + options.page
|
||||||
|
}
|
||||||
|
if (options.includes) {
|
||||||
|
extra += '&includes=' + options.includes.join(',')
|
||||||
|
}
|
||||||
|
|
||||||
|
return '/api/pages/' + pageId + '/articles?' + extra
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.getArticle = function(id) {
|
||||||
|
return common.sendRequest({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/articles/' + id + '?includes=media,parent,banner,files',
|
||||||
|
})
|
||||||
|
}
|
19
app/api/page.p.js
Normal file
19
app/api/page.p.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const common = require('./common')
|
||||||
|
|
||||||
|
const Tree = window.__nfptree || []
|
||||||
|
|
||||||
|
exports.Tree = Tree
|
||||||
|
|
||||||
|
exports.getTree = function() {
|
||||||
|
return common.sendRequest({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/pages?tree=true&includes=children&fields=id,name,path,children(id,name,path)',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.getPage = function(id) {
|
||||||
|
return common.sendRequest({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/api/pages/' + id + '?includes=media,banner,children,news,news.media',
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
const m = require('mithril')
|
const m = require('mithril')
|
||||||
const ApiArticle = require('../api/article')
|
const ApiArticle = require('../api/article.p')
|
||||||
const Authentication = require('../authentication')
|
const Authentication = require('../authentication')
|
||||||
const Fileinfo = require('../widgets/fileinfo')
|
const Fileinfo = require('../widgets/fileinfo')
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const m = require('mithril')
|
const m = require('mithril')
|
||||||
const Page = require('../api/page')
|
const Page = require('../api/page.p')
|
||||||
const Authentication = require('../authentication')
|
const Authentication = require('../authentication')
|
||||||
|
|
||||||
const Footer = {
|
const Footer = {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const m = require('mithril')
|
const m = require('mithril')
|
||||||
|
|
||||||
const Page = require('../api/page')
|
const Page = require('../api/page.p')
|
||||||
const Article = require('../api/article')
|
const Article = require('../api/article.p')
|
||||||
const Pagination = require('../api/pagination')
|
const Pagination = require('../api/pagination')
|
||||||
const Pages = require('../widgets/pages')
|
const Pages = require('../widgets/pages')
|
||||||
const Newsitem = require('../widgets/newsitem')
|
const Newsitem = require('../widgets/newsitem')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const m = require('mithril')
|
const m = require('mithril')
|
||||||
const Authentication = require('../authentication')
|
const Authentication = require('../authentication')
|
||||||
const Darkmode = require('../darkmode')
|
const Darkmode = require('../darkmode')
|
||||||
const Page = require('../api/page')
|
const Page = require('../api/page.p')
|
||||||
|
|
||||||
const Menu = {
|
const Menu = {
|
||||||
currentActive: 'home',
|
currentActive: 'home',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const m = require('mithril')
|
const m = require('mithril')
|
||||||
const ApiPage = require('../api/page')
|
const ApiPage = require('../api/page.p')
|
||||||
const Article = require('../api/article')
|
const Article = require('../api/article.p')
|
||||||
const pagination = require('../api/pagination')
|
const pagination = require('../api/pagination')
|
||||||
const Authentication = require('../authentication')
|
const Authentication = require('../authentication')
|
||||||
const Newsentry = require('../widgets/newsentry')
|
const Newsentry = require('../widgets/newsentry')
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
{"version":3,"sourceRoot":"","sources":["../../app/admin.scss","../../app/_common.scss","../../app/admin/admin.scss","../../app/admin/pages.scss","../../app/admin/articles.scss","../../app/admin/staff.scss","../../app/widgets/admin.scss"],"names":[],"mappings":"AAEA,OACE,eACA,MCSkB,QDRlB,iBACA,oBAOF,qBACE,wBACA,YACA,yBACA,yBACA,iBACA,eAEA,8BACE,iBClBe,QDmBf,yBACA,MCnBe,KDoBf,aACA,gBAEF,8BACE,gBACA,yBACA,MCfO,KDgBP,aAEF,mFAGE,qBACA,MCzBgB,QD0BhB,iBAGF,4BACE,MC9BgB,QD+BhB,uBACA,yBAGF,4DAEE,iBAIJ,oBACE,eACA,MACA,SACA,OACA,QACA,qBACA,aACA,sBACA,uBACA,mBE/DF,eACE,YACA,aACA,sBACA,WDJW,QCKX,oBAGF,eACE,WDTW,QCUX,aACA,uBACA,gBAEA,oBACE,MDdS,KCeT,aACA,eACA,iBAGF,iBACE,aACA,qBACA,MDdiB,QCejB,eACA,iBAIJ,4CAGE,2BCjCF,iBACE,kBACA,gBACA,iBAEA,wBACE,aACA,WFCW,QECX,2BACE,MFDS,KEIX,0BACE,eACA,qBACA,iBACA,MFNe,KEUnB,4BACE,gBAEA,oCACE,aAIJ,kCACE,kBACA,gBAEA,2CACE,0BAIJ,sBACE,oBAEA,+BACE,aAGF,uCACE,aACA,kBAIJ,oBACE,mBAGF,kCACE,YACA,YACA,kBAIJ,mBACE,cC/DF,oBACE,kBACA,gBACA,iBAEA,2BACE,aACA,WHCW,QGCX,8BACE,MHDS,KGIX,6BACE,eACA,qBACA,iBACA,MHNe,KGUnB,+BACE,gBAEA,uCACE,aAIJ,qCACE,kBACA,gBAGF,yBACE,oBAEA,kCACE,aAGF,0CACE,aACA,kBAIJ,uBACE,mBAGF,qCACE,YACA,YACA,kBAEA,0CACE,WAIJ,gCACE,kBACA,aACA,cACA,gBACA,YACA,yBACA,WH1DiB,QG2DjB,MH1DiB,KG2DjB,kBAEA,sCACE,kBACA,MACA,OACA,QACA,SACA,YACA,WACA,eACA,oBACA,UAIJ,0BACE,oBACA,WACA,aACA,sBACA,oBACA,gBAEA,6BACE,gBACA,iBACA,kBACA,mBACA,6BAKN,sBACE,cCzGF,kBACE,kBACA,gBACA,iBAEA,yBACE,aACA,WJCW,QICX,4BACE,MJDS,KIIX,2BACE,eACA,qBACA,iBACA,MJNe,KIUnB,uBACE,oBAEA,gCACE,aAGF,wCACE,aACA,kBAIJ,qBACE,mBAGF,mCACE,YACA,YACA,kBAEA,wCACE,WC5CN,WACE,kBACA,aACA,oBACA,sBACA,wBAEA,oEAGE,YAGF,2BACE,sBACA,oBACA,yCACA,2BACA,4BACA,qBAGF,qBACE,kBACA,QACA,UACA,WACA,YACA,yCACA,2BACA,4BACA,wBAGF,eACE,gBACA,WACA,kBACA,iBAGF,oBACE,sBACA,4BACA,2BAGF,4BACE,kBACA,MACA,OACA,QACA,SACA,qBACA,WAGF,iBACE,kBACA,MACA,OACA,QACA,SACA,YACA,WACA,eACA,oBACA,UAGF,mBACE,YACA,kBACA,QACA,WACA,WACA,YACA,yCACA,2BACA,4BACA,6BACA,wBACA,UACA,aACA,eAIJ,SACE,gBACA,aACA,sBACA,kBACA,wBACA,gBACA,MLvEQ,KKyER,YACE,WLtFgB,QKuFhB,MLtFgB,KKuFhB,gBACA,aAGF,WACE,aAGF,kBACE,aACA,6BACA,aAGF,gBACE,yBACA,uBACA,MLzGgB,QK0GhB,iBACA,gBAGF,sBACE,iBACA,UAGF,uBACE,kBACA,WN3DF,0CACE,MC/CM,KDkDR,mBACE,MC7BqB","file":"admin.css"}
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue