From 94535d4adc3a4960795d22e3b229a8375de10b74 Mon Sep 17 00:00:00 2001
From: supriya
Date: Wed, 26 Sep 2012 15:49:52 +0530
Subject: all modules integrated
---
gstudio/createhtml.py | 2 +-
gstudio/forms.py | 8 +
gstudio/methods.py | 386 +++++++++++++++++----
gstudio/static/gstudio/js/addcontent.js | 363 ++++++++++---------
gstudio/static/gstudio/js/loomscripts.js | 201 +++++++++++
.../js/orgitdown/orgitdown/jquery.orgitdown.js | 44 ++-
.../orgitdown/orgitdown/sets/org/images/close.jpeg | Bin 0 -> 418 bytes
.../gstudio/js/orgitdown/orgitdown/sets/org/set.js | 13 +-
.../js/orgitdown/orgitdown/sets/savedata.js | 4 +
gstudio/templates/gstudio/NewGroup.html | 90 ++++-
gstudio/templates/gstudio/NewPage.html | 1 +
gstudio/templates/gstudio/NewSection1.html | 2 +
gstudio/templates/gstudio/NewTopic1.html | 11 +-
gstudio/templates/gstudio/_header.html | 17 +-
gstudio/templates/gstudio/_nodetype_detail.html | 100 +++++-
gstudio/templates/gstudio/docu.html | 43 ++-
gstudio/templates/gstudio/fulldocument.html | 177 ++++++++++
gstudio/templates/gstudio/fullscreen.html | 26 +-
gstudio/templates/gstudio/home.html | 70 ++--
gstudio/templates/gstudio/image.html | 28 +-
gstudio/templates/gstudio/more.html | 209 ++++-------
gstudio/templates/gstudio/nodes_search.html | 7 +
gstudio/templates/gstudio/nodetype_detail.html | 55 ++-
gstudio/templates/gstudio/nodetype_search.html | 9 +
gstudio/templates/gstudio/skeleton.html | 53 +--
gstudio/templates/gstudio/tags/comment.html | 113 +++---
gstudio/templates/gstudio/tags/commentpage.html | 69 +---
gstudio/templates/gstudio/transcript.html | 62 +++-
gstudio/templates/gstudio/version_diff.html | 4 +-
gstudio/templates/gstudio/video.html | 31 +-
gstudio/templates/metadashboard/grpdashboard.html | 144 ++++++--
gstudio/templates/metadashboard/pgedashboard.html | 115 +++---
gstudio/templates/metadashboard/userdashboard.html | 15 +-
gstudio/templates/metadashboard/wikidashboard.html | 8 +-
gstudio/templatetags/gstudio_tags.py | 47 ++-
gstudio/urls/__init__.py | 15 +-
gstudio/urls/docu.py | 2 +-
gstudio/urls/image.py | 2 +-
gstudio/urls/video.py | 2 +-
gstudio/views/ajaxviews.py | 26 +-
gstudio/views/docu.py | 163 +++++++--
gstudio/views/group.py | 39 ++-
gstudio/views/groupadd.py | 5 +-
gstudio/views/image.py | 177 +++++++---
gstudio/views/nodetypes.py | 16 +
gstudio/views/page.py | 36 +-
gstudio/views/pageadd.py | 16 +-
gstudio/views/sectionadd1.py | 5 +-
gstudio/views/topicadd.py | 2 +-
gstudio/views/topicadd1.py | 5 +-
gstudio/views/user.py | 24 +-
gstudio/views/video.py | 326 +++++++++++------
gstudio/xmlrpc/metaweblog.py | 1 +
53 files changed, 2397 insertions(+), 992 deletions(-)
create mode 100644 gstudio/static/gstudio/js/loomscripts.js
mode change 100755 => 100644 gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js
create mode 100644 gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/images/close.jpeg
create mode 100644 gstudio/templates/gstudio/fulldocument.html
(limited to 'gstudio')
diff --git a/gstudio/createhtml.py b/gstudio/createhtml.py
index 7841408..666cc74 100755
--- a/gstudio/createhtml.py
+++ b/gstudio/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/gstudio/forms.py b/gstudio/forms.py
index eee5ec1..0cf9ccc 100644
--- a/gstudio/forms.py
+++ b/gstudio/forms.py
@@ -20,10 +20,18 @@ from django.forms import ModelForm
from django.forms import *
from django.contrib.admin import widgets
from registration.forms import *
+from recaptcha import fields as recaptcha_fields
+from registration.forms import RegistrationForm
+
+class RecaptchaRegistrationForm(RegistrationForm):
+ recaptcha = recaptcha_fields.ReCaptchaField()
+
class UserRegistrationForm(RegistrationForm):
first_name = forms.CharField()
last_name = forms.CharField()
+ recaptcha = recaptcha_fields.ReCaptchaField()
+
class MetatypeForm(ModelForm):
diff --git a/gstudio/methods.py b/gstudio/methods.py
index bdcc5ad..b0b75d3 100644
--- a/gstudio/methods.py
+++ b/gstudio/methods.py
@@ -4,6 +4,7 @@ from django.template.defaultfilters import slugify
import datetime
import os
from demo.settings import PYSCRIPT_URL_GSTUDIO
+from demo.settings import FILE_URL
def delete(idnum):
@@ -11,28 +12,42 @@ def delete(idnum):
del_ob.delete()
return True
-def make_rep_object(title,auth_id):
+def make_rep_object(title,auth_id,usr):
new_ob = Gbobject()
- new_ob.content_org=title
- myfile = open('/tmp/file.org', 'w')
+ new_ob.title = "Re: "
+ new_ob.slug=slugify(new_ob.title)
+ new_ob.save()
+ titleid = "Re:"+str(new_ob.id)
+ contorg = unicode(title)
+ fname=slugify(titleid)+"-"+usr
+ new_ob.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
myfile.write(new_ob.content_org)
myfile.close()
- myfile = open('/tmp/file.org', 'r')
- myfile.readline()
- myfile = open('/tmp/file.org', 'a')
- myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
myfile.write("\n#+TITLE: ")
- myfile = open('/tmp/file.org', 'r')
- stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
output = stdout.read()
- data = open("/tmp/file.html")
+
+ data = open(os.path.join(FILE_URL,fname+html))
data1 = data.readlines()
- data2 = data1[67:]
+ data2 = data1[72:]
+ data3 = data2[:-3]
newdata=""
- for line in data2:
+ for line in data3:
newdata += line.lstrip()
new_ob.content = newdata
- new_ob.title = "Re: " +title
+ new_ob.title = "Re: "
new_ob.status = 2
new_ob.slug = slugify(title)
new_ob.save()
@@ -41,27 +56,73 @@ def make_rep_object(title,auth_id):
new_ob.sites.add(Site.objects.get_current())
return new_ob
-def make_topic_object(title,auth_id,content):
- print "save"
+def edit_section(sec_id,title,usr):
+ new_ob = Gbobject.objects.get(id=int(sec_id))
+ contorg = unicode(title)
+ new_ob.content_org=contorg.encode('utf8')
+ ssid=new_ob.get_ssid.pop()
+ fname=str(ssid)+"-"+usr
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(new_ob.content_org)
+ myfile.close()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile.write("\n#+TITLE: ")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
+ output = stdout.read()
+ data = open(os.path.join(FILE_URL,fname+html))
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ new_ob.content = newdata
+ new_ob.save()
+ return True
+
+
+def make_topic_object(title,auth_id,content,usr):
new_ob = Gbobject()
- new_ob.title = "Query: " + title
- new_ob.content_org = content
- myfile = open('/tmp/file.org', 'w')
+ new_ob.title = "Twist: " + title
+ contorg = unicode(content)
+ fname=slugify(title)+"-"+usr
+ new_ob.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
myfile.write(new_ob.content_org)
myfile.close()
- myfile = open('/tmp/file.org', 'r')
- myfile.readline()
- myfile = open('/tmp/file.org', 'a')
- myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
myfile.write("\n#+TITLE: ")
- myfile = open('/tmp/file.org', 'r')
- stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
output = stdout.read()
- data = open("/tmp/file.html")
+ data = open(os.path.join(FILE_URL,fname+html))
data1 = data.readlines()
- data2 = data1[67:]
+ data2 = data1[72:]
+ data3 = data2[:-3]
newdata=""
- for line in data2:
+ for line in data3:
newdata += line.lstrip()
new_ob.content = newdata
new_ob.status = 2
@@ -73,28 +134,39 @@ def make_topic_object(title,auth_id,content):
new_ob.sites.add(Site.objects.get_current())
return new_ob
-def make_sectionreply_object(content_org,title,auth_id):
+def make_sectionreply_object(content_org,title,auth_id,usr):
new_ob = Gbobject()
new_ob.title = title
new_ob.status = 2
new_ob.slug = slugify(title)
- new_ob.content_org = content_org
- myfile = open('/tmp/file.org', 'w')
+ contorg = unicode(content_org)
+ fname=slugify(title)+"-"+usr
+
+ new_ob.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
myfile.write(new_ob.content_org)
myfile.close()
- myfile = open('/tmp/file.org', 'r')
- myfile.readline()
- myfile = open('/tmp/file.org', 'a')
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
myfile.write("\n#+TITLE: ")
- myfile = open('/tmp/file.org', 'r')
- stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
output = stdout.read()
- data = open("/tmp/file.html")
+ data = open(os.path.join(FILE_URL,fname+html))
data1 = data.readlines()
- data2 = data1[67:]
+ data2 = data1[72:]
+ data3 = data2[:-3]
newdata=""
- for line in data2:
+ for line in data3:
newdata += line.lstrip()
new_ob.content = newdata
myfile = open('/tmp/file.org', 'w')
@@ -107,29 +179,39 @@ def make_sectionreply_object(content_org,title,auth_id):
return new_ob
-def make_section_object(title,auth_id,content_org):
+def make_section_object(title,auth_id,content_org,usr):
new_ob = Gbobject()
new_ob.title = title
new_ob.status = 2
new_ob.slug = slugify(title)
+ fname=slugify(title)+"-"+usr
#new_ob.content = content
- new_ob.content_org = content_org
- myfile = open('/tmp/file.org', 'w')
+ contorg = unicode(content_org)
+ new_ob.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
myfile.write(new_ob.content_org)
myfile.close()
- myfile = open('/tmp/file.org', 'r')
- myfile.readline()
- myfile = open('/tmp/file.org', 'a')
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
myfile.write("\n#+TITLE: ")
- myfile = open('/tmp/file.org', 'r')
- stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
output = stdout.read()
- data = open("/tmp/file.html")
+ data = open(os.path.join(FILE_URL,fname+html))
data1 = data.readlines()
- data2 = data1[67:]
+ data2 = data1[72:]
+ data3 = data2[:-3]
newdata=""
- for line in data2:
+ for line in data3:
newdata += line.lstrip()
new_ob.content = newdata
new_ob.save()
@@ -139,15 +221,18 @@ def make_section_object(title,auth_id,content_org):
return new_ob
-def make_relation(rep,id_no,idusr):
- r = make_rep_object(rep,idusr)
+def make_relation(rep,id_no,idusr,usr):
+ r = make_rep_object(rep,idusr,usr)
t = Gbobject.objects.get(id=id_no)
t.posterior_nodes.add(r)
r.prior_nodes.add(t)
+ r.title="Re:"+str(r.id)+t.title
+ r.slug=slugify(r.title)
+ r.save()
return True
-def make_sectionrelation(rep,ptitle,id_no,idusr):
- r = make_sectionreply_object(rep,ptitle,idusr)
+def make_sectionrelation(rep,ptitle,id_no,idusr,usr):
+ r = make_sectionreply_object(rep,ptitle,idusr,usr)
t = Gbobject.objects.get(id=id_no)
t.posterior_nodes.add(r)
r.prior_nodes.add(t)
@@ -166,11 +251,39 @@ def rate_section(section_id,request,rating):
-def create_meeting(title,idusr,content):
+def create_meeting(title,idusr,content,usr):
sys = System()
sys.title = title
sys.status = 2
- sys.content = content
+ contorg = unicode(content)
+ sys.content_org=contorg.encode('utf8')
+ fname=slugify(title)+"-"+usr
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(sys.content_org)
+ myfile.close()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+# myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile.write("\n#+TITLE: ")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
+ output = stdout.read()
+ data = open(os.path.join(FILE_URL,fname+html))
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ sys.content = newdata
sys.slug = slugify(title)
sys.save()
sys.systemtypes.add(Systemtype.objects.get(title="Meeting"))
@@ -189,38 +302,48 @@ def create_meeting(title,idusr,content):
sys1.title = "message box of " + title
sys1.status = 2
sys1.content = "contains messages of " + title
- sys1.slug = slugify(title)
+ sys1.slug = "message_box_of_" + slugify(title)
sys1.save()
sys1.systemtypes.add(Systemtype.objects.get(title="message_box"))
sys.system_set.add(sys1)
sys.member_set.add(Author.objects.get(id=idusr))
sys.sites.add(Site.objects.get_current())
sys1.sites.add(Site.objects.get_current())
- return sys.id
+ return sys.id
-def create_wikipage(title,idusr,content_org):
+
+
+def create_wikipage(title,idusr,content_org,usr):
sys = System()
sys.title = title
sys.status = 2
contorg = unicode(content_org)
- sys.content_org = contorg.encode('utf8')
-
- myfile = open('/tmp/file.org', 'w')
+ sys.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ fname=slugify(title)+"-"+usr
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
myfile.write(sys.content_org)
myfile.close()
- myfile = open('/tmp/file.org', 'r')
- myfile.readline()
- myfile = open('/tmp/file.org', 'a')
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
myfile.write("\n#+TITLE: ")
- myfile = open('/tmp/file.org', 'r')
- stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
output = stdout.read()
- data = open("/tmp/file.html")
+ data = open(os.path.join(FILE_URL,fname+html))
data1 = data.readlines()
- data2 = data1[67:]
+ data2 = data1[72:]
+ data3 = data2[:-3]
newdata=""
- for line in data2:
+ for line in data3:
newdata += line.lstrip()
sys.content = newdata
sys.slug = slugify(title)
@@ -241,7 +364,7 @@ def create_wikipage(title,idusr,content_org):
sys1.title = "page box of " + title
sys1.status = 2
sys1.content = "contains pages of " + title
- sys1.slug = slugify(title)
+ sys1.slug = "page_box_of_" + slugify(title)
sys1.save()
sys1.systemtypes.add(Systemtype.objects.get(title="page_box"))
sys.system_set.add(sys1)
@@ -338,3 +461,126 @@ def del_section(section_id):
del_comment(each.id)
ob.delete()
return True
+
+def edit_topic(topic_id,title,usr):
+ ob=Gbobject.objects.get(id=int(topic_id))
+ contorg = unicode(title)
+ ob.content_org=contorg.encode('utf8')
+ ssid=ob.get_ssid.pop()
+ fname=str(ssid)+"-"+usr
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(ob.content_org)
+ myfile.close()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile.write("\n#+TITLE: ")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
+ output = stdout.read()
+ data = open(os.path.join(FILE_URL,fname+html))
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ ob.content = newdata
+ ob.save()
+ return True
+
+def edit_thread(thread_id,title,usr):
+ ob=System.objects.get(id=int(thread_id))
+ contorg = unicode(title)
+ ssid=ob.get_ssid.pop()
+ fname=str(ssid)+"-"+usr
+ ob.content_org=contorg.encode('utf8')
+ ext='.org'
+ html='.html'
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(ob.content_org)
+ myfile.close()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+ #myfile.readline()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile.write("\n#+TITLE: ")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
+ output = stdout.read()
+ data = open(os.path.join(FILE_URL,fname+html))
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ ob.content = newdata
+ ob.save()
+
+ return True
+
+def edit_nodetype(iden,rep,usr):
+ nid = NID.objects.get(id = iden)
+ ssid=nid.get_ssid.pop()
+ fname=str(ssid)+"-"+usr
+ refobj = nid.ref
+ refobj.content_org = rep
+ #orgcontent = request.GET["content_org"]
+ ext='.org'
+ html='.html'
+ #usr=str(request.user)
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(refobj.content_org)
+ myfile.close()
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ rfile=myfile.readlines()
+ scontent="".join(rfile)
+ newcontent=scontent.replace("\r","")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'w')
+ myfile.write(newcontent)
+
+ myfile = open(os.path.join(FILE_URL,fname+ext),'a')
+ myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t")
+ myfile.write("\n#+TITLE: ")
+ myfile = open(os.path.join(FILE_URL,fname+ext),'r')
+ stdout = os.popen("%s %s %s"%(PYSCRIPT_URL_GSTUDIO,fname+ext,FILE_URL))
+ output = stdout.read()
+ data = open(os.path.join(FILE_URL,fname+html))
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ refobj.content= newdata
+ refobj.save()
+ return True
+
+def check_release_or_not(meet_ob):
+ fl = 0
+ for each in meet_ob.subject_of.all():
+ if (each.attributetype.title=='release' and each.svalue=='true'):
+ fl=1
+ return fl
+
+def get_factory_loom_OTs():
+ retlist=[]
+ for each in Objecttype.objects.all():
+ if each.parent:
+ if ((each.parent.title=='Factory_Object') and (str(each.slug)[0:4]=='loom')):
+ retlist.append(each.title)
+ return retlist
diff --git a/gstudio/static/gstudio/js/addcontent.js b/gstudio/static/gstudio/js/addcontent.js
index 655e2f5..5c0c4bc 100644
--- a/gstudio/static/gstudio/js/addcontent.js
+++ b/gstudio/static/gstudio/js/addcontent.js
@@ -1,34 +1,52 @@
+
$.noConflict();
+ var isWikipage=false;
+ var editWikipage=false;
+ var objid;
+ var isSection=false;
+ var editSection=false;
+ var isSubsection=false;
+ var editSubsection=false;
+ var isNode=false;
+ function subsecsave(objid){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#sectionreply"+objid).val(decode_data);
+ $("#subsecsubmit"+objid).trigger('click');
+ $(".savesubsec1").hide();
+
+ }
+
jQuery(document).ready(function($) {
$("#addcontent").one("click",function(){
- //var abc = document.getElementById('pageid1').value;
- //window.location.replace('sectionadd1/'+abc);
- $("#save").show();
- $("#chart").hide();
- // var orgdata = document.getElementById('orgcontent').value;
- document.getElementById('gnoweditor').style.visibility="visible";
-
- $("#gnoweditor").orgitdown(mySettings);
-
- var orgtext = $("#gnoweditor").val();
+ isSection=true;
+ $("#addcontent").hide();
+ //$("#save").show();
+ $("#chart").hide();
+ $("#content").css({"width":"300px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var orgtext = $("#gnoweditor").val();
- // });
- // });
});
$("#save").one("click",function() {
var org_data = $("#gnoweditor").val();
document.getElementById("orgpage").value = org_data;
var encode_data = encodeURIComponent(org_data);
$('#submitsec').trigger('click');
-
+ $("#save").hide();
});
$("#pagecontent1").one("click",function() {
+ isWikipage=true;
$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
- $("#save1").show();
+ //$("#save1").show();
+ $("#pagecontent1").hide();
+ $("#content").css({"width":"300px",})
});
$("#save1").one("click",function() {
var org_data = $("#gnoweditor").val();
@@ -36,157 +54,155 @@
var encode_data = encodeURIComponent(org_data);
$('#submitpage').trigger('click');
- });
- $("#editseccontent").one("click",function(){
- $("#saveseccontent").show();
-
- $("#chart").hide();
- document.getElementById('gnoweditor').style.visibility="visible";
- $("#gnoweditor").orgitdown(mySettings);
- var a = document.getElementById('sectionorg').value;
- $("#gnoweditor").val(a);
- var screenTop = $(document).scrollTop();
- $(".orgitdownContainer").css({
- "margin-top":screenTop,});
- });
- $("#saveseccontent").one("click",function(){
- var org_data = $("#gnoweditor").val();
- var id = document.getElementById("sectionid").value
- document.getElementById("sectionorg").value = org_data;
- var encode_data = encodeURIComponent(org_data);
-
- $.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();}
- });
- }
- });
- }
- });
-
- }
- });
-
-
-
-
-
-
- });
- $("#editsubsec").one("click",function(){
- $("#savesubsec1").show();
-
- $("#chart").hide();
- document.getElementById('gnoweditor').style.visibility="visible";
- $("#gnoweditor").orgitdown(mySettings);
- var a = document.getElementById('subsecorg').value;
- $("#gnoweditor").val(a);
- var screenTop = $(document).scrollTop();
- $(".orgitdownContainer").css({
- "margin-top":screenTop,});
-
- });
- $("#savesubsec1").one("click",function(){
- var org_data = $("#gnoweditor").val();
- var id = document.getElementById("subsecid").value
- document.getElementById("subsecorg").value = org_data;
- var encode_data = encodeURIComponent(org_data);
-
- $.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();}
- });
- }
- });
- }
- });
-
- }
- });
-
-
-
-
+ });
+ $(".editseccontent").one("click",function(){
+ editSection=true;
+ // $(".saveseccontent").show();
+ $("#content img").css({"max-width":"600px",})
+ $("#content").css({"width":"600px",})
+ $("#chart").hide();
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var a = this.name;
+ $("#gnoweditor").val(a);
+ var elmts = document.getElementsByClassName("editval");
+ for (var i = 0; i < elmts.length; i++){
+ elmts[i].setAttribute("value","edited");}
+ var screenTop = $(document).scrollTop();
+ $(".orgitdownContainer").css({
+ "margin-top":screenTop,});
+ $("#newsection1").hide();
+ $(".editseccontent").hide();
+ $(".createsubsection").hide();
+ $("#rating").hide();
+ $(".chkbox").hide();
+ $(".deletesec").hide();
+ $(".tag").hide();
+ $(".tagtext").hide();
+ $(".editpagecontent").hide();
+ $(".editsubsec").hide();
+ });
+ $(".saveseccontent").one("click",function(){
+ var org_data = $("#gnoweditor").val();
+ var elmts = document.getElementsByClassName("reptext");
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ for (var i = 0; i < elmts.length; i++){
+ elmts[i].setAttribute("value",decode_data);}
+ $(".submitresponse").trigger('click');
+ $(".saveseccontent").hide();
+
+ });
-
- });
-
- $("#editpagecontent").one("click",function(){
- $("#chart").hide();
- $("#savepagecontent").show();
- document.getElementById('gnoweditor').style.visibility="visible";
+ $(".editsubsec").one("click",function(){
+ editSubsection=true;
+ var each_id=$(this).attr("id");
+ $("#chart").hide();
+ $("#content img").css({"max-width":"600px",})
+
+ $("#content").css({"width":"600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var org_data=$("#subsec"+each_id).val();
+ $("#edit"+each_id).val("edited");
+ $("#sectionreply"+each_id).val(org_data);
+ $("#gnoweditor").val(org_data);
+ var screenTop = $(document).scrollTop();
+ $(".orgitdownContainer").css({
+ "margin-top":screenTop,});
+ //$("#save"+each_id).show();
+ objid=each_id;
+ $(".editsubsec").hide();
+ $(".submitsubsec1").hide();
+ $(".tag").hide();
+ $(".tagtext").hide();
+ $(".editpagecontent").hide();
+ $("#newsection1").hide();
+ $(".editseccontent").hide();
+ $(".createsubsection").hide();
+ $("#rating").hide();
+ $(".chkbox").hide();
+ $(".deletesec").hide();
+ });
+ $(".editpagecontent").one("click",function(){
+ editWikipage=true;
+ $("#chart").hide();
+ $(".editpagecontent").hide();
+ // $(".savepagecontent").show();
+ $("#content img").css({"max-width":"600px",})
+
+ $("#content").css({"width":"600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var a = this.name;
+ $("#gnoweditor").val(a);
+ var elmts = document.getElementsByClassName("editval");
+ for (var i = 0; i < elmts.length; i++){
+ elmts[i].setAttribute("value","edited");}
+ var screenTop = $(document).scrollTop();
+ $(".orgitdownContainer").css({
+ "margin-top":screenTop,});
+ $(".tag").hide();
+ $(".tagtext").hide();
+ $("#newsection1").hide();
+ $(".createsubsection").hide();
+ $("#rating").hide();
+ $(".chkbox").hide();
+ $(".deletesec").hide();
+ $(".editseccontent").hide();
+ $(".editsubsec").hide();
+
- $("#gnoweditor").orgitdown(mySettings);
- var a = document.getElementById('pageorg').value;
- $("#gnoweditor").val(a);
- var screenTop = $(document).scrollTop();
- $(".orgitdownContainer").css({
- "margin-top":screenTop,});
+ });
+ $(".savepagecontent").one("click",function(){
+ var org_data = $("#gnoweditor").val();
+ var elmts = document.getElementsByClassName("reptext");
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ for (var i = 0; i < elmts.length; i++){
+ elmts[i].setAttribute("value",decode_data);}
+ $(".pagedit").trigger('click');
+ $(".savepagecontent").hide();
+
+ });
+ $("#editnodecontent").one("click",function(){
+ isNode=true;
+ $("#chart").hide();
+ $("#content img").css({"max-width":"600px",})
+
+ $("#content").css({"width":"600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var a = this.name;
+
+ $("#gnoweditor").val(a);
+ var screenTop = $(document).scrollTop();
+ $(".orgitdownContainer").css({
+ "margin-top":screenTop,});
+ $("#editnodecontent").hide();
+ //$("#savenodecontent").show();
+ $("#nodedit").hide();
- });
- $("#savepagecontent").one("click",function(){
- // var org = $("#gnoweditor").val();
- // $("#sectionorg").val(org);
- // var test = $("#sectionorg").val();
- // alert(test);
- var org_data = $("#gnoweditor").val();
- var id = document.getElementById("pageid").value
- document.getElementById("pageorg").value = org_data;
- var encode_data = encodeURIComponent(org_data);
- //$("#gnoweditor").val(org_data);
-
- $.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();}
- });
- }
- });
- }
- });
-
- }
- });
+ });
+ $("#savenodecontent").one("click",function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#reptext").val(decode_data);
+ $("#nodedit").trigger('click');
+ $("#nodedit").hide();
+
+ });
+ $(".createsubsection").one("click",function(){
+ isSubsection=true;
+ //$(".savesubsec").show();
+ //$(".submitsubsec").show();
+ $(".createsubsection").hide();
- });
-
-
- $("#createsubsection").one("click",function(){
- $("#savesubsec").show();
-
+ $("#content img").css({"max-width":"600px",})
+ $("#content").css({"width":"600px",})
$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
@@ -194,20 +210,25 @@
var screenTop = $(document).scrollTop();
$(".orgitdownContainer").css({
"margin-top":screenTop,});
-
+
});
- $("#savesubsec").one("click",function() {
- var org_data = $("#gnoweditor").val();
- document.getElementById("sectionreply").value = org_data;
- var encode_data = encodeURIComponent(org_data);
- $('#submitsubsec').trigger('click');});
+ $(".savesubsec").one("click",function() {
+ var org_data = $("#gnoweditor").val();
+ var elmts = document.getElementsByClassName("reptext");
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ for (var i = 0; i < elmts.length; i++){
+ elmts[i].setAttribute("value",decode_data);}
+ $(".savesubsec").hide();
+ $(".submitsubsec").trigger('click');
+ });
$("#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) {
@@ -228,11 +249,11 @@
}
});
- }
- });
+ }
+ });
- });
});
+ });
-
+
diff --git a/gstudio/static/gstudio/js/loomscripts.js b/gstudio/static/gstudio/js/loomscripts.js
new file mode 100644
index 0000000..45d7f37
--- /dev/null
+++ b/gstudio/static/gstudio/js/loomscripts.js
@@ -0,0 +1,201 @@
+ $.noConflict();
+var isThread=false;
+var editThread=false;
+var isTwist=false;
+var editTwist=false;
+var isResponse=false;
+var objid;
+var twistid;
+var responseid;
+function saveclick(objid){
+ $("#add"+objid).show();
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#text"+objid).val(decode_data);
+ $("#submit"+objid).trigger('click');
+ $(".commenteditor").hide();
+ $(".editcontent").hide();
+}//closing saveclick
+
+
+
+
+jQuery(document).ready(function($) {
+ $(".commenteditor").one("click",function() {
+ var a=$(this).attr("id");
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+ $("#content").css({"width": "600px",})
+
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ $("#save"+a).show();
+ $(".commenteditor").hide();
+ $(".chkdel").hide();
+ $(".submitdelete").hide();
+ $(".rating").hide();
+ $(".editor").hide();
+ $(".topicchk").hide();
+ $(".topicdelete").hide();
+ $(".editcontent").hide();
+
+ });
+
+});
+function topicsaveclick(objid){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#topictext"+objid).val(decode_data);
+ $("#topicsubmit"+objid).trigger('click');
+ $(".editor").hide();
+ $(".editcontent").hide();
+}//closing saveclick
+ jQuery(document).ready(function($) {
+ $(".editor").one("click",function() {
+ isResponse=true;
+ var a=$(this).attr("id");
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+
+ $("#content").css({"width": "600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ responseid=a;
+ //$("#save"+a).show();
+ $(".editor").hide();
+ $(".topicchk").hide();
+ $(".topicdelete").hide();
+ $(".editcontent").hide();
+ $(".commenteditor").hide();
+ $(".chkdel").hide();
+ $(".submitdelete").hide();
+ $(".rating").hide();
+ });
+
+});
+
+
+jQuery(document).ready(function($) {
+ $(".editcontent").one("click",function() {
+ editTwist=true;
+ var each_id = $(this).attr("id");
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+
+ $("#content").css({"width": "600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var org_data=$("#commentdata"+each_id).val();
+ $("#edit"+each_id).val("edited");
+ $("#topictext"+each_id).val(org_data);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ $("#gnoweditor").val(org_data);
+ twistid=each_id;
+ //$("#save"+each_id).show();
+ $(".editcontent").hide();
+ $(".editor").hide();
+ $(".submitdelete").hide();
+ $(".commenteditor").hide();
+ $(".rating").hide();
+ $(".topicdelete").hide();
+ $(".chkdel").hide();
+ $(".topicchk").hide();
+ });
+
+
+ });
+
+ $.noConflict();
+ jQuery(document).ready(function($) {
+ $("#topicaddcontent").one("click",function() {
+ isTwist=true;
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+
+ $("#content").css({"width": "600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ // $("#topicaddsave").show();
+ });
+
+ $("#topicaddsave").one("click",function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#contenttext").val(decode_data);
+ $('#topicsubmit').trigger('click');
+ $("#topicaddsave").hide();
+ });
+
+ $("#addthreadcontent").one("click",function() {
+ isThread=true;
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+
+ $("#content").css({"width": "600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ $("#addthreadcontent").hide();
+ // $("#threadsave").show();
+ });
+
+ $("#threadsave").one("click",function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#threadcontent").val(decode_data);
+ $('.orgitdownContainer').hide();
+ $("#threadsave").hide();
+ $("#addthreadcontent").show();
+ });
+
+ });
+jQuery(document).ready(function($) {
+ $("#threadedit").one("click",function() {
+ editThread=true;
+ $("#chart").hide();
+ $("#content img").css({"max-width": "600px",})
+
+ $("#content").css({"width": "600px",})
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+
+
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ var id=document.getElementById("threadid").value;
+ var org_data=document.getElementById("threadcontent"+id).value;
+ $("#gnoweditor").val(org_data);
+ $("#threadedit").hide();
+ $(".editor").hide();
+ $(".editcontent").hide();
+ $("#addthreadcontent").hide();
+ $("#twistaddbtn").hide();
+ $("#Release *").hide();
+ //$("#editthreadsave").show();
+ });
+
+ $("#editthreadsave").one("click",function() {
+ var id=document.getElementById("threadid").value;
+ var org_data=$("#gnoweditor").val();
+ $("#threadcontent"+id).val(org_data);
+ $('.orgitdownContainer').hide();
+ $("#threadsave").hide();
+ $("#threadedit"+id).val("editthread");
+ $(".commenteditor").hide();
+ $(".editcontent").hide();
+ $("#subeditresp").trigger('click');
+ });
+});
+
diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js
old mode 100755
new mode 100644
index c766300..6e207a0
--- a/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js
+++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js
@@ -438,7 +438,7 @@
}
return selection;
}
- function save() {
+ function save1() {
var org_data = $("#gnoweditor").val();
var id = document.getElementById("objectid").value
document.getElementById("orgcontent").value = org_data;
@@ -466,6 +466,48 @@
}
});}
+ function close() {
+ $(".orgitdownContainer").hide();
+ location.reload();}
+ function save() {
+ if (isWikipage){
+ $("#save1").trigger('click');}
+ if (isNode){
+ $("#savenodecontent").trigger('click');}
+
+ if (editWikipage){
+ $(".savepagecontent").trigger('click');}
+ if (isSection){
+ $("#save").trigger('click');}
+ if (editSection){
+ $(".saveseccontent").trigger('click');}
+ if (editSubsection){
+ subsecsave(objid);}
+ if (isSubsection){
+ $(".savesubsec").trigger('click');}
+
+ if (isThread){
+ $("#threadsave").trigger('click');}
+ if (editThread){
+ $("#editthreadsave").trigger('click');}
+ if (isTwist){
+ $("#topicaddsave").trigger('click');}
+ if (editTwist){
+ topicsaveclick(twistid);}
+ if (isResponse){
+ topicsaveclick(responseid);}
+
+ if (editImage){
+ $("#save").trigger('click');}
+ if (isImage){
+ $("#save").trigger('click');
+ $("#descriptionsave").trigger('click');
+ $("#save"+objid).trigger('click');}
+ if (isVideotitle){
+ $("#titlesave").trigger('click');}
+
+ }
+
// open preview window
function preview() {
if (typeof options.previewHandler === 'function') {
diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/images/close.jpeg b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/images/close.jpeg
new file mode 100644
index 0000000..5c5297c
Binary files /dev/null and b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/images/close.jpeg differ
diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js
index 25b118e..17121d7 100644
--- a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js
+++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js
@@ -14,7 +14,8 @@ var mySettings = {
onAltEnter: {keepDefault:false, replaceWith:'\n* '},
onAltrightArrow: {keepDefault:false, replaceWith:'*'},
markupSet: [
- {name:'Save', key:'S',call:'save' },
+ {name:'Save',call:'save' },
+ {separator:'---------------' },
{name:'Bold', key:'B', openWith:'*', closeWith:'*' },
{name:'Italic', key:'I', openWith:'/', closeWith:'/' },
{name:'Stroke through', key:'S', openWith:'+', closeWith:'+' },
@@ -22,10 +23,12 @@ var mySettings = {
{name:'Bulleted List', openWith:' - ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'},
{name:'Numeric List', openWith:' 1. ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'},
{separator:'---------------' },
- {name:'Picture', key:'P', replaceWith:'[[http:fileName.jpg]]' },
+ {name:'Picture', key:'P', replaceWith:'\n#+CAPTION: \n#+ATTR_HTML: width="600" \n[[http:fileName.jpg]]\n' },
{name:'Link', key:'L', openWith:'[[http://your.address.com here/][Your visible link text here]]', closeWith:'', placeHolder:'' },
- {separator:'---------------' },
- {name:'Clean', className:'clean', replaceWith:function(orgitdown) { return orgitdown.selection.replace(/<(.*?)>/g, "") } },
- {name:'Preview', className:'preview', call:'preview'}
+ {separator:'---------------' },
+ {name:'Close',call:'close' }
+
+ //{name:'Clean', className:'clean', replaceWith:function(orgitdown) { return orgitdown.selection.replace(/<(.*?)>/g, "") } }
+ //{name:'Preview', className:'preview', call:'preview'}
]
}
diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js
index eaf728c..7b3d5cd 100644
--- a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js
+++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js
@@ -6,8 +6,12 @@
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
$("#gnoweditor").val(orgdata);
+ $("#editdata").hide();
+ $("#savecontent").show();
+
});
+
});
diff --git a/gstudio/templates/gstudio/NewGroup.html b/gstudio/templates/gstudio/NewGroup.html
index 829c4fa..df0009d 100644
--- a/gstudio/templates/gstudio/NewGroup.html
+++ b/gstudio/templates/gstudio/NewGroup.html
@@ -1,4 +1,5 @@
{%extends "gstudio/base.html"%}
+{% load gstudio_tags %}
{%load i18n %}
{%block extrahead%}
{%endblock%}
{% block content %}
+
{%if user.is_authenticated%}
{% if errors %}
@@ -20,32 +63,47 @@
{% endif %}
-Creating a group will require to schedule it for an indefinite period of time. So in this case, please enter end time of say 50 years from now
{%else%}
- Sorry! Login To proceed
+ Please Login
{%endif%}
{% endblock %}
diff --git a/gstudio/templates/gstudio/NewPage.html b/gstudio/templates/gstudio/NewPage.html
index b73b0dc..9d4caa5 100644
--- a/gstudio/templates/gstudio/NewPage.html
+++ b/gstudio/templates/gstudio/NewPage.html
@@ -26,6 +26,7 @@
+
{%else%}
diff --git a/gstudio/templates/gstudio/NewSection1.html b/gstudio/templates/gstudio/NewSection1.html
index daf29bc..a9c59ff 100644
--- a/gstudio/templates/gstudio/NewSection1.html
+++ b/gstudio/templates/gstudio/NewSection1.html
@@ -6,6 +6,7 @@
$(window).load(function() {
$("#save").hide();});
+
Add a new Section
{% if errors %}
{% csrf_token %}
-Title:
-Description:
+Name :
+Substance:
-
-
+
+
+
diff --git a/gstudio/templates/gstudio/_header.html b/gstudio/templates/gstudio/_header.html
index 1a5de32..123b05d 100644
--- a/gstudio/templates/gstudio/_header.html
+++ b/gstudio/templates/gstudio/_header.html
@@ -13,14 +13,17 @@
-->
- {% if user.is_authenticated %}
- {% if user.is_staff %}
- | Loom Studio
+ | Loom
+ | Wikipages
| Documents
- | Wikipage
| Images
| Videos
- | Admin Dashboard
+ | Node Types
+ | Node Objects
+ {% if user.is_authenticated %}
+ {% if user.is_staff %}
+
+ | Dashboard
{% endif %}
{% endif %}
@@ -58,9 +61,9 @@
{% url django-admindocs-docroot as docsroot %}
{% if docsroot %}
- {% trans 'Documentation' %}
+
{% endif %}
- Code
+ Code
{% endblock %}
{% else %}
diff --git a/gstudio/templates/gstudio/_nodetype_detail.html b/gstudio/templates/gstudio/_nodetype_detail.html
index 7f56f40..fc5d95f 100644
--- a/gstudio/templates/gstudio/_nodetype_detail.html
+++ b/gstudio/templates/gstudio/_nodetype_detail.html
@@ -1,20 +1,106 @@
{% load tagging_tags comments i18n %}
+{% load i18n gstudio_tags %}
{% trans "Comments" %}
+ {% with doc.comments as comment_list %} + {% if comment_list.count %} ++ {% for comment in comment_list %} +-
+
+
+
+
+
+ {% if comment.url %}
+ {{ comment.user_name }}
+ {% else %}
+ {{ comment.user_name }}
+ {% endif %}
+ {% trans "on" %} {{ comment.submit_date|date:"SHORT_DATETIME_FORMAT" }}
+
+
+ {{ comment.comment|linebreaks }}
+
+
+
+ {% endfor %}
+
+ {% if not doc.comments_are_open %} +{% trans "Comments are closed." %}
+ {% endif %} + {% else %} + {% if doc.comments_are_open %} +{% trans "No comments yet." %}
+ {% else %} +{% trans "Comments are closed." %}
+ {% endif %} + {% endif %} + {% endwith %} +