<commit_before><template>
  <div class="cd-find-dojo">
    <div class="cd-find-dojo__panel">
      <form class="cd-find-dojo__panel-form" @submit.prevent="searchDojosByAddress">
        <h1 class="cd-find-dojo__panel-form-header">{{ $t('Find a Dojo to attend') }}</h1>
        <p class="cd-find-dojo__panel-form-info">{{ $t('Learn technology in an informal, creative and social environment. Find a dojo near you.') }}</p>
        <div class="cd-find-dojo__panel-form-search">
          <div class="cd-find-dojo__panel-form-search-input">
            <input type="text" name="addressSearch" class="form-control input-lg" :placeholder="$t('Enter your city or locality')" v-model="searchCriteria" autofocus>
          </div>
          <div class="cd-find-dojo__panel-form-search-submit">
            <input type="submit" class="btn btn-lg" :value="$t('Search for Dojos')"/>
          </div>
        </div>
        <button @click.prevent="getCurrentLocation" class="cd-find-dojo__panel-form-detect-location">
          <i class="fa fa-location-arrow" aria-hidden="true" v-show="!detectingLocation"></i>
          <i class="fa fa-spinner fa-spin" aria-hidden="true" v-show="detectingLocation"></i>
          {{ $t('Detect my location') }}
        </button>
      </form>
      <div class="cd-find-dojo__panel-illustration">
        <img src="../assets/characters/ninjas/ninja-female-2-laptop-sitting.svg" />
      </div>
    </div>
    <div v-if="searchExecuted" class="cd-find-dojo__results-header cd-find-dojo__results-header--mobile">
      <span>{{ $t('Showing {total} Dojos', { total: dojos.length }) }}</span>
      <button class="cd-find-dojo__results-header-map-toggle btn btn-link" @click="toggleMap"><i class="fa fa-map-o" aria-hidden="true"></i> {{ showMap ? $t('Hide Map') : $t('Show Map') }}</button>
    </div>
    <div v-if="searchExecuted" class="cd-find-dojo__results">
      <div class="cd-find-dojo__results-list">
        <div class="cd-find-dojo__results-header hidden-xs">
          <span>{{ $t('Showing {total} Dojos', { total: dojos.length }) }}</span>
        </div>
        <dojo-list :dojos="dojos"></dojo-list>
        <h4 v-if="dojos.length === 0" class="cd-find-dojo__no-results-message">
          <no-results-desktop class="cd-find-dojo__no-results-message--desktop hidden-xs"></no-results-desktop>
          <no-results-mobile @toggleMap="toggleMap" class="cd-find-dojo__no-results-message--mobile visible-xs"></no-results-mobile>
        </h4>
      </div>
      <dojo-map :center="coordinates" :class="{ 'cd-find-dojo__results-map': true, 'cd-find-dojo__results-map--hidden': !showMap }" :dojos="allActiveDojos"></dojo-map>
    </div>

  </div>

</template>
<script>
  import Vue from 'vue';
  import DojoList from '@/dojos/cd-dojo-list';
  import DojoMap from '@/dojos/cd-dojo-map';
  import GeolocationService from '@/geolocation/service';
  import translationComponentGenerator from '@/common/cd-translation-component-generator';
  import DojosService from './service';

  const noResultsString = 'Try modifying your search location, or zoom out on the {openLink}map{closeLink} to find the nearest dojos.';
  const NoResultsDesktop = translationComponentGenerator(noResultsString, {
    openLink: '',
    closeLink: '',
  });
  const NoResultsMobile = translationComponentGenerator(noResultsString, {
    openLink: '<a @click="$emit(\'toggleMap\')">',
    closeLink: '</a>',
  });

  export default {
    name: 'findDojo',
    props: ['lat', 'long'],<commit_msg>[#148104669] Dojo with a capital D<commit_after><template>
  <div class="cd-find-dojo">
    <div class="cd-find-dojo__panel">
      <form class="cd-find-dojo__panel-form" @submit.prevent="searchDojosByAddress">
        <h1 class="cd-find-dojo__panel-form-header">{{ $t('Find a Dojo to attend') }}</h1>
        <p class="cd-find-dojo__panel-form-info">{{ $t('Learn technology in an informal, creative and social environment. Find a dojo near you.') }}</p>
        <div class="cd-find-dojo__panel-form-search">
          <div class="cd-find-dojo__panel-form-search-input">
            <input type="text" name="addressSearch" class="form-control input-lg" :placeholder="$t('Enter your city or locality')" v-model="searchCriteria" autofocus>
          </div>
          <div class="cd-find-dojo__panel-form-search-submit">
            <input type="submit" class="btn btn-lg" :value="$t('Search for Dojos')"/>
          </div>
        </div>
        <button @click.prevent="getCurrentLocation" class="cd-find-dojo__panel-form-detect-location">
          <i class="fa fa-location-arrow" aria-hidden="true" v-show="!detectingLocation"></i>
          <i class="fa fa-spinner fa-spin" aria-hidden="true" v-show="detectingLocation"></i>
          {{ $t('Detect my location') }}
        </button>
      </form>
      <div class="cd-find-dojo__panel-illustration">
        <img src="../assets/characters/ninjas/ninja-female-2-laptop-sitting.svg" />
      </div>
    </div>
    <div v-if="searchExecuted" class="cd-find-dojo__results-header cd-find-dojo__results-header--mobile">
      <span>{{ $t('Showing {total} Dojos', { total: dojos.length }) }}</span>
      <button class="cd-find-dojo__results-header-map-toggle btn btn-link" @click="toggleMap"><i class="fa fa-map-o" aria-hidden="true"></i> {{ showMap ? $t('Hide Map') : $t('Show Map') }}</button>
    </div>
    <div v-if="searchExecuted" class="cd-find-dojo__results">
      <div class="cd-find-dojo__results-list">
        <div class="cd-find-dojo__results-header hidden-xs">
          <span>{{ $t('Showing {total} Dojos', { total: dojos.length }) }}</span>
        </div>
        <dojo-list :dojos="dojos"></dojo-list>
        <h4 v-if="dojos.length === 0" class="cd-find-dojo__no-results-message">
          <no-results-desktop class="cd-find-dojo__no-results-message--desktop hidden-xs"></no-results-desktop>
          <no-results-mobile @toggleMap="toggleMap" class="cd-find-dojo__no-results-message--mobile visible-xs"></no-results-mobile>
        </h4>
      </div>
      <dojo-map :center="coordinates" :class="{ 'cd-find-dojo__results-map': true, 'cd-find-dojo__results-map--hidden': !showMap }" :dojos="allActiveDojos"></dojo-map>
    </div>

  </div>

</template>
<script>
  import Vue from 'vue';
  import DojoList from '@/dojos/cd-dojo-list';
  import DojoMap from '@/dojos/cd-dojo-map';
  import GeolocationService from '@/geolocation/service';
  import translationComponentGenerator from '@/common/cd-translation-component-generator';
  import DojosService from './service';

  const noResultsString = 'Try modifying your search location, or zoom out on the {openLink}map{closeLink} to find the nearest Dojos.';
  const NoResultsDesktop = translationComponentGenerator(noResultsString, {
    openLink: '',
    closeLink: '',
  });
  const NoResultsMobile = translationComponentGenerator(noResultsString, {
    openLink: '<a @click="$emit(\'toggleMap\')">',
    closeLink: '</a>',
  });

  export default {
    name: 'findDojo',
    props: ['lat', 'long'],
{'fraction_non_alphanumeric': 0.18071601768649265, 'fraction_numerical': 0.002995293110825845, 'mean_word_length': 3.506426735218509, 'pattern_counts': {'":': 0, '<': 119, '<?xml version=': 0, '>': 119, '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': '4523399', 'n_tokens_mistral': 2350, 'n_tokens_neox': 2305, 'n_words': 438}