<commit_before>React = require 'react'
{Link} = require 'react-router'
resourceCount = require './lib/resource-count'
{State} = require 'react-router'
PromiseRenderer = require '../components/promise-renderer'
LatestCommentLink = require './latest-comment-link'

module?.exports = React.createClass
  displayName: 'TalkDiscussionPreview'

  propTypes:
    discussion: React.PropTypes.object

  render: ->
    {params, discussion} = @props

    <div className="talk-discussion-preview">
      <div className="preview-content">
        <h1>
          {<i className="fa fa-thumb-tack talk-sticky-pin"></i> if discussion.sticky}
          {if params?.owner and params?.name # get from url if possible
            <Link to="project-talk-discussion" params={board: discussion.board_id, discussion: discussion.id, owner: params.owner, name: params.name}>
              {discussion.title}
            </Link>

          else if @props.project # otherwise fetch from project
            <PromiseRenderer promise={@props.project.get('owner')}>{(owner) =>
              <Link to="project-talk-discussion" params={board: discussion.board_id, discussion: discussion.id, owner: owner.login, name: @props.project.slug}>
                {discussion.title}
              </Link>
            }</PromiseRenderer>

          else # link to zooniverse main talk
            <Link to="talk-discussion" params={board: discussion.board_id, discussion: discussion.id}>
              {discussion.title}
            </Link>
            }
        </h1>

        <LatestCommentLink {...@props} project={@props.project} discussion={discussion} />

      </div>
      <div className="preview-stats">
        <p>
          <i className="fa fa-user"></i> {resourceCount(discussion.users_count, "Users")}
        </p>
        <p>
          <i className="fa fa-comment"></i> {resourceCount(discussion.comments_count, "Comments")}
        </p>
      </div>
    </div><commit_msg>Change users to participants in discussion link<commit_after>React = require 'react'
{Link} = require 'react-router'
resourceCount = require './lib/resource-count'
{State} = require 'react-router'
PromiseRenderer = require '../components/promise-renderer'
LatestCommentLink = require './latest-comment-link'

module?.exports = React.createClass
  displayName: 'TalkDiscussionPreview'

  propTypes:
    discussion: React.PropTypes.object

  render: ->
    {params, discussion} = @props

    <div className="talk-discussion-preview">
      <div className="preview-content">
        <h1>
          {<i className="fa fa-thumb-tack talk-sticky-pin"></i> if discussion.sticky}
          {if params?.owner and params?.name # get from url if possible
            <Link to="project-talk-discussion" params={board: discussion.board_id, discussion: discussion.id, owner: params.owner, name: params.name}>
              {discussion.title}
            </Link>

          else if @props.project # otherwise fetch from project
            <PromiseRenderer promise={@props.project.get('owner')}>{(owner) =>
              <Link to="project-talk-discussion" params={board: discussion.board_id, discussion: discussion.id, owner: owner.login, name: @props.project.slug}>
                {discussion.title}
              </Link>
            }</PromiseRenderer>

          else # link to zooniverse main talk
            <Link to="talk-discussion" params={board: discussion.board_id, discussion: discussion.id}>
              {discussion.title}
            </Link>
            }
        </h1>

        <LatestCommentLink {...@props} project={@props.project} discussion={discussion} />

      </div>
      <div className="preview-stats">
        <p>
          <i className="fa fa-user"></i> {resourceCount(discussion.users_count, "Participants")}
        </p>
        <p>
          <i className="fa fa-comment"></i> {resourceCount(discussion.comments_count, "Comments")}
        </p>
      </div>
    </div>
{'fraction_non_alphanumeric': 0.14056531703590527, 'fraction_numerical': 0.0010185892538833714, 'mean_word_length': 2.640407784986098, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 61, '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': '6252449', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1067, 'n_words': 247}