Integrate better monocle in COPS

--HG--
extra : rebase_source : 9132076c5553d0a2a7c550e7f3523b922e52b693
This commit is contained in:
Sébastien Lucas 2014-01-11 18:48:10 +01:00
parent 62941ccb4b
commit 1d2e37d259
3 changed files with 8 additions and 2 deletions

View file

@ -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 ();

View file

@ -12,6 +12,9 @@
{{? data.mail == 1}}
<a id="mailButton" title="Mail" href="empty.php" onclick="sendToMailAddress (this, {{=data.id}}); return false;"><i class="icon-envelope icon-large"></i></a>
{{?}}
{{? data.readerUrl != ""}}
<a title="Reader" href="{{=data.readerUrl}}" target="blank"><i class="icon-eye-open icon-large"></i></a>
{{?}}
<br />
{{~}}
</h2>

View file

@ -32,7 +32,7 @@
</h2>
<a class="fancydetail" href="{{=str_format (it.c.url.detailUrl, entry.book.id, it.databaseId)}}">
<div class="fullclickpopup">
<h2><span class="st"><a href="{{=entry.book.readerUrl}}" target="blank">{{=htmlspecialchars (entry.title)}}</a></span>
<h2><span class="st">{{=htmlspecialchars (entry.title)}}</span>
{{? entry.book.pubDate != ""}}<span class="sp">({{=entry.book.pubDate}})</span>{{?}}
{{? entry.book.rating != ""}}<span class="sr">{{=entry.book.rating}}</span>{{?}}
</h2>