From 1d2e37d2593ca554e742e349e6d330066a99bfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 11 Jan 2014 18:48:10 +0100 Subject: [PATCH] Integrate better monocle in COPS --HG-- extra : rebase_source : 9132076c5553d0a2a7c550e7f3523b922e52b693 --- JSON_renderer.php | 5 ++++- templates/default/bookdetail.html | 3 +++ templates/default/main.html | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/JSON_renderer.php b/JSON_renderer.php index 130395a..8e63a67 100644 --- a/JSON_renderer.php +++ b/JSON_renderer.php @@ -72,10 +72,13 @@ class JSONRenderer $out ["datas"] = array (); $dataKindle = $book->GetMostInterestingDataToSendToKindle (); foreach ($book->getDatas() as $data) { - $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0); + $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0, "readerUrl" => ""); if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) { $tab ["mail"] = 1; } + if ($data->format == "EPUB") { + $tab ["readerUrl"] = "epubreader.php?data={$data->id}&db=0"; //TODO fix the database + } array_push ($out ["datas"], $tab); } $out ["authors"] = array (); diff --git a/templates/default/bookdetail.html b/templates/default/bookdetail.html index 9049978..b9ed403 100644 --- a/templates/default/bookdetail.html +++ b/templates/default/bookdetail.html @@ -12,6 +12,9 @@ {{? data.mail == 1}} {{?}} + {{? data.readerUrl != ""}} + + {{?}}
{{~}} diff --git a/templates/default/main.html b/templates/default/main.html index 063d594..bcbd614 100644 --- a/templates/default/main.html +++ b/templates/default/main.html @@ -32,7 +32,7 @@
-

{{=htmlspecialchars (entry.title)}} +

{{=htmlspecialchars (entry.title)}} {{? entry.book.pubDate != ""}}({{=entry.book.pubDate}}){{?}} {{? entry.book.rating != ""}}{{=entry.book.rating}}{{?}}