From c6ab4c4f7ba8a5dab0c02ec3603aa5190aa6e88a Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 22 Jul 2014 17:43:17 +0100 Subject: [PATCH] roughly styled template search results clear button in template search also clears results --- services/web/app/views/templates/index.jade | 14 ++++++++------ services/web/public/coffee/main/templates.coffee | 3 +++ services/web/public/stylesheets/app/templates.less | 7 +++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/templates/index.jade b/services/web/app/views/templates/index.jade index beb6a9cc06..d0c5b7aae2 100644 --- a/services/web/app/views/templates/index.jade +++ b/services/web/app/views/templates/index.jade @@ -3,12 +3,12 @@ extends ../layout block content .content.content-alt .container - .row.template-page-header + .row.template-page-header(ng-controller="SearchController") .col-md-2 h2 a(href="/templates") Templates - .col-md-8(ng-controller="SearchController") + .col-md-8 form.project-search.form-horizontal(role="form") .form-group.has-feedback.has-feedback-left.col-md-12 input.form-control.col-md-12(type='text', ng-model='searchQueryText', ng-keyup='search()', placeholder="Search template library....") @@ -18,15 +18,17 @@ block content style="cursor: pointer;", ng-show="searchQueryText.length > 0" ) - ul.unstyled + .col-md-12 + ul.list-unstyled li(ng-repeat='hit in hits') .thumbnail.searchResult .row a(ng-href='{{hit.url}}') .col-md-3 - img(ng-src='{{hit.image_url}}') - .col-md-9 - h2(ng-bind-html='hit.name') + img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb8c6f34a287a85245b493/v/0/pdf-converted-cache/style-thumbnail") + //img(ng-src='{{hit.image_url}}') + .col-md-7 + h1(ng-bind-html='hit.name') p(ng-bind-html='hit.description') diff --git a/services/web/public/coffee/main/templates.coffee b/services/web/public/coffee/main/templates.coffee index 6ab8b28199..a51a8f8c44 100644 --- a/services/web/public/coffee/main/templates.coffee +++ b/services/web/public/coffee/main/templates.coffee @@ -17,6 +17,8 @@ define [ App.factory "algolia", -> + console.log window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key + if window?.sharelatex?.algolia?.app_id? client = new AlgoliaSearch(window.sharelatex.algolia?.app_id, window.sharelatex.algolia?.api_key) index = client.initIndex(window.sharelatex.algolia?.indexes?.templates) @@ -27,6 +29,7 @@ define [ $scope.clearSearchText = -> $scope.searchQueryText = "" + updateHits [] $scope.safeApply = (fn)-> phase = $scope.$root.$$phase diff --git a/services/web/public/stylesheets/app/templates.less b/services/web/public/stylesheets/app/templates.less index af6ec4f8e5..47a6f81896 100644 --- a/services/web/public/stylesheets/app/templates.less +++ b/services/web/public/stylesheets/app/templates.less @@ -40,4 +40,11 @@ .template-details-section { padding-bottom: 20px; +} + +.searchResult { + img { + max-width: 100%; + height: auto; + } } \ No newline at end of file