Skip to content

Commit

Permalink
Merge pull request #81 from supriyasawant/master
Browse files Browse the repository at this point in the history
tags added to wikipage
  • Loading branch information
gnowgi committed Aug 13, 2012
2 parents 3180e36 + c46d210 commit 86e6691
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 39 deletions.
26 changes: 11 additions & 15 deletions gstudio/static/gstudio/js/addcontent.js
Expand Up @@ -4,6 +4,7 @@
$("#addcontent").one("click",function(){
//var abc = document.getElementById('pageid1').value;
//window.location.replace('sectionadd1/'+abc);
$("#save").show();
$("#chart").hide();
// var orgdata = document.getElementById('orgcontent').value;
document.getElementById('gnoweditor').style.visibility="visible";
Expand All @@ -27,6 +28,7 @@
$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
$("#save1").show();
});
$("#save1").one("click",function() {
var org_data = $("#gnoweditor").val();
Expand All @@ -36,6 +38,8 @@

});
$("#editseccontent").one("click",function(){
$("#saveseccontent").show();

$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
Expand All @@ -44,10 +48,6 @@
var screenTop = $(document).scrollTop();
$(".orgitdownContainer").css({
"margin-top":screenTop,});
$("#savesubsec").hide();
$("#savesubsec1").hide();
$("#savepagecontent").hide();

});
$("#saveseccontent").one("click",function(){
var org_data = $("#gnoweditor").val();
Expand Down Expand Up @@ -85,6 +85,8 @@

});
$("#editsubsec").one("click",function(){
$("#savesubsec1").show();

$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
Expand All @@ -93,10 +95,7 @@
var screenTop = $(document).scrollTop();
$(".orgitdownContainer").css({
"margin-top":screenTop,});
$("#savesubsec").hide();
$("#saveseccontent").hide();
$("#savepagecontent").hide();


});
$("#savesubsec1").one("click",function(){
var org_data = $("#gnoweditor").val();
Expand Down Expand Up @@ -136,6 +135,7 @@

$("#editpagecontent").one("click",function(){
$("#chart").hide();
$("#savepagecontent").show();
document.getElementById('gnoweditor').style.visibility="visible";

$("#gnoweditor").orgitdown(mySettings);
Expand All @@ -144,10 +144,6 @@
var screenTop = $(document).scrollTop();
$(".orgitdownContainer").css({
"margin-top":screenTop,});
$("#saveseccontent").hide();
$("#savesubsec").hide();
$("#savesubsec1").hide();


});
$("#savepagecontent").one("click",function(){
Expand Down Expand Up @@ -189,16 +185,16 @@


$("#createsubsection").one("click",function(){
$("#savesubsec").show();

$("#chart").hide();
document.getElementById('gnoweditor').style.visibility="visible";
$("#gnoweditor").orgitdown(mySettings);
$("#gnoweditor").val('');
var screenTop = $(document).scrollTop();
$(".orgitdownContainer").css({
"margin-top":screenTop,});
$("#savesubsec1").hide();
$("#saveseccontent").hide();
$("#savepagecontent").hide();

});
$("#savesubsec").one("click",function() {
var org_data = $("#gnoweditor").val();
Expand Down
6 changes: 6 additions & 0 deletions gstudio/templates/gstudio/NewPage.html
@@ -1,6 +1,12 @@
{%extends "gstudio/base.html"%}
{%load i18n %}
{% block content %}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#save1").hide();});
</script>

{%if user.is_authenticated%}
{% if errors %}
<ul>
Expand Down
5 changes: 5 additions & 0 deletions gstudio/templates/gstudio/NewSection1.html
@@ -1,6 +1,11 @@

{% extends "gstudio/base.html" %}
{% block content %}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" >
$(window).load(function() {
$("#save").hide();});
</script>
<h1>Add a new Section</h1>
{% if errors %}
<ul>
Expand Down
4 changes: 4 additions & 0 deletions gstudio/templates/gstudio/skeleton.html
Expand Up @@ -293,6 +293,10 @@

<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>
Expand Down
23 changes: 22 additions & 1 deletion gstudio/templates/gstudio/tags/commentpage.html
Expand Up @@ -4,6 +4,8 @@

{% load gstudio_tags %}
{% load i18n %}
{% load tagging_tags comments i18n %}




Expand Down Expand Up @@ -32,7 +34,26 @@
<input type="button" id="subsecorg" value="{{child.content_org}}" style="visibility:hidden;"/>
<input type="button" id="subsecid" value="{{child.id}}" style="visibility:hidden;"/>
<input type="checkbox" name="del_comment" value="delete_comment">
<input type="submit" value="Delete this Subsection">
<input type="submit" value="Delete this Subsection"></br>
<form method="post" action="">{% csrf_token %}
<input type="hidden" name="docid" value={{child.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 child 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>

</form>
{% show_commentpage child idusr flag admin_id attribute%}
</li>
Expand Down
71 changes: 48 additions & 23 deletions gstudio/templates/metadashboard/pgedashboard.html
Expand Up @@ -3,6 +3,9 @@
{% load adminmedia grp_tags %}
{% load gstudio_tags %}
{% load pagination_tags %}
{% load i18n objectapp_tags %}
{% load tagging_tags comments i18n %}

<!-- {% load i18n %} -->
{% block content %}
<style>
Expand All @@ -20,6 +23,14 @@

$("#graphcss").hide();
});
$(window).load(function() {

$("#savepagecontent").hide();
$("#saveseccontent").hide();
$("#savesubsec").hide();
$("#savesubsec1").hide();

});

</script>

Expand All @@ -39,32 +50,27 @@ <h1>{{ page_ob.title }}</h1>

<input type="button" id="editpagecontent" value="Edit"/>
<input type="button" id="savepagecontent" value="Save"/></br>
<form method="post" action="">{% csrf_token %}
<input type="hidden" name="docid" value={{page_ob.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 ot 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>
<input type="button" id="pageid" value="{{page_ob.id}}" style="visibility:hidden;"/>
<input type="button" id="pageorg" value="{{page_ob.content_org}}" style="visibility:hidden;"/>

<!-- <h3> This Discussion was initiated by {{admin_m.username}}</h3> -->

<!-- <h>You are logged in as <font color="blue">{{user.username}}</font></h> -->

<!-- {%if flag %} -->
<!-- <div id="Release"> -->
<!-- <form method="post" action=".">{% csrf_token %} -->
<!-- <input type="submit" value="Release Replies"> -->
<!-- <input type="hidden" value="hits" name = "pagerelease"> -->
<!-- </form> -->
<!-- </div> -->
<!-- <div> -->
<!-- <form method="post" action=".">{% csrf_token %} -->
<!-- <input type="submit" value="Block Replies"> -->
<!-- <input type="hidden" value="hits" name = "block"> -->
<!-- </form> -->
<!-- </div> -->
<!-- {% endif %} -->
<!-- </br> -->


<form method="post" action=".">{% csrf_token %}
<!-- <input type="hidden" value="{{page_ob.id}}" name = "pageid">-->
<input type="button" id="newsection1" value="Add a new Section" onClick="location.href='sectionadd1/{{page_ob.id}}';">
<input type="hidden" id="pageid1" value="{{page_ob.id}}"/>
</form>
Expand All @@ -89,6 +95,25 @@ <h5> Not yet rated </h5>
{% endautoescape%}
<input type="button" id="editseccontent" value="Edit"/>
<input type="button" id="saveseccontent" value="Save"/>
<form method="post" action="">{% csrf_token %}
<input type="hidden" name="docid" value={{each.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 each 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>

<input type="button" id="sectionorg" value="{{each.content_org}}" style="visibility:hidden;"/>
<input type="button" id="sectionid" value="{{each.id}}" style="visibility:hidden;"/>
<form method="post" action=".">{% csrf_token %}<br/>
Expand Down
8 changes: 8 additions & 0 deletions gstudio/views/page.py
Expand Up @@ -39,12 +39,20 @@ def pagedashboard(request,pageid):
# # block = request.POST.get("block","")
section_del = request.POST.get("del_section", "")
comment_del = request.POST.get("del_comment", "")
docid = request.POST.get("docid","")
addtags = request.POST.get("addtags","")
texttags = request.POST.get("texttags","")
if section_del:
del_section(int(id_no))
if comment_del:
del_comment(int(id_no1))
if rating :
rate_section(int(id_no),request,int(rating))
if addtags != "":
i=Gbobject.objects.get(id=docid)
i.tags = i.tags+ ","+str(texttags)
i.save()

if rep :
if not id_no :
ptitle= make_title(int(id_no))
Expand Down

0 comments on commit 86e6691

Please sign in to comment.