<commit_before>kd              = require 'kd'
React           = require 'kd-react'

EnvironmentFlux = require 'app/flux/environment'
KDReactorMixin  = require 'app/flux/base/reactormixin'

List            = require 'app/components/list'
TimeAgo         = require 'app/components/common/timeago'


module.exports = class TeamStacksListView extends React.Component

  numberOfSections: -> 1


  numberOfRowsInSection: -> @props.templates?.size or 0


  renderSectionHeaderAtIndex: -> null


  renderRowAtIndex: (sectionIndex, rowIndex) ->

    template = @props.templates.toList().get(rowIndex)

    <div className='StackTemplateItem'>
      <div className='StackTemplateItem-label'>
        {template.get 'title'}
      </div>
      <div className='StackTemplateItem-description'>
        Last updated <TimeAgo from={template.getIn ['meta', 'modifiedAt']} />
      </div>
      <div className='StackTemplateItem-ButtonContainer'>
        <a href="#" className="HomeAppView--button" onClick={kd.noop}>RE-INITIALIZE</a>
        <a href="#" className="HomeAppView--button primary" onClick={kd.noop}>LAUNCH</a>
      </div>
    </div>


  renderEmptySectionAtIndex: -> <div>No team stacks</div>


  render: ->

    <List
      numberOfSections={@bound 'numberOfSections'}
      numberOfRowsInSection={@bound 'numberOfRowsInSection'}
      renderSectionHeaderAtIndex={@bound 'renderSectionHeaderAtIndex'}
      renderRowAtIndex={@bound 'renderRowAtIndex'}
      renderEmptySectionAtIndex={@bound 'renderEmptySectionAtIndex'}
    /><commit_msg>client: home: open stackEditor when stack label clicked<commit_after>kd = require 'kd'
React = require 'kd-react'
EnvironmentFlux = require 'app/flux/environment'
KDReactorMixin = require 'app/flux/base/reactormixin'
List = require 'app/components/list'
TimeAgo = require 'app/components/common/timeago'
showStackEditor = require 'app/util/showStackEditor'


module.exports = class TeamStacksListView extends React.Component

  numberOfSections: -> 1


  numberOfRowsInSection: -> @props.templates?.size or 0


  renderSectionHeaderAtIndex: -> null


  renderRowAtIndex: (sectionIndex, rowIndex) ->

    template = @props.templates.toList().get(rowIndex)

    <div className='StackTemplateItem'>
      <div
        className='StackTemplateItem-label'
        onClick={showStackEditor.bind null, template.get '_id'}>
        {template.get 'title'}
      </div>
      <div className='StackTemplateItem-description'>
        Last updated <TimeAgo from={template.getIn ['meta', 'modifiedAt']} />
      </div>
      <div className='StackTemplateItem-ButtonContainer'>
        <a href="#" className="HomeAppView--button" onClick={kd.noop}>RE-INITIALIZE</a>
        <a href="#" className="HomeAppView--button primary" onClick={kd.noop}>LAUNCH</a>
      </div>
    </div>


  renderEmptySectionAtIndex: -> <div>No team stacks</div>


  render: ->

    <List
      numberOfSections={@bound 'numberOfSections'}
      numberOfRowsInSection={@bound 'numberOfRowsInSection'}
      renderSectionHeaderAtIndex={@bound 'renderSectionHeaderAtIndex'}
      renderRowAtIndex={@bound 'renderRowAtIndex'}
      renderEmptySectionAtIndex={@bound 'renderEmptySectionAtIndex'}
    />
{'fraction_non_alphanumeric': 0.1285982478097622, 'fraction_numerical': 0.0012515644555694619, 'mean_word_length': 3.880916030534351, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '13208', 'n_tokens_mistral': 979, 'n_tokens_neox': 913, 'n_words': 176}