From 0f63050f700197eab9f8e26edf8981842a659ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sun, 13 Oct 2013 22:20:08 +0200 Subject: [PATCH] Add a new template for the suggestion item. re #34 --- index.php | 6 +++++- templates/default/suggestion.html | 1 + util.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 templates/default/suggestion.html diff --git a/index.php b/index.php index ab5b9cf..f9070d0 100644 --- a/index.php +++ b/index.php @@ -72,7 +72,8 @@ $.get('templates/default/bookdetail.html'), $.get('templates/default/main.html'), $.get('templates/default/page.html'), - $.getJSON(url)).done(function(header, footer, bookdetail, main, page, data){ + $.get('templates/default/suggestion.html'), + $.getJSON(url)).done(function(header, footer, bookdetail, main, page, suggestion, data){ templateBookDetail = doT.template (bookdetail [0]); var defMain = { @@ -89,6 +90,9 @@ }; templatePage = doT.template (page [0], undefined, defPage); + + templateSuggestion = doT.template (suggestion [0]); + currentData = data [0]; updatePage (data [0]); diff --git a/templates/default/suggestion.html b/templates/default/suggestion.html new file mode 100644 index 0000000..1107dad --- /dev/null +++ b/templates/default/suggestion.html @@ -0,0 +1 @@ +

{{=it.title}}

\ No newline at end of file diff --git a/util.js b/util.js index ea92d1f..f408054 100644 --- a/util.js +++ b/util.js @@ -2,7 +2,7 @@ // copyright Sébastien Lucas // https://github.com/seblucas/cops -var templatePage, templateBookDetail, templateMain, currentData, before, filterList; +var templatePage, templateBookDetail, templateMain, templateSuggestion, currentData, before, filterList; if (typeof LRUCache!='undefined') { var cache = new LRUCache(30);