History

Add doc/type pages to the search index

Closes #55.

Thibaut committed 12 years ago

Commit 32906bc1 parent 68b29113 files · +14 −2Browse files

Unified · Split

3 files
  1. assets/javascripts/app/app.coffee +4 −1
  2. assets/javascripts/models/type.coffee +6 −0
  3. assets/javascripts/templates/pages/news_tmpl.coffee +4 −1
assets/javascripts/app/app.coffee+4−1
@@ -71,7 +71,10 @@ · 70 unmodified lines
71 return71 return
72 72
73 start: ->73 start: ->
74 @entries.add doc.entries.all() for doc in @docs.all()74 for doc in @docs.all()
75 @entries.add doc.toEntry()
76 @entries.add type.toEntry() for type in doc.types.all()
77 @entries.add doc.entries.all()
75 @trigger 'ready'78 @trigger 'ready'
76 @router.start()79 @router.start()
77 @hideLoading()80 @hideLoading()
assets/javascripts/models/type.coffee+6−0
@@ -6,3 +6,9 @@ class app.models.Type extends app.Model · 5 unmodified lines
6 6
7 entries: ->7 entries: ->
8 @doc.entries.findAllBy 'type', @name8 @doc.entries.findAllBy 'type', @name
9
10 toEntry: ->
11 new app.models.Entry
12 doc: @doc
13 name: "#{@doc.name} / #{@name}"
14 path: '..' + @fullPath()
assets/javascripts/templates/pages/news_tmpl.coffee+4−1
@@ -24,7 +24,10 @@ newsItem = (date, news) -> · 23 unmodified lines
24 result24 result
25 25
26app.news = [26app.news = [
27 [ 1390694400000, # January 26, 201327 [ 1392163200000, # February 12, 2013
28 """ The root/category pages are now included in the search index (e.g. <a href="/#q=CSS">CSS</a>) """,
29 ], [
30 1390694400000, # January 26, 2013
28 """ Updated <a href="/angular/">Angular.js</a> documentation """,31 """ Updated <a href="/angular/">Angular.js</a> documentation """,
29 ], [32 ], [
30 1390089600000, # January 19, 201333 1390089600000, # January 19, 2013