<commit_before>const Partner = require('../partner.js.jsx')
const PeopleStore = require('../../stores/people_store');
const AppCoins = require('../app_coins.js.jsx')
const Tile = require('../ui/tile.js.jsx')
const ProgressBar = require('../ui/progress_bar.js.jsx')
const Markdown = require('../markdown.js.jsx')
import ProductHeader from '../products/product_header.js.jsx'
import ProductStore from '../../stores/product_store'
import PartnersStore from '../../stores/partners_store'
import Button from '../ui/button.js.jsx';

function _parseDate(date) {
  var parsedDate = new Date(date);

  return (parsedDate.getMonth() + 1).toString() + '-' + parsedDate.getDate().toString() + '-' + parsedDate.getFullYear().toString();
}

const ProductPartners = React.createClass({

  getInitialState() {
    return {
      partners: PartnersStore.get(ProductStore.getId()),
      coinprism_url: ProductStore.getCoinPrismUrl()
    }
  },

  render() {
    let partners = _.sortBy(
      _.filter(
        this.state.partners,
        (m) => { return m.coins > 0}),
      (m) => { return -m.coins })

    let totalCoins = _.reduce(
      partners.map(
        (m) => { return m.coins }),
      (memo, num) => { return memo + num },
      0)

    let rows = partners.map(function(partnership) {
      const {partner, coins} = partnership

      let formattedCoins = null;

      if (coins  / totalCoins < 0.0001) {
        formattedCoins = "< 0.01"
      } else {
        formattedCoins = numeral(coins/totalCoins).format('0.00%')
      }

      return (
        <tr key={`partner-${partner.id}`}>
          <td>
            <a href={partner.url} title={'@' + partner.username}>
              <div className="left mr2">
                <Partner user={partner} size={24} />
              </div>
              {partner.username}
            </a>
          </td>

          <td className="right-align">
            <AppCoins n={coins} />
          </td>

          <td className="right-align">
            {formattedCoins}
          </td>

          <td>
            <a href={partner.coinprism_url}>
              <div className="">
                {partner.wallet_public_address}
              </div>
            </a>
          </td>
        </tr>
      )
    })
    return <div>
        <ProductHeader />
        <div className="container mt3">
          <Tile>
          <div className="p4">
            <Button action={this.state.coinprism_url}>See it on the Blockchain</Button>
            <div className="table-responsive">
              <table className="table">
                <thead>
                  <tr>
                    <th>Partner</th>
                    <th className="right-align">Coins</th>
                    <th className="right-align">Ownership</th>
                    <th>Public Address</th>
                  </tr>
                </thead>
                <tbody>
                  {rows}
                </tbody>
              </table>
            </div>
          </div>
        </Tile>
      </div>
    </div>
  }
})

module.exports = window.ProductPartners = ProductPartners;

var PeopleList = React.createClass({

  render: function() {
    return (
      <div>
        {this.rows(this.props.memberships)}<commit_msg>removing columns from partners page for now<commit_after>const Partner = require('../partner.js.jsx')
const PeopleStore = require('../../stores/people_store');
const AppCoins = require('../app_coins.js.jsx')
const Tile = require('../ui/tile.js.jsx')
const ProgressBar = require('../ui/progress_bar.js.jsx')
const Markdown = require('../markdown.js.jsx')
import ProductHeader from '../products/product_header.js.jsx'
import ProductStore from '../../stores/product_store'
import PartnersStore from '../../stores/partners_store'
import Button from '../ui/button.js.jsx';

function _parseDate(date) {
  var parsedDate = new Date(date);

  return (parsedDate.getMonth() + 1).toString() + '-' + parsedDate.getDate().toString() + '-' + parsedDate.getFullYear().toString();
}

const ProductPartners = React.createClass({

  getInitialState() {
    return {
      partners: PartnersStore.get(ProductStore.getId()),
      coinprism_url: ProductStore.getCoinPrismUrl()
    }
  },

  render() {
    let partners = _.sortBy(
      _.filter(
        this.state.partners,
        (m) => { return m.coins > 0}),
      (m) => { return -m.coins })

    let totalCoins = _.reduce(
      partners.map(
        (m) => { return m.coins }),
      (memo, num) => { return memo + num },
      0)

    let rows = partners.map(function(partnership) {
      const {partner, coins} = partnership

      let formattedCoins = null;

      if (coins  / totalCoins < 0.0001) {
        formattedCoins = "< 0.01"
      } else {
        formattedCoins = numeral(coins/totalCoins).format('0.00%')
      }

      return (
        <tr key={`partner-${partner.id}`}>
          <td>
            <a href={partner.url} title={'@' + partner.username}>
              <div className="left mr2">
                <Partner user={partner} size={24} />
              </div>
              {partner.username}
            </a>
          </td>

          <td className="right-align">
            <AppCoins n={coins} />
          </td>

          <td className="right-align">
            {formattedCoins}
          </td>
        </tr>
      )
    })
    return <div>
        <ProductHeader />
        <div className="container mt3">
          <Tile>
          <div className="p4">

            <div className="table-responsive">
              <table className="table">
                <thead>
                  <tr>
                    <th>Partner</th>
                    <th className="right-align">Coins</th>
                    <th className="right-align">Ownership</th>
                  
                  </tr>
                </thead>
                <tbody>
                  {rows}
                </tbody>
              </table>
            </div>
          </div>
        </Tile>
      </div>
    </div>
  }
})

module.exports = window.ProductPartners = ProductPartners;

var PeopleList = React.createClass({

  render: function() {
    return (
      <div>
        {this.rows(this.props.memberships)}
{'fraction_non_alphanumeric': 0.15374677002583978, 'fraction_numerical': 0.006136950904392765, 'mean_word_length': 1.7622658340767172, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 103, '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': '5396053', 'n_tokens_mistral': 1916, 'n_tokens_neox': 1835, 'n_words': 360}