restructure
13
.gitignore
vendored
|
@ -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
|
||||
|
|
12
app/admin.js
|
@ -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],
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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'),
|
||||
])
|
||||
}
|
|
@ -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')
|
||||
})
|
||||
])
|
||||
};
|
|
@ -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')
|
||||
})
|
||||
])
|
||||
};
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 437 KiB After Width: | Height: | Size: 437 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 285 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 345 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 436 KiB After Width: | Height: | Size: 436 KiB |