<commit_before><link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-material/paper-material.html">

<dom-module id="bridge-scoreboard">
  <style>
    :host {
      display: block;
      padding: 0 10px;
    }

    paper-material {
      background: white;
      box-sizing: border-box;
      margin: 8px;
      padding: 16px;
      border-radius: 2px;
    }

    .container {
      max-width: 920px;
      margin: 0 auto;
    }

    .table-container {
      overflow-x: auto;
    }

    /* The follow CSS is copied from Bootstrap 4 */
    table {
      width: 100%;
      margin-bottom: 1rem;
      border-collapse: collapse;
    }

    table thead th {
      vertical-align: bottom;
      border-bottom: 2px solid #eceeef;
    }

    table td, table th {
      padding: .75rem;
      line-height: 1.5;
      vertical-align: top;
      border-top: 1px solid #eceeef;
    }

    th {
      text-align: left;
    }
  </style>

  <template>

    <div class="container">
      <h1>Scoreboard</h1>
    </div>

    <div class="container table-container">
      <paper-material class="table-container">
        <table>

          <thead>
            <tr>
              <th></th>
              <template is="dom-repeat" items="[[service.players]]">
                <th>[[item.name]]</th>
              </template>
            </tr>
          </thead>

          <tbody>

            <template is="dom-repeat" items="[[service.players.0.score]]" index-as="round" id="repeat">
              <tr>
                <td>[[_showRound(round)]]</td>
                <template is="dom-repeat" items="[[service.players]]" index-as="i">
                  <td>[[_showScore(round, item)]]</td>
                </template>
              </tr>
            </template>

            <tr>
              <td>Total score</td>
              <template is="dom-repeat" items="[[service.players]]">
                <td>[[_getTotalScore(item, item.score)]]</td>
              </template>
            </tr>

            <tr>
              <td>Rank</td>
              <template is="dom-repeat" items="[[_compRank(service.players, service.currentRound)]]">
                <td>[[item]]</td>
              </template>
            </tr>
          </tbody>

        </table>
      </paper-material>
    </div>

  </template>

  <script>
    Polymer({
      is: 'bridge-scoreboard',

      properties: {
        service: {
          type: Object
        }<commit_msg>FIX: Total score not updated in scoreboard<commit_after><link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-material/paper-material.html">

<dom-module id="bridge-scoreboard">
  <style>
    :host {
      display: block;
      padding: 0 10px;
    }

    paper-material {
      background: white;
      box-sizing: border-box;
      margin: 8px;
      padding: 16px;
      border-radius: 2px;
    }

    .container {
      max-width: 920px;
      margin: 0 auto;
    }

    .table-container {
      overflow-x: auto;
    }

    /* The follow CSS is copied from Bootstrap 4 */
    table {
      width: 100%;
      margin-bottom: 1rem;
      border-collapse: collapse;
    }

    table thead th {
      vertical-align: bottom;
      border-bottom: 2px solid #eceeef;
    }

    table td, table th {
      padding: .75rem;
      line-height: 1.5;
      vertical-align: top;
      border-top: 1px solid #eceeef;
    }

    th {
      text-align: left;
    }
  </style>

  <template>

    <div class="container">
      <h1>Scoreboard</h1>
    </div>

    <div class="container table-container">
      <paper-material class="table-container">
        <table>

          <thead>
            <tr>
              <th></th>
              <template is="dom-repeat" items="[[service.players]]">
                <th>[[item.name]]</th>
              </template>
            </tr>
          </thead>

          <tbody>

            <template is="dom-repeat" items="[[service.players.0.score]]" index-as="round" id="repeat">
              <tr>
                <td>[[_showRound(round)]]</td>
                <template is="dom-repeat" items="[[service.players]]" index-as="i">
                  <td>[[_showScore(round, item)]]</td>
                </template>
              </tr>
            </template>

            <tr>
              <td>Total score</td>
              <template is="dom-repeat" items="[[service.players]]">
                <td>[[_getTotalScore(item, item.score, service.currentRound)]]</td>
              </template>
            </tr>

            <tr>
              <td>Rank</td>
              <template is="dom-repeat" items="[[_compRank(service.players, service.currentRound)]]">
                <td>[[item]]</td>
              </template>
            </tr>
          </tbody>

        </table>
      </paper-material>
    </div>

  </template>

  <script>
    Polymer({
      is: 'bridge-scoreboard',

      properties: {
        service: {
          type: Object
        }
{'fraction_non_alphanumeric': 0.15712304339211414, 'fraction_numerical': 0.009906875371507827, 'mean_word_length': 1.5847414234511008, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 115, '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': '950839', 'n_tokens_mistral': 1638, 'n_tokens_neox': 1532, 'n_words': 301}