Code coverage report for code/data/licenses.coffee

Statements: 0% (0 / 11)      Branches: 100% (0 / 0)      Functions: 0% (0 / 3)      Lines: 0% (0 / 8)      Ignored: none     

All files » code/data/ » licenses.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48                                                                                               
{option, optgroup} = React.DOM
 
module.exports =
  map:
    'public domain':
      label: 'Public Domain'
      fullLabel: 'Public Domain'
      link: 'http://en.wikipedia.org/wiki/Public_domain'
    'creative commons':
      'cc by':
        label: 'Attribution Only'
        fullLabel: 'Creative Commons: Attribution Only'
        link: 'http://creativecommons.org/licenses/by/4.0'
      'cc by-sa':
        label: 'ShareAlike'
        fullLabel: 'Creative Commons: ShareAlike'
        link: 'http://creativecommons.org/licenses/by-sa/4.0'
      'cc by-nd':
        label: 'NoDerivatives'
        fullLabel: 'Creative Commons: NoDerivatives'
        link: 'http://creativecommons.org/licenses/by-nd/4.0'
      'cc by-nc':
        label: 'NonCommercial (NC)'
        fullLabel: 'Creative Commons: NonCommercial (NC)'
        link: 'http://creativecommons.org/licenses/by-nc/4.0'
      'cc by-nc-sa':
        label: 'NC-ShareAlike'
        fullLabel: 'Creative Commons: NC-ShareAlike'
        link: 'http://creativecommons.org/licenses/by-nc-sa/4.0'
      'cc by-nc-nd':
        label: 'NC-NoDerivatives'
        fullLabel: 'Creative Commons: NC-NoDerivatives'
        link: 'http://creativecommons.org/licenses/by-nc-nd/4.0'
 
  getLicense: (slug) ->
    @map[slug] or @map['creative commons'][slug] or {label: 'n/a', link: null}
 
  getLicenseLabel: (slug) ->
    (@getLicense slug).label
 
  getRenderOptions: (slug) ->
    [
      (option {value: 'public domain'}, (@getLicenseLabel 'public domain'))
      (optgroup {label: 'Creative Commons'},
        (option {key: slug, value: slug}, license.label) for slug, license of @map['creative commons']
      )
    ]