diff options
Diffstat (limited to 'objectapp')
-rwxr-xr-x | objectapp/createhtml.py | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js | 0 | ||||
-rw-r--r-- | objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js | 33 | ||||
-rw-r--r-- | objectapp/templates/objectapp/_gbobject_detail.html | 111 | ||||
-rw-r--r-- | objectapp/templates/objectapp/tags/recent_gbobjects.html | 97 | ||||
-rw-r--r-- | objectapp/templates/objectapp/version_diff.html | 4 | ||||
-rw-r--r-- | objectapp/templatetags/objectapp_tags.py | 25 |
7 files changed, 252 insertions, 20 deletions
diff --git a/objectapp/createhtml.py b/objectapp/createhtml.py index 7841408..666cc74 100755 --- a/objectapp/createhtml.py +++ b/objectapp/createhtml.py @@ -6,7 +6,7 @@ import commands def main(argv): #f_name =sys.argv[1] - f_name = "/tmp/file.org" + f_name = sys.argv[2]+sys.argv[1] s1='commands.getoutput("emacs --batch ' s2=" --eval '" s3="(org-export-as-html nil)'" diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js b/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js index c766300..c766300 100755..100644 --- a/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js +++ b/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js index eaf728c..2fb78ed 100644 --- a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js +++ b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js @@ -6,8 +6,39 @@ document.getElementById('gnoweditor').style.visibility="visible"; $("#gnoweditor").orgitdown(mySettings); $("#gnoweditor").val(orgdata); + $("#editdata").hide(); + $("#savecontent").show(); }); - + $("#savecontent").one("click",function() { + var org_data = $("#gnoweditor").val(); + var id = document.getElementById("objectid").value + document.getElementById("orgcontent").value = org_data; + var encode_data = encodeURIComponent(org_data); + $("#savecontent").hide(); + $.ajax({ + url: '/nodetypes/ajax/contentorgadd/?id=' + id + '&contentorg=' + encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatefile/?id=' +id+ '&content_org=' +encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatehtml/', + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/contentadd/?id=' +id, + success: function(data) { + // alert("Data Saved"); + location.reload();} + }); + } + }); + } + }); + + } + }); + + }); }); diff --git a/objectapp/templates/objectapp/_gbobject_detail.html b/objectapp/templates/objectapp/_gbobject_detail.html index a070716..89d8650 100644 --- a/objectapp/templates/objectapp/_gbobject_detail.html +++ b/objectapp/templates/objectapp/_gbobject_detail.html @@ -1,15 +1,104 @@ {% load tagging_tags comments i18n %} +{% load i18n gstudio_tags %} +<script type="text/javascript" > +$(window).load(function() { + + $("#savecontent").hide(); +}); +</script> <div id="gbobject-{{ object.pk }}" class="hgbobject{% if object.featured %} featured{% endif %} span-16 last"> <div class="gbobject-header span-16 last"> - <h2 class="gbobject-title"> - <a href="{{ object.get_absolute_url }}" title="{{ object.title }}" rel="bookmark"> - {{ object.title }} - </a><a href="{{ object.ref.get_edit_url }}" target="_blank" >[edit]</a> + <h2 class="nodetype-title"> + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-document' %} + <a href="/gstudio/resources/documents/show/{{object.id}}">{{object.title}}</a> <font size="2" color="black"> is a Document</font> + + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-image' %} + <a href="/gstudio/resources/images/show/{{object.id}}">{{object.title}}</a> <font size="2" color="black"> is an Image</font> + + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-video' %} + <a href="/gstudio/resources/videos/show/{{object.id}}">{{object.title}}</a> <font size="2" color="black"> is a Video</font> + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-topic' %} + <a href="/gstudio/{% show_nodesystem object.id %}">{{object.title}}</a> <font size="2" color="black">is a Topic of a Loom-thread</font> + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-section' %} + <a href="/gstudio/{% show_nodesystem object.id %}">{{object.title}}</a> <font size="2" color="black"> is a Section of a wiki-page</font> + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-reply' %} + + {% for eachobject in object.ref.prior_nodes.all %} + {% if eachobject.ref.prior_nodes.all %} + {% for eachobject1 in eachobject.ref.prior_nodes.all %} + {% if eachobject1.ref.prior_nodes.all %} + {% for eachobject2 in eachobject1.ref.prior_nodes.all %} + <a href="/gstudio/{% show_nodesystem eachobject2.id %}">{{object.title}}</a> <font size="2" color="black">is a Reply</font> + {% endfor %} + {% else %} + <a href="/gstudio/{% show_nodesystem eachobject1.id %}">{{object.title}}</a> <font size="2" color="black">is a Reply </font> + {% endif %} + {% endfor %} + {% else %} + <a href="/gstudio/{% show_nodesystem eachobject.id %}">{{object.title}}</a> <font size="2" color="black"> is a Reply </font> + {% endif %} + + {% endfor %} + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-subsection' %} + {% for eachobject in object.ref.prior_nodes.all %} + <a href="/gstudio/{% show_nodesystem eachobject.id %}">{{object.title}}</a> <font size="2" color="black"> is a Subsection of a Section wiki-page</font> + {% endfor %} + {% else %} +<a href="{{ object.get_absolute_url }}" title="{{ object.title }}" rel="bookmark" id = "{{object.id}}awikiloom"> {{ object.title }} </a><font size="2" color="black"> +<script type="text/javascript" > +var a = "{% show_nodesystem object.id %}" +if (a != "") +{ +document.getElementById("{{object.id}}awikiloom").setAttribute("href","/gstudio/"+a); +space = a.replace( "/", " " ); +b = space.match("group") +c = space.match("page") +if(b == "group"){ +document.write("is a Loom thread" ); +} +if(c == "page"){ +document.write("is a Wiki page" ); +} + +} +else +{ +var e; +e = "{{ object.nodemodel}}"; +if(e == "Gbobject") +{document.write("is an Object"); +} +else +{ +document.write("is a {{object.nodemodel}}"); +} +} +</script> +</font> + + + +{% endifequal %} +{% endifequal %} +{% endifequal %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + + +<!-- <a href="{{ object.ref.get_edit_url }}" target="_blank" >[edit]</a> --> </h2> <table border="1" cellspacing="0"> - + <b>Versions: </b> {% for sid in object.ref.get_ssid %} @@ -19,9 +108,9 @@ </table> <p class="gbobject-info"> - {% if object.authors.count %} + {% if object.ref.authors.count %} {% trans "Written by" %} - {% for author in object.authors.all %} + {% for author in object.ref.authors.all %} <span class="vcard author"> <a href="{% url objectapp_author_detail author %}" class="fn nickname url" rel="author" title="{% blocktrans with author as author %}Show {{ author }} gbobjects{% endblocktrans %}">{{ author }}</a> @@ -67,8 +156,8 @@ <b> Content:<nbsp> - <input type="button" id="editdata" value="Edit Content"/><ndsp><nbsp> - <input type="button" id="savecontent" value="Save Content"/><ndsp><nbsp> + <!-- <input type="button" id="editdata" value="Edit Content"/><nbsp><nbsp> + <input type="button" id="savecontent" value="Save Content"/>--> <input type="hidden" id="objectid" value="{{object.id}}"/> <input type="hidden" id="title" value="{{object.title}}"/> @@ -80,8 +169,8 @@ {% else %} <b> - Content:<nbsp> <input type="button"id="editdata"value="Edit Content"/><ndsp><nbsp> - + Content:<nbsp> <!--<input type="button"id="editdata"value="Edit Content"/><nbsp><nbsp> + <input type="button" id="savecontent" value="Save Content"/>--> <input type="hidden" id="objectid" value="{{object.id}}"/> <input type="hidden" id="title" value="{{object.title}}"/> diff --git a/objectapp/templates/objectapp/tags/recent_gbobjects.html b/objectapp/templates/objectapp/tags/recent_gbobjects.html index 9e9c924..25fc6a7 100644 --- a/objectapp/templates/objectapp/tags/recent_gbobjects.html +++ b/objectapp/templates/objectapp/tags/recent_gbobjects.html @@ -1,9 +1,102 @@ {% load i18n %} +{% load i18n gstudio_tags %} <ul> - {% for gbobject in gbobjects %} + {% for object in gbobjects %} + {% ifequal object.title|truncatewords:"3" 'page box of ...' %} + {% else %} + {% ifequal object.title|truncatewords:"3" 'message box of ...' %} + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-video' %} + {% else %} <li> - <a href="{{ gbobject.get_absolute_url }}" title="{{ gbobject.title }}" rel="bookmark">{{ gbobject.title }}</a> + + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-document' %} + <a href="/gstudio/resources/documents/show/{{object.id}}">{{object.title}}</a> <font size="2" color="black"> is a Document</font> + + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-image' %} + <a href="/gstudio/resources/images/show/{{object.id}}">{{object.title}}</a> <font size="2" color="black"> is an Image</font> + + {% else %} + + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-topic' %} + <a href="/gstudio/{% show_nodesystem object.id %}">{{object.title}}</a> <font size="2" color="black">is a Topic of a Loom-thread</font> + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-section' %} + <a href="/gstudio/{% show_nodesystem object.id %}">{{object.title}}</a> <font size="2" color="black"> is a Section of a wiki-page</font> + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-reply' %} + + {% for eachobject in object.ref.prior_nodes.all %} + {% if eachobject.ref.prior_nodes.all %} + {% for eachobject1 in eachobject.ref.prior_nodes.all %} + {% if eachobject1.ref.prior_nodes.all %} + {% for eachobject2 in eachobject1.ref.prior_nodes.all %} + <a href="/gstudio/{% show_nodesystem eachobject2.id %}">{{object.title}}</a> <font size="2" color="black">is a Reply</font> + {% endfor %} + {% else %} + <a href="/gstudio/{% show_nodesystem eachobject1.id %}">{{object.title}}</a> <font size="2" color="black">is a Reply </font> + {% endif %} + {% endfor %} + {% else %} + <a href="/gstudio/{% show_nodesystem eachobject.id %}">{{object.title}}</a> <font size="2" color="black"> is a Reply </font> + {% endif %} + + {% endfor %} + {% else %} + {% ifequal object.ref.get_nbh.member_of|slugify 'nodetype-ot-subsection' %} + {% for eachobject in object.ref.prior_nodes.all %} + <a href="/gstudio/{% show_nodesystem eachobject.id %}">{{object.title}}</a> <font size="2" color="black"> is a Subsection of a Section wiki-page</font> + {% endfor %} + {% else %} +<a href="{{ object.get_absolute_url }}" title="{{ object.title }}" rel="bookmark" id = "{{object.id}}awikiloom"> {{ object.title }} </a><font size="2" color="black"> +<script type="text/javascript" > +var a = "{% show_nodesystem object.id %}" +if (a != "") +{ +document.getElementById("{{object.id}}awikiloom").setAttribute("href","/gstudio/"+a); +space = a.replace( "/", " " ); +b = space.match("group") +c = space.match("page") +if(b == "group"){ +document.write("is a Loom thread" ); +} +if(c == "page"){ +document.write("is a Wiki page" ); +} + +} +else +{ +var e; +e = "{{ object.nodemodel}}"; +if(e == "Gbobject") +{document.write("is an Object"); +} +else +{ +document.write("is a {{object.nodemodel}}"); +} +} +</script> +</font> + + + + +{% endifequal %} +{% endifequal %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + + + <!-- <a href="{{ gbobject.get_absolute_url }}" title="{{ gbobject.title }}" rel="bookmark">{{ gbobject.title }}</a>--> </li> + {% endifequal %} +{% endifequal %} +{% endifequal %} {% empty %} <li> {% trans "No gbobjects yet." %} diff --git a/objectapp/templates/objectapp/version_diff.html b/objectapp/templates/objectapp/version_diff.html index a552b5c..b798dcc 100644 --- a/objectapp/templates/objectapp/version_diff.html +++ b/objectapp/templates/objectapp/version_diff.html @@ -250,8 +250,8 @@ </tr> <tr><td> <form method="get" action="/objects/display/revert" > -<input type="submit" value="Revert" name="{{ ssid1 }}"></input></td> -<td><input type="submit" value="Revert" name="{{ ssid2 }}"></input></td> +<input type="submit" value="Revert to {{ nt.id }}.{{ version_no1 }}" name="{{ ssid1 }}"></input></td> +<td><input type="submit" value="Revert to {{ nt.id }}.{{ version_no2 }}" name="{{ ssid2 }}"></input></td> </form></tr> </table> </body> diff --git a/objectapp/templatetags/objectapp_tags.py b/objectapp/templatetags/objectapp_tags.py index 209223c..9a368b5 100644 --- a/objectapp/templatetags/objectapp_tags.py +++ b/objectapp/templatetags/objectapp_tags.py @@ -96,17 +96,36 @@ def get_this_nodes_uri(name): @register.inclusion_tag('objectapp/tags/dummy.html') -def get_authors(template='objectapp/tags/authors.html'): +def get_authors(number=5, template='objectapp/tags/authors.html'): """Return the published authors""" return {'template': template, - 'authors': Author.published.all()} + 'authors': Author.published.all()[:number]} @register.inclusion_tag('objectapp/tags/dummy.html') def get_recent_gbobjects(number=5, template='objectapp/tags/recent_gbobjects.html'): + i = 0 + j = 0 + a = 12 + gb = Gbobject.published.all()[:60] + for objects in gb: + varobj = str(objects.ref.get_nbh['member_of']) + if 'page box of' in objects.title: + i = i + 1 + elif 'message box of' in objects.title: + i = i + 1 + elif "[<Nodetype: OT: Video>]" == varobj: + i = i + 1 + else: + j = j + 1 + + if j == 12: + break + + """Return the most recent gbobjects""" return {'template': template, - 'gbobjects': Gbobject.published.all()[:number]} + 'gbobjects': Gbobject.published.all()[:a + i]} @register.inclusion_tag('objectapp/tags/dummy.html') |