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
0bd9c36d
You need to sign in or sign up before continuing.
Commit
0bd9c36d
authored
Sep 22, 2018
by
Nicolas Giard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: list sponsors + contributors on contribute admin page
parent
925b3e15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
1 deletion
+156
-1
admin-contribute.vue
client/components/admin/admin-contribute.vue
+73
-1
contribute-query-contributors.gql
.../graph/admin/contribute/contribute-query-contributors.gql
+17
-0
contribute.js
server/graph/resolvers/contribute.js
+33
-0
contribute.graphql
server/graph/schemas/contribute.graphql
+33
-0
No files found.
client/components/admin/admin-contribute.vue
View file @
0bd9c36d
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
span
{{
$t
(
'admin:contribute.makeADonation'
)
}}
span
{{
$t
(
'admin:contribute.makeADonation'
)
}}
.body-1.mt-3.pl-3
{{
$t
(
'admin:contribute.tshirts'
)
}}
.body-1.mt-3.pl-3
{{
$t
(
'admin:contribute.tshirts'
)
}}
v-card-actions.ml-2
v-card-actions.ml-2
v-btn(
depressed
, color='primary', href='https://wikijs.threadless.com')
v-btn(
outline
, color='primary', href='https://wikijs.threadless.com')
v-icon(left) shopping_cart
v-icon(left) shopping_cart
span
{{
$t
(
'admin:contribute.shop'
)
}}
span
{{
$t
(
'admin:contribute.shop'
)
}}
v-divider.mt-3
v-divider.mt-3
...
@@ -39,11 +39,83 @@
...
@@ -39,11 +39,83 @@
li
{{
$t
(
'admin:contribute.talkToFriends'
)
}}
li
{{
$t
(
'admin:contribute.talkToFriends'
)
}}
i18next(path='admin:contribute.followUsOnTwitter', tag='li')
i18next(path='admin:contribute.followUsOnTwitter', tag='li')
a(href='https://twitter.com/requarks', target='_blank') Twitter
a(href='https://twitter.com/requarks', target='_blank') Twitter
v-card
v-toolbar(color='teal', dense, dark)
.subheading Sponsors
v-list(two-line, dense)
template(v-for='(sponsor, idx) in sponsors')
v-list-tile(:key='sponsor.id')
v-list-tile-avatar
img(v-if='sponsor.image', :src='sponsor.image')
v-avatar(v-else, color='teal', size='40')
span.white--text.subheading
{{
sponsor
.
name
[
0
].
toUpperCase
()
}}
v-list-tile-content
v-list-tile-title
{{
sponsor
.
name
}}
v-list-tile-sub-title
{{
sponsor
.
description
}}
v-list-tile-action(v-if='sponsor.twitter')
v-btn(icon, :href='sponsor.twitter', target='_blank')
icon-twitter(fillColor='#9e9e9e')
v-list-tile-action(v-if='sponsor.website')
v-btn(icon, :href='sponsor.website', target='_blank')
v-icon(color='grey') public
v-divider(v-if='idx < sponsors.length - 1')
v-card
v-toolbar(color='blue-grey', dense, dark)
.subheading Backers
v-list(two-line, dense)
template(v-for='(backer, idx) in backers')
v-list-tile(:key='backer.id')
v-list-tile-avatar
img(v-if='backer.image', :src='backer.image')
v-avatar(v-else, color='blue-grey', size='40')
span.white--text.subheading
{{
backer
.
name
[
0
].
toUpperCase
()
}}
v-list-tile-content
v-list-tile-title
{{
backer
.
name
}}
v-list-tile-sub-title
{{
backer
.
description
}}
v-list-tile-action(v-if='backer.twitter')
v-btn(icon, :href='backer.twitter', target='_blank')
icon-twitter(fillColor='#9e9e9e')
v-list-tile-action(v-if='backer.website')
v-btn(icon, :href='backer.website', target='_blank')
v-icon(color='grey') public
v-divider(v-if='idx < backers.length - 1')
</
template
>
</
template
>
<
script
>
<
script
>
import
_
from
'lodash'
import
groupsQuery
from
'gql/admin/contribute/contribute-query-contributors.gql'
import
IconTwitter
from
'mdi/Twitter'
export
default
{
export
default
{
components
:
{
IconTwitter
},
data
()
{
return
{
contributors
:
[]
}
},
computed
:
{
sponsors
()
{
return
_
.
filter
(
this
.
contributors
,
[
'tier'
,
'sponsors'
])
},
backers
()
{
return
_
.
reject
(
this
.
contributors
,
[
'tier'
,
'sponsors'
])
}
},
apollo
:
{
contributors
:
{
query
:
groupsQuery
,
fetchPolicy
:
'network-only'
,
update
:
(
data
)
=>
data
.
contribute
.
contributors
,
watchLoading
(
isLoading
)
{
this
.
$store
.
commit
(
`loading
${
isLoading
?
'Start'
:
'Stop'
}
`
,
'admin-contribute-refresh'
)
}
}
}
}
}
</
script
>
</
script
>
...
...
client/graph/admin/contribute/contribute-query-contributors.gql
0 → 100644
View file @
0bd9c36d
query
{
contribute
{
contributors
{
company
currency
description
id
image
name
profile
tier
totalDonated
twitter
website
}
}
}
server/graph/resolvers/contribute.js
0 → 100644
View file @
0bd9c36d
const
request
=
require
(
'request-promise'
)
const
_
=
require
(
'lodash'
)
module
.
exports
=
{
Query
:
{
async
contribute
()
{
return
{}
}
},
ContributeQuery
:
{
async
contributors
(
obj
,
args
,
context
,
info
)
{
const
resp
=
await
request
({
uri
:
'https://opencollective.com/wikijs/members/all.json'
,
json
:
true
})
const
dude
=
_
.
filter
(
resp
,
c
=>
{
return
c
.
role
===
'BACKER'
&&
c
.
totalAmountDonated
>
0
}).
map
(
c
=>
({
company
:
_
.
get
(
c
,
'company'
,
''
)
||
''
,
currency
:
_
.
get
(
c
,
'currency'
,
'USD'
)
||
'USD'
,
description
:
_
.
get
(
c
,
'description'
,
''
)
||
''
,
id
:
_
.
get
(
c
,
'MemberId'
,
0
),
image
:
_
.
get
(
c
,
'image'
,
''
)
||
''
,
name
:
_
.
get
(
c
,
'name'
,
'Anonymous'
)
||
''
,
profile
:
_
.
get
(
c
,
'profile'
,
''
),
tier
:
_
.
toLower
(
_
.
get
(
c
,
'tier'
,
'backers'
)),
totalDonated
:
_
.
get
(
c
,
'totalAmountDonated'
,
0
),
twitter
:
_
.
get
(
c
,
'twitter'
,
''
)
||
''
,
website
:
_
.
get
(
c
,
'website'
,
''
)
||
''
}))
console
.
info
(
dude
)
return
dude
}
}
}
server/graph/schemas/contribute.graphql
0 → 100644
View file @
0bd9c36d
# ===============================================
# CONTRIBUTE
# ===============================================
extend
type
Query
{
contribute
:
ContributeQuery
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type
ContributeQuery
{
contributors
:
[
ContributeContributor
]
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type
ContributeContributor
{
company
:
String
!
currency
:
String
!
description
:
String
!
id
:
Int
!
image
:
String
!
name
:
String
!
profile
:
String
!
tier
:
String
!
totalDonated
:
Int
!
twitter
:
String
!
website
:
String
!
}
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