From f28648fce9a224b6f4c3a24cfaf4b29082dbb775 Mon Sep 17 00:00:00 2001 From: csitifr Date: Mon, 28 May 2012 18:40:43 +0530 Subject: Relation can be now saved and viewed hierachy wise.Attribute does not get saved in duplicate --- gstudio/templates/gstudio/nodetype_detail.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gstudio/templates') 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 %} +{% if user.is_authenticated %}

{% if object.reftype == 'Objecttype' %} Add Attributes: @@ -264,7 +265,7 @@ {{ i }}; {% endfor %} {% endif %} - +{% endif %}

-- cgit v1.1 From adb0662690f845be8524d68cf2aa9f57c10fac13 Mon Sep 17 00:00:00 2001 From: Arun yadav Date: Wed, 30 May 2012 19:01:12 +0530 Subject: Full version control for OTs,Objects,ATs,RTs done.Merge and revert also done.Extra history field added in nbhood --- gstudio/templates/gstudio/display.html | 261 +++++++++++++++------- gstudio/templates/gstudio/skeleton.html | 2 +- gstudio/templates/gstudio/version_diff.html | 333 +++++++++++++++++++++------- 3 files changed, 434 insertions(+), 162 deletions(-) (limited to 'gstudio/templates') 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 @@ - @@ -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() { }); - +
+ + +
{% include "gstudio/_header.html" %} @@ -583,13 +689,8 @@ $(function() { {{ GSTUDIO_VERSION }}.

- + - - - - - diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index 3b945f4..96a2287 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -207,7 +207,7 @@ $(function fgraph() { $.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}}) }); 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 @@

{% block content %} {% block nodetype-content %}

- {{ ver_new.title }} + {{ ver_new_dict.title }} {{ nt.id }}.{{ version_no1 }}

- - - - - - {% with nt1.html_content|safe as object_content %}
- Name:{{ ver_new.title }}
- {% if ver_new.altnames %} - Alternate names:{{ ver_new.altnames }} -
- {% endif %} - {% if ver_new.plural %} - Plural Name:{{ ver_new.plural }}
- {% endif %} - - Content:{{ ver_new.content }}
- + + {% with nt.html_content|safe as object_content %}
- {% if nt1.get_rendered_nbh.authors %}Authors: - {% endif %} - {% for author in nt1.authors.all %} - - - {% if not forloop.last %}, {% endif %} - {% endfor %}
- {% endwith %} - {% endblock %} - {% endblock %} + Name: {{ ver_new_nbh_dict.title }}
+ + {% if ver_new_nbh_dict.plural or ver_old_nbh_dict.plural %} + Plural Name: + {{ ver_new_nbh_dict.plural}}
+ {% endif %} + {% if ver_new_nbh_dict.altnames or ver_old_nbh_dict.altnames%} + Alternate names: + {{ ver_new_nbh_dict.altnames}}
+ {% endif %} + {% if ver_new_nbh_dict.type_of or ver_old_nbh_dict.type_of %} + Type of: + {% for typekey,typevalue in ver_new_nbh_dict.type_of.items %} + {{typekey}}; + {% endfor %}
+ {% endif %} + + + {% if ver_new_nbh_dict.member_of_metatypes or ver_old_nbh_dict.member_of_metatypes %} + + + Member of Metatypes: + {% for mkey,mvalue in ver_new_nbh_dict.member_of_metatypes.items %} + {{mkey}}; + {% endfor %}
+ {% endif %} + + + + {% if ver_new_nbh_dict.contains_subtypes or ver_old_nbh_dict.contains_subtypes %} + Contains SubTypes: + {% for stkey,stvalue in ver_new_nbh_dict.items %} + {{stkey}}; + {% endfor %}
+ {% endif %} + + + {% if ver_new_nbh_dict.contains_members or ver_old_nbh_dict.contains_members %} + + + Contains Members: + {% for mkey,mvalue in ver_new_nbh_dict.contains_members.items %} + {{mkey}}; + {% endfor %}
+ {% endif %} + + + + + + + + + + + + + + + + + + + + + {% if ver_new_nbh_dict.priornodes or ver_old_nbh_dict.priornodes %} + + + Prior nodes: + {% for mkey,mvalue in ver_new_nbh_dict.items %} + {{mkey}}; + {% endfor %}
+ {% endif %} + + {% if ver_new_nbh_dict.posteriornodes or ver_old_nbh_dict.posteriornodes %} + + + Posterior nodes: + {% for mkey,mvalue in ver_new_nbh_dict.items %} + {{mkey}}; + {% endfor %}
+ {% endif %} + + {% if ver_new_nbh_dict.relations or ver_old_nbh_dict.relations %} + + + {% for relkey,relvalue in ver_new_nbh_dict.relations.items %} + {{relkey}}: + {% for relk, relv in relvalue.items %} + {{relk}}; + {% endfor %}
+ {% 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 %} + {{atkey}}: + {% for atr in atvalue %} + {{atr}}; + {% endfor %}
+ {% endif %} + {% endfor %} + {% endif %} + {% if ver_new_nbh_dict.leftroles or ver_old_nbh_dict.leftroles %} + + + Left roles: + + {% for lrkey,lrvalue in ver_new_nbh_dict.leftroles.items %} + {{lrkey}}; + {% endfor %}
+ {% endif %} + + {% if ver_new_nbh_dict.rightroles or ver_old_nbh_dict.rightroles %} + + Right roles: + + {% for rrkey,rrvalue in ver_new_nbh_dict.rightroles.items %} + {{rrkey}}; + {% endfor %}
+ {% endif %} + + + {% if ver_new_nbh_dict.ats or ver_old_nbh_dict.ats %} + + + Subjecttype of: + + {% for atkey,atvalue in ver_new_nbh_dict.ats.items %} + {{atkey}}; + {% endfor %}
+ {% endif %} + + {% if ver_new_nbh_dict.content or ver_old_nbh_dict.content %} + Content:{{ ver_new_nbh_dict.content }} + {% endif %} + + {% endwith %} + {% endblock %} + {% endblock %} @@ -147,71 +263,126 @@

{% block content1 %} {% block nodetype-content1 %}

- {{ ver_old.title }} + {{ ver_old_dict.title }} {{ nt.id }}.{{ version_no2 }} -

- - - - -
- {% with nt1.html_content|safe as object_content %} +
+ {% with nt.html_content|safe as object_content %} + Name:{% autoescape off %} - {{ diffs.0 }} + {{ compare_dict.title }} {% endautoescape %}
- {% if ver_old.altnames %} + {% if ver_old_nbh_dict.plural or ver_new_nbh_dict.plural %} + Plural Name: {% autoescape off %} + {{ compare_dict.plural }} + {% endautoescape %}
+ {% endif %} + {% if ver_old_nbh_dict.altnames or ver_new_nbh_dict.altnames %} Alternate names: {% autoescape off %} - {{ diffs.1 }} + {{ compare_dict.altnames }} {% endautoescape %}
{% endif %} - {% if ver_old.plural %} - Plural Name: {% autoescape off %} - {{ diffs.2 }} - {% endautoescape %}
+ {% if ver_new_nbh_dict.type_of or ver_old_nbh_dict.type_of %} + Type of: {% autoescape off %} + {{ compare_dict.type_of }} + {% endautoescape %} +
{% endif %} - - Content: {% autoescape off %} - {{ diffs.3 }} + {% if ver_new_nbh_dict.member_of_metatypes or ver_old_nbh_dict.member_of_metatypes %} + Member of Metatypes: {% autoescape off %} + {{ compare_dict.member_of_metatypes }} + {% endautoescape %} +
+ {% endif %} + {% if ver_new_nbh_dict.contains_subtypes or ver_old_nbh_dict.contains_subtypes %} + Contain subtypes: {% autoescape off %} + {{ compare_dict.contains_subtypes }} + {% endautoescape %} +
+ {% endif %} + + {% if ver_old_nbh_dict.contains_members or ver_new_nbh_dict.contains_members %} + Contains Members:{% autoescape off %} + {{ compare_dict.contains_members }} {% endautoescape %}
+ {% endif %} + {% if ver_new_nbh_dict.priornodes or ver_old_nbh_dict.priornodes %} + Prior nodes: {% autoescape off %} + {{ compare_dict.priornodes }} + {% endautoescape %}
+ + + {% endif %} + {% if ver_new_nbh_dict.posteriornodes or ver_old_nbh_dict.posteriornodes %} + Posterior nodes: {% autoescape off %} + {{ compare_dict.posteriornodes }} + {% endautoescape %}
+ + + {% endif %} + + {% if ver_new_nbh_dict.relations or ver_old_nbh_dict.relations %} + {% for relkey,relvalue in compare_dict.relations.items %} + {{relkey}}: + {% autoescape off %} + + + {{ relvalue }} + + + {% endautoescape %} +
+ {% endfor %} + {% endif %} + + {% if ver_new_nbh_dict.attributes or ver_old_nbh_dict.attributes %} + Attributes: {% autoescape off %} + {{ compare_dict.attributes }} + {% endautoescape %}
+ {% endif %} - - {% if nt1.get_rendered_nbh.authors %}Authors: - {% endif %} - {% for author in nt1.authors.all %} - - - {% if not forloop.last %}, {% endif %} - {% endfor %}
+ + {% if ver_new_nbh_dict.leftroles or ver_old_nbh_dict.leftroles %} + Left roles: {% autoescape off %} + {{ compare_dict.leftroles }} + {% endautoescape %} +
+ {% endif %} + {% if ver_new_nbh_dict.rightroles or ver_old_nbh_dict.rightroles %} + Right roles: {% autoescape off %} + {{ compare_dict.rightroles }} + {% endautoescape %} +
+ {% endif %} + {% if ver_new_nbh_dict.ats or ver_old_nbh_dict.ats %} + + + Subjecttype of: {% autoescape off %} + {{ compare_dict.ats }} + {% endautoescape %}
+ {% endif %} + {% if ver_new_nbh_dict.content or ver_old_nbh_dict.content %} + Content: {% autoescape off %} + {{ compare_dict.content }} + {% endautoescape %}
+ {% endif %} {% endwith %} {% endblock %} {% endblock %} - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + +
+ +
+ + +
+ + +
+ + -- cgit v1.1