template search works nicely, needs styling

This commit is contained in:
Henry Oswald 2016-03-22 22:16:38 +00:00
parent cf45b8bd74
commit 9cfbbfa504
2 changed files with 32 additions and 29 deletions

View file

@ -3,34 +3,35 @@ extends ../layout
block content
.content.content-alt(ng-cloak)
.container.wiki
.row.template-page-header(ng-controller="SearchWikiController")
.col-xs-3
.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 help library....")
i.fa.fa-search.form-control-feedback-left
i.fa.fa-times.form-control-feedback(
ng-click="clearSearchText()",
style="cursor: pointer;",
ng-show="searchQueryText.length > 0"
)
.row.template-page-header
.col-md-8(ng-cloak)
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-7
h1(ng-bind-html='hit.name')
p(ng-bind-html='hit.description')
.row(ng-non-bindable)
.col-xs-3.contents
.row
.col-xs-3.contents(ng-non-bindable)
| !{contents.content}
.col-xs-9.page
.card
.col-xs-9.page(ng-controller="SearchWikiController")
.row
.col-md-12
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 help library....")
i.fa.fa-search.form-control-feedback-left
i.fa.fa-times.form-control-feedback(
ng-click="clearSearchText()",
style="cursor: pointer;",
ng-show="searchQueryText.length > 0"
)
.row
.col-md-12(ng-cloak)
ul.list-unstyled
li(ng-repeat='hit in hits')
.searchResult
.row
.col.-md-12
a(ng-href='{{hit.url}}')
span(ng-bind-html='hit.name')
.card(ng-non-bindable)
.page-header
h1 #{title}

View file

@ -86,10 +86,11 @@ define [
$scope.$apply(fn)
buildHitViewModel = (hit)->
page_underscored = hit.title.replace(/\s/g,'_')
page_underscored = hit.pageName.replace(/\s/g,'_')
section_underscored = hit.sectionName.replace(/\s/g,'_')
result =
name : hit._highlightResult.title.value
url :"/learn/#{page_underscored}"
name : hit._highlightResult.pageName.value + " - " + hit._highlightResult.sectionName.value
url :"/learn/#{page_underscored}##{section_underscored}"
console.log result
return result
@ -99,6 +100,7 @@ define [
$scope.search = ->
query = $scope.searchQueryText
console.log query
if !query? or query.length == 0
updateHits []
return