<commit_before><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../item-display-behavior/item-display-behavior.html">
<link rel="import" href="../../styles/icon-styles.html">
<link rel="import" href="../../styles/entity-view-styles.html">

<dom-module id="phone-display">
  <template>
    <style include="icon-styles"></style>
    <style include="entity-view-styles"></style>
    <style>
      :host {
        display: block;
      }
      .expand:hover {
        cursor: pointer;
        /* color: var(--default-primary-color); */
      }
      .related-btn {
        color: var(--secondary-text-color);
      }
    </style>
    <div class="layout horizontal entity-content">
      <div class="entity-page">
        <div hidden="{{!isItemThisType}}"> 
          <div class="expand" on-click="toggle">
            <h4><iron-icon icon="communication:contact-phone"></iron-icon> Phone: <span>[[item._source.name]]</span></h4>
          </div>
          <!--simply using first result from each array (could be many owners) -->
          <iron-collapse id="collapse" opened="[[isOpened]]">
            <div class="layout horizontal">
              <div>
                <paper-item>
                  <label>Title:</label>
                  <span>[[item._source.owner.0.makesOffer.0.title]]</span>
                </paper-item>
                <paper-item>
                  <label>Address: </label>
                  <span>[[item._source.owner.0.makesOffer.0.availableAtOrFrom.address.0.addressLocality]]</span>
                  <span>[[item._source.owner.0.makesOffer.0.availableAtOrFrom.address.0.addressRegion]]</span> 
                  <span>[[item._source.owner.0.makesOffer.0.availableAtOrFrom.address.0.addressCountry]]</span>
                </paper-item>
                <paper-item>
                  <label>Valid From: </label>
                  <span>[[item._source.owner.0.makesOffer.0.validFrom]]</span>
                </paper-item>
                <crossfilter-ex original-results="[[subqueryResults.offer]]" records="{{records}}"></crossfilter-ex>
              </div>
            </div>
          </iron-collapse>
        </div>
      </div>
      <div class="v-divider"></div>
      <div class="related-entities">
        <records-list records="[[records]]"></records-list>
      </div>
    </div>
  </template>
  <script>
  (function() {
    'use strict';
    /* globals DigBehaviors */

    Polymer({
      is: 'phone-display',
      behaviors: [DigBehaviors.ItemDisplayBehavior],
      properties: {
        type: {
          type: String,
          value: 'phone'
        },
        typesToSubquery: {
          type: Array,
          value: ['webpage', 'offer', 'seller', 'email', 'adultservice']
        }
      },
      getSubqueryStringFromItem: function() {
        this.subqueryString = this.item._source.name.toString();
      }<commit_msg>Removing redundant details from phone display.<commit_after><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../item-display-behavior/item-display-behavior.html">
<link rel="import" href="../../styles/icon-styles.html">
<link rel="import" href="../../styles/entity-view-styles.html">

<dom-module id="phone-display">
  <template>
    <style include="icon-styles"></style>
    <style include="entity-view-styles"></style>
    <style>
      :host {
        display: block;
      }
      .expand:hover {
        cursor: pointer;
        /* color: var(--default-primary-color); */
      }
      .related-btn {
        color: var(--secondary-text-color);
      }
    </style>
    <div class="layout horizontal entity-content">
      <div class="entity-page">
        <div hidden="{{!isItemThisType}}"> 
          <div class="expand" on-click="toggle">
            <h4><iron-icon icon="communication:contact-phone"></iron-icon> Phone: <span>[[item._source.name]]</span></h4>
          </div>
          <!--simply using first result from each array (could be many owners) -->
          <iron-collapse id="collapse" opened="[[isOpened]]">
            <div class="layout horizontal">
              <crossfilter-ex original-results="[[subqueryResults.offer]]" records="{{records}}"></crossfilter-ex>
            </div>
          </iron-collapse>
        </div>
      </div>
      <div class="v-divider"></div>
      <div class="related-entities">
        <records-list records="[[records]]"></records-list>
      </div>
    </div>
  </template>
  <script>
  (function() {
    'use strict';
    /* globals DigBehaviors */

    Polymer({
      is: 'phone-display',
      behaviors: [DigBehaviors.ItemDisplayBehavior],
      properties: {
        type: {
          type: String,
          value: 'phone'
        },
        typesToSubquery: {
          type: Array,
          value: ['webpage', 'offer', 'seller', 'email', 'adultservice']
        }
      },
      getSubqueryStringFromItem: function() {
        this.subqueryString = this.item._source.name.toString();
      }
{'fraction_non_alphanumeric': 0.15942507847348422, 'fraction_numerical': 0.004130183380142078, 'mean_word_length': 2.3783482142857144, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 111, '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': '2484921', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1718, 'n_words': 382}