diff --git a/Makefile b/Makefile index d03bf49..ce7ae34 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ sinclude GNUmakefile.local DATABASE = metadata.db OBJS = db.o db_author.o db_book.o db_series.o json.o main.o -HTMLS = index.html book.html author.html -JSMINS = index.min.js book.min.js author.min.js +HTMLS = index.html book.html author.html series.html +JSMINS = index.min.js book.min.js author.min.js series.min.js EXTJS = externals/vue.min.js CSS = externals/bootstrap.min.css FONTS = externals/fonts/* diff --git a/author.html b/author.html index bbf84e1..b3f7865 100644 --- a/author.html +++ b/author.html @@ -41,7 +41,7 @@
Cette bibliothèque contient actuellement {{ booksCount }} livres et BD en format papier ou électronique.
+ -Nom | +Livre(s) | +Auteur(s) | +
---|---|---|
+ + {{ serie.name }} + | +{{ serie.count }} | ++ + + {{ author.name }} + + | +
Nom | @@ -55,7 +76,8 @@- {{ book.series ? book.series.name : '' }} + + {{ book.series.name }} {{ book.series ? book.series.idx : '' }} | diff --git a/index.js b/index.js index 14ef86b..b52f63c 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ var app = new Vue({ data: { books: [], authors: [], + series: [], booksCount: 0, page: 1, perpage: 20 @@ -48,6 +49,9 @@ var app = new Vue({ booksSuccess: function(resp) { this.books = resp; }, + seriesSuccess: function(resp) { + this.series = resp; + }, prevPage: function() { if (this.page > 1) { this.page--; @@ -55,6 +59,8 @@ var app = new Vue({ this.loadBooks(); if (this.authors.length > 0) this.loadAuthors(); + if (this.series.length > 0) + this.loadSeries(); } }, nextPage: function() { @@ -63,6 +69,8 @@ var app = new Vue({ this.loadBooks(); if (this.authors.length > 0) this.loadAuthors(); + if (this.series.length > 0) + this.loadSeries(); }, loadAuthors: function() { this.sendQuery('cgi-bin/bouquins/authors?page=' + this.page + '&perpage=' + this.perpage, @@ -72,14 +80,27 @@ var app = new Vue({ this.sendQuery('cgi-bin/bouquins/books?page=' + this.page + '&perpage=' + this.perpage, this.stdError, this.booksSuccess); }, + loadSeries: function() { + this.sendQuery('cgi-bin/bouquins/series?page=' + this.page + '&perpage=' + this.perpage, + this.stdError, this.seriesSuccess); + }, + showSeries: function() { + this.books = []; + this.authors = []; + this.page = 1; + this.perpage = 20; + this.loadSeries(); + }, showAuthors: function() { this.books = []; + this.series = []; this.page = 1; this.perpage = 20; this.loadAuthors(); }, showBooks: function() { this.authors = []; + this.series = []; this.page = 1; this.perpage = 20; this.loadBooks(); diff --git a/series.html b/series.html new file mode 100644 index 0000000..904741b --- /dev/null +++ b/series.html @@ -0,0 +1,50 @@ + + + +
---|