mirror of https://github.com/Requarks/wiki.git
34 changed files with 581 additions and 725 deletions
Split View
Diff Options
-
76client/components/admin.vue
-
17client/components/admin/admin-dashboard.vue
-
44client/components/admin/admin-groups-edit-rules.vue
-
60client/components/common/nav-header.vue
-
6client/graph/common/common-locale-query.gql
-
8client/graph/common/common-localization-query-translations.gql
-
6client/modules/localization.js
-
1client/scss/app.scss
-
81client/scss/pages/_notfound.scss
-
1package.json
-
7server/controllers/common.js
-
105server/core/auth.js
-
74server/graph/resolvers/comment.js
-
46server/graph/resolvers/document.js
-
88server/graph/resolvers/file.js
-
60server/graph/resolvers/folder.js
-
12server/graph/resolvers/group.js
-
3server/graph/resolvers/localization.js
-
9server/graph/resolvers/page.js
-
53server/graph/resolvers/right.js
-
24server/graph/resolvers/setting.js
-
4server/graph/resolvers/system.js
-
112server/graph/resolvers/tag.js
-
12server/graph/resolvers/translation.js
-
1server/graph/resolvers/user.js
-
239server/graph/schemas/common.graphql
-
17server/graph/schemas/group.graphql
-
6server/graph/schemas/localization.graphql
-
27server/graph/schemas/page.graphql
-
2server/graph/schemas/site.graphql
-
52server/graph/schemas/system.graphql
-
36server/models/users.js
-
4server/setup.js
-
13server/views/notfound.pug
@ -1,6 +0,0 @@ |
|||
query($locale: String!, $namespace: String!) { |
|||
translations(locale:$locale, namespace:$namespace) { |
|||
key |
|||
value |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
query($locale: String!, $namespace: String!) { |
|||
localization { |
|||
translations(locale:$locale, namespace:$namespace) { |
|||
key |
|||
value |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,81 @@ |
|||
.notfound { |
|||
background: linear-gradient(to bottom, darken(mc('red', '900'), 25%) 0%, mc('red', '600') 100%); |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
align-items: center; |
|||
color: mc('grey', '50'); |
|||
|
|||
&::before { |
|||
content: ''; |
|||
display:block; |
|||
width: 100%; |
|||
height: 100%; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
background-image: url('../static/svg/motif-circuit.svg'); |
|||
background-position: center center; |
|||
background-repeat: repeat; |
|||
background-size: 200px; |
|||
z-index: 0; |
|||
opacity: .75; |
|||
animation: onboardingBgReveal 80s linear infinite; |
|||
|
|||
@include keyframes(onboardingBgReveal) { |
|||
0% { |
|||
background-position-y: 0; |
|||
} |
|||
100% { |
|||
background-position-y: -2000px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
&::after { |
|||
content: ''; |
|||
position: absolute; |
|||
background-color: transparent; |
|||
background-image: url('../static/svg/motif-overlay.svg'); |
|||
background-attachment: fixed; |
|||
background-size: cover; |
|||
opacity: .5; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100vw; |
|||
height: 100vh; |
|||
} |
|||
|
|||
&-content { |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
align-items: center; |
|||
z-index: 2; |
|||
} |
|||
|
|||
img { |
|||
height: 250px; |
|||
margin-bottom: 3rem; |
|||
z-index: 2; |
|||
animation-duration: 2s; |
|||
|
|||
@include until($tablet) { |
|||
height: 200px; |
|||
} |
|||
} |
|||
|
|||
h1 { |
|||
font-size: 1.5rem; |
|||
margin-bottom: 1rem; |
|||
z-index: 2; |
|||
} |
|||
h2 { |
|||
margin-bottom: 3rem; |
|||
z-index: 2; |
|||
} |
|||
.v-btn { |
|||
z-index: 2; |
|||
} |
|||
} |
@ -1,46 +0,0 @@ |
|||
|
|||
/* global WIKI */ |
|||
|
|||
module.exports = { |
|||
Query: { |
|||
documents(obj, args, context, info) { |
|||
return WIKI.models.Document.findAll({ where: args }) |
|||
} |
|||
}, |
|||
Mutation: { |
|||
createDocument(obj, args) { |
|||
return WIKI.models.Document.create(args) |
|||
}, |
|||
deleteDocument(obj, args) { |
|||
return WIKI.models.Document.destroy({ |
|||
where: { |
|||
id: args.id |
|||
}, |
|||
limit: 1 |
|||
}) |
|||
}, |
|||
modifyDocument(obj, args) { |
|||
return WIKI.models.Document.update({ |
|||
title: args.title, |
|||
subtitle: args.subtitle |
|||
}, { |
|||
where: { id: args.id } |
|||
}) |
|||
}, |
|||
moveDocument(obj, args) { |
|||
return WIKI.models.Document.update({ |
|||
path: args.path |
|||
}, { |
|||
where: { id: args.id } |
|||
}) |
|||
} |
|||
}, |
|||
Document: { |
|||
comments(doc) { |
|||
return doc.getComments() |
|||
}, |
|||
tags(doc) { |
|||
return doc.getTags() |
|||
} |
|||
} |
|||
} |
@ -1,53 +0,0 @@ |
|||
|
|||
/* global WIKI */ |
|||
|
|||
const gql = require('graphql') |
|||
|
|||
module.exports = { |
|||
Query: { |
|||
rights(obj, args, context, info) { |
|||
return WIKI.models.Right.findAll({ where: args }) |
|||
} |
|||
}, |
|||
Mutation: { |
|||
addRightToGroup(obj, args) { |
|||
return WIKI.models.Group.findById(args.groupId).then(grp => { |
|||
if (!grp) { |
|||
throw new gql.GraphQLError('Invalid Group ID') |
|||
} |
|||
return WIKI.models.Right.create({ |
|||
path: args.path, |
|||
role: args.role, |
|||
exact: args.exact, |
|||
allow: args.allow, |
|||
group: grp |
|||
}) |
|||
}) |
|||
}, |
|||
removeRightFromGroup(obj, args) { |
|||
return WIKI.models.Right.destroy({ |
|||
where: { |
|||
id: args.rightId |
|||
}, |
|||
limit: 1 |
|||
}) |
|||
}, |
|||
modifyRight(obj, args) { |
|||
return WIKI.models.Right.update({ |
|||
path: args.path, |
|||
role: args.role, |
|||
exact: args.exact, |
|||
allow: args.allow |
|||
}, { |
|||
where: { |
|||
id: args.id |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
Right: { |
|||
group(rt) { |
|||
return rt.getGroup() |
|||
} |
|||
} |
|||
} |
@ -1,24 +0,0 @@ |
|||
|
|||
/* global WIKI */ |
|||
|
|||
const _ = require('lodash') |
|||
|
|||
module.exports = { |
|||
Query: { |
|||
settings(obj, args, context, info) { |
|||
return WIKI.models.Setting.findAll({ where: args, raw: true }).then(entries => { |
|||
return _.map(entries, entry => { |
|||
entry.config = JSON.stringify(entry.config) |
|||
return entry |
|||
}) |
|||
}) |
|||
} |
|||
}, |
|||
Mutation: { |
|||
setConfigEntry(obj, args) { |
|||
return WIKI.models.Setting.update({ |
|||
value: args.value |
|||
}, { where: { key: args.key } }) |
|||
} |
|||
} |
|||
} |
@ -1,12 +0,0 @@ |
|||
|
|||
/* global WIKI */ |
|||
|
|||
module.exports = { |
|||
Query: { |
|||
translations (obj, args, context, info) { |
|||
return WIKI.lang.getByNamespace(args.locale, args.namespace) |
|||
} |
|||
}, |
|||
Mutation: {}, |
|||
Translation: {} |
|||
} |
@ -0,0 +1,13 @@ |
|||
extends master.pug |
|||
|
|||
block body |
|||
#root.is-fullscreen |
|||
v-app |
|||
.notfound |
|||
.notfound-content |
|||
img.animated.fadeIn(src='/svg/icon-delete-file.svg', alt='Not Found') |
|||
.headline= t('notfound.title') |
|||
.subheading.mt-3= t('notfound.subtitle') |
|||
v-btn.mt-5(color='red lighten-4', href='/', large, outline) |
|||
v-icon(left) home |
|||
span= t('notfound.gohome') |
Write
Preview
Loading…
Cancel
Save