Commit 27781f79 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

add list features to render list of link toward show/secretion_system

add index.js which use replicon.html to render list of secretion system as unordered list
add replicon.html a Mustache template to render an item of secretion system

modify view_by_name to be useable by index list
instaed returning  doc_id as value return an object with several fields which are used to display tooltips.

parent f327a5bd
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
<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>
function(doc) { 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment