Skip to content
This repository

modification done in image ,video ,document and home page #83

Merged
merged 1 commit into from over 1 year ago

2 participants

Dhiru gnowgi
Dhiru

given to image and video
in home page, given css to tag cloud and also showing recent node objects

gnowgi gnowgi merged commit 85f7d71 into from August 24, 2012
gnowgi gnowgi closed this August 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 24, 2012
Change in image,video and document library and also in home page 11b4650
This page is out of date. Refresh to see the latest.
86  gstudio/templates/gstudio/docu.html
... ...
@@ -1,7 +1,3 @@
1  
- 
2  
-<html>
3  
-
4  
-<body>
5 1
 {% extends "gstudio/base.html" %}
6 2
 {% load pagination_tags %}
7 3
 {% load adminmedia grp_tags %}
@@ -10,6 +6,8 @@
10 6
 {% block content %}
11 7
 {% load tagging_tags comments i18n %}
12 8
 <script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
  9
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  10
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
13 11
     <script type="text/javascript" >
14 12
       $(window).load(function() {
15 13
       $("#content").css({
@@ -21,6 +19,41 @@
21 19
  $("#graphcss").hide();   
22 20
   });
23 21
 var i = 0;
  22
+jQuery(document).ready(function($) {
  23
+    $("#commenteditor").click(function(){
  24
+        document.getElementById('gnoweditor').style.visibility="visible";
  25
+        $("#gnoweditor").orgitdown(mySettings);
  26
+	document.getElementById('descriptionsave').style.visibility="visible";
  27
+	$("#commenteditor").hide();
  28
+		
  29
+	});
  30
+     $("#descriptionsave").click(function(){
  31
+            var org_data = $("#gnoweditor").val();     
  32
+	    var encode_data = encodeURIComponent(org_data);
  33
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));  
  34
+ 	    $("#descriptioncommenttext").val(decode_data);
  35
+	   
  36
+	});
  37
+});
  38
+jQuery(document).ready(function($) {
  39
+    $(".editcontent").click(function(){
  40
+	var a = $(this).attr("id");
  41
+        document.getElementById('gnoweditor').style.visibility="visible";
  42
+	 $("#gnoweditor").val($("#editortext"+a).val());
  43
+        $("#gnoweditor").orgitdown(mySettings);
  44
+        var screentop=$(document).scrollTop();
  45
+        $(".orgitdownContainer").css({"margin-top":screentop,});
  46
+	document.getElementById('save'+a).style.visibility="visible";
  47
+	$("#"+a).hide();
  48
+	});
  49
+     $(".commentsavecontent").click(function(){
  50
+            var org_data = $("#gnoweditor").val(); 
  51
+	    var encode_data = encodeURIComponent(org_data);
  52
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));     
  53
+ 	    $(".commenttext").val(decode_data);
  54
+	    });
  55
+});
  56
+
24 57
 </script>
25 58
 <style type="text/css">
26 59
 #divsearch
@@ -65,9 +98,11 @@ <h4 style="color: black;">Search File</h4>
65 98
 <div id="divpost">
66 99
 <form enctype="multipart/form-data" method="post" action="">{% csrf_token %}
67 100
 <br/>
68  
-<h4 style="color: black;">Post File:</h4>&nbsp;
69  
-file:&nbsp;<input type=file name="doc[]" multiple="multiple" /><br><br>
70  
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
  101
+<h4 style="color: black;">Post File:</h4>
  102
+<font size="3">File:</font>&nbsp;<input type=file name="doc[]" multiple="multiple" /><br><br>
  103
+Description:&nbsp;&nbsp;<input type="button"  id="commenteditor"  value="Add Content" >
  104
+<input type="button" class="commentsavecontent" id="descriptionsave" value="Save" style="visibility:hidden" />
  105
+<input type=text name="contenttext" id="descriptioncommenttext" style="visibility:hidden" />
71 106
 <input type="hidden" name="user" value={{user.username}}><br><br>
72 107
 
73 108
 <input type="submit" value="Post">
@@ -86,6 +121,7 @@ <h4 style="color: teal;">Documents Listing</h4>
86 121
     <div class="gbobject-content">
87 122
      <!-- {{ object_content }}-->
88 123
     </div>
  124
+<form method="post" action="">{% csrf_token %}
89 125
 <h2 style="color: green;">{{document.title}}</a></h2>
90 126
 <font color = 'black'>Posted By : </font>
91 127
 {% for author in document.authors.all %}
@@ -94,9 +130,24 @@ <h2 style="color: green;">{{document.title}}</a></h2>
94 130
 <br>
95 131
 <font color = 'black'>Posted At : </font><font color = 'teal'>{{document.creation_date}}</font>
96 132
 <br>
97  
-<font color = 'black'>Description:</font><font color = 'teal'>{{ document.content }}</font>
  133
+<font color = 'black'>Description:</font><font color = 'teal'>
  134
+{%autoescape on%}
  135
+{% with document.html_content|safe as document_content %}
  136
+     {{document_content}}
  137
+{% endwith %}
  138
+{% endautoescape%}</font>
  139
+{% for author in image.authors.all %}
  140
+	{% ifequal author.username user.username %}
  141
+<input type="hidden" name="docid" value={{document.id}}>
  142
+<input type="button" class="editcontent" id="{{document.id}}"  value="Edit"/>
  143
+<input type="submit" class="commentsavecontent" id="save{{document.id}}" value="Save" style="visibility:hidden" />
  144
+<input type="hidden" name="commenttext" class="commenttext" id="commenttext{{document.id}}" style="visibility:hidden" />
  145
+<input type="hidden" id="editortext{{document.id}}" style="visibility:hidden" value="{{document.content_org}}">
  146
+	{% endifequal %}
  147
+{% endfor %}
  148
+</form>
98 149
 <br>
99  
-<a href="{% admin_media_prefix %}img/{{document.title}}">Download now!!</a>
  150
+<font color = 'black'>Download: </font><a href="{% admin_media_prefix %}img/{{document.title}}">Click to download!!</a>
100 151
 <br>
101 152
 {% for author in document.authors.all %}
102 153
 	{% ifequal author.username user.username %} 
@@ -114,20 +165,17 @@ <h2 style="color: green;">{{document.title}}</a></h2>
114 165
     return false;
115 166
   }
116 167
  }
117  
-{% else %}
118  
-		<script type="text/javascript">
119  
-		function myFunction()
120  
-		{
121  
-			alert("You are not authorised to delete other users file!");
122  
-		}
123  
-		</script>
124  
- 
125  
-		<input type="button" onclick="myFunction()" value="Delete" />
126 168
 	{% endifequal %}
127 169
 {% endfor %}
128 170
 </script>
129 171
 <br>
130  
-<font color = 'black'>Current rating is </font><h4>{{ document.rating.get_rating }}</h4>
  172
+{% ifequal document.rating.get_rating 0 %}
  173
+
  174
+<font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
  175
+{% else %}
  176
+<font color = 'black'>Average Current rating is: </font><h4>{{ document.rating.get_rating }}</h4>
  177
+<font color = 'black'>Total Number of votes is:  &nbsp;<font color='teal'><b>{{ document.rating_votes }}</b></font> </font>
  178
+{% endifequal %}
131 179
 <br>
132 180
 <form method="post" action="">
133 181
 {% csrf_token %}
75  gstudio/templates/gstudio/fullscreen.html
... ...
@@ -1,17 +1,47 @@
  1
+{% extends "gstudio/base.html" %}
1 2
 {% load adminmedia grp_tags %}
2 3
 {% load i18n comments gstudio_tags %} 
3 4
 {% load tagging_tags comments i18n %}
4  
-
5  
-<html>
6  
-<head>
  5
+{% block content %}
  6
+<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
  7
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  8
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  9
+    <script type="text/javascript" >
  10
+      $(window).load(function() {
  11
+      $("#content").css({
  12
+    "width": "600px",});});
  13
+$(window).load(function() {
  14
+ $("#chart").hide();});
  15
+$(window).load(function() {
  16
+ 
  17
+ $("#graphcss").hide();   
  18
+  });
  19
+jQuery(document).ready(function($) {
  20
+    $("#editcontent").click(function(){
  21
+        document.getElementById('gnoweditor').style.visibility="visible";
  22
+	 $("#gnoweditor").val($("#editortext").val());
  23
+        $("#gnoweditor").orgitdown(mySettings);
  24
+	document.getElementById('save').style.visibility="visible";
  25
+	$("#editcontent").hide();
  26
+		
  27
+	});
  28
+     $("#save").click(function(){
  29
+            var org_data = $("#gnoweditor").val();       
  30
+	    var encode_data = encodeURIComponent(org_data);
  31
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
  32
+ 	    $("#commenttext").val(decode_data);
  33
+			   
  34
+	});
  35
+});
  36
+</script>
  37
+</script>
7 38
 <link href="{% admin_media_prefix %}css/base.css" rel="stylesheet" type="text/css" />
8 39
 <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen.css" />
9 40
 <link rel="shortcut icon" href="{{ STATIC_URL }}gstudio/img/favicon.ico" />
10  
-</head>
11  
-<body>
12 41
 
13 42
 <img src="{% admin_media_prefix %}img/{{image.image}}" >
14 43
 <br/>
  44
+<form method="post" action="">{% csrf_token %}
15 45
 <font color = 'black'>Name : </font><font color = 'teal'>{{image.title}}</font>
16 46
 <br/>
17 47
 <font color = 'black'>Posted By : </font>
@@ -22,14 +52,34 @@
22 52
 
23 53
 <font color = 'black'>Posted At : </font><font color = 'teal'>{{image.creation_date}}</font>
24 54
 <br/>
25  
-<font color = 'black'>Description:</font><font color = 'teal'>{{ image.content }}</font>
26  
-<br/>
  55
+<font color = 'black'>Description:</font><font color = 'teal'>
  56
+{%autoescape on%}
  57
+{% with image.html_content|safe as image_content %}
  58
+     {{image_content}}
  59
+{% endwith %}
  60
+{% endautoescape%}
  61
+</font>
  62
+
27 63
 
  64
+{% for author in image.authors.all %}
  65
+	{% ifequal author.username user.username %}
  66
+<input type="hidden" name="imgid" value={{image.id}}>
  67
+<input type="button" id="editcontent" value="Edit"/>
  68
+
  69
+<input type="submit" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
  70
+<input type="hidden" name="contenttext" id="commenttext" style="visibility:hidden" />
  71
+<input type="hidden" id="editortext" style="visibility:hidden" value="{{image.content_org}}">
  72
+	{% endifequal %}
  73
+{% endfor %}
  74
+</form>
  75
+
  76
+<br/>
28 77
 {% ifequal image.rating.get_rating 0 %}
29 78
 
30 79
 <font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
31 80
 {% else %}
32  
-<font color = 'black'>Current rating is: &nbsp; <font color = 'teal'> {{ image.rating.get_rating }} </font></font>
  81
+<font color = 'black'>Average Current rating is: &nbsp; <font color = 'teal'> {{ image.rating.get_rating }} </font></font><br/>
  82
+<font color = 'black'>Total Number of votes is:  &nbsp;<font color='teal'><b>{{ image.rating_votes }}</b></font> </font>
33 83
 {% endifequal %}
34 84
 <br>
35 85
 <form method="post" action="">
@@ -42,13 +92,6 @@
42 92
 </br>
43 93
 <input type="hidden" name="imgid" value={{image.id}}>
44 94
 <input type="submit" value="Rate it!!!">
45  
-<script type="text/javascript">
46  
-function myFunction()
47  
-{
48  
-     document.this_form.action = "/gstudio/resources/images/";
49  
-}
50  
-</script>
51  
-<input type="submit" value="Back" onclick()="myFunction()">
52 95
 </form>
53 96
 <br/>
54 97
 
@@ -124,4 +167,4 @@
124 167
 <hr width="100%" style="height:5px;" color="black"/>
125 168
 <br>
126 169
 
127  
-</html></body>
  170
+{% endblock %}
24  gstudio/templates/gstudio/home.html
@@ -14,7 +14,7 @@
14 14
       } 
15 15
       #homebody{
16 16
 	height:100%;
17  
-	background: #B3B3B3;
  17
+	background: white;
18 18
 	
19 19
 	}
20 20
       #header {
@@ -77,6 +77,14 @@
77 77
       position:absolute;
78 78
       margin-left:47%;
79 79
       }
  80
+	.tags .tag_1 { font-size: 1em; color: #001e2d; }
  81
+	.tags .tag_2 { font-size: 1.125em; color: #00334c; }
  82
+	.tags .tag_3 { font-size: 2em; color: #005b89; }
  83
+	.tags .tag_4 { font-size: 2.25em; color: #0070a8; }
  84
+	.tags .tag_5 { font-size: 3em; color: #0099e5; }
  85
+	.tags .tag_6 { font-size: 3.20em; color: #00adff; }
  86
+      }
  87
+	#tag{ width: 50%; } 
80 88
       }
81 89
     </style>   
82 90
     
@@ -114,11 +122,11 @@
114 122
     <div id="header" >
115 123
       {% include "gstudio/_header.html" %}
116 124
     </div>
117  
-   <div class="tags">
118  
-	<h3>{% trans "Tags" %}</h3>
  125
+    <div class="tags" align="center" id="tag">
  126
+	<h2>{% trans "Tag Cloud" %}</h2>
119 127
   	{% get_tag_cloud %}
120 128
    </div>
121  
-	
  129
+   </center>
122 130
     <div id="main">
123 131
       <center><font size="23" color="#4d659e"><b>{{ site }}</b></font></center>
124 132
       <form action="{% url gstudio_nodetype_search %}" method="get">
@@ -129,16 +137,16 @@
129 137
       </form>
130 138
     </div><br/><br/><br/>
131 139
 <link rel="stylesheet" type="text/css" media="screen, projection" href="/static/gstudio/css/screen.css" />
132  
-<center><p style = " font-size : 19px ; color : #4d659e"><b>Let us collaboratively construct semantic knowledge networks with a special focus on education.<a href="/more/"><font color="red">more</font></a></b></p></center>
  140
+<center><p style = " font-size : 19px ; color : #4d659e"><b>The site provides a loom (place to exchange views from the members of the site on a topic, or seek responses from members); collaboratively construct wikipages; share electronic documents, images and videos and use them in your discussions or wikipages; and create semantic networks. We will soon provide a link on how to use the site prominently on the home page.  All resources are released under creative commons license. <a href="/more/"><font color="red">more</font></a></b></p></center>
133 141
     <div class="bottom">
134 142
       <div class="authors">
135  
-	<h3>{% trans "Recents Authors" %}</h3>
  143
+	<h3>{% trans "Recent Authors" %}</h3>
136 144
 	{% get_authors %}
137 145
       </div>
138 146
 	
139 147
 <div class="recentsnodetype">
140  
-<h3>{% trans "Recent Nodes" %}</h3>
141  
-{% get_recent_nodetypes %}
  148
+<h3>{% trans "Recent Objects" %}</h3>
  149
+{% get_recent_gbobjects %}
142 150
 </div>
143 151
 <div class="comments">
144 152
   <h3>{% trans "Recent Comments" %}</h3>
38  gstudio/templates/gstudio/image.html
@@ -6,10 +6,11 @@
6 6
 {% load i18n %}
7 7
 {% block content %}
8 8
 <script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
9  
-    <script type="text/javascript" >
10  
-      $(window).load(function() {
11  
-      $("#content").css({
12  
-    "width": "600px",});});
  9
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  10
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  11
+<script type="text/javascript" >
  12
+$(window).load(function(){ 
  13
+$("#content").css({"width": "600px"});});
13 14
 $(window).load(function() {
14 15
  $("#chart").hide();});
15 16
 $(window).load(function() {
@@ -18,6 +19,23 @@
18 19
   });
19 20
 
20 21
 var i = 0;
  22
+
  23
+jQuery(document).ready(function($) {
  24
+    $("#commenteditor").click(function(){
  25
+        document.getElementById('gnoweditor').style.visibility="visible";
  26
+        $("#gnoweditor").orgitdown(mySettings);
  27
+	document.getElementById('save').style.visibility="visible";
  28
+	$("#commenteditor").hide();
  29
+		
  30
+	});
  31
+     $("#save").click(function(){
  32
+            var org_data = $("#gnoweditor").val();
  33
+	    var encode_data = encodeURIComponent(org_data);
  34
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));       
  35
+ 	    $("#commenttext").val(decode_data);
  36
+	   
  37
+	});
  38
+});
21 39
 </script>
22 40
 <style type="text/css">
23 41
 #div2
@@ -76,7 +94,9 @@ <h4 style="color: black; margin-left: 0px;">Search Image:</h4>
76 94
 <h4 style="color: black; margin-left: 0px;">Post Image:</h4>
77 95
 Title:&nbsp; <input type="text" name="title1"><br/><br/>
78 96
 Image:&nbsp; <input type=file name="image[]" multiple="multiple" /><br/><br/>
79  
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
  97
+Description:&nbsp;&nbsp;<input type="button"  id="commenteditor"  value="Add Content" >
  98
+<input type="button" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
  99
+<input type=text name="contenttext" id="commenttext" style="visibility:hidden" />
80 100
 <input type="hidden" name="user" value={{user.username}}><br/><br/>
81 101
 <input type="submit" value="  Post  " size="900" name="post" onclick="return myupload();">
82 102
 
@@ -101,11 +121,15 @@ <h4 style="color: teal;">IMAGES</h4>
101 121
 document.getElementById("divimage").setAttribute("id","div2");
102 122
 }
103 123
 
  124
+
  125
+
104 126
 </script>
105 127
       <h2>{{image.title}}</h2>
106 128
        <form method="post" action="">{% csrf_token %}
107 129
        <input type="hidden" name="fulid" value={{image.id}}>
108  
-       <input type="submit" value="Show" name="Show">
  130
+     <!--  <input type="submit" value="Show" name="Show">-->
  131
+
  132
+	<a href="/gstudio/resources/images/show/{{image.id}}/"><font size="4"><u>Show</u></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
109 133
 
110 134
     <!--   <p> -->
111 135
 <!-- <img src="{% admin_media_prefix %}img/{{image.title}}" width="300" height="225" alt="{{ image.title }}" > -->
@@ -157,7 +181,7 @@ <h4 style="color: teal;">IMAGES</h4>
157 181
 		}
158 182
 		</script>
159 183
  
160  
-		<input type="button" onclick="myFunction()" value="Delete" />
  184
+		<input type="button" onclick="myFunction()" value="Delete" style="visibility:hidden" />
161 185
 		</form>
162 186
 	{% endifequal %}
163 187
 {% endfor %}
53  gstudio/templates/gstudio/skeleton.html
@@ -51,9 +51,9 @@
51 51
 				display: block;
52 52
 				position: absolute;
53 53
 			}
54  
-.orgitdown .orgitdownButton1 a {
55  
-	background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg);
56  
-}
  54
+<!-- .orgitdown .orgitdownButton1 a { -->
  55
+<!-- 	background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg); -->
  56
+<!-- } -->
57 57
 .orgitdown .orgitdownButton2 a {
58 58
 	background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png);
59 59
 }
@@ -101,10 +101,10 @@
101 101
 }
102 102
 .orgitdownContainer  {
103 103
 	border:1px solid #3C769D;	
104  
-	background:#FFF url(/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-container.png) repeat-x top left; 
  104
+	<!-- background:#FFF url(/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-container.png) repeat-x top left;  -->
105 105
 	padding:5px 5px 2px 5px;
106 106
 	font:11px Verdana, Arial, Helvetica, sans-serif;
107  
-        margin-left:450px;
  107
+        margin-left:640px;
108 108
         width:450px;
109 109
         margin-top:30px;
110 110
 }
@@ -283,8 +283,47 @@
283 283
 	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
284 284
 	
285 285
 	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  286
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/replytotopic.js"></script>
  287
+
  288
+        <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/replycomment.js"></script>
  289
+	 <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  290
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  291
+	
  292
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  293
+
  294
+        <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/topiccomment.js"></script>
  295
+
  296
+ <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  297
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  298
+	
  299
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
286 300
 	
287 301
 	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/savedata.js"></script>
  302
+	 <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
  303
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  304
+	
  305
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  306
+	
  307
+	<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/addcontent.js"></script>
  308
+	<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> -->
  309
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script> -->
  310
+	
  311
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script> -->
  312
+	
  313
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/updatepage.js"></script> -->
  314
+
  315
+	<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> -->
  316
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script> -->
  317
+	
  318
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script> -->
  319
+	
  320
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/addcontent.js"></script> -->
  321
+	<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> -->
  322
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script> -->
  323
+	
  324
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script> -->
  325
+	
  326
+	<!-- <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/updatesection.js"></script> -->
288 327
 
289 328
 	<!-- EXTRAHEAD -->
290 329
 	
@@ -341,7 +380,7 @@
341 380
 				<textarea id="gnoweditor" style="visibility:hidden;">
342 381
 				</textarea>
343 382
 				
344  
-				
  383
+				{% block graph %}
345 384
 				<div id="graphcss">
346 385
 				<div id="chart">
347 386
 					
@@ -773,6 +812,7 @@
773 812
 </script>
774 813
 
775 814
 				</div>
  815
+				{% endblock %}
776 816
 		</div>
777 817
 				
778 818
 				
@@ -792,3 +832,4 @@
792 832
 	
793 833
 	</body>
794 834
 </html>
  835
+
122  gstudio/templates/gstudio/transcript.html
... ...
@@ -1,17 +1,64 @@
  1
+{% extends "gstudio/base.html" %}
1 2
 {% load adminmedia grp_tags %}
2 3
 {% load i18n comments gstudio_tags %} 
3 4
 {% load tagging_tags comments i18n %}
  5
+{% load gstudio_tags %}
4 6
 
5 7
 <html>
6 8
 <head>
  9
+{% block javascripts %}
  10
+
  11
+<script type="text/javascript">
  12
+			// GLOBALS
  13
+			var grappelli = {},
  14
+			// TODO: klemens: drop ADMIN_URL
  15
+			ADMIN_URL = "{% url admin:index %}",
  16
+			MODEL_URL_ARRAY = {% get_content_types %}, DATE_FORMAT = "{% get_date_format %}", TIME_FORMAT = "{% get_time_format %}", DATETIME_FORMAT = "{% get_datetime_format %}";
  17
+</script>
7 18
 <link href="{% admin_media_prefix %}css/base.css" rel="stylesheet" type="text/css" />
8 19
 <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen.css" />
9 20
 <link rel="shortcut icon" href="{{ STATIC_URL }}gstudio/img/favicon.ico" />
10 21
 <script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
  22
+<script src="{% admin_media_prefix %}jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
  23
+<script src="{% admin_media_prefix %}js/grappelli/grappelli.js" type="text/javascript"></script>
  24
+<script src="{% admin_media_prefix %}js/grappelli/jquery.grp_collapsible.js" type="text/javascript"></script>
  25
+<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
11 26
 <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery.pandoravideo.js"></script>
12 27
 <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery.js"></script>
13 28
 <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-1.8.21.custom.min.js"></script>
14  
- 
  29
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  30
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
  31
+
  32
+
  33
+ <script type="text/javascript" >
  34
+      $(window).load(function() {
  35
+      $("#content").css({
  36
+    "width": "600px"});});
  37
+
  38
+$(window).load(function() {
  39
+
  40
+ $("#graphcss").hide();   
  41
+  });
  42
+$(window).load(function() {
  43
+ $("#chart").hide();});
  44
+var i = 0;
  45
+jQuery(document).ready(function($) {
  46
+    $("#editcontent").click(function(){
  47
+        document.getElementById('gnoweditor').style.visibility="visible";
  48
+	 $("#gnoweditor").val($("#editortext").val());
  49
+        $("#gnoweditor").orgitdown(mySettings);
  50
+	document.getElementById('save').style.visibility="visible";
  51
+	$("#editcontent").hide();
  52
+		
  53
+	});
  54
+     $("#save").click(function(){
  55
+            var org_data = $("#gnoweditor").val();       
  56
+	    var encode_data = encodeURIComponent(org_data);
  57
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
  58
+ 	    $("#commenttext").val(decode_data);	   
  59
+	});
  60
+});
  61
+</script>
15 62
 <script type="text/javascript">
16 63
  
17 64
 $.noConflict();	
@@ -19,28 +66,72 @@
19 66
 $('#pandoravideo').pandoravideo();
20 67
 });
21 68
 </script>
  69
+
  70
+{% endblock %}
  71
+ {% block title %}{{ video.title }}{% endblock %}
22 72
 </head>
23 73
 <body>
24  
-<div id="pandoravideo" data-pandora-id={{id}} data-pandora-layers="transcripts, descriptions, keywords, places">
25  
-
  74
+{% block content %}
26 75
 
  76
+<div id="pandoravideo" data-pandora-id={{video.slug}} data-pandora-layers="transcripts, descriptions, keywords, places">
27 77
 </div>
  78
+<b>Download:</b>&nbsp;&nbsp;<a href={{video.rurl}} target="_blank">Right click to download</a><br/>
  79
+<form method="post" action="">{% csrf_token %}
28 80
 <font color='black'>Name:</font>
29  
-<font color='teal'>{{ titlename }}</font><br/>
  81
+<font color='teal'>{{ video.title }}</font><br/>
30 82
 <font color = 'black'>Posted By : </font>
  83
+{% for author in video.get_nbh.posted_by %}
  84
+  <font color = 'teal'>{{ author }}</font>
  85
+{% endfor %}
31 86
 
32  
-  <font color = 'teal'>{{postedby}}</font>
33 87
 <br>
34 88
 <font color = 'black'>Posted At :</font>
35  
- <font color = 'teal'>{{date}}</font>
  89
+{% for date in video.get_nbh.creation_day %}
  90
+<font color = 'teal'>{{date}}</font>
  91
+
  92
+{% endfor %}
  93
+ 
36 94
 
37 95
 <br>
38 96
 		<font color = 'black'>Location: </font>
  97
+{% for we in video.get_nbh.source %}
  98
+		<!-- <font color = 'black'>Location: </font>  -->
  99
+			{% for map in video.get_nbh.map_link %}
  100
+				{% ifnotequal map '' %}
39 101
 <a href=http://maps.google.co.in/maps?hl=en&cp=43&gs_id=6&xhr=t&q={{map}}&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&biw=1304&bih=680&um=1&ie=UTF-8&sa=N&tab=wl target="_blank">{{we}}</a>
  102
+				{% endifnotequal %}
  103
+			{% endfor %}
  104
+		{% endfor %}
  105
+
40 106
 <br>
41  
-<font color = 'black'>Description:</font><font color = 'teal'>{{ contentname }}</font>
  107
+ <input type="hidden" name="contentname" value="{{ video.content }}" />
  108
+ <input type="hidden" name="ratename" value="{{ video.rating.get_rating }}" />
  109
+<font color = 'black'>Description:</font><font color = 'teal'>
  110
+{%autoescape on%}
  111
+{% with video.html_content|safe as video_content %}
  112
+     {{video_content}}
  113
+{% endwith %}
  114
+{% endautoescape%}</font>
  115
+
  116
+{% for author in video.get_nbh.posted_by %}
  117
+	{% ifequal author user.username %}
  118
+<input type="hidden" name="vidid" value={{video.id}}>
  119
+<input type="button" id="editcontent" name="{{video.content}}" value="Edit"/>
  120
+<input type="submit" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
  121
+<input type="hidden" name="contenttext" id="commenttext" style="visibility:hidden" />
  122
+<input type="hidden" id="editortext" style="visibility:hidden" value="{{video.content_org}}">
  123
+	{% endifequal %}
  124
+{% endfor %}
  125
+</form>
42 126
 <br/>
43  
-<font color = 'black'>Current rating is:  &nbsp;<font color='teal'><b>{{ rateby }}</b></font> </font>
  127
+
  128
+{% ifequal video.rating.get_rating 0 %}
  129
+
  130
+<font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
  131
+{% else %}
  132
+<font color = 'black'>Average Current rating is:  &nbsp;<font color='teal'><b>{{ video.rating.get_rating }}</b></font> </font><br/>
  133
+<font color = 'black'>Total Number of votes is:  &nbsp;<font color='teal'><b>{{ video.rating_votes }}</b></font> </font>
  134
+{% endifequal %}
44 135
 <br>
45 136
 <form method="post" action="">
46 137
 {% csrf_token %}
@@ -50,18 +141,18 @@
50 141
 <input name="star1" type="radio" value=4 class="star"/>
51 142
 <input name="star1" type="radio" value=5 class="star"/>
52 143
   
53  
-<input type="hidden" name="vidid" value={{vidid}}>
  144
+<input type="hidden" name="vidid" value={{video.id}}>
54 145
 <input type="submit" value="Rate it!!!">
55 146
 </form>
56 147
 <br>
57 148
 <form method="post" action="">
58 149
 {% csrf_token %}
59  
-<input type="hidden" name="favid" value={{vidid}}>
  150
+<input type="hidden" name="favid" value={{video.id}}>
60 151
 <input type="hidden" name="favusr" value={{user.username}}>
61 152
 <input type="submit" value="Add to favourites">
62 153
 </form><br>
63 154
 <form method="post" action="">{% csrf_token %}
64  
-<input type="hidden" name="vidid" value={{vidid}}>
  155
+<input type="hidden" name="vidid" value={{video.id}}>
65 156
 <input type="text" value="" name="texttags"  />
66 157
 <input type="submit" value="Add Tags" name="addtags" />
67 158
 </form>
@@ -125,8 +216,11 @@
125 216
 <div class="commentForm span-16 last">
126 217
   {% render_comment_form for video %}
127 218
 </div>
128  
-<hr width="100%" style="height:5px;" color="black"/>
  219
+<!--<hr width="100%" style="height:5px;" color="black"/>-->
129 220
 <br>
  221
+
  222
+{% endblock %}
  223
+{% block graph %}
  224
+
  225
+{% endblock %}
130 226
 </body>
131  
- 
132  
-</html>
29  gstudio/templates/gstudio/video.html
@@ -6,6 +6,8 @@
6 6
 
7 7
 {% block content %}
8 8
 <script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
  9
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
  10
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
9 11
     <script type="text/javascript" >
10 12
       $(window).load(function() {
11 13
       $("#content").css({
@@ -17,6 +19,21 @@
17 19
  $("#graphcss").hide();   
18 20
   });
19 21
 var i = 0;
  22
+jQuery(document).ready(function($) {
  23
+    $("#commenteditor").click(function(){
  24
+        document.getElementById('gnoweditor').style.visibility="visible";
  25
+        $("#gnoweditor").orgitdown(mySettings);
  26
+	document.getElementById('save').style.visibility="visible";
  27
+	$("#commenteditor").hide();
  28
+		
  29
+	});
  30
+     $("#save").click(function(){
  31
+            var org_data = $("#gnoweditor").val();   
  32
+	    var encode_data = encodeURIComponent(org_data);
  33
+	    var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));    
  34
+ 	    $("#commenttext").val(decode_data);	   
  35
+	});
  36
+});
20 37
 </script>
21 38
 <style type="text/css">
22 39
 #div2
@@ -92,13 +109,15 @@ <h4 style="color: black;">Search Videos:</h4>
92 109
 <form enctype="multipart/form-data" method="post" action="">
93 110
 {% csrf_token %}
94 111
 <p><h4 style="color: black;">Submit Videos:</h4>Video:&nbsp;<input type="file" name="clip" multiple="multiple" /></p><br/>
95  
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
  112
+Description:&nbsp;&nbsp;<input type="button"  id="commenteditor"  value="Add Content" >
  113
+<input type="button" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
  114
+<input type=text name="contenttext" id="commenttext" style="visibility:hidden" />
96 115
 <input type="hidden" name="user" value={{user.username}}>
97 116
 <input type="hidden" name="userpassword" value={{user.password}}>
98  
-<input type="hidden" name="useremail" value={{user.email}}><br/><br/>
  117
+<input type="hidden" name="useremail" value={{user.email}}>
99 118
 <p><b> Enter the password of wetube.gnowledge.org</b> </p>
100 119
 <input type="password" name="videopassword" />
101  
-<br/><br/>
  120
+
102 121
 <input type="submit" value="Upload"  onclick="return myupload();" >
103 122
 <script type="text/javascript">
104 123
 function myupload()
@@ -165,8 +184,8 @@ <h2 style="color: teal;">List of Videos in the library </h2><br/>
165 184
 <form enctype="multipart/form-data" method="post" action="" target="_blank">
166 185
 {% csrf_token %}
167 186
 <input type="hidden" name = "full" value ={{video.slug}}>
168  
-<input type="submit" value="Play">
169  
-	
  187
+<!--<input type="submit" value="Play">-->
  188
+<a href="/gstudio/resources/videos/show/{{video.id}}/"><font size="4"><u>Show</u></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
170 189
 <a href={{video.rurl}} target="_blank">Right click to download</a><br>
171 190
 <!-- <font color = 'black'>Posted By : </font> -->
172 191
 {% for author in video.get_nbh.posted_by %}
2  gstudio/urls/image.py
@@ -21,5 +21,5 @@
21 21
 urlpatterns = patterns('gstudio.views.image',
22 22
                        url(r'^$', 'image',
23 23
                            name='image'),
24  
-
  24
+			url(r'show/(\d+)/$','show',name='showimage'),
25 25
                        )
2  gstudio/urls/video.py
@@ -21,5 +21,5 @@
21 21
 urlpatterns = patterns('gstudio.views.video',
22 22
                        url(r'^$', 'video',
23 23
                            name='video'),
24  
-
  24
+            	       url(r'show/(\d+)/$','show',name='showvideo'),
25 25
                        )
58  gstudio/views/docu.py
@@ -21,6 +21,7 @@
21 21
 from demo.settings import *
22 22
 from gstudio.models import *
23 23
 from objectapp.models import *
  24
+from gstudio.methods import *
24 25
 
25 26
 def docu(request):
26 27
 	p=Objecttype.objects.get(title="Document")
@@ -36,6 +37,7 @@ def docu(request):
36 37
 		delete = request.POST.get("delete","")
37 38
 		addtags = request.POST.get("addtags","")
38 39
 		texttags = request.POST.get("texttags","")
  40
+		contenttext = request.POST.get("commenttext","")
39 41
 		if rating :
40 42
         	 	rate_it(int(docid),request,int(rating))
41 43
 		if delete != "":
@@ -70,6 +72,9 @@ def docu(request):
70 72
 			i.tags = i.tags+ ","+str(texttags)
71 73
 			i.save()
72 74
 
  75
+		if contenttext !="":
  76
+	                edit_description(docid,contenttext)
  77
+
73 78
 
74 79
 		a=[]
75 80
 		for each in request.FILES.getlist("doc[]",""):
@@ -81,7 +86,9 @@ def docu(request):
81 86
 			vars=RequestContext(request,{'documents':q})
82 87
 			template="gstudio/docu.html"
83 88
 			return render_to_response(template, vars)	
84  
-	vars=RequestContext(request,{'documents':q})
  89
+	s=Nodetype.objects.get(title="Document")
  90
+#	t=s.get_nbh['contains_members']
  91
+	vars=RequestContext(request,{'documents':q,'docomment':s})
85 92
 	template="gstudio/docu.html"
86 93
 	return render_to_response(template, vars)
87 94
 
@@ -105,7 +112,7 @@ def create_object(file,log,content):
105 112
 		else:
106 113
 			final = final+each1	
107 114
 	p.slug=final
108  
-	p.content=content
  115
+	p.content_org=content
109 116
 	p.status=2
110 117
 	p.save()
111 118
 	p.sites.add(Site.objects.get_current())
@@ -116,8 +123,55 @@ def create_object(file,log,content):
116 123
 	q=Objecttype.objects.get(title="Document")
117 124
 	p.objecttypes.add(Objecttype.objects.get(id=q.id))
118 125
 	p.save()
  126
+	new_ob = content
  127
+	myfile = open('/tmp/file.org', 'w')
  128
+ 	myfile.write(new_ob)
  129
+	myfile.close()
  130
+	myfile = open('/tmp/file.org', 'r')
  131
+	myfile.readline()
  132
+	myfile = open('/tmp/file.org', 'a')
  133
+	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")
  134
+	myfile.write("\n#+TITLE: ")
  135
+	myfile = open('/tmp/file.org', 'r')
  136
+	stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  137
+	output = stdout.read()
  138
+	data = open("/tmp/file.html")
  139
+ 	data1 = data.readlines()
  140
+ 	data2 = data1[72:]
  141
+	data3 = data2[:-3]	
  142
+ 	newdata=""
  143
+ 	for line in data3:
  144
+        	newdata += line.lstrip()
  145
+ 	p.content = newdata
  146
+ 	p.save()	
119 147
 
120 148
 def rate_it(topic_id,request,rating):
121 149
 	ob = Gbobject.objects.get(id=topic_id)
122 150
 	ob.rating.add(score=rating ,user=request.user, ip_address=request.META['REMOTE_ADDR'])
123 151
 	return True
  152
+
  153
+
  154
+def edit_description(sec_id,title):
  155
+	new_ob = Gbobject.objects.get(id=int(sec_id))
  156
+	new_ob.content_org = title
  157
+	myfile = open('/tmp/file.org', 'w')
  158
+	myfile.write(new_ob.content_org)
  159
+	myfile.close()
  160
+	myfile = open('/tmp/file.org', 'r')
  161
+	myfile.readline()
  162
+	myfile = open('/tmp/file.org', 'a')
  163
+	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")
  164
+	myfile.write("\n#+TITLE: ")
  165
+	myfile = open('/tmp/file.org', 'r')
  166
+	stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  167
+	output = stdout.read()
  168
+	data = open("/tmp/file.html")
  169
+	data1 = data.readlines()
  170
+	data2 = data1[72:]
  171
+	data3 = data2[:-3]
  172
+	newdata=""
  173
+	for line in data3:
  174
+		newdata += line.lstrip()
  175
+	new_ob.content = newdata
  176
+	new_ob.save()
  177
+	return True
70  gstudio/views/image.py
@@ -22,6 +22,7 @@
22 22
 from gstudio.models import *
23 23
 from objectapp.models import *
24 24
 import os
  25
+from gstudio.methods import *
25 26
 
26 27
 def image(request):
27 28
 	p=Objecttype.objects.get(title="Image")
@@ -40,6 +41,7 @@ def image(request):
40 41
 		show = request.POST.get("Show","")
41 42
 		addtags = request.POST.get("addtags","")
42 43
 		texttags = request.POST.get("texttags","")
  44
+		contenttext = request.POST.get("contenttext","")
43 45
 		if show != "":
44 46
 			i=Gbobject.objects.get(id=fulid)
45 47
 			vars=RequestContext(request,{'image':i})
@@ -129,7 +131,7 @@ def create_object(f,log,title,content):
129 131
 		dirname = dirname + final[i]
130 132
 		i=i+1
131 133
 	p.slug=dirname
132  
-	p.content=content
  134
+	p.content_org=content
133 135
 	p.status=2
134 136
 	p.save()
135 137
 	p.sites.add(Site.objects.get_current())
@@ -140,8 +142,74 @@ def create_object(f,log,title,content):
140 142
 	q=Objecttype.objects.get(title="Image")
141 143
 	p.objecttypes.add(Objecttype.objects.get(id=q.id))
142 144
 	p.save()
  145
+	new_ob = content
  146
+ 	myfile = open('/tmp/file.org', 'w')
  147
+ 	myfile.write(new_ob)
  148
+	myfile.close()
  149
+	myfile = open('/tmp/file.org', 'r')
  150
+	myfile.readline()
  151
+	myfile = open('/tmp/file.org', 'a')
  152
+	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")
  153
+	myfile.write("\n#+TITLE: ")
  154
+	myfile = open('/tmp/file.org', 'r')
  155
+	stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  156
+	output = stdout.read()
  157
+	data = open("/tmp/file.html")
  158
+ 	data1 = data.readlines()
  159
+ 	data2 = data1[72:]
  160
+ 	data3 = data2[:-3]
  161
+ 	newdata=""
  162
+ 	for line in data3:
  163
+        	newdata += line.lstrip()
  164
+ 	p.content = newdata
  165
+ 	p.save()
143 166
 
144 167
 def rate_it(topic_id,request,rating):
145 168
 	ob = Gbobject.objects.get(id=topic_id)
146 169
 	ob.rating.add(score=rating ,user=request.user, ip_address=request.META['REMOTE_ADDR'])
147 170
 	return True
  171
+
  172
+def show(request,imageid):
  173
+	if request.method=="POST":
  174
+		rating = request.POST.get("star1","")
  175
+		imgid = request.POST.get("imgid","")
  176
+		addtags = request.POST.get("addtags","")
  177
+		texttags = request.POST.get("texttags","")
  178
+		contenttext = request.POST.get("contenttext","")
  179
+		if rating :
  180
+	       	 	rate_it(int(imgid),request,int(rating))
  181
+		if addtags != "":
  182
+			i=Gbobject.objects.get(id=imgid)
  183
+			i.tags = i.tags+ ","+str(texttags)
  184
+			i.save()
  185
+		if contenttext !="":
  186
+			 edit_description(imgid,contenttext)
  187
+	gbobject = Gbobject.objects.get(id=imageid)
  188
+	vars=RequestContext(request,{'image':gbobject})
  189
+	template="gstudio/fullscreen.html"
  190
+	return render_to_response(template,vars)
  191
+
  192
+def edit_description(sec_id,title):
  193
+	new_ob = Gbobject.objects.get(id=int(sec_id))
  194
+	new_ob.content_org = title
  195
+	myfile = open('/tmp/file.org', 'w')
  196
+	myfile.write(new_ob.content_org)
  197
+	myfile.close()
  198
+	myfile = open('/tmp/file.org', 'r')
  199
+	myfile.readline()
  200
+	myfile = open('/tmp/file.org', 'a')
  201
+	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")
  202
+	myfile.write("\n#+TITLE: ")
  203
+	myfile = open('/tmp/file.org', 'r')
  204
+	stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  205
+	output = stdout.read()
  206
+	data = open("/tmp/file.html")
  207
+	data1 = data.readlines()
  208
+	data2 = data1[72:]
  209
+	data3 = data2[:-3]
  210
+	newdata=""
  211
+	for line in data3:
  212
+		newdata += line.lstrip()
  213
+	new_ob.content = newdata
  214
+	new_ob.save()
  215
+	return True
98  gstudio/views/video.py
@@ -141,7 +141,7 @@ def video(request):
141 141
 				m.title=each['title'].lower()
142 142
 				m.rurl="http://wetube.gnowledge.org/"+each['id']+'/480p.webm'
143 143
 				m.slug=each['id']
144  
-				m.content=content
  144
+				m.content_org=content
145 145
 				m.status=2
146 146
 				m.save()
147 147
 				m.sites.add(Site.objects.get_current())
@@ -181,6 +181,27 @@ def video(request):
181 181
 				a4.svalue=final
182 182
 				a4.save()
183 183
 				m.save()
  184
+				new_ob = content
  185
+ 				myfile = open('/tmp/file.org', 'w')
  186
+			 	myfile.write(new_ob)
  187
+				myfile.close()
  188
+				myfile = open('/tmp/file.org', 'r')
  189
+				myfile.readline()
  190
+				myfile = open('/tmp/file.org', 'a')
  191
+				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")
  192
+				myfile.write("\n#+TITLE: ")
  193
+				myfile = open('/tmp/file.org', 'r')
  194
+				stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  195
+				output = stdout.read()
  196
+				data = open("/tmp/file.html")
  197
+			 	data1 = data.readlines()
  198
+			  	data2 = data1[72:]
  199
+ 				data3 = data2[:-3]
  200
+			 	newdata=""
  201
+			 	for line in data3:
  202
+			        	newdata += line.lstrip()
  203
+			 	m.content = newdata
  204
+			 	m.save()				
184 205
 			
185 206
 			
186 207
 					
@@ -332,4 +353,79 @@ def CreateConfig(user,password):
332 353
     
333 354
 
334 355
 
  356
+def show(request,videoid):
  357
+	if request.method == 'POST':
  358
+		svid = request.POST.get("svid","")
  359
+		rating = request.POST.get("star1","")
  360
+		vidid = request.POST.get("vidid","")
  361
+		user = request.POST.get("user","")
  362
+		favid=request.POST.get("favid","")
  363
+		favusr=request.POST.get("favusr","")
  364
+		addtags = request.POST.get("addtags","")
  365
+		texttags = request.POST.get("texttags","")
  366
+		contenttext = request.POST.get("contenttext","")
  367
+		if rating :
  368
+        	 	rate_it(int(vidid),request,int(rating))
  369
+		
  370
+		if favid!="":
  371
+                        e=0
  372
+                        r = Objecttype.objects.get(title="user")
  373
+                        for each in r.get_nbh['contains_members']:
  374
+                                if favusr+"video" == each.title:
  375
+                                    e=1
  376
+                        if e==0 :
  377
+				t=Gbobject()
  378
+                                t.title=favusr+"video"
  379
+                                t.slug=favusr+"video"
  380
+                                t.content=' '
  381
+                                t.status=2
  382
+                                t.save()
  383
+                                t.objecttypes.add(Objecttype.objects.get(title="user"))
  384
+                                t.save()
  385
+                        t=Gbobject.objects.get(title=favusr+"video")
  386
+                        rel=Relation()
  387
+                        rt=Relationtype.objects.get(title="has_favourite")
  388
+                        rel.relationtype_id=rt.id
  389
+                        f1=Gbobject.objects.get(id=favid)
  390
+                        rel.left_subject_id=t.id
  391
+                        rel.right_subject_id=f1.id
  392
+                        rel.save()
  393
+			t.save()
  394
+
  395
+		
  396
+		if addtags != "":
  397
+			i=Gbobject.objects.get(id=vidid)
  398
+			i.tags = i.tags+ ","+str(texttags)
  399
+			i.save()
  400
+		if contenttext !="":
  401
+			 edit_description(vidid,contenttext)		
  402
+	gbobject = Gbobject.objects.get(id=videoid)
  403
+	vars=RequestContext(request,{'video':gbobject})
  404
+	template="gstudio/transcript.html"
  405
+	return render_to_response(template,vars)
  406
+
335 407
 
  408
+def edit_description(sec_id,title):
  409
+	new_ob = Gbobject.objects.get(id=int(sec_id))
  410
+	new_ob.content_org = title
  411
+	myfile = open('/tmp/file.org', 'w')
  412
+	myfile.write(new_ob.content_org)
  413
+	myfile.close()
  414
+	myfile = open('/tmp/file.org', 'r')
  415
+	myfile.readline()
  416
+	myfile = open('/tmp/file.org', 'a')
  417
+	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")
  418
+	myfile.write("\n#+TITLE: ")
  419
+	myfile = open('/tmp/file.org', 'r')
  420
+	stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
  421
+	output = stdout.read()
  422
+	data = open("/tmp/file.html")
  423
+	data1 = data.readlines()
  424
+	data2 = data1[72:]
  425
+	data3 = data2[:-3]
  426
+	newdata=""
  427
+	for line in data3:
  428
+		newdata += line.lstrip()
  429
+	new_ob.content = newdata
  430
+	new_ob.save()