diff options
author | Dhiru <dhiru@labadmin-P5E-Deluxe.(none)> | 2012-08-24 14:59:49 +0530 |
---|---|---|
committer | Dhiru <dhiru@labadmin-P5E-Deluxe.(none)> | 2012-08-24 14:59:49 +0530 |
commit | 11b4650894021919a60da396de6bf4dd00b68551 (patch) | |
tree | 7a556ff961310eea9ad790ceff1a7f91a5762933 /gstudio | |
parent | 374eb2576ac59e0792349e97ab5f689671d8712a (diff) | |
download | gnowsys-11b4650894021919a60da396de6bf4dd00b68551.tar.gz |
Change in image,video and document library and also in home page
Diffstat (limited to 'gstudio')
-rw-r--r-- | gstudio/templates/gstudio/docu.html | 86 | ||||
-rw-r--r-- | gstudio/templates/gstudio/fullscreen.html | 75 | ||||
-rw-r--r-- | gstudio/templates/gstudio/home.html | 24 | ||||
-rw-r--r-- | gstudio/templates/gstudio/image.html | 38 | ||||
-rw-r--r-- | gstudio/templates/gstudio/skeleton.html | 53 | ||||
-rw-r--r-- | gstudio/templates/gstudio/transcript.html | 122 | ||||
-rw-r--r-- | gstudio/templates/gstudio/video.html | 29 | ||||
-rw-r--r-- | gstudio/urls/image.py | 2 | ||||
-rw-r--r-- | gstudio/urls/video.py | 2 | ||||
-rw-r--r-- | gstudio/views/docu.py | 58 | ||||
-rw-r--r-- | gstudio/views/image.py | 70 | ||||
-rw-r--r-- | gstudio/views/video.py | 98 |
12 files changed, 576 insertions, 81 deletions
diff --git a/gstudio/templates/gstudio/docu.html b/gstudio/templates/gstudio/docu.html index 58e6a44..bb66363 100644 --- a/gstudio/templates/gstudio/docu.html +++ b/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 @@ $(window).load(function() { $("#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 @@ margin-left:52%; <div id="divpost"> <form enctype="multipart/form-data" method="post" action="">{% csrf_token %} <br/> -<h4 style="color: black;">Post File:</h4> -file: <input type=file name="doc[]" multiple="multiple" /><br><br> -Description: <input type=textarea name="contenttext"/> +<h4 style="color: black;">Post File:</h4> +<font size="3">File:</font> <input type=file name="doc[]" multiple="multiple" /><br><br> +Description: <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 @@ Description: <input type=textarea name="contenttext"/> <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 @@ Description: <input type=textarea name="contenttext"/> <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 @@ Description: <input type=textarea name="contenttext"/> 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: <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: <font color='teal'><b>{{ document.rating_votes }}</b></font> </font> +{% endifequal %} <br> <form method="post" action=""> {% csrf_token %} diff --git a/gstudio/templates/gstudio/fullscreen.html b/gstudio/templates/gstudio/fullscreen.html index 8c3efed..e08a09d 100644 --- a/gstudio/templates/gstudio/fullscreen.html +++ b/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: <font color = 'teal'> No rating yet </font></font> {% else %} -<font color = 'black'>Current rating is: <font color = 'teal'> {{ image.rating.get_rating }} </font></font> +<font color = 'black'>Average Current rating is: <font color = 'teal'> {{ image.rating.get_rating }} </font></font><br/> +<font color = 'black'>Total Number of votes is: <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 @@ function myFunction() <hr width="100%" style="height:5px;" color="black"/> <br> -</html></body> +{% endblock %} diff --git a/gstudio/templates/gstudio/home.html b/gstudio/templates/gstudio/home.html index 8859bca..44680fd 100644 --- a/gstudio/templates/gstudio/home.html +++ b/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> diff --git a/gstudio/templates/gstudio/image.html b/gstudio/templates/gstudio/image.html index 73d05da..fa6ccbd 100644 --- a/gstudio/templates/gstudio/image.html +++ b/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 @@ $(window).load(function() { }); 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 @@ margin-left:52%; <h4 style="color: black; margin-left: 0px;">Post Image:</h4> Title: <input type="text" name="title1"><br/><br/> Image: <input type=file name="image[]" multiple="multiple" /><br/><br/> -Description: <input type=textarea name="contenttext"/> +Description: <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 @@ else 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> <!-- <p> --> <!-- <img src="{% admin_media_prefix %}img/{{image.title}}" width="300" height="225" alt="{{ image.title }}" > --> @@ -157,7 +181,7 @@ document.getElementById("divimage").setAttribute("id","div2"); } </script> - <input type="button" onclick="myFunction()" value="Delete" /> + <input type="button" onclick="myFunction()" value="Delete" style="visibility:hidden" /> </form> {% endifequal %} {% endfor %} diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index 8f5c30d..cddc112 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -51,9 +51,9 @@ display: block; position: absolute; } -.orgitdown .orgitdownButton1 a { - background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg); -} +<!-- .orgitdown .orgitdownButton1 a { --> +<!-- background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg); --> +<!-- } --> .orgitdown .orgitdownButton2 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png); } @@ -101,10 +101,10 @@ } .orgitdownContainer { border:1px solid #3C769D; - background:#FFF url(/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-container.png) repeat-x top left; + <!-- background:#FFF url(/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-container.png) repeat-x top left; --> padding:5px 5px 2px 5px; font:11px Verdana, Arial, Helvetica, sans-serif; - margin-left:450px; + margin-left:640px; width:450px; margin-top:30px; } @@ -283,8 +283,47 @@ <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" src="{{STATIC_URL}}gstudio/js/replytotopic.js"></script> + + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/replycomment.js"></script> + <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/topiccomment.js"></script> + + <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/orgitdown/orgitdown/sets/savedata.js"></script> + <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/addcontent.js"></script> + <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/updatepage.js"></script> --> + + <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/addcontent.js"></script> --> + <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.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" src="{{STATIC_URL}}gstudio/js/updatesection.js"></script> --> <!-- EXTRAHEAD --> @@ -341,7 +380,7 @@ <textarea id="gnoweditor" style="visibility:hidden;"> </textarea> - + {% block graph %} <div id="graphcss"> <div id="chart"> @@ -773,6 +812,7 @@ return relations; </script> </div> + {% endblock %} </div> @@ -792,3 +832,4 @@ return relations; </body> </html> + diff --git a/gstudio/templates/gstudio/transcript.html b/gstudio/templates/gstudio/transcript.html index 7860061..d86810e 100644 --- a/gstudio/templates/gstudio/transcript.html +++ b/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 @@ $(function() { $('#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> <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: <font color='teal'><b>{{ rateby }}</b></font> </font> + +{% ifequal video.rating.get_rating 0 %} + +<font color = 'black'>Current rating is: <font color = 'teal'> No rating yet </font></font> +{% else %} +<font color = 'black'>Average Current rating is: <font color='teal'><b>{{ video.rating.get_rating }}</b></font> </font><br/> +<font color = 'black'>Total Number of votes is: <font color='teal'><b>{{ video.rating_votes }}</b></font> </font> +{% endifequal %} <br> <form method="post" action=""> {% csrf_token %} @@ -50,18 +141,18 @@ $('#pandoravideo').pandoravideo(); <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 @@ $('#pandoravideo').pandoravideo(); <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> diff --git a/gstudio/templates/gstudio/video.html b/gstudio/templates/gstudio/video.html index 1a2f6bf..f88572b 100644 --- a/gstudio/templates/gstudio/video.html +++ b/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 @@ $(window).load(function() { $("#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 @@ background: green; <form enctype="multipart/form-data" method="post" action=""> {% csrf_token %} <p><h4 style="color: black;">Submit Videos:</h4>Video: <input type="file" name="clip" multiple="multiple" /></p><br/> -Description: <input type=textarea name="contenttext"/> +Description: <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 @@ document.getElementById("divvideo").setAttribute("id","div2"); <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> <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 %} diff --git a/gstudio/urls/image.py b/gstudio/urls/image.py index 275beb1..8836ffd 100644 --- a/gstudio/urls/image.py +++ b/gstudio/urls/image.py @@ -21,5 +21,5 @@ from django.conf.urls.defaults import patterns urlpatterns = patterns('gstudio.views.image', url(r'^$', 'image', name='image'), - + url(r'show/(\d+)/$','show',name='showimage'), ) diff --git a/gstudio/urls/video.py b/gstudio/urls/video.py index fc1b928..e6ed0f9 100644 --- a/gstudio/urls/video.py +++ b/gstudio/urls/video.py @@ -21,5 +21,5 @@ from django.conf.urls.defaults import patterns urlpatterns = patterns('gstudio.views.video', url(r'^$', 'video', name='video'), - + url(r'show/(\d+)/$','show',name='showvideo'), ) diff --git a/gstudio/views/docu.py b/gstudio/views/docu.py index 45be873..1d0f7f8 100644 --- a/gstudio/views/docu.py +++ b/gstudio/views/docu.py @@ -21,6 +21,7 @@ from django.template import RequestContext 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 diff --git a/gstudio/views/image.py b/gstudio/views/image.py index 508755f..4b1c3f4 100644 --- a/gstudio/views/image.py +++ b/gstudio/views/image.py @@ -22,6 +22,7 @@ from demo.settings import * 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 diff --git a/gstudio/views/video.py b/gstudio/views/video.py index 65e9d43..0bd39b7 100644 --- a/gstudio/views/video.py +++ b/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 |