<commit_before><dom-module id="coa-list">
    <link rel="import" href="../css/coaprendamos-style.html">

    <template id="tmpCoaList">
        <style include="about-estilo"></style>
        <style include="kudos"></style>
        <style include="cards"></style>

        <paper-search-bar id="btnBuscar"
          placeholder="Buscar..."
          disable-filter-button=true
          hide-filter-button=true
          on-paper-search-search="buscar"  >
        </paper-search-bar>
        <div class="card">

            <template id="list" is="dom-repeat" items="{{retos}}" as="reto">
                <paper-card style="width:100%">
                    <div>{{reto.creator}} quiere 
                        <div class="hashReto">{{reto.descripcion}}</div> 
                        para <div class="hashReto">{{reto.motivo}}</div> y ofrece <div class="hashReto">{{reto.retribucion}}</div></div>
                    <paper-button toggles raised>
                        <iron-icon icon="image:center-focus-strong"></iron-icon>Me apunto</paper-button>
                    </paper-button>
                    <paper-button toggles raised on-click="chatbot">Conoceme</paper-button>
                </paper-card>
            </template>
        </div>
    </template>
    <script>
        Polymer({
            is: 'coa-list',
            properties: {
                retos: { type: Array, notify: true },

            },
            ready: function () {

            },
            getRetos: function () {
                var self = this;
                firebase.database().ref('retos').once('value').then(function (snapshot) {
                    self.retos = [];
                    snapshot.forEach(function (element) {
                        console.log(element.val());
                        var reto = element.val();
                        reto.creator = element.val().creator;
                        reto.descripcion = element.val().descripcion;
                        reto.motivo = element.val().motivo;
                        reto.retribucion = element.val().retribucion;
                        self.push('retos', reto);
                    });
                });
            },
            buscar:function(){
              var query = this.$.btnBuscar.query;
              var self = this;
              firebase.database().ref('retos').once('value').then(function (snapshot){
                  self.retos = [];
                  snapshot.forEach(function(element) {
                      var reto = element.val();
                      if(reto.descripcion.indexOf(query) !== -1){
                        console.log(reto);
                        reto.creator = element.val().creator;
                        self.push('retos', reto);
                      }
                  });
              });
            },
            chatbot:function(e) {
                var btnCard = Polymer.dom(e).localTarget;
                this.fire('showChatbot', btnCard);
            }
        });
</script>
</dom-module><commit_msg>se agregan estrellas!<commit_after><dom-module id="coa-list">
    <link rel="import" href="../css/coaprendamos-style.html">
    <link rel="import" href="../bower_components/star-rating/star-rating.html">

    <template id="tmpCoaList">
        <style include="about-estilo"></style>
        <style include="kudos"></style>
        <style include="cards"></style>

        <paper-search-bar id="btnBuscar"
          placeholder="Buscar..."
          disable-filter-button=true
          hide-filter-button=true
          on-paper-search-search="buscar"  >
        </paper-search-bar>
        <div class="card">

            <template id="list" is="dom-repeat" items="{{retos}}" as="reto">
                <paper-card style="width:100%">
                    <div>{{reto.creator}} quiere 
                        <div class="hashReto">{{reto.descripcion}}</div> 
                        para <div class="hashReto">{{reto.motivo}}</div> y ofrece <div class="hashReto">{{reto.retribucion}}</div></div>
                        <div class="valoracion-star">
                          <star-rating stars="5" id="star_"></star-rating>
                          {{getRating(reto.valoracion)}}
                        </div>
                    <paper-button toggles raised>
                        <iron-icon icon="image:center-focus-strong"></iron-icon>Me apunto</paper-button>
                    </paper-button>
                    <paper-button toggles raised on-click="chatbot">Conoceme</paper-button>
                </paper-card>
            </template>
        </div>
    </template>
    <script>
        Polymer({
            is: 'coa-list',
            properties: {
                retos: { type: Array, notify: true },

            },
            ready: function () {

            },
            getRetos: function () {
                var self = this;
                firebase.database().ref('retos').once('value').then(function (snapshot) {
                    self.retos = [];
                    snapshot.forEach(function (element) {
                        console.log(element.val());
                        var reto = element.val();
                        reto.creator = element.val().creator;
                        reto.descripcion = element.val().descripcion;
                        reto.motivo = element.val().motivo;
                        reto.retribucion = element.val().retribucion;
                        self.push('retos', reto);
                    });
                });
            },
            buscar:function(){
              var query = this.$.btnBuscar.query;
              var self = this;
              firebase.database().ref('retos').once('value').then(function (snapshot){
                  self.retos = [];
                  snapshot.forEach(function(element) {
                      var reto = element.val();
                      if(reto.descripcion.indexOf(query) !== -1){
                        console.log(reto);
                        reto.creator = element.val().creator;
                        self.push('retos', reto);
                      }
                  });
              });
            },
            chatbot:function(e) {
                var btnCard = Polymer.dom(e).localTarget;
                this.fire('showChatbot', btnCard);
            }, 
            getRating:function(valoracion) {
                self=this;
                self.stars=this.valoracion;
                //self.$$('#star_').valoracion='3';
            }
        });
</script>
</dom-module>
{'fraction_non_alphanumeric': 0.14490324546701203, 'fraction_numerical': 0.0015236934328813044, 'mean_word_length': 1.3161609033168666, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 80, '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': '1055009', 'n_tokens_mistral': 1805, 'n_tokens_neox': 1711, 'n_words': 255}