diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/includes/book/header.html | 13 | ||||
-rw-r--r-- | templates/includes/book/summary.html | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/templates/includes/book/header.html b/templates/includes/book/header.html index 2fd0cb0..c1b6518 100644 --- a/templates/includes/book/header.html +++ b/templates/includes/book/header.html @@ -4,8 +4,8 @@ <a href="#" class="btn pull-left toggle-summary"><i class="fa fa-align-justify"></i> Summary</a> <!-- Actions Right --> - <a href="/star/{{ githubId }}" class="btn pull-right"><i class="fa fa-star-o"></i> Star (0)</a> - <a href="/watch/{{ githubId }}" class="btn pull-right"><i class="fa fa-eye"></i> Watch (0)</a> + <a href="https://github.com/{{ githubId }}/stargazers" target="_blank" class="btn pull-right count-star"><i class="fa fa-star-o"></i> Star (<span>-</span>)</a> + <a href="https://github.com/{{ githubId }}/watchers" target="_blank" class="btn pull-right count-watch"><i class="fa fa-eye"></i> Watch (<span>-</span>)</a> <!-- Title --> @@ -14,9 +14,18 @@ <script> $(document).ready(function() { var $book = $(".book"); + + // Toggle summary $book.find(".book-header .toggle-summary").click(function(e) { e.preventDefault(); $book.toggleClass("with-summary"); }); + + // Star and watch count + $.getJSON("https://api.github.com/repos/{{ githubId }}") + .done(function(repo) { + $book.find(".count-star span").text(repo.stargazers_count); + $book.find(".count-watch span").text(repo.subscribers_count); + }); }); </script>
\ No newline at end of file diff --git a/templates/includes/book/summary.html b/templates/includes/book/summary.html index 99c226c..52eeb2f 100644 --- a/templates/includes/book/summary.html +++ b/templates/includes/book/summary.html @@ -4,7 +4,7 @@ <a href="{{ basePath }}/README.html">Introduction</a> </li> <li> - <a href="https://github.com/{{ owner }}" target="blank">About the author</a> + <a href="https://github.com/{{ githubAuthor }}" target="blank">About the author</a> </li> <li class="divider"></li> {% for item in summary.chapters %} |