Code coverage report for code/views/relation-inspector-view.coffee

Statements: 0% (0 / 24)      Branches: 0% (0 / 2)      Functions: 0% (0 / 5)      Lines: 0% (0 / 18)      Ignored: none     

All files » code/views/ » relation-inspector-view.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                                                                                   
LinkRelationView = React.createFactory require "./link-relation-view"
TabbedPanel = React.createFactory require './tabbed-panel-view'
Tabber = require './tabbed-panel-view'
tr = require "../utils/translate"
 
graphStore        = require '../stores/graph-store'
 
{div, h2, label, span, input, p, i, select, option} = React.DOM
 
module.exports = React.createClass
 
  displayName: 'RelationInspectorView'
 
  mixins: [ graphStore.mixin ]
 
  renderTabforLink: (link) ->
    relationView = (LinkRelationView {link: link, graphStore: @props.graphStore})
    (Tabber.Tab {label: (link.sourceNode.title), component: relationView})
 
  renderNodeRelationInspector: ->
    tabs = _.map @props.node.inLinks(), (link) => @renderTabforLink(link)
    (div {className:'relation-inspector'},
      (TabbedPanel {tabs: tabs})
      (div {className: "bottom-pane"},
        (p {}, tr "~NODE-RELATION-EDIT.DEFINING_WITH_WORDS")
      )
    )
 
  renderLinkRelationInspector: ->
    (div {className:'relation-inspector'})
    # TODO: build this later.
    #   (div {className: 'link-relation-inspector'}, "TBD: No link relation panel")
    #   (div {className: "bottom-pane"},
    #     (p {}, tr "~NODE-RELATION-EDIT.DEFINING_WITH_WORDS")
    #   )
    # )
  render: ->
    if @props.node
      @renderNodeRelationInspector()
    else
      @renderLinkRelationInspector()