Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #83 from Dhiru/master

modification done in image, video, document and home page
  • Loading branch information...
commit 85f7d716309b79fb1f46dc887897a127017841cb 2 parents 02b3d1e + 11b4650
@gnowgi authored
View
86 gstudio/templates/gstudio/docu.html
@@ -1,7 +1,3 @@
-
-<html>
-
-<body>
{% extends "gstudio/base.html" %}
{% load pagination_tags %}
{% load adminmedia grp_tags %}
@@ -10,6 +6,8 @@
{% block content %}
{% load tagging_tags comments i18n %}
<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#content").css({
@@ -21,6 +19,41 @@
$("#graphcss").hide();
});
var i = 0;
+jQuery(document).ready(function($) {
+ $("#commenteditor").click(function(){
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ document.getElementById('descriptionsave').style.visibility="visible";
+ $("#commenteditor").hide();
+
+ });
+ $("#descriptionsave").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#descriptioncommenttext").val(decode_data);
+
+ });
+});
+jQuery(document).ready(function($) {
+ $(".editcontent").click(function(){
+ var a = $(this).attr("id");
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").val($("#editortext"+a).val());
+ $("#gnoweditor").orgitdown(mySettings);
+ var screentop=$(document).scrollTop();
+ $(".orgitdownContainer").css({"margin-top":screentop,});
+ document.getElementById('save'+a).style.visibility="visible";
+ $("#"+a).hide();
+ });
+ $(".commentsavecontent").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $(".commenttext").val(decode_data);
+ });
+});
+
</script>
<style type="text/css">
#divsearch
@@ -65,9 +98,11 @@ <h4 style="color: black;">Search File</h4>
<div id="divpost">
<form enctype="multipart/form-data" method="post" action="">{% csrf_token %}
<br/>
-<h4 style="color: black;">Post File:</h4>&nbsp;
-file:&nbsp;<input type=file name="doc[]" multiple="multiple" /><br><br>
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
+<h4 style="color: black;">Post File:</h4>
+<font size="3">File:</font>&nbsp;<input type=file name="doc[]" multiple="multiple" /><br><br>
+Description:&nbsp;&nbsp;<input type="button" id="commenteditor" value="Add Content" >
+<input type="button" class="commentsavecontent" id="descriptionsave" value="Save" style="visibility:hidden" />
+<input type=text name="contenttext" id="descriptioncommenttext" style="visibility:hidden" />
<input type="hidden" name="user" value={{user.username}}><br><br>
<input type="submit" value="Post">
@@ -86,6 +121,7 @@ <h4 style="color: teal;">Documents Listing</h4>
<div class="gbobject-content">
<!-- {{ object_content }}-->
</div>
+<form method="post" action="">{% csrf_token %}
<h2 style="color: green;">{{document.title}}</a></h2>
<font color = 'black'>Posted By : </font>
{% for author in document.authors.all %}
@@ -94,9 +130,24 @@ <h2 style="color: green;">{{document.title}}</a></h2>
<br>
<font color = 'black'>Posted At : </font><font color = 'teal'>{{document.creation_date}}</font>
<br>
-<font color = 'black'>Description:</font><font color = 'teal'>{{ document.content }}</font>
+<font color = 'black'>Description:</font><font color = 'teal'>
+{%autoescape on%}
+{% with document.html_content|safe as document_content %}
+ {{document_content}}
+{% endwith %}
+{% endautoescape%}</font>
+{% for author in image.authors.all %}
+ {% ifequal author.username user.username %}
+<input type="hidden" name="docid" value={{document.id}}>
+<input type="button" class="editcontent" id="{{document.id}}" value="Edit"/>
+<input type="submit" class="commentsavecontent" id="save{{document.id}}" value="Save" style="visibility:hidden" />
+<input type="hidden" name="commenttext" class="commenttext" id="commenttext{{document.id}}" style="visibility:hidden" />
+<input type="hidden" id="editortext{{document.id}}" style="visibility:hidden" value="{{document.content_org}}">
+ {% endifequal %}
+{% endfor %}
+</form>
<br>
-<a href="{% admin_media_prefix %}img/{{document.title}}">Download now!!</a>
+<font color = 'black'>Download: </font><a href="{% admin_media_prefix %}img/{{document.title}}">Click to download!!</a>
<br>
{% for author in document.authors.all %}
{% ifequal author.username user.username %}
@@ -114,20 +165,17 @@ <h2 style="color: green;">{{document.title}}</a></h2>
return false;
}
}
-{% else %}
- <script type="text/javascript">
- function myFunction()
- {
- alert("You are not authorised to delete other users file!");
- }
- </script>
-
- <input type="button" onclick="myFunction()" value="Delete" />
{% endifequal %}
{% endfor %}
</script>
<br>
-<font color = 'black'>Current rating is </font><h4>{{ document.rating.get_rating }}</h4>
+{% ifequal document.rating.get_rating 0 %}
+
+<font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
+{% else %}
+<font color = 'black'>Average Current rating is: </font><h4>{{ document.rating.get_rating }}</h4>
+<font color = 'black'>Total Number of votes is: &nbsp;<font color='teal'><b>{{ document.rating_votes }}</b></font> </font>
+{% endifequal %}
<br>
<form method="post" action="">
{% csrf_token %}
View
75 gstudio/templates/gstudio/fullscreen.html
@@ -1,17 +1,47 @@
+{% extends "gstudio/base.html" %}
{% load adminmedia grp_tags %}
{% load i18n comments gstudio_tags %}
{% load tagging_tags comments i18n %}
-
-<html>
-<head>
+{% block content %}
+<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
+ <script type="text/javascript" >
+ $(window).load(function() {
+ $("#content").css({
+ "width": "600px",});});
+$(window).load(function() {
+ $("#chart").hide();});
+$(window).load(function() {
+
+ $("#graphcss").hide();
+ });
+jQuery(document).ready(function($) {
+ $("#editcontent").click(function(){
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").val($("#editortext").val());
+ $("#gnoweditor").orgitdown(mySettings);
+ document.getElementById('save').style.visibility="visible";
+ $("#editcontent").hide();
+
+ });
+ $("#save").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#commenttext").val(decode_data);
+
+ });
+});
+</script>
+</script>
<link href="{% admin_media_prefix %}css/base.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen.css" />
<link rel="shortcut icon" href="{{ STATIC_URL }}gstudio/img/favicon.ico" />
-</head>
-<body>
<img src="{% admin_media_prefix %}img/{{image.image}}" >
<br/>
+<form method="post" action="">{% csrf_token %}
<font color = 'black'>Name : </font><font color = 'teal'>{{image.title}}</font>
<br/>
<font color = 'black'>Posted By : </font>
@@ -22,14 +52,34 @@
<font color = 'black'>Posted At : </font><font color = 'teal'>{{image.creation_date}}</font>
<br/>
-<font color = 'black'>Description:</font><font color = 'teal'>{{ image.content }}</font>
-<br/>
+<font color = 'black'>Description:</font><font color = 'teal'>
+{%autoescape on%}
+{% with image.html_content|safe as image_content %}
+ {{image_content}}
+{% endwith %}
+{% endautoescape%}
+</font>
+
+{% for author in image.authors.all %}
+ {% ifequal author.username user.username %}
+<input type="hidden" name="imgid" value={{image.id}}>
+<input type="button" id="editcontent" value="Edit"/>
+
+<input type="submit" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
+<input type="hidden" name="contenttext" id="commenttext" style="visibility:hidden" />
+<input type="hidden" id="editortext" style="visibility:hidden" value="{{image.content_org}}">
+ {% endifequal %}
+{% endfor %}
+</form>
+
+<br/>
{% ifequal image.rating.get_rating 0 %}
<font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
{% else %}
-<font color = 'black'>Current rating is: &nbsp; <font color = 'teal'> {{ image.rating.get_rating }} </font></font>
+<font color = 'black'>Average Current rating is: &nbsp; <font color = 'teal'> {{ image.rating.get_rating }} </font></font><br/>
+<font color = 'black'>Total Number of votes is: &nbsp;<font color='teal'><b>{{ image.rating_votes }}</b></font> </font>
{% endifequal %}
<br>
<form method="post" action="">
@@ -42,13 +92,6 @@
</br>
<input type="hidden" name="imgid" value={{image.id}}>
<input type="submit" value="Rate it!!!">
-<script type="text/javascript">
-function myFunction()
-{
- document.this_form.action = "/gstudio/resources/images/";
-}
-</script>
-<input type="submit" value="Back" onclick()="myFunction()">
</form>
<br/>
@@ -124,4 +167,4 @@
<hr width="100%" style="height:5px;" color="black"/>
<br>
-</html></body>
+{% endblock %}
View
24 gstudio/templates/gstudio/home.html
@@ -14,7 +14,7 @@
}
#homebody{
height:100%;
- background: #B3B3B3;
+ background: white;
}
#header {
@@ -77,6 +77,14 @@
position:absolute;
margin-left:47%;
}
+ .tags .tag_1 { font-size: 1em; color: #001e2d; }
+ .tags .tag_2 { font-size: 1.125em; color: #00334c; }
+ .tags .tag_3 { font-size: 2em; color: #005b89; }
+ .tags .tag_4 { font-size: 2.25em; color: #0070a8; }
+ .tags .tag_5 { font-size: 3em; color: #0099e5; }
+ .tags .tag_6 { font-size: 3.20em; color: #00adff; }
+ }
+ #tag{ width: 50%; }
}
</style>
@@ -114,11 +122,11 @@
<div id="header" >
{% include "gstudio/_header.html" %}
</div>
- <div class="tags">
- <h3>{% trans "Tags" %}</h3>
+ <div class="tags" align="center" id="tag">
+ <h2>{% trans "Tag Cloud" %}</h2>
{% get_tag_cloud %}
</div>
-
+ </center>
<div id="main">
<center><font size="23" color="#4d659e"><b>{{ site }}</b></font></center>
<form action="{% url gstudio_nodetype_search %}" method="get">
@@ -129,16 +137,16 @@
</form>
</div><br/><br/><br/>
<link rel="stylesheet" type="text/css" media="screen, projection" href="/static/gstudio/css/screen.css" />
-<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>
+<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>
<div class="bottom">
<div class="authors">
- <h3>{% trans "Recents Authors" %}</h3>
+ <h3>{% trans "Recent Authors" %}</h3>
{% get_authors %}
</div>
<div class="recentsnodetype">
-<h3>{% trans "Recent Nodes" %}</h3>
-{% get_recent_nodetypes %}
+<h3>{% trans "Recent Objects" %}</h3>
+{% get_recent_gbobjects %}
</div>
<div class="comments">
<h3>{% trans "Recent Comments" %}</h3>
View
38 gstudio/templates/gstudio/image.html
@@ -6,10 +6,11 @@
{% load i18n %}
{% block content %}
<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
- <script type="text/javascript" >
- $(window).load(function() {
- $("#content").css({
- "width": "600px",});});
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
+<script type="text/javascript" >
+$(window).load(function(){
+$("#content").css({"width": "600px"});});
$(window).load(function() {
$("#chart").hide();});
$(window).load(function() {
@@ -18,6 +19,23 @@
});
var i = 0;
+
+jQuery(document).ready(function($) {
+ $("#commenteditor").click(function(){
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ document.getElementById('save').style.visibility="visible";
+ $("#commenteditor").hide();
+
+ });
+ $("#save").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#commenttext").val(decode_data);
+
+ });
+});
</script>
<style type="text/css">
#div2
@@ -76,7 +94,9 @@ <h4 style="color: black; margin-left: 0px;">Search Image:</h4>
<h4 style="color: black; margin-left: 0px;">Post Image:</h4>
Title:&nbsp; <input type="text" name="title1"><br/><br/>
Image:&nbsp; <input type=file name="image[]" multiple="multiple" /><br/><br/>
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
+Description:&nbsp;&nbsp;<input type="button" id="commenteditor" value="Add Content" >
+<input type="button" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
+<input type=text name="contenttext" id="commenttext" style="visibility:hidden" />
<input type="hidden" name="user" value={{user.username}}><br/><br/>
<input type="submit" value=" Post " size="900" name="post" onclick="return myupload();">
@@ -101,11 +121,15 @@ <h4 style="color: teal;">IMAGES</h4>
document.getElementById("divimage").setAttribute("id","div2");
}
+
+
</script>
<h2>{{image.title}}</h2>
<form method="post" action="">{% csrf_token %}
<input type="hidden" name="fulid" value={{image.id}}>
- <input type="submit" value="Show" name="Show">
+ <!-- <input type="submit" value="Show" name="Show">-->
+
+ <a href="/gstudio/resources/images/show/{{image.id}}/"><font size="4"><u>Show</u></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- <p> -->
<!-- <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>
}
</script>
- <input type="button" onclick="myFunction()" value="Delete" />
+ <input type="button" onclick="myFunction()" value="Delete" style="visibility:hidden" />
</form>
{% endifequal %}
{% endfor %}
View
4 gstudio/templates/gstudio/skeleton.html
@@ -380,7 +380,7 @@
<textarea id="gnoweditor" style="visibility:hidden;">
</textarea>
-
+ {% block graph %}
<div id="graphcss">
<div id="chart">
@@ -812,6 +812,7 @@
</script>
</div>
+ {% endblock %}
</div>
@@ -831,3 +832,4 @@
</body>
</html>
+
View
122 gstudio/templates/gstudio/transcript.html
@@ -1,17 +1,64 @@
+{% extends "gstudio/base.html" %}
{% load adminmedia grp_tags %}
{% load i18n comments gstudio_tags %}
{% load tagging_tags comments i18n %}
+{% load gstudio_tags %}
<html>
<head>
+{% block javascripts %}
+
+<script type="text/javascript">
+ // GLOBALS
+ var grappelli = {},
+ // TODO: klemens: drop ADMIN_URL
+ ADMIN_URL = "{% url admin:index %}",
+ MODEL_URL_ARRAY = {% get_content_types %}, DATE_FORMAT = "{% get_date_format %}", TIME_FORMAT = "{% get_time_format %}", DATETIME_FORMAT = "{% get_datetime_format %}";
+</script>
<link href="{% admin_media_prefix %}css/base.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen.css" />
<link rel="shortcut icon" href="{{ STATIC_URL }}gstudio/img/favicon.ico" />
<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
+<script src="{% admin_media_prefix %}jquery/ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
+<script src="{% admin_media_prefix %}js/grappelli/grappelli.js" type="text/javascript"></script>
+<script src="{% admin_media_prefix %}js/grappelli/jquery.grp_collapsible.js" type="text/javascript"></script>
+<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery.pandoravideo.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-1.8.21.custom.min.js"></script>
-
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
+
+
+ <script type="text/javascript" >
+ $(window).load(function() {
+ $("#content").css({
+ "width": "600px"});});
+
+$(window).load(function() {
+
+ $("#graphcss").hide();
+ });
+$(window).load(function() {
+ $("#chart").hide();});
+var i = 0;
+jQuery(document).ready(function($) {
+ $("#editcontent").click(function(){
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").val($("#editortext").val());
+ $("#gnoweditor").orgitdown(mySettings);
+ document.getElementById('save').style.visibility="visible";
+ $("#editcontent").hide();
+
+ });
+ $("#save").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#commenttext").val(decode_data);
+ });
+});
+</script>
<script type="text/javascript">
$.noConflict();
@@ -19,28 +66,72 @@
$('#pandoravideo').pandoravideo();
});
</script>
+
+{% endblock %}
+ {% block title %}{{ video.title }}{% endblock %}
</head>
<body>
-<div id="pandoravideo" data-pandora-id={{id}} data-pandora-layers="transcripts, descriptions, keywords, places">
-
+{% block content %}
+<div id="pandoravideo" data-pandora-id={{video.slug}} data-pandora-layers="transcripts, descriptions, keywords, places">
</div>
+<b>Download:</b>&nbsp;&nbsp;<a href={{video.rurl}} target="_blank">Right click to download</a><br/>
+<form method="post" action="">{% csrf_token %}
<font color='black'>Name:</font>
-<font color='teal'>{{ titlename }}</font><br/>
+<font color='teal'>{{ video.title }}</font><br/>
<font color = 'black'>Posted By : </font>
+{% for author in video.get_nbh.posted_by %}
+ <font color = 'teal'>{{ author }}</font>
+{% endfor %}
- <font color = 'teal'>{{postedby}}</font>
<br>
<font color = 'black'>Posted At :</font>
- <font color = 'teal'>{{date}}</font>
+{% for date in video.get_nbh.creation_day %}
+<font color = 'teal'>{{date}}</font>
+
+{% endfor %}
+
<br>
<font color = 'black'>Location: </font>
+{% for we in video.get_nbh.source %}
+ <!-- <font color = 'black'>Location: </font> -->
+ {% for map in video.get_nbh.map_link %}
+ {% ifnotequal map '' %}
<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>
+ {% endifnotequal %}
+ {% endfor %}
+ {% endfor %}
+
<br>
-<font color = 'black'>Description:</font><font color = 'teal'>{{ contentname }}</font>
+ <input type="hidden" name="contentname" value="{{ video.content }}" />
+ <input type="hidden" name="ratename" value="{{ video.rating.get_rating }}" />
+<font color = 'black'>Description:</font><font color = 'teal'>
+{%autoescape on%}
+{% with video.html_content|safe as video_content %}
+ {{video_content}}
+{% endwith %}
+{% endautoescape%}</font>
+
+{% for author in video.get_nbh.posted_by %}
+ {% ifequal author user.username %}
+<input type="hidden" name="vidid" value={{video.id}}>
+<input type="button" id="editcontent" name="{{video.content}}" value="Edit"/>
+<input type="submit" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
+<input type="hidden" name="contenttext" id="commenttext" style="visibility:hidden" />
+<input type="hidden" id="editortext" style="visibility:hidden" value="{{video.content_org}}">
+ {% endifequal %}
+{% endfor %}
+</form>
<br/>
-<font color = 'black'>Current rating is: &nbsp;<font color='teal'><b>{{ rateby }}</b></font> </font>
+
+{% ifequal video.rating.get_rating 0 %}
+
+<font color = 'black'>Current rating is: &nbsp;<font color = 'teal'> No rating yet </font></font>
+{% else %}
+<font color = 'black'>Average Current rating is: &nbsp;<font color='teal'><b>{{ video.rating.get_rating }}</b></font> </font><br/>
+<font color = 'black'>Total Number of votes is: &nbsp;<font color='teal'><b>{{ video.rating_votes }}</b></font> </font>
+{% endifequal %}
<br>
<form method="post" action="">
{% csrf_token %}
@@ -50,18 +141,18 @@
<input name="star1" type="radio" value=4 class="star"/>
<input name="star1" type="radio" value=5 class="star"/>
-<input type="hidden" name="vidid" value={{vidid}}>
+<input type="hidden" name="vidid" value={{video.id}}>
<input type="submit" value="Rate it!!!">
</form>
<br>
<form method="post" action="">
{% csrf_token %}
-<input type="hidden" name="favid" value={{vidid}}>
+<input type="hidden" name="favid" value={{video.id}}>
<input type="hidden" name="favusr" value={{user.username}}>
<input type="submit" value="Add to favourites">
</form><br>
<form method="post" action="">{% csrf_token %}
-<input type="hidden" name="vidid" value={{vidid}}>
+<input type="hidden" name="vidid" value={{video.id}}>
<input type="text" value="" name="texttags" />
<input type="submit" value="Add Tags" name="addtags" />
</form>
@@ -125,8 +216,11 @@
<div class="commentForm span-16 last">
{% render_comment_form for video %}
</div>
-<hr width="100%" style="height:5px;" color="black"/>
+<!--<hr width="100%" style="height:5px;" color="black"/>-->
<br>
+
+{% endblock %}
+{% block graph %}
+
+{% endblock %}
</body>
-
-</html>
View
29 gstudio/templates/gstudio/video.html
@@ -6,6 +6,8 @@
{% block content %}
<script src="{% admin_media_prefix %}jquery/jquery-1.6.2.min.js" type="text/javascript"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/org/set.js"></script>
+<script type="text/javascript" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#content").css({
@@ -17,6 +19,21 @@
$("#graphcss").hide();
});
var i = 0;
+jQuery(document).ready(function($) {
+ $("#commenteditor").click(function(){
+ document.getElementById('gnoweditor').style.visibility="visible";
+ $("#gnoweditor").orgitdown(mySettings);
+ document.getElementById('save').style.visibility="visible";
+ $("#commenteditor").hide();
+
+ });
+ $("#save").click(function(){
+ var org_data = $("#gnoweditor").val();
+ var encode_data = encodeURIComponent(org_data);
+ var decode_data = decodeURIComponent(encode_data.replace(/\+/g, " "));
+ $("#commenttext").val(decode_data);
+ });
+});
</script>
<style type="text/css">
#div2
@@ -92,13 +109,15 @@ <h4 style="color: black;">Search Videos:</h4>
<form enctype="multipart/form-data" method="post" action="">
{% csrf_token %}
<p><h4 style="color: black;">Submit Videos:</h4>Video:&nbsp;<input type="file" name="clip" multiple="multiple" /></p><br/>
-Description:&nbsp;&nbsp;<input type=textarea name="contenttext"/>
+Description:&nbsp;&nbsp;<input type="button" id="commenteditor" value="Add Content" >
+<input type="button" class="commentsavecontent" id="save" value="Save" style="visibility:hidden" />
+<input type=text name="contenttext" id="commenttext" style="visibility:hidden" />
<input type="hidden" name="user" value={{user.username}}>
<input type="hidden" name="userpassword" value={{user.password}}>
-<input type="hidden" name="useremail" value={{user.email}}><br/><br/>
+<input type="hidden" name="useremail" value={{user.email}}>
<p><b> Enter the password of wetube.gnowledge.org</b> </p>
<input type="password" name="videopassword" />
-<br/><br/>
+
<input type="submit" value="Upload" onclick="return myupload();" >
<script type="text/javascript">
function myupload()
@@ -165,8 +184,8 @@ <h2 style="color: teal;">List of Videos in the library </h2><br/>
<form enctype="multipart/form-data" method="post" action="" target="_blank">
{% csrf_token %}
<input type="hidden" name = "full" value ={{video.slug}}>
-<input type="submit" value="Play">
-
+<!--<input type="submit" value="Play">-->
+<a href="/gstudio/resources/videos/show/{{video.id}}/"><font size="4"><u>Show</u></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href={{video.rurl}} target="_blank">Right click to download</a><br>
<!-- <font color = 'black'>Posted By : </font> -->
{% for author in video.get_nbh.posted_by %}
View
2  gstudio/urls/image.py
@@ -21,5 +21,5 @@
urlpatterns = patterns('gstudio.views.image',
url(r'^$', 'image',
name='image'),
-
+ url(r'show/(\d+)/$','show',name='showimage'),
)
View
2  gstudio/urls/video.py
@@ -21,5 +21,5 @@
urlpatterns = patterns('gstudio.views.video',
url(r'^$', 'video',
name='video'),
-
+ url(r'show/(\d+)/$','show',name='showvideo'),
)
View
58 gstudio/views/docu.py
@@ -21,6 +21,7 @@
from demo.settings import *
from gstudio.models import *
from objectapp.models import *
+from gstudio.methods import *
def docu(request):
p=Objecttype.objects.get(title="Document")
@@ -36,6 +37,7 @@ def docu(request):
delete = request.POST.get("delete","")
addtags = request.POST.get("addtags","")
texttags = request.POST.get("texttags","")
+ contenttext = request.POST.get("commenttext","")
if rating :
rate_it(int(docid),request,int(rating))
if delete != "":
@@ -70,6 +72,9 @@ def docu(request):
i.tags = i.tags+ ","+str(texttags)
i.save()
+ if contenttext !="":
+ edit_description(docid,contenttext)
+
a=[]
for each in request.FILES.getlist("doc[]",""):
@@ -81,7 +86,9 @@ def docu(request):
vars=RequestContext(request,{'documents':q})
template="gstudio/docu.html"
return render_to_response(template, vars)
- vars=RequestContext(request,{'documents':q})
+ s=Nodetype.objects.get(title="Document")
+# t=s.get_nbh['contains_members']
+ vars=RequestContext(request,{'documents':q,'docomment':s})
template="gstudio/docu.html"
return render_to_response(template, vars)
@@ -105,7 +112,7 @@ def create_object(file,log,content):
else:
final = final+each1
p.slug=final
- p.content=content
+ p.content_org=content
p.status=2
p.save()
p.sites.add(Site.objects.get_current())
@@ -116,8 +123,55 @@ def create_object(file,log,content):
q=Objecttype.objects.get(title="Document")
p.objecttypes.add(Objecttype.objects.get(id=q.id))
p.save()
+ new_ob = content
+ myfile = open('/tmp/file.org', 'w')
+ myfile.write(new_ob)
+ 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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.html")
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ p.content = newdata
+ p.save()
def rate_it(topic_id,request,rating):
ob = Gbobject.objects.get(id=topic_id)
ob.rating.add(score=rating ,user=request.user, ip_address=request.META['REMOTE_ADDR'])
return True
+
+
+def edit_description(sec_id,title):
+ new_ob = Gbobject.objects.get(id=int(sec_id))
+ new_ob.content_org = title
+ myfile = open('/tmp/file.org', '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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.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
View
70 gstudio/views/image.py
@@ -22,6 +22,7 @@
from gstudio.models import *
from objectapp.models import *
import os
+from gstudio.methods import *
def image(request):
p=Objecttype.objects.get(title="Image")
@@ -40,6 +41,7 @@ def image(request):
show = request.POST.get("Show","")
addtags = request.POST.get("addtags","")
texttags = request.POST.get("texttags","")
+ contenttext = request.POST.get("contenttext","")
if show != "":
i=Gbobject.objects.get(id=fulid)
vars=RequestContext(request,{'image':i})
@@ -129,7 +131,7 @@ def create_object(f,log,title,content):
dirname = dirname + final[i]
i=i+1
p.slug=dirname
- p.content=content
+ p.content_org=content
p.status=2
p.save()
p.sites.add(Site.objects.get_current())
@@ -140,8 +142,74 @@ def create_object(f,log,title,content):
q=Objecttype.objects.get(title="Image")
p.objecttypes.add(Objecttype.objects.get(id=q.id))
p.save()
+ new_ob = content
+ myfile = open('/tmp/file.org', 'w')
+ myfile.write(new_ob)
+ 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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.html")
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ p.content = newdata
+ p.save()
def rate_it(topic_id,request,rating):
ob = Gbobject.objects.get(id=topic_id)
ob.rating.add(score=rating ,user=request.user, ip_address=request.META['REMOTE_ADDR'])
return True
+
+def show(request,imageid):
+ if request.method=="POST":
+ rating = request.POST.get("star1","")
+ imgid = request.POST.get("imgid","")
+ addtags = request.POST.get("addtags","")
+ texttags = request.POST.get("texttags","")
+ contenttext = request.POST.get("contenttext","")
+ if rating :
+ rate_it(int(imgid),request,int(rating))
+ if addtags != "":
+ i=Gbobject.objects.get(id=imgid)
+ i.tags = i.tags+ ","+str(texttags)
+ i.save()
+ if contenttext !="":
+ edit_description(imgid,contenttext)
+ gbobject = Gbobject.objects.get(id=imageid)
+ vars=RequestContext(request,{'image':gbobject})
+ template="gstudio/fullscreen.html"
+ return render_to_response(template,vars)
+
+def edit_description(sec_id,title):
+ new_ob = Gbobject.objects.get(id=int(sec_id))
+ new_ob.content_org = title
+ myfile = open('/tmp/file.org', '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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.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
View
98 gstudio/views/video.py
@@ -141,7 +141,7 @@ def video(request):
m.title=each['title'].lower()
m.rurl="http://wetube.gnowledge.org/"+each['id']+'/480p.webm'
m.slug=each['id']
- m.content=content
+ m.content_org=content
m.status=2
m.save()
m.sites.add(Site.objects.get_current())
@@ -181,6 +181,27 @@ def video(request):
a4.svalue=final
a4.save()
m.save()
+ new_ob = content
+ myfile = open('/tmp/file.org', 'w')
+ myfile.write(new_ob)
+ 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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.html")
+ data1 = data.readlines()
+ data2 = data1[72:]
+ data3 = data2[:-3]
+ newdata=""
+ for line in data3:
+ newdata += line.lstrip()
+ m.content = newdata
+ m.save()
@@ -332,4 +353,79 @@ def CreateConfig(user,password):
+def show(request,videoid):
+ if request.method == 'POST':
+ svid = request.POST.get("svid","")
+ rating = request.POST.get("star1","")
+ vidid = request.POST.get("vidid","")
+ user = request.POST.get("user","")
+ favid=request.POST.get("favid","")
+ favusr=request.POST.get("favusr","")
+ addtags = request.POST.get("addtags","")
+ texttags = request.POST.get("texttags","")
+ contenttext = request.POST.get("contenttext","")
+ if rating :
+ rate_it(int(vidid),request,int(rating))
+
+ if favid!="":
+ e=0
+ r = Objecttype.objects.get(title="user")
+ for each in r.get_nbh['contains_members']:
+ if favusr+"video" == each.title:
+ e=1
+ if e==0 :
+ t=Gbobject()
+ t.title=favusr+"video"
+ t.slug=favusr+"video"
+ t.content=' '
+ t.status=2
+ t.save()
+ t.objecttypes.add(Objecttype.objects.get(title="user"))
+ t.save()
+ t=Gbobject.objects.get(title=favusr+"video")
+ rel=Relation()
+ rt=Relationtype.objects.get(title="has_favourite")
+ rel.relationtype_id=rt.id
+ f1=Gbobject.objects.get(id=favid)
+ rel.left_subject_id=t.id
+ rel.right_subject_id=f1.id
+ rel.save()
+ t.save()
+
+
+ if addtags != "":
+ i=Gbobject.objects.get(id=vidid)
+ i.tags = i.tags+ ","+str(texttags)
+ i.save()
+ if contenttext !="":
+ edit_description(vidid,contenttext)
+ gbobject = Gbobject.objects.get(id=videoid)
+ vars=RequestContext(request,{'video':gbobject})
+ template="gstudio/transcript.html"
+ return render_to_response(template,vars)
+
+def edit_description(sec_id,title):
+ new_ob = Gbobject.objects.get(id=int(sec_id))
+ new_ob.content_org = title
+ myfile = open('/tmp/file.org', '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.write("\n#+TITLE: ")
+ myfile = open('/tmp/file.org', 'r')
+ stdout = os.popen(PYSCRIPT_URL_GSTUDIO)
+ output = stdout.read()
+ data = open("/tmp/file.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
Please sign in to comment.
Something went wrong with that request. Please try again.