[pirate-politics] r538 committed - haven't made a commit in a while, signficant updates in css/html as we...

0 views
Skip to first unread message

pirate-...@googlecode.com

unread,
Feb 7, 2011, 2:07:16 AM2/7/11
to pirate-poli...@googlegroups.com
Revision: 538
Author: fragro
Date: Sun Feb 6 23:05:17 2011
Log: haven't made a commit in a while, signficant updates in css/html as
well as the code structure. Added pagination, normalized parent_pk into
consensus so the db queries have a chance at scalability. I'm sure there's
more I forgot.
http://code.google.com/p/pirate-politics/source/detail?r=538

Modified:
/trunk/pirate-politics/ajaxapi/views.py
/trunk/pirate-politics/new_templates/_issue.html
/trunk/pirate-politics/new_templates/_rightcol.html
/trunk/pirate-politics/new_templates/_solution.html
/trunk/pirate-politics/new_templates/_sourcetags.html
/trunk/pirate-politics/new_templates/_voting.html
/trunk/pirate-politics/new_templates/argument_detail.html
/trunk/pirate-politics/new_templates/base.html
/trunk/pirate-politics/new_templates/issue_detail.html
/trunk/pirate-politics/new_templates/issues.html
/trunk/pirate-politics/new_templates/register.html
/trunk/pirate-politics/new_templates/solution_detail.html
/trunk/pirate-politics/new_templates/solutions.html
/trunk/pirate-politics/new_templates/submit_issue.html
/trunk/pirate-politics/new_templates/submit_nay_argument.html
/trunk/pirate-politics/new_templates/submit_solution.html
/trunk/pirate-politics/new_templates/submit_yea_argument.html
/trunk/pirate-politics/new_templates/topics.html
/trunk/pirate-politics/new_templates/user_profile.html
/trunk/pirate-politics/new_templates/welcome.html
/trunk/pirate-politics/pirate_consensus/models.py
/trunk/pirate-politics/pirate_consensus/templatetags/consensustags.py
/trunk/pirate-politics/pirate_core/middleware.py
/trunk/pirate-politics/pirate_core/templatetags/pp_url.py
/trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py
/trunk/pirate-politics/pirate_issues/models.py
/trunk/pirate-politics/pirate_issues/templatetags/issuetags.py
/trunk/pirate-politics/pirate_issues/templatetags/solutiontags.py
/trunk/pirate-politics/pirate_messages/models.py
/trunk/pirate-politics/static/style.css
/trunk/pirate-politics/urls.py

=======================================
--- /trunk/pirate-politics/ajaxapi/views.py Fri Jan 28 02:56:45 2011
+++ /trunk/pirate-politics/ajaxapi/views.py Sun Feb 6 23:05:17 2011
@@ -4,10 +4,13 @@
from django.http import HttpResponse, HttpResponseRedirect
from pirate_consensus.models import UpDownVote
from pirate_sources.models import URLSource
+from tagging.models import Tag
import datetime
from django.shortcuts import get_object_or_404,redirect
from django.contrib.contenttypes.models import ContentType

+from pirate_core.templatetags.tag_helpers import
get_tag_list,get_link_tag_list
+
from pirate_signals.models import aso_rep_event,aso_rep_delete
from pirate_reputation.models import ReputationDimension

@@ -67,7 +70,28 @@
obj.delete()
if isinstance(request.session['last_visited'],list):
return redirect(request.session['last_visited'][-1][0])
-
+
+
+def add_tag(request):
+ if not request.user.is_authenticated():
+ #needs to popup registration dialog instead
+ return HttpResponse(simplejson.dumps({'FAIL':True}), #need a
better non-auth error here, interferes with view
+ mimetype='application/json')
+
+ if request.method == 'POST':
+ obj_id = int(request.POST[u'obj'])
+ tag = str(request.POST[u'tag'])
+ c_type = str(request.POST['c_type'])
+ app_type = str(request.POST['app_type'])
+
+ model_type = ContentType.objects.get(app_label=app_type,
model=c_type)
+ obj = model_type.get_object_for_this_type(pk=obj_id)
+
+ Tag.objects.add_tag(obj, tag)
+ results = {'linktaglist':
get_link_tag_list(obj),'taglist':get_tag_list(obj),'FAIL':False}
+ return HttpResponse(simplejson.dumps(results),
+ mimetype='application/json')
+


def vote(request):
@@ -86,9 +110,12 @@
#needs to popup registration dialog instead
return HttpResponse(simplejson.dumps({'FAIL':True}), #need a
better non-auth error here, interferes with view
mimetype='application/json')
+
if request.method == 'POST':
+ c = None
pk = int(request.POST[u'pk'])
vote_str = request.POST[u'vote']
+ img_size = request.POST[u'img_size']
consensus = Consensus.objects.get(object_pk=pk)
upd = UpDownVote.objects.filter(parent=consensus,user=request.user)
newu = upd.count()
@@ -96,8 +123,8 @@
if newu == 0: #if user has never voted on this consensus object,
create new vote
new_vote =
UpDownVote(vote_type=vote_type,parent=consensus,submit_date=datetime.datetime.now(),user=request.user)
new_vote.save()
- c =
UpDownVote.objects.filter(vote_type=vote_type,parent=consensus).count()
- imgsrc = "/static/voteimgs/" + vote_str + "_arrow_acti.png"
+ #c =
UpDownVote.objects.filter(vote_type=vote_type,parent=consensus).count()
+ imgsrc = "/static/voteimgs/" + vote_str + "_arrow_acti" +
img_size + ".png"
#create reputation event for this vote_dict

user = consensus.content_object.user
@@ -111,10 +138,10 @@
if vote_type in [1,-1]:
aso_rep_delete.send(sender=request.user, event_score=1, user=user,
initiator=request.user,
dimension=ReputationDimension.objects.get('vote'),related_object=upd[0])
elif vote_type == 0:
aso_rep_delete.send(sender=request.user, event_score=-5, user=user,
initiator=request.user,
dimension=ReputationDimension.objects.get('vote'),related_object=upd[0])
upd[0].delete()
- c =
UpDownVote.objects.filter(vote_type=vote_id,parent=consensus).count()
- else: #else do nothing.
- c =
UpDownVote.objects.filter(vote_type=vote_type,parent=consensus).count()
- imgsrc = "/static/voteimgs/" + vote_str + "_arrow_flat.png"
+ #c =
UpDownVote.objects.filter(vote_type=vote_id,parent=consensus).count()
+ #else: #else do nothing.
+ #c =
UpDownVote.objects.filter(vote_type=vote_type,parent=consensus).count()
+ imgsrc = "/static/voteimgs/" + vote_str + "_arrow_flat" +
img_size + ".png"
results = {'count':str(c),'imgsrc':imgsrc,'FAIL':False }
if 'application/json' in request.META.get('HTTP_ACCEPT', ''):
return HttpResponse(simplejson.dumps(results),
=======================================
--- /trunk/pirate-politics/new_templates/_issue.html Mon Jan 31 18:54:01
2011
+++ /trunk/pirate-politics/new_templates/_issue.html Sun Feb 6 23:05:17
2011
@@ -5,21 +5,22 @@
{% load argumenttags %}
{% load solutiontags %}
{% load commenttags %}
+{% load tag_helpers %}


- {% if iss_obj %}
+ {% if iss_obj.content_object %}


<div class="issue">
<div class="bullet">
{% if request.user.is_authenticated %}
- {% pp_consensus_get object=iss_obj.id
user=request.user %}
- <h1> {{ pp_consensus.interest|floatformat }}
+ {% pp_consensus_get
object=iss_obj.content_object.id user=request.user %}
+ <h1> {{ pp_consensus.interest|floatformat:0 }}
</h1>
{% endpp_consensus_get %}
{% else %}
- {% pp_consensus_get object=iss_obj.id %}
- <h1> {{ pp_consensus.interest|floatformat }}
+ {% pp_consensus_get
object=iss_obj.content_object.id %}
+ <h1> {{ pp_consensus.interest|floatformat:0 }}
</h1>
{% endpp_consensus_get %}
{% endif %}
@@ -27,26 +28,33 @@
<div class="bullet_verdict"></div> -->
</div>
<div class="issueback">
-
-<a href="{% pp_url template='issue_detail.html' object=iss_obj %}">
{{iss_obj.name}} </a>
-
- <div class="threecol">
+ <div class="issheader">
+<a href="{% pp_url template='issue_detail.html'
object=iss_obj.content_object %}"> {{iss_obj.content_object.name}}
</a></div>
+
<div class="iss_col1">
- {% pp_comment_count
object=iss_obj.id %}
+ {% pp_comment_count
object=iss_obj.content_object.id %}

{% if not request.object %}
- submitted to <a href="{% pp_url
template='issues.html' object=iss_obj.topic
dimension=request.dimension %}">{{ iss_obj.topic.text }}</a> | {%
endif %}{{ iss_obj.solutions }} solution{{ iss_obj.solutions|pluralize }} |
{{ iss_obj.arguments }} argument{{ iss_obj.arguments|pluralize }} | {{
pp_comment.count }} comment{{ pp_comment.count|pluralize}}
+ submitted to <a href="{% pp_url
template='issues.html' object=iss_obj.content_object.topic
dimension=request.dimension %}">{{ iss_obj.content_object.topic.text }}</a>
| {% endif %}{{ iss_obj.content_object.solutions }} solution{{
iss_obj.content_object.solutions|pluralize }} | {{
iss_obj.content_object.arguments }} argument{{
iss_obj.content_object.arguments|pluralize }} | {{ pp_comment.count }}
comment{{ pp_comment.count|pluralize}}

{% endpp_comment_count %}

</div>
<div class="iss_col2">
- <a href="{% pp_url
template='solutions.html' object=iss_obj dimension=request.dimension %}"
class="button blue">see solution{{ iss_obj.solutions|pluralize }}</a>
+ <a href="{% pp_url
template='solutions.html' object=iss_obj.content_object
dimension=request.dimension %}" class="button blue">see {{
iss_obj.content_object.solutions}} solution{{
iss_obj.content_object.solutions|pluralize }}</a>

</div>
-
- </div>
- </div>
- </div>
+ <div class="isstags">
+ Tags:
+ {% pp_get_tags_for_object
object=iss_obj.content_object %}
+ {% for tag in
pp_tag.tags %}
+ <a href="{% pp_url
template='tag_detail.html' object=tag %}">{{tag.name}}</a>{% if not
forloop.last %},{% endif%}
+ {% empty %}
+ N/A
+ {% endfor %}
+ {%
endpp_get_tags_for_object %}
+ </div>
+ </div>
+ </div>

{% endif %}
=======================================
--- /trunk/pirate-politics/new_templates/_rightcol.html Tue Jan 25 15:15:31
2011
+++ /trunk/pirate-politics/new_templates/_rightcol.html Sun Feb 6 23:05:17
2011
@@ -9,7 +9,7 @@
{% load usertags %}

<ul class="d">
- <div id="login" style="display:none; overflow:hidden; height:75px;">
+ <div id="login" style="display:none; overflow:hidden; height:85px;">
{% pp_user_login_form POST=request.POST path=request.path
request=request object=request.object %}
{{ pp_login.form.errors }}
<form method="post" action="">
=======================================
--- /trunk/pirate-politics/new_templates/_solution.html Mon Jan 31 19:27:56
2011
+++ /trunk/pirate-politics/new_templates/_solution.html Sun Feb 6 23:05:17
2011
@@ -6,20 +6,19 @@
{% load solutiontags %}
{% load commenttags %}
{% load commenttags %}
-
- {% if iss_obj %}
-
+{% load tag_helpers %}
+
+ {% if iss_obj.content_object %}
<div class="issue">
- <div class="main">
<div class="bullet">
{% if request.user.is_authenticated %}
- {% pp_consensus_get object=iss_obj.id
user=request.user %}
- <h1> {{ pp_consensus.interest|floatformat }}
+ {% pp_consensus_get
object=iss_obj.content_object.id user=request.user %}
+ <h1> {{ pp_consensus.interest|floatformat:0 }}
</h1>
{% endpp_consensus_get %}
{% else %}
- {% pp_consensus_get object=iss_obj.id %}
- <h1> {{ pp_consensus.interest|floatformat }}
+ {% pp_consensus_get
object=iss_obj.content_object.id %}
+ <h1> {{ pp_consensus.interest|floatformat:0 }}
</h1>
{% endpp_consensus_get %}
{% endif %}
@@ -29,25 +28,34 @@

<div class="issueback">

-<a href="{% pp_url template='solution_detail.html' object=iss_obj %}">
{{iss_obj.name}} </a>
- <div class="iss_col3">
- {% pp_comment_count
object=iss_obj.id %}
-
-submitted by <a href="{% pp_url template='user_profile.html'
object=iss_obj.user%}"> {{iss_obj.user.username}} </a> on
{{iss_obj.submit_date|date:"(d/m/Y h:sA)"}} | {{ pp_comment.count }}
comment{{ pp_comment.count|pluralize}} | {{iss_obj.arguments}}
argument{{iss_obj.arguments|pluralize}}
+<div class="header"><a href="{% pp_url template='solution_detail.html'
object=iss_obj.content_object %}"> {{iss_obj.content_object.name}}
</a></div>
+ <div class="iss_col1">
+ {% pp_comment_count
object=iss_obj.content_object.id %}
+
+submitted by <a href="{% pp_url template='user_profile.html'
object=iss_obj.content_object.user%}">
{{iss_obj.content_object.user.username}} </a> on
{{iss_obj.content_object.submit_date|date:"(d/m/Y h:sA)"}} | {{
pp_comment.count }} comment{{ pp_comment.count|pluralize}} |
{{iss_obj.content_object.arguments}}
argument{{iss_obj.content_object.arguments|pluralize}}
{% endpp_comment_count %}
-
- </div> </div>
-
- <div class="bullet_">
-
- {% pp_consensus_get object=iss_obj.id
user=request.user %}
- {% include '_voting_iss_obj.html' %}
- {% endpp_consensus_get %}
-
- </div>
-
-
- </div>
- </div>
-
+ </div>
+
+ <div class="iss_col2">
+
+ {% pp_consensus_get
object=iss_obj.content_object.id user=request.user small="small" %}
+ {%
include '_voting_iss_obj_small.html' %}
+ {%
endpp_consensus_get %}
+
+
+ </div>
+ <div class="tags">
+ Tags:
+ {% pp_get_tags_for_object
object=iss_obj.content_object %}
+ {% for tag in
pp_tag.tags %}
+ <a href="{% pp_url
template='tag_detail.html' object=tag %}">{{tag.name}}</a>{% if not
forloop.last %},{% endif%}
+ {% empty %}
+ N/A
+ {% endfor %}
+ {%
endpp_get_tags_for_object %}
+ </div>
+
+ </div>
+</div>
+
{% endif %}
=======================================
--- /trunk/pirate-politics/new_templates/_sourcetags.html Tue Jan 25
15:15:31 2011
+++ /trunk/pirate-politics/new_templates/_sourcetags.html Sun Feb 6
23:05:17 2011
@@ -6,17 +6,17 @@
{% load solutiontags %}
{% load sourcetags %}
{% load tag_helpers %}
+{% load tagging_tags %}

<div class="sourcetags">
<div class="sources">

-<h2>Sources:
+<b>Sources:</b>
{% ifequal request.user request.object.user %}<a href="javascript:;"
onmousedown="toggleSlide('mydiv');">+url</a>

{% comment %}<a href="javascript:;"
onmousedown="toggleSlide('mydiv2');">+image</a>
{% endcomment %}
{% endifequal %}
-</h2>
{% ifequal request.user request.object.user %}

<div id="mydiv" style="display:none; overflow:hidden;
height:30px;">
@@ -53,17 +53,17 @@
</ul>

</div>
-<div class="tags">
-
{% if request.object.taggable %}
+<div class="taglist">
+<b>Tags:</b>{% if request.user.is_authenticated and request.object %}<a
href="javascript:;" onmousedown="toggleSlide('tag_rightcol');">+tag</a>{%
endif %}
<ul class="d">
- <h2><b>Tags:</b> {% if request.user.is_authenticated and
request.object %}<a href="javascript:;"
onmousedown="toggleSlide('tag_rightcol');">+tag</a>{% endif %}</h2>
- {% pp_get_tags_for_object object=request.object %}
+ <div id="ajax_tag_list">
+ {% pp_get_tags_for_object object=request.object %}
{% for tag in pp_tag.tags %}
<li><a href="{% pp_url template='tag_detail.html'
object=tag %}">{{tag.name}}</a></li>
{% endfor %}
{% endpp_get_tags_for_object %}
-
+ <div>
{% endif %}

</ul>
@@ -71,7 +71,7 @@
{% if request.user.is_authenticated and request.object.taggable %}

{% pp_tag_form POST=request.POST path=request.path
object=request.object %}
- <div id="tag_rightcol" style="display:none; overflow:hidden;
height:50px;">
+ <div id="tag_rightcol" style="display:none; overflow:hidden;
height:150px;">
{{ pp_tag.form.errors }}
<form method="post" action="">
{{ pp_tag.form.tag}}
@@ -79,8 +79,16 @@
{% csrf_token %}
<input type="submit" class='button green' value="Submit
Tag">
</form>
- </div>
{% endpp_tag_form %}
+
+ <div id="ajax_link_tag_list">
+ {% pp_tag_recommendations object=request.object %}
+
+ {{pp_tag.taglist|safe}}
+
+ {% endpp_tag_recommendations %}
+ </div>
+ </div>
{% endif %}

</div>
=======================================
--- /trunk/pirate-politics/new_templates/_voting.html Wed Jan 26 22:18:11
2011
+++ /trunk/pirate-politics/new_templates/_voting.html Sun Feb 6 23:05:17
2011
@@ -1,12 +1,20 @@


<div class = "voting">
-
- <img src= "{{pp_consensus.upvoteimg}}"
id="upvoteimg{{request.object.id}}"
onclick="upvote({{request.object.id}},'upcount{{request.object.id}}','upvoteimg{{request.object.id}}');"/>
+ {% if request.user.is_authenticated %}
+ <img src= "{{pp_consensus.upvoteimg}}"
id="upvoteimg{{request.object.id}}"
onclick="upvote({{request.object.id}},'upcount{{request.object.id}}','upvoteimg{{request.object.id}}','');"/>
+
+
+ <img src= "{{pp_consensus.neutvoteimg}}"
id="neutvoteimg{{request.object.id}}"
onclick="neutvote({{request.object.id}},'neutcount{{request.object.id}}','neutvoteimg{{request.object.id}}','');"
/>
+
+ <img src= "{{pp_consensus.downvoteimg}}"
id="downvoteimg{{request.object.id}}"
onclick="downvote({{request.object.id}},'downcount{{request.object.id}}', 'downvoteimg{{request.object.id}}','');"
/>
+ {% else %}
+
+ <img src= "{{pp_consensus.upvoteimg}}"
id="upvoteimg{{request.object.id}}" onclick="js_redirect('welcome.html');"/>


- <img src= "{{pp_consensus.neutvoteimg}}"
id="neutvoteimg{{request.object.id}}"
onclick="neutvote({{request.object.id}},'neutcount{{request.object.id}}','neutvoteimg{{request.object.id}}');"
/>
-
- <img src= "{{pp_consensus.downvoteimg}}"
id="downvoteimg{{request.object.id}}"
onclick="downvote({{request.object.id}},'downcount{{request.object.id}}', 'downvoteimg{{request.object.id}}');"
/>
-
+ <img src= "{{pp_consensus.neutvoteimg}}"
id="neutvoteimg{{request.object.id}}"
onclick="js_redirect('welcome.html');" />
+
+ <img src= "{{pp_consensus.downvoteimg}}"
id="downvoteimg{{request.object.id}}"
onclick="js_redirect('welcome.html');" />
+ {% endif %}
</div>
=======================================
--- /trunk/pirate-politics/new_templates/argument_detail.html Wed Jan 26
22:18:11 2011
+++ /trunk/pirate-politics/new_templates/argument_detail.html Sun Feb 6
23:05:17 2011
@@ -6,18 +6,13 @@
{% load tag_helpers %}
{% load commenttags %}
{% load markup %}
-
-
-{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
-{% endblock %}

{% block content %}
<div class="stage">
<div class="issuemask">

<div class="pagehead">
-
+ {{request.object.arg_type.arg}} argument for
{{request.object.parent.name}}

</div>

@@ -25,32 +20,30 @@


<div class="issue">
- <div class="main">
+
{% pp_consensus_get object=request.object.id user=request.user %}

<div class="issueback2">
- {% ifequal request.object.user
request.user %}
+
+{{request.object.name}}<br>
+{% pp_comment_count object=request.object.id %}
+<div class="userinfo">submitted by <a href="{% pp_url
template='user_profile.html'
object=request.object.user%}">{{request.object.user.username}}</a>
+
+ {{request.object.submit_date|date:"(d/m/Y h:sA)"}}| {{ pp_comment.count
}} comment{{ pp_comment.count|pluralize}} |
interest:{{pp_consensus.consensus.interest|floatformat}}{% ifequal
request.object.user request.user %}
{% ifequal pp_consensus.interest 0 %}
{% ifequal
request.object.arg_type.arg "yea" %}
- <div class="bullet_">
- <ul><a href="{% pp_url
template='submit_yea_argument.html' object=request.object %}" class='button
blue'>edit</a></ul>
- </div>
+
+ <a href="{% pp_url
template='submit_yea_argument.html' object=request.object %}" class='button
blue'>edit</a>

{% else %}
{% ifequal
request.object.arg_type.arg "nay" %}
- <div class="bullet_">
- <ul><a href="{% pp_url
template='submit_nay_argument.html' object=request.object %}" class='button
blue'>edit</a></ul>
- </div>
- {% endifequal %}
- {% endifequal %}
+ <a href="{% pp_url
template='submit_nay_argument.html' object=request.object %}" class='button
blue'>edit</a>

{% endifequal %}
{% endifequal %}
-{{request.object.name}}<br>
-{% pp_comment_count object=request.object.id %}
-<div class="userinfo">submitted by <a href="{% pp_url
template='user_profile.html'
object=request.object.user%}">{{request.object.user.username}}</a>
-
- {{request.object.submit_date|date:"(d/m/Y h:sA)"}}| {{ pp_comment.count
}} comment{{ pp_comment.count|pluralize}} |
interest:{{pp_consensus.consensus.interest|floatformat}}</div>
+
+ {% endifequal %}
+ {% endifequal %}</div>
{% endpp_comment_count %}
</div>

@@ -77,7 +70,6 @@

- </div>
</div>

</div>
=======================================
--- /trunk/pirate-politics/new_templates/base.html Mon Jan 31 18:26:02 2011
+++ /trunk/pirate-politics/new_templates/base.html Sun Feb 6 23:05:17 2011
@@ -16,7 +16,7 @@

<link rel="shortcut icon" href="/static/favicon.ico" />

- <link rel="stylesheet" type="text/css" href="/static/style.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style2.css" />

<title>{{request.path|cut:"/"|cut:".html"|capfirst}} -
Nonrel-testapp</title>

@@ -60,9 +60,26 @@
elem = document.getElementById(div_id);
elem.src = text;
};
-
- function upvote(idk,div_id,img_id){
- $.post("/vote/", {vote: "up", pk: idk },
+
+ function js_redirect(location)
+ {
+ window.location.replace( location );
+ };
+
+ function add_tag(tag, obj_id, c_type, app_type){
+ $.post("/add_tag/", {tag: tag, obj: obj_id, c_type:c_type,
app_type:app_type },
+ function(data) {
+ if(data.FAIL != true){
+ changeText(data.taglist,'ajax_link_tag_list');
+ changeText(data.linktaglist,'ajax_tag_list');
+
+ }
+ }, "json");
+ };
+
+
+ function upvote(idk,div_id,img_id, img_size){
+ $.post("/vote/", {vote: "up", pk: idk, img_size:img_size },
function(data) {
if(data.FAIL != true){
changeImgSrc(data.imgsrc,img_id);
@@ -70,8 +87,8 @@
}
}, "json");
};
- function downvote(idk,div_id,img_id){
- $.post("/vote/", {vote: "down", pk: idk },
+ function downvote(idk,div_id,img_id, img_size){
+ $.post("/vote/", {vote: "down", pk: idk, img_size:img_size },
function(data) {
if(data.FAIL != true){
changeImgSrc(data.imgsrc,img_id);
@@ -79,8 +96,8 @@
}
}, "json");
};
- function neutvote(idk,div_id,img_id){
- $.post("/vote/", {vote: "neut", pk: idk },
+ function neutvote(idk,div_id,img_id, img_size){
+ $.post("/vote/", {vote: "neut", pk: idk, img_size:img_size},
function(data) {
if(data.FAIL != true){
changeImgSrc(data.imgsrc,img_id);
@@ -97,19 +114,20 @@

{% block extra-head %}{% endblock %}

- <script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-21028017-1']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type
= 'text/javascript'; ga.async = true;
- ga.src = ('https:' ==
document.location.protocol ? 'https://ssl' : 'http://www')
+ '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
- })();
-
- </script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-21219475-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type
= 'text/javascript'; ga.async = true;
+ ga.src = ('https:' ==
document.location.protocol ? 'https://ssl' : 'http://www')
+ '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
</head>

{% if request.scroll_to %}
@@ -119,11 +137,11 @@
{% endif%}

<div id="header">
- <div class="headtitle"><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot'%}">egalit.ar</a></div>
+ <div class="headtitle">openassembly.org</div>
<ul>
- <li><a href="{% pp_url template='topics.html'
dimension='hot' %}">topics</a></li>
- <li><a href="{% pp_url template='issues.html'
dimension='hot' %}">issues</a></li>
- <li><a href="{% pp_url template='solutions.html'
dimension='hot' %}">solutions</a></li>
+ <li><a href="{% pp_url template='topics.html' dimension='hot' start=0
end=20 %}">topics</a></li>
+ <li><a href="{% pp_url template='issues.html' dimension='hot' start=0
end=20 %}">issues</a></li>
+ <li><a href="{% pp_url template='solutions.html'
dimension='hot' start=0 end=20 %}">solutions</a></li>

{% if request.user.is_authenticated %}
<li><a href="{% pp_url template='user_profile.html'
object=request.user%}">profile</a></li>
@@ -131,8 +149,7 @@
<li><a href="/register.html">profile</a></li>
{% endif %}
<li><a href="/platform.html">platform</a></li>
- <li><a href="/action.html">action</a></li>
- <li><a href="/action.html">about</a></li>
+ <li><a href="/welcome.html">about</a></li>
</ul>
</div>
<div id="mainContent">
@@ -144,13 +161,14 @@
<div class="col2">
{% block browser_bar %}
<ul>
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot'%}">{% ifequal "hot"
request.dimension %}<b>hot</b>{% else %}hot{% endifequal %}</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='cont'%}">{% ifequal "cont"
request.dimension %}<b>controversial</b>{% else %}controversial{%
endifequal %}</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='new'%}">{% ifequal "new"
request.dimension %}<b>new</b>{% else %}new{% endifequal %}</a></li>
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot' start=request.start
end=request.end %}">{% ifequal "hot" request.dimension %}<b>hot</b>{%
else %}hot{% endifequal %}</a></li> |
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='cont' start=request.start
end=request.end %}">{% ifequal "cont"
request.dimension %}<b>controversial</b>{% else %}controversial{%
endifequal %}</a></li> |
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='new' start=request.start
end=request.end %}">{% ifequal "new" request.dimension %}<b>new</b>{%
else %}new{% endifequal %}</a></li>
</ul>
{% endblock %}
</div>
<div class="col3">
+ {% block user_register_login %}
{% if request.user.username %}
{% pp_get_reputation user=request.user %}
<ul>hello
@@ -171,6 +189,7 @@
<li><a href="javascript:;"
onmousedown="toggleSlide('login');">login</a></li>
{% endif %}
</ul>
+ {% endblock %}
</div>
</div>
</div>
=======================================
--- /trunk/pirate-politics/new_templates/issue_detail.html Mon Jan 31
18:26:02 2011
+++ /trunk/pirate-politics/new_templates/issue_detail.html Sun Feb 6
23:05:17 2011
@@ -15,69 +15,60 @@
{% block title %}
{% if request.object %}{{ request.object.text }}{% endif %} Issues
{% endblock title %}
-{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
+{% block browser_bar %}
+
{% endblock %}

- {% block browser_bar %}
- <ul>
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot'%}">hot</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='cont'%}">controversial</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='new'%}">new </a></li>
- </ul>
- {% endblock %}
+

{% block content %}
+
<div class="stage">
<div class="issuemask">
+
+

<div class="issuebound">

- {% pp_get_issue object=request.object %}
+
+ {% pp_get_issue object=request.object %}
+
+ {% pp_consensus_get object=pp_issue.issue.id user=request.user %}

<div class="issue">
- <div class="main">
- <div class="bullet">
- {% pp_consensus_get object=pp_issue.issue.id
user=request.user %}
- <h1> {{ pp_consensus.interest|floatformat }}
- </h1>
-
- </div>
-
- <div class="issueback">
- {% ifequal pp_issue.issue.user
request.user %}
-
- {% ifequal pp_consensus.interest 0 %}
- {% ifequal
pp_issue.issue.solutions 0 %}
- <div class="bullet_">
-
- </div>
+
+
+ <div class="issueback2">
+
+<div class="header">{{pp_issue.issue.name}}</div>
+
+<div class="userinfo">submitted by <a href="{% pp_url
template='user_profile.html'
object=pp_issue.issue.user%}">{{pp_issue.issue.user.username}}</a>
+
+{% pp_comment_count object=pp_issue.issue.id %}
+
+{{pp_issue.issue.submit_date|date:"(d/m/Y h:sA)"}} | {{ pp_comment.count
}} comment{{ pp_comment.count|pluralize}} |
{{pp_consensus.consensus.interest|floatformat:0 }} interest
+
+ {% ifequal pp_issue.issue.user request.user %}
+
+ <a href="{% pp_url
template='submit_issue.html' object=pp_issue.issue %}" class='button
blue'>edit</a>
{% endifequal %}
- {% endifequal %}
- {% endifequal %}
- {% endpp_consensus_get %}
- {{pp_issue.issue.name}}
- <div class="threecol">
- <div class="iss_col1">
- {% pp_comment_count
object=pp_issue.issue.id %}
-
- {{ pp_issue.issue.solutions }} solution{{ pp_issue.issue.solutions|
pluralize }} | {{ pp_issue.issue.arguments }} argument{{
pp_issue.issue.arguments|pluralize }} | {{ pp_comment.count }} comment{{
pp_comment.count|pluralize}}
-
- {% endpp_comment_count %}
-
- </div>
- <div class="iss_col2">
- <a href="{% pp_url
template='solutions.html' object=pp_issue.issue dimension=dimension %}"
class="button blue">see solution{{ pp_issue.issue.solutions|pluralize
}}</a> <a href="{% pp_url
template='submit_issue.html' object=pp_issue.issue %}" class='button
blue'>edit</a>
-
- </div>
-
- </div>
+
+<a href="{% pp_url template='solutions.html' object=pp_issue.issue
dimension=request.dimension %}" class="button blue">see {{
pp_issue.issue.solutions}} solution{{ pp_issue.issue.solutions|pluralize
}}</a>
+ </div>
+
+{% endpp_comment_count %}
+
</div>
- </div>
-
- <div class="details">
- {{pp_issue.issue.text|markdown|escape }}
- </div>
+
+
+ <div class="details">
+ {% autoescape on %}
+ {{pp_issue.issue.text|markdown }}
+ {% endautoescape %}
+
+
+ </div>

{% include "_sourcetags.html" %}

@@ -92,19 +83,19 @@

{% endpp_comment_list_get%}

+ {% endpp_consensus_get %}
+ {% endpp_get_issue %}
</div>

-
- {% endpp_get_issue %}
- </div>
+ </div>
<div class="rightcol">

{% include "_rightcol.html" %}

- </div>
-
- </div>
- </div>
+
+ </div>
+</div> </div>
+ </div>
</body>
</html>

=======================================
--- /trunk/pirate-politics/new_templates/issues.html Mon Jan 31 18:26:02
2011
+++ /trunk/pirate-politics/new_templates/issues.html Sun Feb 6 23:05:17
2011
@@ -11,14 +11,14 @@
{% if request.object %}{{ request.object.text }}{% endif %} Issues
{% endblock title %}
{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
{% endblock %}

{% block browser_bar %}
<ul>
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot' object=request.object %}">{%
ifequal "hot" request.dimension %}<b>hot</b>{% else %}hot{%
endifequal %}</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='cont' object=request.object %}">{%
ifequal "cont" request.dimension %}<b>controversial</b>{%
else %}controversial{% endifequal %}</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='new' object=request.object %}">{%
ifequal "new" request.dimension %}<b>new</b>{% else %}new{%
endifequal %}</a></li>
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='hot' object=request.object
start=request.start end=request.end %}">{% ifequal "hot"
request.dimension %}<b>hot</b>{% else %}hot{% endifequal %}</a></li> |
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='cont' object=request.object
start=request.start end=request.end %}">{% ifequal "cont"
request.dimension %}<b>controversial</b>{% else %}controversial{%
endifequal %}</a></li> |
+ <li><a STYLE="text-decoration:none" href="{% pp_url
template='issues.html' dimension='new' object=request.object
start=request.start end=request.end %}">{% ifequal "new"
request.dimension %}<b>new</b>{% else %}new{% endifequal %}</a></li>
</ul>
{% endblock %}

@@ -31,43 +31,37 @@
{% else %}<div class="pagehead"> all issues </div>
{% endif %}
<div class="issuebound">
-
- {% if request.dimension%}
-
- {% pp_get_issue_list dimension=request.dimension
topic=request.object %}
+
+ {% pp_get_issue_list dimension=request.dimension
topic=request.object start=request.start end=request.end %}

{% for iss_obj in pp_issue.issue_list %}

{% include '_issue.html' %} <br>

-
{% empty %}
<div class="pagehead">
There doesn't seem to be anything here yet.
</div>
{% endfor %}
- {% endpp_get_issue_list %}
-
- {% else %}
- {% pp_get_issue_list dimension="hot" topic=request.object %}
-
- {% for iss_obj in pp_issue.issue_list %}
-
- {% include '_issue.html' %} <br>
-
- {% empty %}
- <div class="pagehead">
- There doesn't seem to be anything here yet.
- </div>
+
+ <div class="pagination">
+ <p>({{pp_issue.count}})<
+ {% for s,e,n in request.rangelist %}
+ {% if not s > pp_issue.count %}
+ <a href="{% pp_url template='issues.html'
dimension=request.dimension object=request.object start=s end=e %}">{%
ifequal s request.start %}<b>{{n}}</b>{% else %}{{n}}{% endifequal %}</a>
+ {% endif %}
{% endfor %}
+ ></p>
{% endpp_get_issue_list %}
- {% endif %}
- </div>
+ </div>
+
+ </div>
+
<div class="rightcol">
{% if request.user.is_authenticated %}
- <ul>{% if request.object %}<a href="{% pp_url
template='submit_issue.html' object=request.object %}" class='button
blue'>Submit Issue</a>{% endif %}</ul>
+ <ul><a href="{% pp_url template='submit_issue.html'
object=request.object %}" class='button blue'>Submit Issue</a></ul>
{% else %}
-<ul><a href="{% pp_url template='register.html' %}" class='button
blue'>Submit Issue</a></ul>
+ <ul><a href="{% pp_url template='register.html' %}"
class='button blue'>Submit Issue</a></ul>
{% endif %}
{% include '_rightcol.html' %}
</div>
=======================================
--- /trunk/pirate-politics/new_templates/register.html Tue Jan 25 15:15:31
2011
+++ /trunk/pirate-politics/new_templates/register.html Sun Feb 6 23:05:17
2011
@@ -4,14 +4,25 @@

{% block title %}Register Page{% endblock %}
{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
+{% block browser_bar %}
+
+{% endblock %}
+
+{% block user_register_login %}
+
+{% endblock %}
+
{% endblock %}

{% block content%}

{% pp_user_registration_form POST=request.POST path=request.path
request=request %}
<div class="register_title">
-<h2>Welcome to elgalit.ar</h2>
+<h2>Welcome to OpenAssembly: Alpha</h2>
+</div>
+<div class="register_title2">
+an evolution in deliberation
</div>
<div class = "register">
<div class="register_registration">
=======================================
--- /trunk/pirate-politics/new_templates/solution_detail.html Fri Jan 28
02:56:45 2011
+++ /trunk/pirate-politics/new_templates/solution_detail.html Sun Feb 6
23:05:17 2011
@@ -15,16 +15,9 @@
{% block title %}
{% if request.object %}{{ request.object.text }}{% endif %} Issues
{% endblock title %}
-{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
-{% endblock %}

{% block browser_bar %}
- <ul>
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='solutions.html' dimension='hot'
object=request.object.issue %}">hot</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='solutions.html' dimension='cont'
object=request.object.issue %}">controversial</a></li> |
- <li><a STYLE="text-decoration:none" href="{% pp_url
template='solutions.html' dimension='new'
object=request.object.issue %}">new </a></li>
- </ul>
+
{% endblock %}


@@ -33,9 +26,6 @@

<div class="stage">
<div class="issuemask">
-
-
-
<div class="issuebound">


@@ -44,45 +34,40 @@
{% pp_consensus_get object=pp_solution.solution.id
user=request.user %}

<div class="issue">
- <div class="main">
+

<div class="issueback2">
- {% ifequal pp_solution.solution.user
request.user %}
- {% ifequal pp_consensus.interest 0 %}
- {% ifequal
pp_solution.solution.arguments 0 %}
- <div class="bullet_">
- <ul><a href="{% pp_url
template='submit_solution.html' object=pp_solution.solution %}"
class='button blue'>edit</a></ul>
- </div>
- {% endifequal %}
- {% endifequal %}
- {% endifequal %}
-{{pp_solution.solution.name}}<br>
+
+<div class="header">{{pp_solution.solution.name}}</div>

<div class="userinfo">submitted by <a href="{% pp_url
template='user_profile.html'
object=pp_solution.solution.user%}">{{pp_solution.solution.user.username}}</a>

{% pp_comment_count object=pp_solution.solution.id %}

-{{pp_solution.solution.submit_date|date:"(d/m/Y h:sA)"}} | {{
pp_comment.count }} comment{{ pp_comment.count|pluralize}} |
interest:{{pp_consensus.consensus.interest|floatformat}}</div>
+{{pp_solution.solution.submit_date|date:"(d/m/Y h:sA)"}} | {{
pp_comment.count }} comment{{ pp_comment.count|pluralize}} |
{{pp_consensus.consensus.interest|floatformat:0 }} interest {% ifequal
pp_solution.solution.user request.user %}
+ {% ifequal pp_consensus.interest 0 %}
+ {% ifequal
pp_solution.solution.arguments 0 %}
+ <a href="{% pp_url
template='submit_solution.html' object=pp_solution.solution %}"
class='button blue'>edit</a>
+ {% endifequal %}
+ {% endifequal %}
+ {% endifequal %}</div>

{% endpp_comment_count %}


</div>

- </div>

{% include '_voting.html' %}
-
+

<div class="details">
- {% autoescape on %}
- {{pp_solution.solution.text|markdown }}
- {% endautoescape %}
-
-
- </div>
-
- {% include "_sourcetags.html" %}
+ {% autoescape on %}
+ {{pp_solution.solution.text|markdown }}
+ {% endautoescape %}
+ </div>
+ {% include "_sourcetags.html" %}
+


<div class="argument">
=======================================
--- /trunk/pirate-politics/new_templates/solutions.html Mon Jan 31 18:26:02
2011
+++ /trunk/pirate-politics/new_templates/solutions.html Sun Feb 6 23:05:17
2011
@@ -8,9 +8,6 @@
{% load solutiontags %}
{% load commenttags %}

-{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
-{% endblock %}

{% block browser_bar %}
<ul>
@@ -26,20 +23,18 @@
<div class="pagehead">
{% if request.object %}
Solutions for {{request.object.name}}
- {% else %}
+ {% else %}
All Solutions
{% endif %}
</div>
<div class="issuebound">
-
- {% if request.dimension %}

{% pp_get_solution_list issue=request.object
dimension=request.dimension %}


{%for iss_obj in pp_solution.solution_list%}

- {% include '_solution.html' %}<br>
+ {% include '_solution.html' %}

{% empty %}
<br>
@@ -47,22 +42,16 @@

{% endfor %}

- {% endpp_get_solution_list %}
-
- {% else %}
- {% pp_get_solution_list issue=request.object dimension="hot" %}
-
-
- {%for iss_obj in pp_solution.solution_list%}
-
- {% include '_solution.html' %}<br>
- {% empty %}
- <br>
- No solutions yet! Add a solution.
+ <div class="pagination">
+ <p><
+ {% for s,e,n in request.rangelist %}
+ {% if not s > pp_solution.count %}
+ <a href="{% pp_url template='issues.html'
dimension=request.dimension object=request.object start=s end=e %}">{%
ifequal s request.start %}<b>{{n}}</b>{% else %}{{n}}{% endifequal %}</a>
+ {% endif %}
{% endfor %}
-
+ ></p>
{% endpp_get_solution_list %}
- {% endif %}
+ </div>

</div>
<div class="rightcol">
=======================================
--- /trunk/pirate-politics/new_templates/submit_issue.html Tue Jan 25
15:15:31 2011
+++ /trunk/pirate-politics/new_templates/submit_issue.html Sun Feb 6
23:05:17 2011
@@ -2,9 +2,9 @@
{% load pp_url %}
{% load issuetags %}

-{% block title %}Login Page{% endblock %}
+{% block title %}Submit New Issue{% endblock %}
{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
{% endblock %}

{% block content%}
@@ -16,7 +16,7 @@
{% pp_issue_form POST=request.POST path=request.path request=request
object=request.object %}
<div class="add">
<h2> {{pp_issue.contextname }}</h2>
- {{ pp_issue.form.errors }}
+ <div class="errors">{{ pp_issue.form.errors }}</div>
<form method="post" action="">
Name: <br>{{ pp_issue.form.name }}<br>
Text: <br>{{ pp_issue.form.text }}
@@ -30,8 +30,9 @@
{% pp_issue_form POST=request.POST path=request.path request=request %}
<div class="add">
<h2>{{pp_issue.contextname }}</h2>
- {{ pp_issue.form.errors }}
+ <div class="errors">{{ pp_issue.form.errors }}</div>
<form method="post" action="">
+ {% if not pp_issue.has_topic %} Topic: <br>
{{pp_issue.form.topics}}<br>{% endif %}
Name: <br>{{ pp_issue.form.name }}<br>
Text: <br>{{ pp_issue.form.text }}
{{ pp_issue.form.form_id}}
=======================================
--- /trunk/pirate-politics/new_templates/submit_nay_argument.html Fri Jan
21 16:05:49 2011
+++ /trunk/pirate-politics/new_templates/submit_nay_argument.html Sun Feb
6 23:05:17 2011
@@ -3,7 +3,7 @@
{% load argumenttags %}

{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
{% endblock %}

{% block content%}
=======================================
--- /trunk/pirate-politics/new_templates/submit_solution.html Thu Jan 27
20:02:47 2011
+++ /trunk/pirate-politics/new_templates/submit_solution.html Sun Feb 6
23:05:17 2011
@@ -2,9 +2,9 @@
{% load pp_url %}
{% load solutiontags %}

-{% block title %}Login Page{% endblock %}
+{% block title %}Submit New Solution{% endblock %}
{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
{% endblock %}

{% block content%}
=======================================
--- /trunk/pirate-politics/new_templates/submit_yea_argument.html Fri Jan
21 16:05:49 2011
+++ /trunk/pirate-politics/new_templates/submit_yea_argument.html Sun Feb
6 23:05:17 2011
@@ -3,7 +3,7 @@
{% load argumenttags %}

{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+
{% endblock %}

{% block content%}
=======================================
--- /trunk/pirate-politics/new_templates/topics.html Mon Jan 17 12:38:36
2011
+++ /trunk/pirate-politics/new_templates/topics.html Sun Feb 6 23:05:17
2011
@@ -1,32 +1,49 @@
{% extends "base.html" %}
{% load pp_url %}
{% load topictags %}
+{% load tagging_tags %}
{% block title %}
{% if request.object %}{{ request.object.text }}{% endif %} Topics
{% endblock title %}
+
+{% block browser_bar %}
+
+{% endblock %}

{% block content %}
-{% pp_get_topic_list topic=request.object %}
- {% if pp_topic.topic_list %}
- <h2>Topics</h2>
- <ol>
- {% for topic in pp_topic.topic_list %}
-
- <li> <a href="{% pp_url template="topics.html" object=topic %}">{{
topic.text }}</a> </li>
-
- {% endfor %}
-
- </ol>
-{% endif %}
+ <div class="stage">
+
+ <div class="issuemask">
+ <div class="pagehead">Topics for discussion and
deliberation</div>
+ <div class="issuebound">
+
+
+ {% pp_get_topic_list topic=request.object %}
+ {% if pp_topic.topic_list %}
+ <ul>
+ {% for topic in pp_topic.topic_list %}
+ <div class="topic"?
+ <li> <a href="{% pp_url template='issues.html'
object=topic dimension='hot' start=0 end=20 %}">{{ topic.text }}</a>
+ <div
class="topicdescription">{{topic.description}}</div>
+ </div>
+ </li>
+
+ {% endfor %}
+
+ </ul>
+ {% endif %}
+ </div>

{% endpp_get_topic_list %}
-{% pp_topic_form POST=request.POST path=request.path root=request.object %}
-<h2> Create a new topic </h2>
- <form method="post" action="">
- {{ pp_topic.form.as_p }}
- {% csrf_token %}
- <input type="submit" value="Submit">
- </form>
-{% endpp_topic_form %}
+
+ <div class="rightcol">
+ {% include '_rightcol.html' %}
+ </div>
+
+ </div>
+
+</div>
+
+

{% endblock %}
=======================================
--- /trunk/pirate-politics/new_templates/user_profile.html Mon Jan 31
19:55:57 2011
+++ /trunk/pirate-politics/new_templates/user_profile.html Sun Feb 6
23:05:17 2011
@@ -8,9 +8,8 @@
{% load notificationtags %}
{% load markup %}

-
-{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
+{% block browser_bar %}
+
{% endblock %}

{% block content %}
=======================================
--- /trunk/pirate-politics/new_templates/welcome.html Mon Jan 17 12:38:36
2011
+++ /trunk/pirate-politics/new_templates/welcome.html Sun Feb 6 23:05:17
2011
@@ -4,12 +4,40 @@

{% block title %}Register Page{% endblock %}
{% block css %}
-<link rel="stylesheet" type="text/css" href="/static/style.css" />
{% endblock %}

-{% block content%}
-<h1>WELCOME TO PIRATE-POLITICS</h1>
-
+{% block browser_bar %}
+
+{% endblock %}
+
+{% block content %}
+ <div class="stage">
+
+ <div class="issuemask">
+
+ <div class="pagehead">Welcome to OpenAssembly: Alpha</div>
+
+ <div class="issuebound">
+
+ <div class="welcome">
+ <p> OpenAssembly is a problem/solution website
built for user driven political discussion. The objective of this
discussion is the development of rational and innovative ideas that improve
our democracy, government, and society. OpenAssembly is an alpha, meaning
that it is still in it's infancy, and in the future will host new features
such as an event system, support for issue/geographical subgroups,
electioneering systems, and a intelligent online representative for each
user. </p>
+
+<p>The intelligent representative is an Artificial Intelligence (AI) that
will bring interesting new discussions to your attention, allow you to form
dynamic coalitions with other users, aid in your evaluation of other users,
engage in proxy voting if authorized, and much more. This features will
give you access to information you could not have found otherwise by
learning your political preferences. Once it has learned those preferences
the representative will ensure your opinion is considered, even if you are
not online. The intelligent representatives will work together to bridge
the gaps between communities and allow for the formation of dynamic voting
blocs. They will also allow users to compare their own political interests
with others like never before. Perhaps some will even discover we are not
so different after all.</p>
+
+<p> The current phase of OpenAssembly is highly important as the content
generated by users now will be used to aid research and development of this
intelligent representative. Those that take part in the discussion at this
stage can take an active role in the development of these features if
desired and all users who participate in OpenAssembly: Alpha will receive a
special badge showing their support at such an early stage of
development.</p>
+
+ <p><h3><a href="/register.html">Join the Discussion</a></h3></p>
+
+ <p> We would also love support from developers. OpenAssembly is an open
source project based on <a
href="http://pirate-politics.org">pirate-politics</a>. The site runs on
Django-nonrel and Google App Engine, and any developer with knowledge of
Python/Django or web design is welcome to join our code sprints.</p>
+ </div>
+ </div>
+ <div class="rightcol">
+ {% include '_rightcol.html' %}
+ </div>
+ </div>
+ </div>
+
+

{% endblock content %}

=======================================
--- /trunk/pirate-politics/pirate_consensus/models.py Tue Jan 25 15:15:31
2011
+++ /trunk/pirate-politics/pirate_consensus/models.py Sun Feb 6 23:05:17
2011
@@ -10,6 +10,7 @@
#Generic conesensus object that acts as parent for all votes
class Consensus(models.Model):

+ parent_pk = models.IntegerField()
submit_date = models.DateTimeField(_('date/time submitted'),
auto_now_add=True)
content_type = models.ForeignKey(ContentType,
verbose_name=_('content type'),
=======================================
--- /trunk/pirate-politics/pirate_consensus/templatetags/consensustags.py
Mon Jan 31 18:26:02 2011
+++ /trunk/pirate-politics/pirate_consensus/templatetags/consensustags.py
Sun Feb 6 23:05:17 2011
@@ -24,6 +24,7 @@
namespace = get_namespace(context)

object_pk = kwargs.pop('object', None)
+ small = kwargs.pop('small', None)
if object_pk is None:
raise ValueError("pp_consensus_get tag requires that a consensus
object be passed "
"to it assigned to the 'object=' argument,
and that the str "
@@ -53,12 +54,20 @@
typeneut = 'acti'
elif v == -1:
typedown = 'acti'
- namespace['upvoteimg'] = "/static/voteimgs/up_arrow_" + typeup + ".png"
- namespace['hasupvoted'] = v == 1
- namespace['neutvoteimg'] = "/static/voteimgs/neut_arrow_" + typeneut
+ ".png"
- namespace['hasneutvoted'] = v == 0
- namespace['downvoteimg'] = "/static/voteimgs/down_arrow_" + typedown
+ ".png"
- namespace['hasdownvoted'] = v == -1
+ if small == None:
+ namespace['upvoteimg'] = "/static/voteimgs/up_arrow_" + typeup
+ ".png"
+ namespace['hasupvoted'] = v == 1
+ namespace['neutvoteimg'] = "/static/voteimgs/neut_arrow_" +
typeneut + ".png"
+ namespace['hasneutvoted'] = v == 0
+ namespace['downvoteimg'] = "/static/voteimgs/down_arrow_" +
typedown + ".png"
+ namespace['hasdownvoted'] = v == -1
+ else:
+ namespace['smallupvoteimg'] = "/static/voteimgs/up_arrow_" +
typeup + "_small.png"
+ namespace['hasupvoted'] = v == 1
+ namespace['smallneutvoteimg'] = "/static/voteimgs/neut_arrow_" +
typeneut + "_small.png"
+ namespace['hasneutvoted'] = v == 0
+ namespace['smalldownvoteimg'] = "/static/voteimgs/down_arrow_" +
typedown + "_small.png"
+ namespace['hasdownvoted'] = v == -1

output = nodelist.render(context)
context.pop()
=======================================
--- /trunk/pirate-politics/pirate_core/middleware.py Mon Jan 31 18:26:02
2011
+++ /trunk/pirate-politics/pirate_core/middleware.py Sun Feb 6 23:05:17
2011
@@ -29,9 +29,20 @@
if content_type_id is not None and obj_id is not None:
content_type = ContentType.objects.get(pk=content_type_id)
request.object =
content_type.get_object_for_this_type(pk=obj_id)
-
+
if start is not None and end is not None:
- request.range = (start, end)
+ request.start = int(start)
+ request.end = int(end)
+ rangelist = []
+ div = int(start) / 100.0
+ multiple = round(div)
+ start_range = int(100 * multiple)
+ n = 0
+ for itr in range(start_range, start_range + 100, 20):
+ rangelist.append([itr, itr+20, n])
+ n+=1
+ request.rangelist = rangelist
+

if dim is not None:
request.dimension = dim
@@ -74,12 +85,12 @@
elif str(content_type) == u'argument' and
request.path[0:4] == '/arg':
name = "arg. detail: " +
str(request.object.name).lower()
except:
- try: name = request_path
- except KeyError: name = "NA"
+ name = None
try:
- try:
- if visit_list[-1] != (name,request_path):
visit_list.append((name, request_path))
- except: visit_list.append((name, request_path))
+ if name != None:
+ try:
+ if visit_list[-1] != (name,request_path):
visit_list.append((name, request_path))
+ except: visit_list.append((name, request_path))
except KeyError: pass #first visit
request.session['last_visited'] = visit_list
except KeyError: pass
=======================================
--- /trunk/pirate-politics/pirate_core/templatetags/pp_url.py Fri Jan 28
02:56:45 2011
+++ /trunk/pirate-politics/pirate_core/templatetags/pp_url.py Sun Feb 6
23:05:17 2011
@@ -98,12 +98,16 @@
else:
output = get_reverse(pattern, kwargs, **rev_kwargs)

- elif start is not None and end is not None:
- output = get_reverse(pattern, kwargs, start=start, end=end)
- elif dimension is not None:
- output = get_reverse(pattern, kwargs, dimension=dimension)
else:
- output = get_reverse(pattern, kwargs)
+ rev_kwargs = {}
+ if start is not None and end is not None:
+ rev_kwargs['start'] = start
+ rev_kwargs['end'] = end
+ if dimension is not None:
+ rev_kwargs['dimension'] = dimension
+ output = get_reverse(pattern, kwargs, **rev_kwargs)
+ else:
+ output = get_reverse(pattern, kwargs, **rev_kwargs)

#need to append reverse of pattern to user's recently visited list

=======================================
--- /trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py Tue Jan
18 11:59:15 2011
+++ /trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py Sun Feb
6 23:05:17 2011
@@ -6,6 +6,7 @@
from tagging.models import Tag, TaggedItem
from pirate_issues.models import Issue, Solution
from pirate_deliberation.models import Argument
+from django.db.models import get_model

from pirate_core import HttpRedirectException, namespace_get, FormMixin,
template_for_model

@@ -15,6 +16,115 @@

get_namespace = namespace_get('pp_tag')

+"""This templatetags library exposes the functionality fo django-tagging
in a
+ pirate-politics templatetags pattern"""
+
+def get_link_tag_list(obj,add_tags_in_object=False):
+ """Transforms a list of tags into htmls links to add_tag, used in ajax.
+ This link_list is for tag_details, the other list is to add tags Used
in combination
+ these functions let tag recommendations and insertions occur over
ajax/json."""
+ opts = obj._meta
+
+ al = opts.app_label
+ mod = opts.module_name
+
+ model = get_model(al, mod)
+
+ tags = Tag.objects.get_for_object(obj)
+ c_type = ContentType.objects.get_for_model(model)
+
+ taglist = ""
+
+ for t in tags:
+ link = '<li><a href="/tag_detail.html?_t=' + str(c_type.id)
+ '&_o=' + str(t.id) + '">' + str(t.name) +"</a></li>"
+ taglist += link
+ return taglist
+
+
+def get_tag_list(obj,add_tags_in_object=False):
+ """Transforms a list of tags into htmls links to add_tag, used in ajax.
+ Grabs tag list or a object's model, ignoring tags from that model to
offer
+ for recommendation."""
+ opts = obj._meta
+
+ al = opts.app_label
+ mod = opts.module_name
+
+ model = get_model(al, mod)
+
+ content_type = ContentType.objects.get_for_model(obj)
+ tags = Tag.objects.cloud_for_model(model)
+
+ if not add_tags_in_object:
+ tags_remove = Tag.objects.get_for_object(obj)
+ else:
+ tags_remove = []
+ taglist = "Recommended Tags: "
+
+ itr = 0
+ last = False
+ for t in tags:
+ itr += 1
+ if itr == len(tags): last = True
+ if t not in tags_remove:
+ try:
+ count = t.count
+ font_size = t.font_size
+ link = "<font size=" + str(font_size) + " ><a
href='javascript:;' onClick=" + '"' + "add_tag('" + str(t.name) + "','" +
str(obj.id) + "','" + str(mod) + "', '" + str(al) + "');" + '"' + ">"+
str(t.name) + "(" + str(t.count) + ")" + "</a></font>"
+ if last != True: link += ", "
+ except: link = "(err: " + str(t.name) + ")"
+ taglist += link
+ if itr >= 15: break #hard limit to tag recommendation, probably
should make this dynamic when intelligent tag recommendations are developed
+ return taglist
+
+
+@block
+def pp_tag_recommendations(context, nodelist, *args, **kwargs):
+ '''
+ This block tag can create or process forms to get tags.
+ Usage is as follows:
+
+ '''
+ context.push()
+ namespace = get_namespace(context)
+
+ obj = kwargs.get('object',None)
+
+ taglist = get_tag_list(obj)
+
+ namespace['taglist'] = taglist
+
+ output = nodelist.render(context)
+ context.pop()
+ return output
+
+@block
+def pp_get_tags_for_model(context, nodelist, *args, **kwargs):
+ '''
+ This block tag can create or process forms to get tags.
+ Usage is as follows:
+
+ '''
+
+ context.push()
+ namespace = get_namespace(context)
+
+ obj = kwargs.get('object',None)
+ opts = obj._meta
+
+ al = opts.app_label
+ mod = opts.module_name
+
+ model = get_model(al, mod)
+
+ tags = Tag.objects.cloud_for_model(model)
+
+ namespace['tags'] = tags
+
+ output = nodelist.render(context)
+ context.pop()
+ return output
+

@block
def pp_get_tags_for_object(context, nodelist, *args, **kwargs):
@@ -43,9 +153,9 @@
tags1 = []
tags2 = []

- namespace['tags'] = tags
- namespace['tags1'] = tags1
- namespace['tags2'] = tags2
+ namespace['tags'] = list(tags)
+ namespace['tags'].extend(tags1)
+ namespace['tags'].extend(tags2)
output = nodelist.render(context)
context.pop()
return output
@@ -94,12 +204,17 @@
obj = kwargs.get('object',None)
POST = kwargs.get('POST',None)
path = kwargs.get('path',None)
+ tag = kwargs.get('tag',None)

if POST and POST.get("form_id") == "pp_tag_form":
- form = TagForm(POST)
- #new_arg = form.save(commit=False)
- if form.is_valid():
- Tag.objects.add_tag(obj, form.cleaned_data['tag'])
+ if tag != None:
+ Tag.objects.add_tag(obj, tag.name)
+ else:
+ form = TagForm(POST)
+ #new_arg = form.save(commit=False)
+ if form.is_valid():
+ clean_tag = form.cleaned_data['tag'].replace(' ','_')
+ Tag.objects.add_tag(obj, clean_tag)
raise
HttpRedirectException(HttpResponseRedirect(obj.get_absolute_url()))
else:
form = TagForm()
=======================================
--- /trunk/pirate-politics/pirate_issues/models.py Mon Jan 31 18:54:01 2011
+++ /trunk/pirate-politics/pirate_issues/models.py Sun Feb 6 23:05:17 2011
@@ -35,7 +35,7 @@
#This should be a pirate-wikipage instance
class Issue(models.Model):
topic = models.ForeignKey(Topic, blank= True, null = True)
- name = models.CharField(max_length=64, default = "DEF", blank=True)
+ name = models.CharField(max_length=100, default = "DEF", blank=True)
submit_date = models.DateTimeField('date_published',auto_now_add=True)
text = models.TextField(max_length=1200)
user = models.ForeignKey(User, blank=True, null=True)
@@ -60,7 +60,7 @@

class Solution(models.Model):
issue = models.ForeignKey(Issue, blank=True, null=True)
- name = models.CharField(max_length=64, default = "DEF", blank=True,
null=True)
+ name = models.CharField(max_length=100, default = "DEF", blank=True,
null=True)
text = models.TextField(max_length=1200)
submit_date = models.DateTimeField('date_published',auto_now_add=True)
user = models.ForeignKey(User ,blank=True, null=True)
=======================================
--- /trunk/pirate-politics/pirate_issues/templatetags/issuetags.py Mon Jan
31 18:54:01 2011
+++ /trunk/pirate-politics/pirate_issues/templatetags/issuetags.py Sun Feb
6 23:05:17 2011
@@ -162,13 +162,13 @@

#user = kwargs.pop('user', None)
topic = kwargs.pop('topic', None)
- rng = kwargs.pop('rng', None)
+ start = kwargs.pop('start', None)
+ end = kwargs.pop('end', None)
dimension = kwargs.pop('dimension', None)

- if isinstance(rng, basestring):
+ if isinstance(start, int) and isinstance(end, int):
try:
- rng = rng.strip("()").split(",")
- rng = (int(rng[0]), int(rng[1]))
+ rng = (int(start), int(end))
except:
rng = None

@@ -176,6 +176,7 @@
raise ValueException("The argument 'rng=' to the pp-issue-list
tag must be "
"provided either in the form of an (int,
int) pair, or "
"as a string in the form of '(<int>,
<int>)'.")
+ else: rng = None

#TODO: future functionality to get user-specific lists
#however, it may be better to put this in the discovery module, to
avoid cyclic dependency
@@ -192,7 +193,7 @@

consensus_list = Consensus.objects.all()
issue_list = Issue.objects.all()
-
+
adjust_for_range = True
if not rng: #need to add a range if not specified.
rng = (0,20)
@@ -211,23 +212,33 @@
elif dimension == "top":
order_by = '-votes'

- consensus_list = consensus_list.order_by(order_by)
- issue_list = []
- for i in consensus_list:
- if i.content_type.name == u'issue':
- if topic and isinstance(topic, Topic):
- if i.content_object.topic == topic:
- issue_list.append(i.content_object)
- elif not isinstance(topic, Topic):
- issue_list.append(i.content_object)
+ #need to filter on topic of content object and content_type.name
+
+ if topic and isinstance(topic, Topic): consensus_list =
consensus_list.filter(parent_pk=topic.pk)
+
+ issue_list = consensus_list.order_by(order_by)
+
+ #issue_list = []
+ #for i in consensus_list:
+ # if i.content_type.name == u'issue':
+ # if topic and isinstance(topic, Topic):
+ # if i.content_object.topic == topic:
+ # issue_list.append(i.content_object)
+ # elif not isinstance(topic, Topic):
+ # issue_list.append(i.content_object)

else: #catch all for no dimension grabs new objects
issue_list = issue_list.order_by('-submit_date')

+ try: namespace['count'] = issue_list.count()
+ except: pass #issue_list is probably empty
+
if adjust_for_range: #filter for rng
issue_list = issue_list[rng[0]:rng[1]]

namespace['issue_list'] = issue_list
+
+ #issue list must be empty
output = nodelist.render(context)
context.pop()

@@ -260,37 +271,58 @@
# This topic has to be set here because this is how the form
# is going to know how to set the default choice to be the same
# as the passed-in argument
-
- if isinstance(obj, Issue):
- topic = obj.topic
- issue = obj
- namespace['contextname'] = "Edit issue " + str(issue.name)
- elif isinstance(obj,Topic):
- topic = obj
- issue = None
- namespace['contextname'] = "Create issue on " + str(topic.text)
- else: issue, topic = (None, None)
- if POST and POST.get("form_id") == "pp_issue_form":
- form = IssueForm(POST) if issue is None else IssueForm(POST,
instance=issue)
- issue = form.save(commit=False)
- issue.user = request.user
- issue.solutions = 0
- issue.arguments = 0
- issue.name = clean_html(issue.name)
- issue.text = clean_html(issue.text)
- if isinstance(topic, Topic):
- issue.topic = topic
- issue.save()
- contype = ContentType.objects.get_for_model(Issue)
- obj_pk = issue.pk
- cons, is_new =
Consensus.objects.get_or_create(content_type=contype,
- object_pk=obj_pk)
-
- if is_new: #if this is a new issue/consensus, send signal for
reputation
- aso_rep_event.send(sender=issue,event_score=3,
user=issue.user, dimension=ReputationDimension.objects.get('add_issue'))
- raise
HttpRedirectException(HttpResponseRedirect(issue.get_absolute_url()))
-
- else: form = IssueForm() if issue is None else
IssueForm(instance=issue)
+ if POST and POST.get("form_id") == "pp_issue_form":
+ if isinstance(obj, Issue):
+ topic = obj.topic
+ issue = obj
+ namespace['contextname'] = "Edit issue " + str(issue.name)
+ namespace['has_topic'] = True
+ form = IssueForm(POST, instance=issue)
+
+ elif isinstance(obj,Topic):
+ topic = obj
+ issue = None
+ namespace['contextname'] = "Create issue on " + str(topic.text)
+ namespace['has_topic'] = True
+ form = IssueForm(POST)
+
+ else:
+ issue, topic = (None, None)
+ namespace['contextname'] = "Create issue on topic of your
choice"
+ namespace['has_topic'] = False
+ form = TopicIssueForm(POST)
+
+
+ if form.is_valid():
+ issue = form.save(commit=False)
+ issue.user = request.user
+ if not isinstance(obj, Issue):
+ issue.solutions = 0
+ issue.arguments = 0
+ issue.name = clean_html(issue.name)
+ issue.text = clean_html(issue.text)
+ if isinstance(topic, Topic):
+ issue.topic = topic
+ topic_pk = topic.pk
+ else:
+ topic_pk = form.cleaned_data['topics'].pk
+
+ issue.save()
+ contype = ContentType.objects.get_for_model(Issue)
+ obj_pk = issue.pk
+
+ cons, is_new =
Consensus.objects.get_or_create(content_type=contype,
+
object_pk=obj_pk,parent_pk=topic_pk)
+
+ if is_new: #if this is a new issue/consensus, send signal for
reputation
+ aso_rep_event.send(sender=issue,event_score=3,
user=issue.user, dimension=ReputationDimension.objects.get('add_issue'))
+ raise
HttpRedirectException(HttpResponseRedirect(issue.get_absolute_url()))
+ else: namespace['errors'] = form.errors
+
+ else:
+ if isinstance(obj, Issue): form = IssueForm(instance=obj)
+ elif isinstance(obj, Topic): form = IssueForm()
+ else: form = TopicIssueForm()

#TODO:THIS IS FOR FORMIXIN WHICH NEEDS SOME WORK
#form = IssueForm.create(POST, path, issue)
@@ -331,11 +363,36 @@

class Meta:
model = Issue
+ exclude = ('solutions','arguments','user','topic',)

#need to grab user from authenticatio
form_id = forms.CharField(widget=forms.HiddenInput(),
initial="pp_issue_form")
- name = forms.CharField(label="text", max_length=64,
+ name = forms.CharField(label="text", max_length=100,
widget=forms.TextInput(
- attrs={'size':'60', 'class':'inputText'}))
+ attrs={'size':'50', 'class':'inputText'}))
text = forms.CharField(widget=forms.Textarea)

+
+class TopicIssueForm(forms.ModelForm, FormMixin):
+ '''
+ This form is used to allow creation and modification of issue objects.
+ It extends FormMixin in order to provide a create() class method, which
+ is used to process POST, path, and object variables in a consistant
way,
+ and in order to automatically provide the form with a form_id.
+ '''
+
+ def save(self, commit=True):
+ new_issue = super(TopicIssueForm, self).save(commit=commit)
+ return new_issue
+
+ class Meta:
+ model = Issue
+ exclude = ('solutions','arguments','user',)
+
+ #need to grab user from authenticatio
+ topics = forms.ModelChoiceField(queryset=Topic.clean_objects.all())
+ form_id = forms.CharField(widget=forms.HiddenInput(),
initial="pp_issue_form")
+ name = forms.CharField(label="text", max_length=100,
+ widget=forms.TextInput(
+ attrs={'size':'50', 'class':'inputText'}))
+ text = forms.CharField(widget=forms.Textarea)
=======================================
--- /trunk/pirate-politics/pirate_issues/templatetags/solutiontags.py Mon
Jan 31 18:54:01 2011
+++ /trunk/pirate-politics/pirate_issues/templatetags/solutiontags.py Sun
Feb 6 23:05:17 2011
@@ -116,15 +116,18 @@
elif dimension == "top":
order_by = '-votes'

- consensus_list = consensus_list.order_by(order_by)
- solution_list = []
- for i in consensus_list:
- if topic and isinstance(topic, Topic):
- if i.content_object.issue.topic == topic and
i.content_object.issue == issue:
- solution_list.append(i.content_object)
- elif not isinstance(topic, Topic) and isinstance(issue,Issue):
- if i.content_object.issue == issue:
solution_list.append(i.content_object)
- else: solution_list.append(i.content_object)
+ if issue and isinstance(issue, Issue): consensus_list =
consensus_list.filter(parent_pk=issue.pk)
+
+ solution_list = consensus_list.order_by(order_by)
+
+ #solution_list = []
+ #for i in consensus_list:
+ # if topic and isinstance(topic, Topic):
+ # if i.content_object.issue.topic == topic and
i.content_object.issue == issue:
+ # solution_list.append(i.content_object)
+ # elif not isinstance(topic, Topic) and isinstance(issue,Issue):
+ # if i.content_object.issue == issue:
solution_list.append(i.content_object)
+ # else: solution_list.append(i.content_object)


if adjust_for_range: #filter for rng
@@ -177,7 +180,8 @@
contype = ContentType.objects.get_for_model(Solution)
obj_pk = new_sol.pk
cons, is_new =
Consensus.objects.get_or_create(content_type=contype,
-
object_pk=obj_pk)
+
object_pk=obj_pk,
+
parent_pk=issue.pk)

if is_new: #if this is a new issue/consensus, send signal for
reputation
aso_rep_event.send(sender=new_sol,event_score=5,
user=new_sol.user,
dimension=ReputationDimension.objects.get('add_solution'))
@@ -218,9 +222,9 @@

form_id = forms.CharField(widget=forms.HiddenInput(),
initial="pp_solution_form")
text = forms.CharField(widget=forms.Textarea)
- name = forms.CharField(label="text", max_length=64,
+ name = forms.CharField(label="text", max_length=100,
widget=forms.TextInput(
- attrs={'size':'64', 'class':'inputText'}))
+ attrs={'size':'50', 'class':'inputText'}))
#comments = forms.CharField(widget=forms.HiddenInput(), initial=0)
#issue = forms.CharField(widget=forms.HiddenInput(), initial=None)
#user = forms.CharField(widget=forms.HiddenInput(), initial=None)
=======================================
--- /trunk/pirate-politics/pirate_messages/models.py Mon Jan 31 18:26:02
2011
+++ /trunk/pirate-politics/pirate_messages/models.py Sun Feb 6 23:05:17
2011
@@ -40,7 +40,7 @@
rep_type = ContentType.objects.get_for_model(reply_to)
if len(obj.text) > 30: tt = str(obj.text)[0:30] + "..."
else: tt = str(obj.text)
- text = str(obj.user.username) + " replied to your " + str(rep_type)
+ ": " + tt + "..."
+ text = str(obj.user.username) + " replied to your " + str(rep_type)
+ ": " + tt
link = obj.get_absolute_url()
notif = Notification(receiver=reply_to.user,
sender=obj.user,text=text,link=link,content_type=rep_type,object_pk=reply_to.pk,is_read=False,submit_date=datetime.datetime.now())
notif.save()
=======================================
--- /trunk/pirate-politics/static/style.css Mon Jan 31 19:55:57 2011
+++ /trunk/pirate-politics/static/style.css Sun Feb 6 23:05:17 2011
@@ -8,30 +8,6 @@
a:visited { color:#4E7A49; }
pre { background: #fff; width: 460px; padding: 10px 20px; border-left: 5px
solid #ccc; margin: 0 0 20px; }
input { margin: 0; padding: 0; }
-h2 {
- font-size: 18px;
- line-height: 22px;
- padding: 5px;
-}
-
-h3 {
- font-size: 16px;
- line-height: 20px;
- padding: 3px;
-}
-
-h4 {
- font-size: 14px;
- line-height: 18px;
- padding: 2px;
-}
-
-h5 {
- font-size: 12px;
- line-height: 16px;
- padding: 1px;
-
-}

hr {
border: none;
@@ -50,11 +26,13 @@
}

.voting {
+ width:95%;
float:right;
- left:10%;
+ margin-left:10%;
}

.pagehead {
+ margin-left:2%;
position:relative; /* This fixes the IE7 overflow hidden bug */
float:left;
width:68%;
@@ -257,10 +235,6 @@
#tutorialTable {
display: none;
}
-
-.voting {
- margin-left:10%;
-}

.pagehead {
position:relative; /* This fixes the IE7 overflow hidden bug */
@@ -306,7 +280,6 @@

.submissionbound form {
padding-left: 5%;
-
}

.submissionbount button {
@@ -421,7 +394,7 @@
overflow:hidden;
}

-.issue {
+{
position:relative;
width:100%;
color:black;
@@ -431,7 +404,7 @@
}


-.issue .issueback {
+.issueback {
float:left;
position:relative;
width:90%;
@@ -446,12 +419,15 @@
box-shadow: 5px 5px 2px #888;*/
overflow:visible;
border-bottom:10px solid #BDC4C8;
-}
-
-.issue .issueback2 {
+ margin: 2px 0px 0px 0px;
+}
+
+
+
+.issueback2 {
float:right;
position:relative;
- width:90%;
+ width:95%;
font-size:150%;
font-style:bold;
min-width:20%;
@@ -466,6 +442,7 @@
overflow:visible;
border-bottom:10px solid #d3d9df;
}
+

.issueback a {
font-weight: bold;
@@ -530,13 +507,12 @@
width:native;
font-size:50%;
border-bottom:0;
-
-}
-
-.issue p {
- padding:0 1em 1em 1em;
- /*border: 1px dashed black;*/
- }
+}
+
+.issue
+{
+ padding:1em 0em 1em 1em;
+}

.bullet {
position:relative;
@@ -599,25 +575,48 @@
overflow:visible;
}

-.issue .bullet {
+.bullet {
position:relative;
overflow:visible;
}

-.issue .bullet2 {
+.bullet2 {
position:relative;
overflow:visible;
}

-.issue .bullet h1 {
+.bullet h1 {
font-size:25px;
text-align:center;
}
+
+.isstags{
+ margin-top:5px;
+ color:black;
+ font-size:60%; /* width of whole page */
+ width:64%;
+ float:left;
+ position:relative;
+
+}
+
+.tags {
+ margin-top:5px;
+ font-size:60%; /* width of whole page */
+ width:64%;
+ float:left;
+ position:relative;
+
+}
+
+.tags a:link, .tags a:visited, .userinfo a:link, .userinfo a:visited {
+ color:black;
+}

.bullet_ {
float:right;
position:relative;
- width:100%;
+ width:35%;
}

.add_tag {
@@ -628,7 +627,6 @@
position:relative; /* This fixes the IE7 overflow hidden bug */
float:left;
width:100%;
- font-size:85%; /* width of whole page */
border-bottom:3px solid #989898;
padding-bottom: 3px;
top: -3px;
@@ -636,15 +634,12 @@
}

.details {
+ max-width:90%;
+ margin-top:12%;
+ margin-left:3%;
position:relative;
- bottom:-5px;
}

-.detail {
- color:black;
- position:relative;
- overflow:hidden;
-}
.sourcetags {
position:relative;
overflow:hidden;
@@ -685,19 +680,21 @@
}

.iss_col2 {
- width:30%;
+ font-size:60%;
+ width:19%;
padding:5px;
float:right;
}

.iss_col1 {
- width:50%;
+ font-size:60%;
+ width:79%;
margin-top:8px;
}

.iss_col3 {
font-size:60%;
- width:100%;
+ width:80%;
margin-top:8px;
}

@@ -738,8 +735,6 @@
}

.issueback .threecol, .issueback2 .threecol {
- width:native;
- font-size:50%;
border-bottom:0;
}

@@ -761,7 +756,7 @@
background: url(no-mail.png) repeat-x bottom;
}

-.button, .issue .issueback .iss_col2 .button {
+.button, .issueback .iss_col2 .button {
padding: 5px 10px;
display: inline;
background: #777 url(button.png) repeat-x bottom;
@@ -775,12 +770,12 @@
text-shadow: 1px 1px #666;
}

-.button:hover, .issue .issueback .iss_col2 .button:hover {
+.button:hover, .issueback .iss_col2 .button:hover {
background-position: 0 center;
color: #EFEFEF;
}

-.button:active, .issue .issueback .iss_col2 .button:active {
+.button:active, .issueback .iss_col2 .button:active {
background-position: 0 top;
position: relative;
top: 1px;
@@ -792,7 +787,7 @@
.button.purple { background-color: #9400bf; }
.button.green { background-color: #58aa00; }
.button.orange { background-color: #ff9c00; }
-.button.blue, .issue .issueback .iss_col2 .button.blue { background-color:
#2c6da0; }
+.button.blue, .issueback .iss_col2 .button.blue { background-color:
#2c6da0; }

.button.black { background-color: #333; }
.button.white { background-color: #fff; color: #000; text-shadow: 1px 1px
#fff; }
=======================================
--- /trunk/pirate-politics/urls.py Mon Jan 31 18:26:02 2011
+++ /trunk/pirate-politics/urls.py Sun Feb 6 23:05:17 2011
@@ -7,7 +7,7 @@
from django.contrib import admin
from hello.views import hello_view, setup_admin
from pirate_core import redirectable, home_page
-from ajaxapi.views import vote, generate_vote_content, delete_source
+from ajaxapi.views import vote, generate_vote_content, delete_source,
add_tag
from pirate_login.views import logout_view

from pirate_sources.models import URLSource
@@ -24,6 +24,7 @@
(r'^helloworld/', hello_view),
(r'^sourcedelete/(?P<object_id>\d+)/$', delete_source),
(r'^vote/', vote),
+ (r'^add_tag/', add_tag),
(r'^generate_vote_content/', generate_vote_content),
(r'^comments/', include('django.contrib.comments.urls')),
(r'^logout/', logout_view),

Reply all
Reply to author
Forward
0 new messages