summaryrefslogtreecommitdiff
path: root/gstudio/templates/gstudio/docu.html
blob: bb66363ba3ecd893a06ca89ebddb199da4e6b8a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
{% extends "gstudio/base.html" %}
{% load pagination_tags %}
{% load adminmedia grp_tags %}
{% load i18n comments gstudio_tags %}
{% load i18n objectapp_tags %}
{% 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({
    "width": "600px",});});
$(window).load(function() {
 $("#chart").hide();});
$(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
{
position:absolute;
}
#upperdiv
{
position:relative;
margin-bottom:35%;
}
#divpost
{
position:absolute;
margin-left:52%;
}
</style> 
{% if user.is_authenticated %}
{% autopaginate documents 8 %}
<h2 style="color: teal;">Document Library</h2>
<br>
<div id="upperdiv">

<div id="divsearch">
<form method="post" action="">
{% csrf_token %}
<br/>
<h4 style="color: black;">Search File</h4>
<input type="text" name="sdoc" value={{val}}>&nbsp;
<br/>
<br/>
<select name="mydropdown" style="margin:0">
<option value="title">Title</option>
<option value="creation_date">Creation Date</option>
</select>
<br/>
<br/>
<input type="submit" value="Search">
</form>
</div>

<div id="divpost">
<form enctype="multipart/form-data" method="post" action="">{% csrf_token %}
<br/>
<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">
</form>
</div>

</div>
<br>
<br>
<br>
<br>
<h4 style="color: teal;">Documents Listing</h4>

{% for document in documents %}

    <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 %}
  <font color = 'teal'>{{author}}</font>
{% endfor %}
<br>
<font color = 'black'>Posted At : </font><font color = 'teal'>{{document.creation_date}}</font>
<br>
<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>
<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 %} 
<form method="post" action="" onclick="return makesure();">
{% csrf_token %}
<input type="hidden" name="dn" value={{document.id}}>
<input type="submit" name="delete" value="Delete">
</form>
<script type="text/javascript">
 function makesure() {
  if (confirm('Are you sure you want to delete this file?')) {
    return true;
  }
  else {
    return false;
  }
 }
	{% endifequal %}
{% endfor %}
</script>
<br>
{% 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 %}
<input name="star1" type="radio" value=1 class="star"/>
<input name="star1" type="radio" value=2 class="star"/>
<input name="star1" type="radio" value=3 class="star"/>
<input name="star1" type="radio" value=4 class="star"/>
<input name="star1" type="radio" value=5 class="star"/>
</br>
<input type="hidden" name="docid" value={{document.id}}>
<input type="submit" value="Rate it!!!">
</form><br>
<form method="post" action="">{% csrf_token %}
<input type="hidden" name="docid" value={{document.id}}>
<input type="text" value="" name="texttags"  />
<input type="submit" value="Add Tags" name="addtags" />
</form>
<br>
<div class="tags">
    <p class="gbobject-tags span-16 last">
      <strong>{% trans "Tags" %}</strong> :
      {% tags_for_object document as tag_list %}
      {% for tag in tag_list %}
      <a href="{% url objectapp_tag_detail tag %}"
         title="Tag {{ tag }}" rel="tag">{{ tag }}</a>
      {% empty %}
      <span>{% trans "No tags" %}</span>
      {% endfor %}
    </p>
</div>
<br/><br/>
<hr width="100%" style="height:5px;" color="black"/>
<br>
{% endfor %}<br>


{% else %}
 
<h2 style="color: indigo;">Sorry you need to log in to see this content !</h2>
 
{% endif %}
 
 <h2>
{% paginate %}</h2>





{% endblock %}

</body>