diff options
author | shefali shetty <sshefali44@gmail.com> | 2012-06-05 11:28:01 +0530 |
---|---|---|
committer | shefali shetty <sshefali44@gmail.com> | 2012-06-05 11:28:01 +0530 |
commit | 8075ac70992db19a0d77b277f13af07f9f4f8b39 (patch) | |
tree | e2c3dc81dc1b5a000c8e8ab97aa3795a39b41c47 /gstudio/templates | |
parent | 82e6b6a0535a9ffb202ed8c6bb786bdf41a7bb80 (diff) | |
parent | 909ba6f95a054a1bbec0045cbc9a64f34582529e (diff) | |
download | gnowsys-8075ac70992db19a0d77b277f13af07f9f4f8b39.tar.gz |
collapsing done with Ctrl+click event
Diffstat (limited to 'gstudio/templates')
-rw-r--r-- | gstudio/templates/gstudio/display.html | 261 | ||||
-rw-r--r-- | gstudio/templates/gstudio/nodetype_detail.html | 3 | ||||
-rw-r--r-- | gstudio/templates/gstudio/skeleton.html | 193 | ||||
-rw-r--r-- | gstudio/templates/gstudio/version_diff.html | 333 |
4 files changed, 591 insertions, 199 deletions
diff --git a/gstudio/templates/gstudio/display.html b/gstudio/templates/gstudio/display.html index 184b58d..9d48285 100644 --- a/gstudio/templates/gstudio/display.html +++ b/gstudio/templates/gstudio/display.html @@ -1,4 +1,3 @@ - {% load i18n comments gstudio_tags %} {% load gstudio_tags i18n %} {% get_tags as nodetype_tags %} @@ -6,7 +5,6 @@ - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}" version="-//W3C//DTD XHTML 1.1//EN" xmlns="http://www.w3.org/1999/xhtml"> <head> @@ -165,7 +163,7 @@ .attr("width", w) .attr("height", h); - vis.append("svg:g").attr("class", "edges"); + vis.append("svg:g").attr("class", "edges"); vis.append("svg:g").attr("class", "nodes"); $(function() { @@ -176,7 +174,7 @@ $(function() { success : function(json) { //var node = NID.objects.get(slug='{{ slug }}'); - var force; + var force; // this contains all the nodes as a dict with _id as the key @@ -336,18 +334,18 @@ $(function() { nodes_by_id[{{ nt.id }}].y = h/2.0; all_edges = new Array(); - all_edges = all_edges.concat(follows_edges, member_of, contains_members, contains_subtypes, mentions_edges, right_subjecttype_of, left_subjecttype_of, subjecttype_of, type_of,plural,altnames,contains_members,content, prior_nodes, posterior_nodes); - /* all_edges.concat(follows_edges); - all_edges.concat(member_of_metatype); + all_edges = all_edges.concat(follows_edges, member_of, contains_members, contains_subtypes, mentions_edges, right_subjecttype_of, left_subjecttype_of, subjecttype_of, type_of,plural,altnames,contains_members,content, prior_nodes, posterior_nodes); + /* all_edges.concat(follows_edges); + all_edges.concat(member_of_metatype); all_edges.concat(contains_members); - all_edges.concat(contains_subtypes); - all_edges.concat(mentions_edges); + all_edges.concat(contains_subtypes); + all_edges.concat(mentions_edges); - document.getElementById('debugbox1').value= follows_edges; //member_of_metatype + document.getElementById('debugbox1').value= follows_edges; //member_of_metatype document.getElementById('debugbox2').value= mentions_edges; - //document.getElementById('debugbox2').value= member_of_metatype; - document.getElementById('debugbox3').value= all_edges; + //document.getElementById('debugbox2').value= member_of_metatype; + document.getElementById('debugbox3').value= all_edges; */ var force = d3.layout.force() .linkStrength(0.5) @@ -372,7 +370,7 @@ $(function() { if(nodes_by_id[e.to] && !nodes_by_id[e.to].added){ nodes_by_id[e.to].added = true; acc.push(nodes_by_id[e.to]); - } + } return acc; }, []); @@ -390,7 +388,7 @@ $(function() { } */ ) .attr("x1", function(d) { return d.source.x; - }) + }) .attr("y1", function(d) { return d.source.y; }) @@ -405,13 +403,13 @@ $(function() { }) .append("a") - .text(function(d) { return d.type; }); + .text(function(d) { return d.type; }); - var node = d3.select("#chart g.nodes").selectAll("g.node").data(nodes); + var node = d3.select("#chart g.nodes").selectAll("g.node").data(nodes); var new_g = node.enter().append("svg:a") - .attr("class", function(d) { if (d._id=={{ nt.id }}) return "mainnode"; else if (isNaN(d._id)) return "relnode"; else if ((d._id)<0) return "nodetext"; else return "node"; }) + .attr("class", function(d) { if (d._id=={{ nt.id }}) return "mainnode"; else if (isNaN(d._id)) return "relnode"; else if ((d._id)<0) return "nodetext"; else return "node"; }) .attr("xlink:href",function(d){return d.url;}) .call(force.drag); @@ -428,14 +426,14 @@ $(function() { new_g.append("svg:text") .attr("class",function(d) { if (d._id=={{ nt.id }}) return "mainnode"; else if (isNaN(d._id)) return "relnode"; else if ((d._id)<0) return "nodetext"; else return "node"; }) .attr("dy", 20) - .attr("dx", 25) - .attr("text-anchor",function text(d) { if (isNaN(d._id) || (d._id)<0) return "middle" ; else return "left"}) + .attr("dx", 25) + .attr("text-anchor",function text(d) { if (isNaN(d._id) || (d._id)<0) return "middle" ; else return "left"}) -// .attr("style",function text(d) { if (isNaN(d._id)) return "font-size:9.00pt;fill:#333;" ; else return "font-size:9.00pt;fill:black;"}) +// .attr("style",function text(d) { if (isNaN(d._id)) return "font-size:9.00pt;fill:#333;" ; else return "font-size:9.00pt;fill:black;"}) .text(function(d) { return d.screen_name; - }); + }); node.exit().remove(); @@ -465,7 +463,7 @@ $(function() { /* $('input#follows').change(function(){ update(all_edges); }); - */ + */ /* $('input#mentions').change(function(){ update(all_edges); @@ -480,9 +478,12 @@ $(function() { }); -</script> +</script> </div> </div> + + + <div> {% include "gstudio/_header.html" %} <div id="breadcrumbs" class="span-24 last"> @@ -493,81 +494,186 @@ $(function() { <h3>{% block content %} {% block nodetype-content %} <h2 class="nodetype-title"> - <a href="{{ nt.get_absolute_url }}" title="{{ nt.title }}" rel="bookmark">{{ ver_dict.title }} {{ nt.id }}.{{ cnt }} + <a href="{{ nt.get_absolute_url }}" title="{{ nt.title }}" rel="bookmark">{{ ver_nbh_dict.title }} {{ nt.id }}.{{ version_no }} </a> + <a href="{{ nt.get_edit_url }}/history/{{ ssid }}" target="_blank" title = "edit">[edit]</a> </h2> - {% with nt.html_content|safe as object_content %} - <b>Name:<nbsp></b>{{ ver_dict.title }}<br/> - {% if ver_dict.altnames %} - <b> Alternate names:<nbsp></b>{{ ver_dict.altnames}} - <br/> - {% endif %} - {% if ver_dict.plural %} - <b> Plural Name:<nbsp></b>{{ ver_dict.plural }} <br/> - {% endif %} - {% if nt.get_rendered_nbh.authors %}<b>Authors: <nbsp> </b> - {% endif %} - {% for author in nt.authors.all %} - <span class="vcard author"> - <a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author" - title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a> - </span>{% if not forloop.last %}, {% endif %} - {% endfor %} <br/> - {% endwith %} - {% endblock %} - {% endblock %} + {% with nt.html_content|safe as object_content %} + <b>Name:<nbsp></b> {{ ver_nbh_dict.title }} <br/> + + {% if ver_nbh_dict.plural %} + <b> Plural Name:<nbsp></b> + {{ ver_nbh_dict.plural}} <br/> + {% endif %} + {% if ver_nbh_dict.altnames %} + <b> Alternate names:<nbsp></b> + {{ ver_nbh_dict.altnames}} <br/> + {% endif %} + {% if ver_nbh_dict.type_of %} + <b> Type of:<nbsp></b> + {% for typekey,typevalue in ver_nbh_dict.type_of.items %} + <a href="{{typevalue}}" title = "{{typekey}}">{{typekey}}</a>; + {% endfor %}<br/> + {% endif %} + + + {% if ver_nbh_dict.member_of_metatypes %} + + + <b> Member of Metatypes:<nbsp></b> + {% for mkey,mvalue in ver_nbh_dict.member_of_metatypes.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + + {% if ver_nbh_dict.contains_subtypes %} + <b> Contains SubTypes:<nbsp></b> + {% for stkey,stvalue in ver_nbh_dict.contains_subtypes.items %} + <a href="{{stvalue}}" title = "{{stkey}}">{{stkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + {% if ver_nbh_dict.contains_members %} + + + <b>Contains Members:<nbsp></b> + {% for mkey,mvalue in ver_nbh_dict.contains_members.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + + + + + <b>Authors: <nbsp> </b> + + + + + {% for author in nt.authors.all %} + <span class="vcard author"> + <a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author" + title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a> + </span>{% if not forloop.last %}, {% endif %} + {% endfor %} <br/> + + + + {% if ver_nbh_dict.priornodes %} + + + <b>Prior nodes:<nbsp></b> + {% for mkey,mvalue in ver_nbh_dict.priornodes.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + {% if ver_nbh_dict.posteriornodes %} + + + <b>Posterior nodes:<nbsp></b> + {% for mkey,mvalue in ver_nbh_dict.posteriornodes.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + {% if ver_nbh_dict.relations %} + + + {% for relkey,relvalue in ver_nbh_dict.relations.items %} + <b>{{relkey}}:<nbsp></b> + {% for relk, relv in relvalue.items %} + <a href="{{relv}}" title = "{{relk}}">{{relk}}</a>; + {% endfor %}<br/> + {% endfor %} + {% endif %} + + {% if ver_nbh_dict.attributes %} + + {% for atkey,atvalue in ver_nbh_dict.attributes.items %} + {% if atvalue %} + <b>{{atkey}}:<nbsp> </b> + {% for atr in atvalue %} + {{atr}}; + {% endfor %} <br/> + {% endif %} + {% endfor %} + {% endif %} + {% if ver_nbh_dict.leftroles %} + + + <b>Left roles:<nbsp> </b> + + {% for lrkey,lrvalue in ver_nbh_dict.leftroles.items %} + <a href="{{lrvalue}}" title = "{{lrkey}}">{{lrkey}}</a>; + {% endfor %} <br/> + {% endif %} + + {% if ver_nbh_dict.rightroles %} + + <b>Right roles:<nbsp> </b> + + {% for rrkey,rrvalue in ver_nbh_dict.rightroles.items %} + <a href="{{rrvalue}}" title = "{{rrkey}}">{{rrkey}}</a>; + {% endfor %} <br/> + {% endif %} + + + {% if ver_nbh_dict.ats %} + + + <b>Subjecttype of:<nbsp> </b> + + {% for atkey,atvalue in ver_nbh_dict.ats.items %} + <a href="{{atvalue}}" title = "{{atkey}}">{{atkey}}</a>; + {% endfor %} <br/> + {% endif %} + + + <b>Content:<nbsp></b>{{ ver_nbh_dict.content }} + + + {% endwith %} + {% endblock %} + {% endblock %} </div> <div id="sidebar"> {% block sidebar %} <div class="History"> - + <h3>{% trans "Versions" %}</h3> - <script type="text/javascript"> - function go_to_loc(sid) - { - - <!-- var len=document.history.group2.length --> - <!-- for(var i=0;i<len;i++) --> - <!-- { --> - <!-- var r=window.document.history.group2[i] --> - <!-- if(sid==r.) --> - <!-- { --> - <!-- r.disabled="false" --> - <!-- } --> - <!-- else --> - <!-- { --> - <!-- r.enabled="true" --> - <!-- } --> - <!-- } --> - - - } - </script> - <form name="history" action="/nodetypes/display/showhistory/{{ ssid }}" > + <form name="history" action="/nodetypes/display/compare_history/{{ ssid }}" > <table cellspacing="0" border="2"> <tr> - <td> <input type="radio" name="group1" value="{{ ssid }}" checked >{{ nt.id }}.{{ cnt }}</input></td> + <td> <input type="radio" name="group1" value="{{ ssid }}.{{ version_no }}" checked >{{ nt.id }}.{{ version_no }}</input></td> <td></td></tr> + {% for sid in nt.get_ssid %} - {% ifnotequal forloop.counter cnt %} + + {% if sid|stringformat:"s" != ssid|stringformat:"s" %} <tr> <td> </td> <td> - <input type="radio" id="{{ sid }}"name="group2" value="{{ sid }}" >{{ nt.id }}.{{ forloop.counter }}</input> - </td>{% endifnotequal %} - {% endfor %}</tr></table> + <input type="radio" id="{{ sid }}"name="group2" value="{{ sid }}.{{ forloop.counter }}" >{{ nt.id }}.{{ forloop.counter }}</input> + </td></tr>{% endif %} + {% endfor %}</table> <input type="submit" value="Compare" /> </form> - + </div> - + {% endblock %} </div> @@ -583,13 +689,8 @@ $(function() { {{ GSTUDIO_VERSION }}</a>. </p> </div> - </div> + </div> </div> </body> </html> - - - - - diff --git a/gstudio/templates/gstudio/nodetype_detail.html b/gstudio/templates/gstudio/nodetype_detail.html index 7947e58..1a01279 100644 --- a/gstudio/templates/gstudio/nodetype_detail.html +++ b/gstudio/templates/gstudio/nodetype_detail.html @@ -250,6 +250,7 @@ {% endblock %} <!-- Dynamic form begins --> +{% if user.is_authenticated %} <p> {% if object.reftype == 'Objecttype' %} <b>Add Attributes:</b> @@ -264,7 +265,7 @@ <a href="{{ get_absolute_url }}/objects/dynamicRelation/displaymem/{{ i }}/{{ object.title }}">{{ i }}</a><nbsp>; {% endfor %} {% endif %} - +{% endif %} </p> <!-- Dyanic form ends --> <div class="nodetype-content"> diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index eba5e28..f8e366f 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -178,8 +178,8 @@ function init(a,b) { + - nodes_by_id = _.reduce(a, function(acc, n) { acc[n._id] = n; return acc; @@ -198,16 +198,19 @@ function init(a,b) return nodes_by_id[e.from] && nodes_by_id[e.to]&& e.type!="title" && e.type!="content" }).value(); - + } $(function fgraph() { - +neighbour_node= new Array(); +clicked_node=new Array(); +prev_node=new Array(); +neighbour_node= neighbour_node.concat({{object.id}}); $.getJSON('/nodetypes/graphs/graph_json/' + {{object.id}}, function (json1) { metadata=json1.node_metadata; relations=json1.relations; - relnset=json1.relset + init(metadata,relations); load({{object.id}}) }); @@ -338,29 +341,128 @@ function load(key) .attr("fill", "#6D6666"); - -$(window).bind('keydown',function(event){ - if(17==event.keyCode){ - new_g.on("click",function(d){ - if(d._id>0 && d.expanded=="false") - { - d3.select("#amazingViz").remove(); - d.expanded="true"; - $.getJSON('/nodetypes/graphs/graph_json/' + d._id , function (json2) { - new_metadata=json2.node_metadata; - new_relations=json2.relations; - new_relnset=json2.relset - metadata=_.union(new_metadata,metadata); - relations=_.union(new_relations,relations); - init(metadata,relations); - load(d._id) - }) +$(window).bind('keydown',function(event) { + if(event.keyCode==17){ + + new_g.on("click",function(d){ + + + + + if(d._id>0 && d.expanded=="true") + { + + $.getJSON('/nodetypes/graphs/graph_json/' + d._id , function (json2) { + new_metadata=json2.node_metadata; + + }); + + _.filter(new_metadata, function(e){if(e._id>0) + { + clicked_node=clicked_node.concat(e._id) ; + } + }); + + + index = _.indexOf(neighbour_node , d._id); + prev_node=neighbour_node.slice(0,index); + + neighbour_node = _.difference(neighbour_node,clicked_node) ; + + neighbour_node= neighbour_node.concat(prev_node); + neighbour_node = _.uniq(neighbour_node); + metadata=[] + relations=[] + metadata1=[] + relations1=[] + for(i=0;i<(neighbour_node.length);i++) + { + + d3.select("#amazingViz").remove(); + g=neighbour_node[i] + + + + $.ajax({ + async:false, + url:'/nodetypes/graphs/graph_json/' + g , + datatype:'json', + success:function (json2) { + new_metadata=json2.node_metadata; + new_relations=json2.relations; + metadata=_.union(new_metadata,metadata); + + relations=_.union(new_relations,relations); + check_Relationtype(metadata,relations); + }}); + } - - }); + _.each(metadata, function(m){ + + for(i=0;i<neighbour_node.length;i++) + { + if(m._id==neighbour_node[i]) + {m.expanded="true";} + else + {m.expanded="false";} + } + + + }); + + init(metadata,relations); + load({{object.id}}) ; -} + + + } + + + + + else if(d._id>0) + { + + neighbour_node =neighbour_node.concat(d._id); + + d3.select("#amazingViz").remove(); + + $.ajax({ + async:false, + url:'/nodetypes/graphs/graph_json/' + d._id , + datatype:'json', + success:function (json2) { + + new_metadata=json2.node_metadata; + new_relations=json2.relations; + + metadata=_.union(new_metadata,metadata); + relations=_.union(new_relations,relations); + check_Relationtype(metadata,relations); + _.each(metadata, function(m){ + + for(i=0;i<neighbour_node.length;i++) + { + if(m._id==neighbour_node[i]) + m.expanded="true"; + } + }); + + + }}); + console.log(metadata); + init(metadata,relations); + load({{object.id}}); + + + + + } }); +} + +}); + @@ -370,15 +472,7 @@ $(window).bind('keydown',function(event){ }); - /*new_g.append("svg:ellipse") - .attr("cx", function(d) { return d.x - w/2.0 +15; }) - .attr("cy", function(d) { return d.y - h/2.0 +15 ; }) - .call(force.drag) - .attr("rx", function(d) { return ((d.screen_name).length) +10 }) - .attr("ry", function(d) { if (d._id==key) return 8; else if (isNaN(d._id) || (d._id)<0) return 1; else return 7 }); - //.style("fill", function color(d) { if (d._id==key) return "red"; else if (isNaN(d._id) || (d._id)<0) return "white" ; else return "green"});*/ - - + @@ -389,8 +483,7 @@ $(window).bind('keydown',function(event){ .attr("dy", ".35em") .attr("text-anchor","middle") - // .attr("style",function text(d) { if ((d._id)>0) return "font-size:9.00pt;fill:blue;" ; else return "font-size:9.00pt;fill:black;"}) - + .text(function(d) { return d.screen_name; }); @@ -423,7 +516,7 @@ $(window).bind('keydown',function(event){ .style("fill-opacity", ".2") .style("stroke", "#666") .style("stroke-width", "1.5px") - .style("fill", function color(d) {var e=(d._id).charAt(0); if (d.expanded=="true") return "red"; else return "none"}); + .style("fill", function(d) {if ((d.expanded=="true" && d.refType=="Objecttype") ||(d._id=={{object.id}}) ) return "blue"; else if(d.expanded=="true" && d.refType=="Gbobject") return "red"; else return "none"}); @@ -462,9 +555,35 @@ $(window).bind('keydown',function(event){ } +function check_Relationtype(metadata,relations) +{ + _.each(metadata,function(d){ + if (d.refType=="Relationtype") + { + a=d.inverse; + if (d.flag==1) + { + relations= _.reject(relations,function(e) + { + return e.type==a + }); + } + else if (d.flag==0) + { + relations= _.reject(relations,function(e) + { + return e.type==d.screen_name + }); + } + } + + }); + + +} + }); -//fgraph({{object.id}}); </script> diff --git a/gstudio/templates/gstudio/version_diff.html b/gstudio/templates/gstudio/version_diff.html index a640f07..4a11ec2 100644 --- a/gstudio/templates/gstudio/version_diff.html +++ b/gstudio/templates/gstudio/version_diff.html @@ -108,38 +108,154 @@ <h3>{% block content %} {% block nodetype-content %} <h2 class="nodetype-title"> - <a href="{{ nt1.get_absolute_url }}" title="{{ nt1.title }}" rel="bookmark">{{ ver_new.title }} + <a href="{{ nt.get_absolute_url }}" title="{{ nt.title }}" rel="bookmark">{{ ver_new_dict.title }} {{ nt.id }}.{{ version_no1 }} </a> </h2> - <!-- {% block content56 %}{% for each in diffs1 %} --> - <!-- {% autoescape off %} --> - <!-- {{ each }}<br> --> - <!-- {% endautoescape %}{% endfor %} {% endblock %} --> - <!-- <br> --> - {% with nt1.html_content|safe as object_content %}<br> - <b>Name:<nbsp></b>{{ ver_new.title }}<br/> - {% if ver_new.altnames %} - <b> Alternate names:<nbsp></b>{{ ver_new.altnames }} - <br/> - {% endif %} - {% if ver_new.plural %} - <b> Plural Name:<nbsp></b>{{ ver_new.plural }} <br/> - {% endif %} - - <b> Content:<nbsp></b>{{ ver_new.content }} <br/> - + + {% with nt.html_content|safe as object_content %}<br> - {% if nt1.get_rendered_nbh.authors %}<b>Authors: <nbsp> </b> - {% endif %} - {% for author in nt1.authors.all %} - <span class="vcard author"> - <a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author" - title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a> - </span>{% if not forloop.last %}, {% endif %} - {% endfor %} <br/> - {% endwith %} - {% endblock %} - {% endblock %} + <b>Name:<nbsp></b> {{ ver_new_nbh_dict.title }} <br/> + + {% if ver_new_nbh_dict.plural or ver_old_nbh_dict.plural %} + <b> Plural Name:<nbsp></b> + {{ ver_new_nbh_dict.plural}} <br/> + {% endif %} + {% if ver_new_nbh_dict.altnames or ver_old_nbh_dict.altnames%} + <b> Alternate names:<nbsp></b> + {{ ver_new_nbh_dict.altnames}} <br/> + {% endif %} + {% if ver_new_nbh_dict.type_of or ver_old_nbh_dict.type_of %} + <b> Type of:<nbsp></b> + {% for typekey,typevalue in ver_new_nbh_dict.type_of.items %} + <a href="{{typevalue}}" title = "{{typekey}}">{{typekey}}</a>; + {% endfor %}<br/> + {% endif %} + + + {% if ver_new_nbh_dict.member_of_metatypes or ver_old_nbh_dict.member_of_metatypes %} + + + <b> Member of Metatypes:<nbsp></b> + {% for mkey,mvalue in ver_new_nbh_dict.member_of_metatypes.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + + {% if ver_new_nbh_dict.contains_subtypes or ver_old_nbh_dict.contains_subtypes %} + <b> Contains SubTypes:<nbsp></b> + {% for stkey,stvalue in ver_new_nbh_dict.items %} + <a href="{{stvalue}}" title = "{{stkey}}">{{stkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + {% if ver_new_nbh_dict.contains_members or ver_old_nbh_dict.contains_members %} + + + <b>Contains Members:<nbsp></b> + {% for mkey,mvalue in ver_new_nbh_dict.contains_members.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + + + + + + <!-- <b>Authors: <nbsp> </b> --> + + + + + <!-- {% for author in nt.authors.all %} --> + <!-- <span class="vcard author"> --> + <!-- <a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author" --> + <!-- title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a> --> + <!-- </span>{% if not forloop.last %}, {% endif %} --> + <!-- {% endfor %} <br/> --> + + + + {% if ver_new_nbh_dict.priornodes or ver_old_nbh_dict.priornodes %} + + + <b>Prior nodes:<nbsp></b> + {% for mkey,mvalue in ver_new_nbh_dict.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + {% if ver_new_nbh_dict.posteriornodes or ver_old_nbh_dict.posteriornodes %} + + + <b>Posterior nodes:<nbsp></b> + {% for mkey,mvalue in ver_new_nbh_dict.items %} + <a href="{{mvalue}}" title = "{{mkey}}">{{mkey}}</a>; + {% endfor %}<br/> + {% endif %} + + {% if ver_new_nbh_dict.relations or ver_old_nbh_dict.relations %} + + + {% for relkey,relvalue in ver_new_nbh_dict.relations.items %} + <b>{{relkey}}:<nbsp></b> + {% for relk, relv in relvalue.items %} + <a href="{{relv}}" title = "{{relk}}">{{relk}}</a>; + {% endfor %}<br/> + {% endfor %} + {% endif %} + + {% if ver_new_nbh_dict.attributes or ver_old_nbh_dict.attributes %} + + {% for atkey,atvalue in ver_new_nbh_dict.attributes.items %} + {% if atvalue %} + <b>{{atkey}}:<nbsp> </b> + {% for atr in atvalue %} + {{atr}}; + {% endfor %} <br/> + {% endif %} + {% endfor %} + {% endif %} + {% if ver_new_nbh_dict.leftroles or ver_old_nbh_dict.leftroles %} + + + <b>Left roles:<nbsp> </b> + + {% for lrkey,lrvalue in ver_new_nbh_dict.leftroles.items %} + <a href="{{lrvalue}}" title = "{{lrkey}}">{{lrkey}}</a>; + {% endfor %} <br/> + {% endif %} + + {% if ver_new_nbh_dict.rightroles or ver_old_nbh_dict.rightroles %} + + <b>Right roles:<nbsp> </b> + + {% for rrkey,rrvalue in ver_new_nbh_dict.rightroles.items %} + <a href="{{rrvalue}}" title = "{{rrkey}}">{{rrkey}}</a>; + {% endfor %} <br/> + {% endif %} + + + {% if ver_new_nbh_dict.ats or ver_old_nbh_dict.ats %} + + + <b>Subjecttype of:<nbsp> </b> + + {% for atkey,atvalue in ver_new_nbh_dict.ats.items %} + <a href="{{atvalue}}" title = "{{atkey}}">{{atkey}}</a>; + {% endfor %} <br/> + {% endif %} + + {% if ver_new_nbh_dict.content or ver_old_nbh_dict.content %} + <b>Content:<nbsp></b>{{ ver_new_nbh_dict.content }} + {% endif %} + + {% endwith %} + {% endblock %} + {% endblock %} </td> <td> @@ -147,71 +263,126 @@ <h3>{% block content1 %} {% block nodetype-content1 %} <h2 class="nodetype-title"> - <a href="{{ nt1.get_absolute_url }}" title="{{ nt1.title }}" rel="bookmark">{{ ver_old.title }} + <a href="{{ nt.get_absolute_url }}" title="{{ nt.title }}" rel="bookmark">{{ ver_old_dict.title }} {{ nt.id }}.{{ version_no2 }} </a> - </h2><!-- <b> --> - <!-- {% block content85 %}{% for each in diffs %} --> - <!-- {% autoescape off %} --> - <!-- {{ each }}<br> --> - <!-- {% endautoescape %}{% endfor %} {% endblock %}</b> --> - <br> - {% with nt1.html_content|safe as object_content %} + </h2> <br> + {% with nt.html_content|safe as object_content %} + <b>Name:<nbsp></b>{% autoescape off %} - {{ diffs.0 }} + {{ compare_dict.title }} {% endautoescape %}<br> - {% if ver_old.altnames %} + {% if ver_old_nbh_dict.plural or ver_new_nbh_dict.plural %} + <b> Plural Name:<nbsp></b> {% autoescape off %} + {{ compare_dict.plural }} + {% endautoescape %} <br/> + {% endif %} + {% if ver_old_nbh_dict.altnames or ver_new_nbh_dict.altnames %} <b> Alternate names:<nbsp></b> {% autoescape off %} - {{ diffs.1 }} + {{ compare_dict.altnames }} {% endautoescape %} <br/> {% endif %} - {% if ver_old.plural %} - <b> Plural Name:<nbsp></b> {% autoescape off %} - {{ diffs.2 }} - {% endautoescape %} <br/> + {% if ver_new_nbh_dict.type_of or ver_old_nbh_dict.type_of %} + <b> Type of:<nbsp></b> {% autoescape off %} + {{ compare_dict.type_of }} + {% endautoescape %} + <br/> {% endif %} - - <b> Content:<nbsp></b> {% autoescape off %} - {{ diffs.3 }} + {% if ver_new_nbh_dict.member_of_metatypes or ver_old_nbh_dict.member_of_metatypes %} + <b>Member of Metatypes:<nbsp></b> {% autoescape off %} + {{ compare_dict.member_of_metatypes }} + {% endautoescape %} + <br/> + {% endif %} + {% if ver_new_nbh_dict.contains_subtypes or ver_old_nbh_dict.contains_subtypes %} + <b>Contain subtypes:<nbsp></b> {% autoescape off %} + {{ compare_dict.contains_subtypes }} + {% endautoescape %} + <br/> + {% endif %} + + {% if ver_old_nbh_dict.contains_members or ver_new_nbh_dict.contains_members %} + <b>Contains Members:<nbsp></b>{% autoescape off %} + {{ compare_dict.contains_members }} {% endautoescape %} <br/> + {% endif %} + {% if ver_new_nbh_dict.priornodes or ver_old_nbh_dict.priornodes %} + <b>Prior nodes:<nbsp></b> {% autoescape off %} + {{ compare_dict.priornodes }} + {% endautoescape %}<br/> + + + {% endif %} + {% if ver_new_nbh_dict.posteriornodes or ver_old_nbh_dict.posteriornodes %} + <b>Posterior nodes:<nbsp></b> {% autoescape off %} + {{ compare_dict.posteriornodes }} + {% endautoescape %}<br/> + + + {% endif %} + + {% if ver_new_nbh_dict.relations or ver_old_nbh_dict.relations %} + {% for relkey,relvalue in compare_dict.relations.items %} + <b>{{relkey}}:<nbsp></b> + {% autoescape off %} + + + {{ relvalue }} + + + {% endautoescape %} + <br/> + {% endfor %} + {% endif %} + + {% if ver_new_nbh_dict.attributes or ver_old_nbh_dict.attributes %} + <b>Attributes:<nbsp></b> {% autoescape off %} + {{ compare_dict.attributes }} + {% endautoescape %}<br/> + {% endif %} - - {% if nt1.get_rendered_nbh.authors %}<b>Authors: <nbsp> </b> - {% endif %} - {% for author in nt1.authors.all %} - <span class="vcard author"> - <a href="{% url gstudio_author_detail author %}" class="fn nickname url" rel="author" - title="{% blocktrans with author as author %}Show {{ author }} nodetypes{% endblocktrans %}">{{ author }}</a> - </span>{% if not forloop.last %}, {% endif %} - {% endfor %} <br/> + + {% if ver_new_nbh_dict.leftroles or ver_old_nbh_dict.leftroles %} + <b>Left roles:<nbsp> </b> {% autoescape off %} + {{ compare_dict.leftroles }} + {% endautoescape %} + <br/> + {% endif %} + {% if ver_new_nbh_dict.rightroles or ver_old_nbh_dict.rightroles %} + <b>Right roles:<nbsp> </b> {% autoescape off %} + {{ compare_dict.rightroles }} + {% endautoescape %} + <br/> + {% endif %} + {% if ver_new_nbh_dict.ats or ver_old_nbh_dict.ats %} + + + <b>Subjecttype of:<nbsp> </b> {% autoescape off %} + {{ compare_dict.ats }} + {% endautoescape %}<br> + {% endif %} + {% if ver_new_nbh_dict.content or ver_old_nbh_dict.content %} + <b> Content:<nbsp></b> {% autoescape off %} + {{ compare_dict.content }} + {% endautoescape %} <br/> + {% endif %} {% endwith %} {% endblock %} {% endblock %} - - </td> - -<!-- <th><b><i><br><u>Difference between Selected Versions</u></b></i><br><br> --> -<!-- {% block content6 %}{% for each in diffs %} --> -<!-- {% autoescape off %} --> -<!-- {{ each }}<br> --> -<!-- {% endautoescape %}{% endfor %} {% endblock %} --> -<!-- </th> --> - - </tr> -<tr><td><input type="button" value="Merge"></input><input type="button" value="RollBack"></input></td> -<td><input type="button" value="Merge"></input><input type="button" value="RollBack"></input></td> </tr> -<!-- <tr><th><b><i>Difference between Selected Versions<b><i><th><tr> --> -<!-- <tr><td><b>{% block content5 %}{% for each in diffs %} --> -<!-- {% autoescape off %} --> -<!-- {{ each }}<br> --> -<!-- {% endautoescape %}{% endfor %} {% endblock %} </b> </td></tr> --> -<!-- </table> --> - - - - - - </body> +<br> +</td></tr> +<tr><td> +<form method="get" action="/nodetypes/display/merge/{{ ssid1 }}/{{ ssid2 }}"> +<input type="submit" value="Merge {{ nt.id }}.{{ version_no1 }} with {{ nt.id }}.{{ version_no2 }}" id="merge1" name="left" ></input></td> +<td><input type="submit" value="Merge {{ nt.id }}.{{ version_no2 }} with {{ nt.id }}.{{ version_no1 }}" id="merge2" name="right"></input></td></form> +</tr> +<tr><td> +<form method="get" action="/nodetypes/display/revert" > +<input type="submit" value="Revert" name="{{ ssid1 }}"></input></td> +<td><input type="submit" value="Revert" name="{{ ssid2 }}"></input></td> +</form></tr> +</table> +</body> </html> |