Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
f7c0daec
Commit
f7c0daec
authored
Feb 23, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: content license notice option
parent
c5a22f6d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
127 additions
and
85 deletions
+127
-85
admin.vue
client/components/admin.vue
+1
-1
admin-general.vue
client/components/admin/admin-general.vue
+113
-5
site-mutation-save-config.gql
client/graph/admin/site/site-mutation-save-config.gql
+0
-52
site-query-config.gql
client/graph/admin/site/site-query-config.gql
+0
-25
site.js
client/store/site.js
+1
-0
nav-footer.vue
client/themes/default/components/nav-footer.vue
+4
-1
data.yml
server/app/data.yml
+2
-0
site.js
server/graph/resolvers/site.js
+3
-1
site.graphql
server/graph/schemas/site.graphql
+2
-0
master.js
server/master.js
+1
-0
No files found.
client/components/admin.vue
View file @
f7c0daec
...
...
@@ -7,7 +7,7 @@
v-spacer
v-navigation-drawer.pb-0.admin-sidebar(v-model='adminDrawerShown', app, fixed, clipped, :right='$vuetify.rtl', permanent, width='300')
vue-scroll(:ops='scrollStyle')
v-list(dense, nav)
v-list
.radius-0
(dense, nav)
v-list-item(to='/dashboard', color='primary')
v-list-item-avatar(size='24', tile): v-icon mdi-view-dashboard-variant
v-list-item-title
{{
$t
(
'admin:dashboard.title'
)
}}
...
...
client/components/admin/admin-general.vue
View file @
f7c0daec
...
...
@@ -73,6 +73,16 @@
persistent-hint
:hint='$t(`admin:general.companyNameHint`)'
)
v-select.mt-3(
outlined
:label='$t(`admin:general.contentLicense`)'
:items='contentLicenses'
v-model='config.contentLicense'
prepend-icon='mdi-creative-commons'
:return-object='false'
:hint='$t(`admin:general.contentLicenseHint`)'
persistent-hint
)
v-divider
.overline.grey--text.pa-4 SEO
.px-3.pb-3
...
...
@@ -251,8 +261,7 @@
<
script
>
import
_
from
'lodash'
import
{
get
,
sync
}
from
'vuex-pathify'
import
siteConfigQuery
from
'gql/admin/site/site-query-config.gql'
import
siteUpdateConfigMutation
from
'gql/admin/site/site-mutation-save-config.gql'
import
gql
from
'graphql-tag'
import
editorStore
from
'../../store/editor'
...
...
@@ -281,6 +290,7 @@ export default {
analyticsService
:
''
,
analyticsId
:
''
,
company
:
''
,
contentLicense
:
''
,
logoUrl
:
''
,
featureAnalytics
:
false
,
featurePageRatings
:
false
,
...
...
@@ -317,13 +327,82 @@ export default {
siteTitle
:
sync
(
'site/title'
),
logoUrl
:
sync
(
'site/logoUrl'
),
company
:
sync
(
'site/company'
),
activeModal
:
sync
(
'editor/activeModal'
)
contentLicense
:
sync
(
'site/contentLicense'
),
activeModal
:
sync
(
'editor/activeModal'
),
contentLicenses
()
{
return
[
{
value
:
''
,
text
:
this
.
$t
(
'common:license.none'
)
},
{
value
:
'alr'
,
text
:
this
.
$t
(
'common:license.alr'
)
},
{
value
:
'cc0'
,
text
:
this
.
$t
(
'common:license.cc0'
)
},
{
value
:
'ccby'
,
text
:
this
.
$t
(
'common:license.ccby'
)
},
{
value
:
'ccbysa'
,
text
:
this
.
$t
(
'common:license.ccbysa'
)
},
{
value
:
'ccbynd'
,
text
:
this
.
$t
(
'common:license.ccbynd'
)
},
{
value
:
'ccbync'
,
text
:
this
.
$t
(
'common:license.ccbync'
)
},
{
value
:
'ccbyncsa'
,
text
:
this
.
$t
(
'common:license.ccbyncsa'
)
},
{
value
:
'ccbyncnd'
,
text
:
this
.
$t
(
'common:license.ccbyncnd'
)
}
]
}
},
methods
:
{
async
save
()
{
try
{
await
this
.
$apollo
.
mutate
({
mutation
:
siteUpdateConfigMutation
,
mutation
:
gql
`
mutation (
$host: String!
$title: String!
$description: String!
$robots: [String]!
$analyticsService: String!
$analyticsId: String!
$company: String!
$contentLicense: String!
$logoUrl: String!
$featurePageRatings: Boolean!
$featurePageComments: Boolean!
$featurePersonalWikis: Boolean!
$securityIframe: Boolean!
$securityReferrerPolicy: Boolean!
$securityTrustProxy: Boolean!
$securitySRI: Boolean!
$securityHSTS: Boolean!
$securityHSTSDuration: Int!
$securityCSP: Boolean!
$securityCSPDirectives: String!
) {
site {
updateConfig(
host: $host,
title: $title,
description: $description,
robots: $robots,
analyticsService: $analyticsService,
analyticsId: $analyticsId,
company: $company,
contentLicense: $contentLicense,
logoUrl: $logoUrl,
featurePageRatings: $featurePageRatings,
featurePageComments: $featurePageComments,
featurePersonalWikis: $featurePersonalWikis,
securityIframe: $securityIframe,
securityReferrerPolicy: $securityReferrerPolicy,
securityTrustProxy: $securityTrustProxy,
securitySRI: $securitySRI,
securityHSTS: $securityHSTS,
securityHSTSDuration: $securityHSTSDuration,
securityCSP: $securityCSP,
securityCSPDirectives: $securityCSPDirectives
) {
responseResult {
succeeded
errorCode
slug
message
}
}
}
}
`
,
variables
:
{
host
:
_
.
get
(
this
.
config
,
'host'
,
''
),
title
:
_
.
get
(
this
.
config
,
'title'
,
''
),
...
...
@@ -332,6 +411,7 @@ export default {
analyticsService
:
_
.
get
(
this
.
config
,
'analyticsService'
,
''
),
analyticsId
:
_
.
get
(
this
.
config
,
'analyticsId'
,
''
),
company
:
_
.
get
(
this
.
config
,
'company'
,
''
),
contentLicense
:
_
.
get
(
this
.
config
,
'contentLicense'
,
''
),
logoUrl
:
_
.
get
(
this
.
config
,
'logoUrl'
,
''
),
featurePageRatings
:
_
.
get
(
this
.
config
,
'featurePageRatings'
,
false
),
featurePageComments
:
_
.
get
(
this
.
config
,
'featurePageComments'
,
false
),
...
...
@@ -356,6 +436,7 @@ export default {
})
this
.
siteTitle
=
this
.
config
.
title
this
.
company
=
this
.
config
.
company
this
.
contentLicense
=
this
.
config
.
contentLicense
this
.
logoUrl
=
this
.
config
.
logoUrl
}
catch
(
err
)
{
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
...
...
@@ -379,7 +460,34 @@ export default {
},
apollo
:
{
config
:
{
query
:
siteConfigQuery
,
query
:
gql
`
{
site {
config {
host
title
description
robots
analyticsService
analyticsId
company
contentLicense
logoUrl
featurePageRatings
featurePageComments
featurePersonalWikis
securityIframe
securityReferrerPolicy
securityTrustProxy
securitySRI
securityHSTS
securityHSTSDuration
securityCSP
securityCSPDirectives
}
}
}
`
,
fetchPolicy
:
'network-only'
,
update
:
(
data
)
=>
_
.
cloneDeep
(
data
.
site
.
config
),
watchLoading
(
isLoading
)
{
...
...
client/graph/admin/site/site-mutation-save-config.gql
deleted
100644 → 0
View file @
c5a22f6d
mutation
(
$host
:
String
!
$title
:
String
!
$description
:
String
!
$robots
:
[
String
]!
$analyticsService
:
String
!
$analyticsId
:
String
!
$company
:
String
!
$logoUrl
:
String
!
$featurePageRatings
:
Boolean
!
$featurePageComments
:
Boolean
!
$featurePersonalWikis
:
Boolean
!
$securityIframe
:
Boolean
!
$securityReferrerPolicy
:
Boolean
!
$securityTrustProxy
:
Boolean
!
$securitySRI
:
Boolean
!
$securityHSTS
:
Boolean
!
$securityHSTSDuration
:
Int
!
$securityCSP
:
Boolean
!
$securityCSPDirectives
:
String
!
)
{
site
{
updateConfig
(
host
:
$host
,
title
:
$title
,
description
:
$description
,
robots
:
$robots
,
analyticsService
:
$analyticsService
,
analyticsId
:
$analyticsId
,
company
:
$company
,
logoUrl
:
$logoUrl
,
featurePageRatings
:
$featurePageRatings
,
featurePageComments
:
$featurePageComments
,
featurePersonalWikis
:
$featurePersonalWikis
,
securityIframe
:
$securityIframe
,
securityReferrerPolicy
:
$securityReferrerPolicy
,
securityTrustProxy
:
$securityTrustProxy
,
securitySRI
:
$securitySRI
,
securityHSTS
:
$securityHSTS
,
securityHSTSDuration
:
$securityHSTSDuration
,
securityCSP
:
$securityCSP
,
securityCSPDirectives
:
$securityCSPDirectives
)
{
responseResult
{
succeeded
errorCode
slug
message
}
}
}
}
client/graph/admin/site/site-query-config.gql
deleted
100644 → 0
View file @
c5a22f6d
{
site
{
config
{
host
title
description
robots
analyticsService
analyticsId
company
logoUrl
featurePageRatings
featurePageComments
featurePersonalWikis
securityIframe
securityReferrerPolicy
securityTrustProxy
securitySRI
securityHSTS
securityHSTSDuration
securityCSP
securityCSPDirectives
}
}
}
client/store/site.js
View file @
f7c0daec
...
...
@@ -4,6 +4,7 @@ import { make } from 'vuex-pathify'
const
state
=
{
company
:
siteConfig
.
company
,
contentLicense
:
siteConfig
.
contentLicense
,
dark
:
siteConfig
.
darkMode
,
mascot
:
true
,
title
:
siteConfig
.
title
,
...
...
client/themes/default/components/nav-footer.vue
View file @
f7c0daec
<
template
lang=
"pug"
>
v-footer.justify-center(:color='bgColor', inset)
.caption.grey--text.text--darken-1
span(v-if='company && company.length > 0')
{{
$t
(
'common:footer.copyright'
,
{
company
:
company
,
year
:
currentYear
,
interpolation
:
{
escapeValue
:
false
}
}
)
}}
|&
nbsp
;
template(v-if='company && company.length > 0 && contentLicense !== ``')
span(v-if='contentLicense === `alr`')
{{
$t
(
'common:footer.copyright'
,
{
company
:
company
,
year
:
currentYear
,
interpolation
:
{
escapeValue
:
false
}
}
)
}}
|&
nbsp
;
span
(
v
-
else
)
{{
$t
(
'common:footer.license'
,
{
company
:
company
,
license
:
$t
(
'common:license.'
+
contentLicense
),
interpolation
:
{
escapeValue
:
false
}
}
)
}}
|&
nbsp
;
span
{{
$t
(
'common:footer.poweredBy'
)
}}
#
[
a
(
href
=
'https://wiki.js.org'
,
ref
=
'nofollow'
)
Wiki
.
js
]
<
/template
>
...
...
@@ -26,6 +28,7 @@ export default {
}
,
computed
:
{
company
:
get
(
'site/company'
),
contentLicense
:
get
(
'site/contentLicense'
),
darkMode
:
get
(
'site/dark'
),
bgColor
()
{
if
(
!
this
.
darkMode
)
{
...
...
server/app/data.yml
View file @
f7c0daec
...
...
@@ -42,6 +42,8 @@ defaults:
clientId
:
'
'
isEnabled
:
false
title
:
Wiki.js
company
:
'
'
contentLicense
:
'
'
logoUrl
:
https://static.requarks.io/logo/wikijs-butterfly.svg
theming
:
theme
:
'
default'
...
...
server/graph/resolvers/site.js
View file @
f7c0daec
...
...
@@ -15,6 +15,7 @@ module.exports = {
host
:
WIKI
.
config
.
host
,
title
:
WIKI
.
config
.
title
,
company
:
WIKI
.
config
.
company
,
contentLicense
:
WIKI
.
config
.
contentLicense
,
logoUrl
:
WIKI
.
config
.
logoUrl
,
...
WIKI
.
config
.
seo
,
...
WIKI
.
config
.
features
,
...
...
@@ -28,6 +29,7 @@ module.exports = {
WIKI
.
config
.
host
=
args
.
host
WIKI
.
config
.
title
=
args
.
title
WIKI
.
config
.
company
=
args
.
company
WIKI
.
config
.
contentLicense
=
args
.
contentLicense
WIKI
.
config
.
seo
=
{
description
:
args
.
description
,
robots
:
args
.
robots
,
...
...
@@ -50,7 +52,7 @@ module.exports = {
securityCSP
:
args
.
securityCSP
,
securityCSPDirectives
:
args
.
securityCSPDirectives
}
await
WIKI
.
configSvc
.
saveToDb
([
'host'
,
'title'
,
'company'
,
'seo'
,
'logoUrl'
,
'features'
,
'security'
])
await
WIKI
.
configSvc
.
saveToDb
([
'host'
,
'title'
,
'company'
,
'
contentLicense'
,
'
seo'
,
'logoUrl'
,
'features'
,
'security'
])
if
(
WIKI
.
config
.
security
.
securityTrustProxy
)
{
WIKI
.
app
.
enable
(
'trust proxy'
)
...
...
server/graph/schemas/site.graphql
View file @
f7c0daec
...
...
@@ -31,6 +31,7 @@ type SiteMutation {
analyticsService
:
String
!
analyticsId
:
String
!
company
:
String
!
contentLicense
:
String
!
logoUrl
:
String
!
featurePageRatings
:
Boolean
!
featurePageComments
:
Boolean
!
...
...
@@ -58,6 +59,7 @@ type SiteConfig {
analyticsService
:
String
!
analyticsId
:
String
!
company
:
String
!
contentLicense
:
String
!
logoUrl
:
String
!
featurePageRatings
:
Boolean
!
featurePageComments
:
Boolean
!
...
...
server/master.js
View file @
f7c0daec
...
...
@@ -145,6 +145,7 @@ module.exports = async () => {
lang
:
WIKI
.
config
.
lang
.
code
,
rtl
:
WIKI
.
config
.
lang
.
rtl
,
company
:
WIKI
.
config
.
company
,
contentLicense
:
WIKI
.
config
.
contentLicense
,
logoUrl
:
WIKI
.
config
.
logoUrl
}
res
.
locals
.
langs
=
await
WIKI
.
models
.
locales
.
getNavLocales
({
cache
:
true
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment