Mercurial > hg > NetworkVis
diff ismi-python-neo4jrestclient/static/commentaries.html @ 37:7b5dcd3238d2
search field also accepts ismi_ids. display list of authors in head. display author name in title list.
author | casties |
---|---|
date | Thu, 04 Feb 2016 17:35:50 +0100 |
parents | 810ea40a9ef8 |
children | fee275163ff9 |
line wrap: on
line diff
--- a/ismi-python-neo4jrestclient/static/commentaries.html Thu Feb 04 15:50:08 2016 +0100 +++ b/ismi-python-neo4jrestclient/static/commentaries.html Thu Feb 04 17:35:50 2016 +0100 @@ -16,7 +16,7 @@ <div class="form-group"> <input type="text" value="jaghmini" placeholder="Search for person name" class="form-control" name="search"> </div> - <button class="btn btn-default" type="submit">Search for author name</button> + <button class="btn btn-default" type="submit">Search for author name or id</button> </form> </li> </ul> @@ -46,6 +46,7 @@ <table id="results" class="table table-striped table-hover"> <thead> <tr> + <th>Author</th> <th>Title (translit)</th> <th>Title (arabic)</th> <th>ismi_id</th> @@ -166,12 +167,14 @@ // clear all marks $("#graph .marked").each(function(){this.classList.remove("marked")}); // fill table of titles + var authors = {}; data.forEach(function (row) { var text = row.text; var author = row.author; - $("#author").text("Titles by Author: "+author.label+" ["+author.ismi_id+"]"); + // collect authors + authors[author.ismi_id] = author; var comm = row.is_commentary || row.has_commentaries; - var $row = $("<tr><td>" + text.label + "</td><td>" + text.full_title + "</td><td class='text_id'>" + text.ismi_id + "</td></tr>").appendTo(t) + var $row = $("<tr><td>" + author.label + "</td><td>" + text.label + "</td><td>" + text.full_title + "</td><td class='text_id'>" + text.ismi_id + "</td></tr>").appendTo(t) .click(function() { showText($(this).find("td.text_id").text());}); if (comm) { $row.addClass("marked"); @@ -179,6 +182,11 @@ // set mark $("#graph .ismi-"+text.ismi_id).each(function(){this.classList.add("marked")}); }); + var authorlist = ""; + for (var a in authors) { + authorlist += (authorlist ? ", " : "") + authors[a].label + " ["+authors[a].ismi_id+"]"; + } + $("#author").text("Titles by: "+authorlist); if (!keep_detail_view) { // show first title in detail view showText(data[0].text.ismi_id);