<commit_before>import QtQuick 2.0
import Sailfish.Silica 1.0
import "UntappdApp.js" as App

Page {
  id: searchPage

  property var retrieveSearchResults: function(query) {
    listModel.clear()
    App.api("/v4/search/beer", { q: query, sort: 'count' }, function(err, data) {
      data.beers.items.forEach(function(beer) {
        listModel.append(beer);
      })
    });
  }

  SilicaListView {
      anchors.fill: parent
      currentIndex: -1 // otherwise currentItem will steal focus
      width: parent.width

      header:  Column {
        id: headerContainer

        width: searchPage.width

        PageHeader {
          title: "Drink up!"
        }

        SearchField {
          id: searchField
          width: parent.width

          EnterKey.onClicked: {
            retrieveSearchResults(searchField.text);
          }
        }
      }

      model: ListModel { id: listModel }
      delegate: BackgroundItem {
        id: delegate
        height: 80
        contentHeight: 80
        x: Theme.paddingLarge

        Label {
          id: beerName
          text: model.beer.beer_name

          font.pixelSize: Theme.fontSizeMedium
          font.bold: true
          truncationMode: TruncationMode.Elide
          anchors {
            top: parent.top
            left: parent.left
            leftMargin: Theme.paddingLarge
            right: abvPercent.left
            rightMargin: Theme.paddingMedium
          }
        }

        Label {
          id: abvPercent
          text: model.beer.beer_abv + "%"<commit_msg>fix formatting on search page<commit_after>import QtQuick 2.0
import Sailfish.Silica 1.0
import "UntappdApp.js" as App
import "debounce.js" as Db

Page {
  id: searchPage

  property var retrieveSearchResults: function(query) {
    listModel.clear()
    App.api("/v4/search/beer", { q: query, sort: 'count' }, function(err, data) {
      data.beers.items.forEach(function(beer) {
        listModel.append(beer);
      })
    });
  }

  SilicaListView {
      anchors.fill: parent
      currentIndex: -1 // otherwise currentItem will steal focus
      width: parent.width

      header:  Column {
        id: headerContainer

        width: searchPage.width

        PageHeader {
          title: "Drink up!"
        }

        SearchField {
          id: searchField
          width: parent.width

          EnterKey.onClicked: {
            retrieveSearchResults(searchField.text);
          }
        }
      }

      model: ListModel { id: listModel }
      delegate: BackgroundItem {
        id: delegate
        height: 90
        contentHeight: 90

        Label {
          id: beerName
          text: model.beer.beer_name

          font.pixelSize: Theme.fontSizeMedium
          font.bold: true
          truncationMode: TruncationMode.Elide
          anchors {
            top: parent.top
            topMargin: 5
            left: parent.left
            leftMargin: Theme.paddingLarge
            right: abvPercent.left
            rightMargin: Theme.paddingMedium
          }
        }

        Label {
          id: abvPercent
          text: model.beer.beer_abv + "%"
{'fraction_non_alphanumeric': 0.08631713554987212, 'fraction_numerical': 0.006713554987212276, 'mean_word_length': 1.7044079515989627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3592403', 'n_tokens_mistral': 927, 'n_tokens_neox': 889, 'n_words': 202}