diff options
Diffstat (limited to 'gstudio/templates/gstudio/docu.html')
-rw-r--r-- | gstudio/templates/gstudio/docu.html | 86 |
1 files changed, 67 insertions, 19 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 %} |