restructure

This commit is contained in:
Jonatan Nilsson 2022-08-02 08:00:57 +00:00
parent f12b440c19
commit 4014783dbf
115 changed files with 57 additions and 325 deletions

13
.gitignore vendored
View file

@ -58,12 +58,11 @@ typings/
.env
# Local development config file
config/config.json
config.json
package-lock.json
public/assets/app.js
public/assets/app.css
public/assets/app.css.map
public/assets/admin.js
public/assets/admin.css
public/assets/admin.css.map
**/app.js
**/app.css
**/app.css.map
**/admin.js
**/admin.css
**/admin.css.map

View file

@ -1,12 +0,0 @@
const EditPage = require('./admin/editpage')
const AdminPages = require('./admin/pages')
const AdminArticles = require('./admin/articles')
const EditArticle = require('./admin/editarticle')
const AdminStaffList = require('./admin/stafflist')
const EditStaff = require('./admin/editstaff')
window.adminRoutes = {
pages: [AdminPages, EditPage],
articles: [AdminArticles, EditArticle],
staff: [AdminStaffList, EditStaff],
}

View file

@ -1,48 +0,0 @@
{
"NODE_ENV": "development",
"server": {
"port": 4030,
"host": "0.0.0.0"
},
"CIRCLECI_VERSION": "circleci_version_number",
"knex": {
"client": "pg",
"connection": {
"host" : "127.0.0.1",
"user" : "postgres",
"password" : "postgres",
"database" : "nfpmoe"
},
"connectionslave": null,
"migrations": {
},
"acquireConnectionTimeout": 10000
},
"bunyan": {
"name": "nfpmoe",
"streams": [{
"stream": "process.stdout",
"level": "debug"
}
]
},
"frontend": {
"url": "http://beta01.nfp.moe"
},
"jwt": {
"secret": "this-is-my-secret",
"options": {
"expiresIn": 604800
}
},
"sessionsecret": "this-is-session-secret-lol",
"bcrypt": 5,
"fileSize": 524288000,
"upload": {
"baseurl": "https://cdn.nfp.is",
"port": "2111",
"host": "storage01.nfp.is",
"name": "nfpmoe-dev",
"secret": "nfpmoe-dev"
}
}

View file

@ -1,110 +0,0 @@
/* eslint-disable */
exports.up = function up(knex, Promise) {
return Promise.all([
knex.schema.createTable('staff', function(table) {
table.increments()
table.text('email')
table.text('fullname')
table.text('password')
table.boolean('is_deleted')
.notNullable()
.default(false)
table.integer('level')
.notNullable()
.defaultTo(1)
table.timestamps()
})
.then(pass =>
knex('staff').insert({
email: 'jonatan@nilsson.is',
fullname: 'Admin',
level: 100,
})
),
knex.schema.createTable('media', function(table) {
table.increments()
table.text('filename')
table.text('filetype')
table.text('small_image')
table.text('medium_image')
table.text('large_image')
table.text('org_image')
table.integer('size')
table.integer('staff_id')
.references('staff.id')
table.boolean('is_deleted')
.notNullable()
.default(false)
table.timestamps()
}),
knex.schema.createTable('pages', function(table) {
table.increments()
table.integer('staff_id')
.references('staff.id')
table.integer('parent_id')
.references('pages.id')
table.text('name')
table.text('path')
table.text('description')
table.integer('banner_id')
.references('media.id')
.defaultTo(null)
table.integer('media_id')
.references('media.id')
.defaultTo(null)
table.boolean('is_deleted')
.notNullable()
.default(false)
table.timestamps()
}),
knex.schema.createTable('articles', function(table) {
table.increments()
table.integer('staff_id')
.references('staff.id')
table.integer('parent_id')
.references('pages.id')
table.text('name')
table.text('path')
table.text('description')
table.integer('banner_id')
.references('media.id')
.defaultTo(null)
table.integer('media_id')
.references('media.id')
.defaultTo(null)
table.boolean('is_deleted')
.notNullable()
.default(false)
table.timestamp('published_at')
.defaultTo(knex.fn.now())
table.boolean('is_featured')
.notNullable()
.default(false)
table.timestamps()
}),
knex.schema.createTable('files', function(table) {
table.increments()
table.integer('article_id')
.references('articles.id')
table.text('filename')
table.text('filetype')
table.text('path')
table.integer('size')
table.integer('staff_id')
.references('staff.id')
table.jsonb('meta')
table.boolean('is_deleted')
.notNullable()
.default(false)
table.timestamps()
}),
])
}
exports.down = function down(knex, Promise) {
return Promise.all([
knex.schema.dropTable('media'),
knex.schema.dropTable('staff'),
])
}

View file

@ -1,20 +0,0 @@
/* eslint-disable */
exports.up = function(knex) {
return Promise.all([
knex.schema.table('media', function(table) {
table.text('small_image_avif')
table.text('medium_image_avif')
table.text('large_image_avif')
})
])
};
exports.down = function(knex) {
return Promise.all([
knex.schema.table('media', function(table) {
table.dropColumn('small_image_avif')
table.dropColumn('medium_image_avif')
table.dropColumn('large_image_avif')
})
])
};

View file

@ -1,16 +0,0 @@
/* eslint-disable */
exports.up = function(knex) {
return Promise.all([
knex.schema.raw('create index pages_gettree_index on pages (name asc) where not is_deleted'),
knex.schema.raw('create index pages_featuredpublish_index on articles (published_at desc) where is_featured = true and not is_deleted'),
knex.schema.raw('create index pages_publish_index on articles (published_at desc) where is_deleted = false'),
])
};
exports.down = function(knex) {
return Promise.all([
knex.schema.table('pages', function(table) {
table.dropIndex('pages_gettree_index')
})
])
};

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 437 KiB

After

Width:  |  Height:  |  Size: 437 KiB

View file

Before

Width:  |  Height:  |  Size: 285 KiB

After

Width:  |  Height:  |  Size: 285 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 345 KiB

After

Width:  |  Height:  |  Size: 345 KiB

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="52px" height="52px" viewBox="0 0 52 52" enable-background="new 0 0 52 52" xml:space="preserve">
<g opacity="0.8">
<circle fill="#FFFFFF" cx="26" cy="26" r="25"/>
<path fill="#FF0000" d="M26,0C11.664,0,0,11.663,0,26s11.664,26,26,26c14.337,0,26-11.664,26-26S40.337,0,26,0z M26,50
C12.767,50,2,39.233,2,26C2,12.766,12.767,2,26,2s24,10.767,24,24C50,39.233,39.233,50,26,50z"/>
<path fill="#FF0000" d="M22.338,24.725c-0.549,0.055-0.95,0.545-0.896,1.095l0.875,8.75c0.052,0.516,0.486,0.9,0.994,0.9
c0.033,0,0.067-0.002,0.101-0.005c0.549-0.055,0.95-0.545,0.896-1.095l-0.875-8.75C23.378,25.071,22.89,24.669,22.338,24.725z"/>
<path fill="#FF0000" d="M29.662,24.725c-0.551-0.058-1.04,0.346-1.095,0.896l-0.875,8.75c-0.055,0.55,0.346,1.04,0.896,1.095
c0.034,0.003,0.067,0.005,0.101,0.005c0.508,0,0.942-0.385,0.994-0.9l0.875-8.75C30.612,25.27,30.212,24.78,29.662,24.725z"/>
<path fill="#FF0000" d="M35.562,15.154h-6.688v-0.625c0-1.585-1.29-2.875-2.875-2.875c-1.585,0-2.875,1.29-2.875,2.875v0.625
h-6.688c-1.654,0-3,1.346-3,3v1c0,1.449,1.033,2.661,2.401,2.939c-0.159,0.446-0.225,0.927-0.161,1.407l1.941,14.484
c0.188,1.395,1.334,2.446,2.665,2.446h11.436c1.328,0,2.472-1.052,2.661-2.447L36.323,23.5c0.063-0.48-0.003-0.96-0.161-1.406
c1.367-0.278,2.4-1.49,2.4-2.939v-1C38.562,16.5,37.217,15.154,35.562,15.154z M25.125,14.529c0-0.482,0.393-0.875,0.875-0.875
s0.875,0.393,0.875,0.875v0.625h-1.75V14.529z M32.397,37.718c-0.055,0.407-0.347,0.714-0.679,0.714H20.283
c-0.334,0-0.628-0.307-0.683-0.713l-1.94-14.483c-0.035-0.262,0.035-0.535,0.186-0.727c0.13-0.165,0.309-0.26,0.491-0.26h15.325
c0.184,0,0.364,0.095,0.491,0.255c0.152,0.195,0.223,0.469,0.188,0.731L32.397,37.718z M36.562,19.154c0,0.551-0.448,1-1,1H16.438
c-0.551,0-1-0.449-1-1v-1c0-0.551,0.449-1,1-1h19.125c0.552,0,1,0.449,1,1V19.154z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="52px" height="52px" viewBox="0 0 52 52" enable-background="new 0 0 52 52" xml:space="preserve">
<g opacity="0.8">
<circle fill="#FFFFFF" cx="26" cy="26" r="25"/>
<path fill="#FF0000" d="M26,0C11.664,0,0,11.663,0,26s11.664,26,26,26c14.337,0,26-11.664,26-26S40.337,0,26,0z M26,50
C12.767,50,2,39.233,2,26C2,12.766,12.767,2,26,2s24,10.767,24,24C50,39.233,39.233,50,26,50z"/>
<path fill="#FF0000" d="M22.338,24.725c-0.549,0.055-0.95,0.545-0.896,1.095l0.875,8.75c0.052,0.516,0.486,0.9,0.994,0.9
c0.033,0,0.067-0.002,0.101-0.005c0.549-0.055,0.95-0.545,0.896-1.095l-0.875-8.75C23.378,25.071,22.89,24.669,22.338,24.725z"/>
<path fill="#FF0000" d="M29.662,24.725c-0.551-0.058-1.04,0.346-1.095,0.896l-0.875,8.75c-0.055,0.55,0.346,1.04,0.896,1.095
c0.034,0.003,0.067,0.005,0.101,0.005c0.508,0,0.942-0.385,0.994-0.9l0.875-8.75C30.612,25.27,30.212,24.78,29.662,24.725z"/>
<path fill="#FF0000" d="M35.562,15.154h-6.688v-0.625c0-1.585-1.29-2.875-2.875-2.875c-1.585,0-2.875,1.29-2.875,2.875v0.625
h-6.688c-1.654,0-3,1.346-3,3v1c0,1.449,1.033,2.661,2.401,2.939c-0.159,0.446-0.225,0.927-0.161,1.407l1.941,14.484
c0.188,1.395,1.334,2.446,2.665,2.446h11.436c1.328,0,2.472-1.052,2.661-2.447L36.323,23.5c0.063-0.48-0.003-0.96-0.161-1.406
c1.367-0.278,2.4-1.49,2.4-2.939v-1C38.562,16.5,37.217,15.154,35.562,15.154z M25.125,14.529c0-0.482,0.393-0.875,0.875-0.875
s0.875,0.393,0.875,0.875v0.625h-1.75V14.529z M32.397,37.718c-0.055,0.407-0.347,0.714-0.679,0.714H20.283
c-0.334,0-0.628-0.307-0.683-0.713l-1.94-14.483c-0.035-0.262,0.035-0.535,0.186-0.727c0.13-0.165,0.309-0.26,0.491-0.26h15.325
c0.184,0,0.364,0.095,0.491,0.255c0.152,0.195,0.223,0.469,0.188,0.731L32.397,37.718z M36.562,19.154c0,0.551-0.448,1-1,1H16.438
c-0.551,0-1-0.449-1-1v-1c0-0.551,0.449-1,1-1h19.125c0.552,0,1,0.449,1,1V19.154z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View file

Before

Width:  |  Height:  |  Size: 436 KiB

After

Width:  |  Height:  |  Size: 436 KiB

Some files were not shown because too many files have changed in this diff Show more