Skip to content

Commit

Permalink
properties: added Mastodon address (wdt:P4033) to author claims prope…
Browse files Browse the repository at this point in the history
…rties
  • Loading branch information
maxlath committed Nov 13, 2017
1 parent 73433bc commit d912093
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
35 changes: 35 additions & 0 deletions app/assets/images/mastodon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/lib/handlebars_helpers/images.coffee
Expand Up @@ -16,6 +16,7 @@ images =
wikisource: '/public/images/wikisource-64.png'
'barcode-scanner': '/public/images/barcode-scanner-64.png'
gutenberg: '/public/images/gutenberg.png'
mastodon: '/public/images/mastodon.svg'

imagesList = Object.keys images

Expand Down
6 changes: 6 additions & 0 deletions app/lib/handlebars_helpers/platforms.coffee
Expand Up @@ -25,6 +25,12 @@ module.exports =
icon: 'youtube'
text: -> ''
url: (channelId)-> "https://www.youtube.com/channel/#{channelId}"
'wdt:P4033':
icon: 'mastodon'
text: _.identity
url: (address)->
[ username, domain ] = address.split '@'
return "https://#{domain}/@#{username}"

gutenbergBase = ->
base = if _.smallScreen() then 'http://m.' else 'https://www.'
Expand Down
1 change: 1 addition & 0 deletions app/lib/shared/properties_per_type.coffee
Expand Up @@ -55,6 +55,7 @@ module.exports = (_)->
'wdt:P2013': {} # Facebook account
'wdt:P2003': {} # Instagram username
'wdt:P2397': {} # YouTube channel ID
'wdt:P4033': {} # Mastodon address

# Using omit instead of having a common list, extended for works, so that
# the properties order isn't constrained by being part or not of the common properties
Expand Down
2 changes: 2 additions & 0 deletions app/modules/entities/lib/properties.coffee
Expand Up @@ -79,6 +79,8 @@ addProp 'wdt:P2013', 'string', null, false, null
addProp 'wdt:P2003', 'string', null, false, null
# YouTube channel ID
addProp 'wdt:P2397', 'string', null, false, null
# Mastodon address
addProp 'wdt:P4033', 'string', null, false, null

## work and human
addProp 'wdt:P856', 'string', null, false, null
1 change: 1 addition & 0 deletions app/modules/entities/views/templates/author_claims.hbs
Expand Up @@ -13,6 +13,7 @@
{{claim claims 'wdt:P1066' true}} {{!-- student of --}}
{{claim claims 'wdt:P737' true}} {{!-- influence by --}}
{{urlClaim claims 'wdt:P856'}} {{!-- official website --}}
{{platformClaim claims 'wdt:P4033'}} {{!-- mastodon --}}
{{platformClaim claims 'wdt:P2002'}} {{!-- twitter --}}
{{platformClaim claims 'wdt:P2013'}} {{!-- facebook --}}
{{platformClaim claims 'wdt:P2003'}} {{!-- instagram --}}
Expand Down

0 comments on commit d912093

Please sign in to comment.