<commit_before>"use strict";

import React from "react";
import { Grid, Col, Row, Table } from "react-bootstrap";

import Header from "./header";
import FilterIcon from "./contestants/filter_icon";
import resultsFixture from "../fixtures/results";

import "./results.less";


export default React.createClass({
  displayName: "Results",

  getInitialState: function() {
    return {
      currentCategory: "web",
      results: resultsFixture
    };
  },

  toggleCategory(category) {
    this.setState({
      currentCategory: category
    });
  },

  renderTable() {
    return <Grid className="results-section">
      <Row>
        <Col>
          <Table responsive>
            <thead>
              <tr>
                <th>premiul</th>
                <th className="left">numele lucrării</th>
                <th className="left">concurent</th>
                <th className="left hidden-xs">liceu</th>
                <th className="hidden-xs">punctaj</th>
                <th className="hidden-xs">open</th>
                <th>total</th>
              </tr>
            </thead>
            <tbody>
              {this.state.results[this.state.currentCategory].map(function(result) {
                return <tr key={result.project.id}>
                  <td className="rank">{result.rank}</td>
                  <td className="title">{result.project.name}</td>
                  <td>
                    <ul className="list-unstyled">
                      {result.project.authors.map(function(author){
                          return <li className="author" key={author.id}>
                            {author.name}
                          </li>;
                        })}
                    </ul>
                  </td>
                  <td className="hidden-xs">{result.project.school}</td>
                  <td className="hidden-xs score">{result.project.score}</td>
                  <td className="hidden-xs score">{result.project.open}</td>
                  <td className="score">{result.project.total}</td>
                </tr>;
              })}
            </tbody>
          </Table>
        </Col>
      </Row>
    </Grid>;
  },

  render() {
    return <div className="results">
      <div className="blue-section-wrapper">
        <Grid className="blue-section">
          <Header isLoggedIn={this.props.isLoggedIn} />
          <Row className="xsmall-spacing" />
          <Row>
            <Col>
              <h1>Rezultate InfoEducație <br />
              Ediția 2014
              </h1>
            </Col>
          </Row>
          <Row>
            <Col>
              <h2>Concurs Național de Informatică</h2>
            </Col>
          </Row>
          <Row className="big-spacing" />
        </Grid>
      </div>

      <Grid>
        <Row className="small-spacing" />
        <Row className="filter-buttons">
          <Col smOffset={3} sm={1} xs={2} xsOffset={1}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="educational" />
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="media" />
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="robots" />
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="utility" />
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="web" />
          </Col>
        </Row>
        <Row className="small-spacing" />
      </Grid>
      {this.renderTable()}
    </div>;
  }
});
<commit_msg>Add labels for icons in results view. #107<commit_after>"use strict";

import React from "react";
import { Grid, Col, Row, Table } from "react-bootstrap";

import Header from "./header";
import FilterIcon from "./contestants/filter_icon";
import resultsFixture from "../fixtures/results";

import "./results.less";


export default React.createClass({
  displayName: "Results",

  getInitialState: function() {
    return {
      currentCategory: "web",
      results: resultsFixture
    };
  },

  toggleCategory(category) {
    this.setState({
      currentCategory: category
    });
  },

  renderTable() {
    return <Grid className="results-section">
      <Row>
        <Col>
          <Table responsive>
            <thead>
              <tr>
                <th>premiul</th>
                <th className="left">numele lucrării</th>
                <th className="left">concurent</th>
                <th className="left hidden-xs">liceu</th>
                <th className="hidden-xs">punctaj</th>
                <th className="hidden-xs">open</th>
                <th>total</th>
              </tr>
            </thead>
            <tbody>
              {this.state.results[this.state.currentCategory].map(function(result) {
                return <tr key={result.project.id}>
                  <td className="rank">{result.rank}</td>
                  <td className="title">{result.project.name}</td>
                  <td>
                    <ul className="list-unstyled">
                      {result.project.authors.map(function(author){
                          return <li className="author" key={author.id}>
                            {author.name}
                          </li>;
                        })}
                    </ul>
                  </td>
                  <td className="hidden-xs">{result.project.school}</td>
                  <td className="hidden-xs score">{result.project.score}</td>
                  <td className="hidden-xs score">{result.project.open}</td>
                  <td className="score">{result.project.total}</td>
                </tr>;
              })}
            </tbody>
          </Table>
        </Col>
      </Row>
    </Grid>;
  },

  render() {
    return <div className="results">
      <div className="blue-section-wrapper">
        <Grid className="blue-section">
          <Header isLoggedIn={this.props.isLoggedIn} />
          <Row className="xsmall-spacing" />
          <Row>
            <Col>
              <h1>Rezultate InfoEducație <br />
              Ediția 2014
              </h1>
            </Col>
          </Row>
          <Row>
            <Col>
              <h2>Concurs Național de Informatică</h2>
            </Col>
          </Row>
          <Row className="big-spacing" />
        </Grid>
      </div>

      <Grid>
        <Row className="small-spacing" />
        <Row className="filter-buttons">
          <Col smOffset={3} sm={1} xs={2} xsOffset={1}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="web" />
            <p>Web</p>
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="educational" />
            <p>Educațional</p>
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="robots" />
            <p>Roboți</p>
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="utility" />
            <p>Utilitar</p>
          </Col>
          <Col sm={1} xs={2}>
            <FilterIcon currentCategory={this.state.currentCategory}
                        toggleCategory={this.toggleCategory}
                        category="media" />
            <p>Multimedia</p>
          </Col>
        </Row>
        <Row className="small-spacing" />
      </Grid>
      {this.renderTable()}
    </div>;
  }
});

{'fraction_non_alphanumeric': 0.1393939393939394, 'fraction_numerical': 0.00510992275698158, 'mean_word_length': 1.447223029950567, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 195, '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': '2103360', 'n_tokens_mistral': 2318, 'n_tokens_neox': 2210, 'n_words': 398}