diff --git a/src/couchapp/secreton/lists/index.js b/src/couchapp/secreton/lists/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4777ae6d6e8a0d0a8f8facbdc1baed257636c1ca --- /dev/null +++ b/src/couchapp/secreton/lists/index.js @@ -0,0 +1,25 @@ +function(head, req) { + //!json templates.replicon + var Mustache = require("vendor/couchapp/lib/mustache"); + var path = require("vendor/couchapp/lib/path").init(req); + + provides("html", function() { + send("<ul>"); + var row, url; + while (row = getRow()) { + system = row.value ; + send( Mustache.to_html(templates.replicon , { + "url" : path.show("secretion_system" , row.id ) , + "code" : system.code , + "T3SS_family" : system.T3SS_family, + "name" : system.name, + "taxid" : system.taxid, + "strain" : system.strain, + "taxonomy" : system.taxonomy, + "type" : system.type + })); + } + return("</ul>"); + }); +} + \ No newline at end of file diff --git a/src/couchapp/secreton/templates/replicon.html b/src/couchapp/secreton/templates/replicon.html new file mode 100644 index 0000000000000000000000000000000000000000..fac83842c7cd5c4d432192ab49040453a61da23b --- /dev/null +++ b/src/couchapp/secreton/templates/replicon.html @@ -0,0 +1,11 @@ +<li> + <a href="{{url}}">{{name}}</a> + <ul class="tooltip"> + <li>code: {{code}}</li> + <li>T3SS_family: {{T3SS_family}}</li> + <li>taxid: {{taxid}}</li> + <li>strain: {{strain}}</li> + <li>taxonomy: {{taxonomy}}</li> + <li>type: {{type}}</li> + </ul> +</li> diff --git a/src/couchapp/secreton/views/by_replicon_name/map.js b/src/couchapp/secreton/views/by_replicon_name/map.js index 395544409fb114a682a3246a26961de8a3864032..ab85317775fd39b5bba930398ed0b5397e0f2c7e 100644 --- a/src/couchapp/secreton/views/by_replicon_name/map.js +++ b/src/couchapp/secreton/views/by_replicon_name/map.js @@ -1,3 +1,12 @@ function(doc) { - emit(doc.replicon.name, doc._id); + emit(doc.replicon.name, { + "id" : doc._id, + "code" : doc.code , + "name" : doc.replicon.name , + "T3SS_family" : doc.T3SS_family, + "taxid" : doc.replicon.taxid, + "strain" : doc.replicon.strain , + "taxonomy" : doc.replicon.taxonomy.join( ", ") , + "type" : doc.replicon.type + }); } \ No newline at end of file