 
 makeTitle = ({ template, stack }) ->
 
-  title = _.unescape template?.get 'title'
+  title = _.unescape template?.title
 
   return title  unless stack
-  if stack.getIn(['config', 'oldOwner'])
+
+  if stack.getOldOwner()
     title = stack.get 'title'
 
   return "#{title}"
+
+
+ItemLink = ({ onClick, title }) ->
+  <a
+    href="#"
+    className="HomeAppView--button primary"
+    onClick={onClick}
+    children={title} />


    { template, stack, onOpen } = @props

    return @renderDisabledStack(stack, onOpen)  if stack?.get 'disabled'
    return null  unless template

    editorUrl = "/Stack-Editor/#{template.get '_id'}"

    <div className='HomeAppViewListItem StackTemplateItem'>
      <div className='HomeAppViewListItem-label--wrapper'>


  renderButton: ->

    { onAddToSidebar, onRemoveFromSidebar,
      isVisibleOnSidebar, onCloneFromDashboard, template } = @props

    if onCloneFromDashboard and not template.isMine()
      <ItemLink
        onClick={onCloneFromDashboard}
        title='CLONE STACK' />

    else if isVisibleOnSidebar
      <ItemLink
        onClick={onRemoveFromSidebar}
        title='REMOVE FROM SIDEBAR' />
    else
      <ItemLink
        onClick={onAddToSidebar}
        title='ADD TO SIDEBAR' />


  renderUnreadCount: ->

    return null  unless count = @props.stack?.getUnreadCount()

    <UnreadCount count={count} onClick={@bound 'handleUnreadCountClick'} />


  handleUnreadCountClick: ->
