Modified:
/trunk/pirate-politics/ajaxapi/views.py
/trunk/pirate-politics/new_templates/_issue.html
/trunk/pirate-politics/new_templates/_solution.html
/trunk/pirate-politics/new_templates/_sourcetags.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/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_yea_argument.html
/trunk/pirate-politics/new_templates/user_profile.html
/trunk/pirate-politics/new_templates/welcome.html
/trunk/pirate-politics/pirate_comments/templatetags/commenttags.py
/trunk/pirate-politics/pirate_consensus/models.py
/trunk/pirate-politics/pirate_core/forms.py
/trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py
/trunk/pirate-politics/pirate_deliberation/templatetags/argumenttags.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_issues/templatetags/topictags.py
/trunk/pirate-politics/pirate_messages/models.py
/trunk/pirate-politics/pirate_messages/templatetags/notificationtags.py
/trunk/pirate-politics/pirate_profile/templatetags/profiletags.py
/trunk/pirate-politics/pirate_ranking/callbacks.py
/trunk/pirate-politics/pirate_ranking/models.py
/trunk/pirate-politics/pirate_reputation/templatetags/reputationtags.py
/trunk/pirate-politics/pirate_signals/models.py
/trunk/pirate-politics/pirate_sources/models.py
/trunk/pirate-politics/pirate_sources/templatetags/sourcetags.py
/trunk/pirate-politics/settings.py
/trunk/pirate-politics/static/style.css
=======================================
--- /trunk/pirate-politics/ajaxapi/views.py Sun Feb 6 23:05:17 2011
+++ /trunk/pirate-politics/ajaxapi/views.py Thu Feb 17 01:26:13 2011
@@ -9,61 +9,13 @@
from django.shortcuts import get_object_or_404,redirect
from django.contrib.contenttypes.models import ContentType
+from pirate_ranking.models import vote_created_callback
+
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_signals.models import
aso_rep_event,aso_rep_delete,relationship_event
from pirate_reputation.models import ReputationDimension
-
-from BeautifulSoup import BeautifulSoup
-
-acceptable_elements =
['a', 'abbr', 'acronym', 'address', 'area', 'b', 'big',
- 'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col',
- 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em',
- 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img',
- 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', 'ol',
- 'p', 'pre', 'q', 's', 'samp', 'small', 'span', 'strike',
- 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th',
- 'thead', 'tr', 'tt', 'u', 'ul', 'var']
-
-acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey',
- 'action', 'align', 'alt', 'axis', 'border', 'cellpadding', 'cellspacing',
- 'char', 'charoff', 'charset', 'checked', 'cite', 'clear', 'cols',
- 'colspan', 'color', 'compact', 'coords', 'datetime', 'dir',
- 'enctype', 'for', 'headers', 'height', 'href', 'hreflang', 'hspace',
- 'id', 'ismap', 'label', 'lang', 'longdesc', 'maxlength', 'method',
- 'multiple', 'name', 'nohref', 'noshade', 'nowrap', 'prompt',
- 'rel', 'rev', 'rows', 'rowspan', 'rules', 'scope', 'shape', 'size',
- 'span', 'src', 'start', 'summary', 'tabindex', 'target', 'title', 'type',
- 'usemap', 'valign', 'value', 'vspace', 'width']
-
-
-"""This function cleans up user-generated text inputs so to disallow
dangerous
- html such as <script></script> but still allow html modifications and
markdown"""
-def clean_html( fragment ):
- while True:
- soup = BeautifulSoup( fragment )
- removed = False
- for tag in soup.findAll(True): # find all tags
- if tag.name not in acceptable_elements:
- tag.extract() # remove the bad ones
- removed = True
- else: # it might have bad attributes
- # a better way to get all attributes?
- for attr in tag._getAttrMap().keys():
- if attr not in acceptable_attributes:
- del tag[attr]
-
- # turn it back to html
- fragment = unicode(soup)
-
- if removed:
- # we removed tags and tricky can could exploit that!
- # we need to reparse the html until it stops changing
- continue # next round
-
- return fragment
-
#DELETE FUNCTIONS
def delete_source(request,object_id):
obj = get_object_or_404(URLSource,id=object_id)
@@ -88,6 +40,8 @@
obj = model_type.get_object_for_this_type(pk=obj_id)
Tag.objects.add_tag(obj, tag)
+ new_tag = Tag.objects.get(name=tag)
+
relationship_event.send(sender=new_tag,obj=new_tag,parent=obj,initiator=request.user)
results = {'linktaglist':
get_link_tag_list(obj),'taglist':get_tag_list(obj),'FAIL':False}
return HttpResponse(simplejson.dumps(results),
mimetype='application/json')
@@ -128,15 +82,14 @@
#create reputation event for this vote_dict
user = consensus.content_object.user
- if vote_type in [1,-1]:
aso_rep_event.send(sender=request.user, event_score=1, user=user,
initiator=request.user,
dimension=ReputationDimension.objects.get('vote'),related_object=new_vote)
- elif vote_type == 0: aso_rep_event.send(sender=request.user,
event_score=-5, user=user, initiator=request.user,
dimension=ReputationDimension.objects.get('vote'),related_object=new_vote)
+ aso_rep_event.send(sender=request.user, event_score=1,
user=user, initiator=request.user,
dimension=ReputationDimension.objects.get('Voting'),related_object=new_vote)
+ vote_created_callback(sender=request.user,
parent=consensus,vote_type=vote_type)
else: #if this user has already voted
vote_id = int(upd[0].vote_type)
if vote_type == vote_id: #if user clicked on same vote, delete
old vote
user = consensus.content_object.user
- 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])
+ aso_rep_delete.send(sender=request.user, event_score=1,
user=user, initiator=request.user,
dimension=ReputationDimension.objects.get('Voting'),related_object=upd[0])
upd[0].delete()
#c =
UpDownVote.objects.filter(vote_type=vote_id,parent=consensus).count()
#else: #else do nothing.
=======================================
--- /trunk/pirate-politics/new_templates/_issue.html Tue Feb 8 19:28:28
2011
+++ /trunk/pirate-politics/new_templates/_issue.html Thu Feb 17 01:26:13
2011
@@ -24,24 +24,23 @@
<div class="bullet_verdict"></div> -->
</div>
<div class="issueback">
- <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="issueinformation">
+ <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.content_object.id %}
{% if not request.object %}
- 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}}
+ 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> by <a href="{% pp_url template='user_profile.html'
object=iss_obj.content_object.user %}">{{
iss_obj.content_object.user.username }}</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.content_object
dimension=request.dimension start=0 end=20 %}" class="button blue">see_{{
iss_obj.content_object.solutions}}_solution{{
iss_obj.content_object.solutions|pluralize }}</a>
-
- </div>
+ </div>
+
<div class="isstags">
- Tags:
+
{{iss_obj.content_object.submit_date|date:"(d/m/Y h:sA)"}} 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%}
@@ -50,6 +49,20 @@
{% endfor %}
{%
endpp_get_tags_for_object %}
</div>
+ </div>
+ <div class="buttons">
+
+ {% pp_consensus_get
object=iss_obj.content_object.id user=request.user small="small" %}
+ {%
include '_voting_iss_obj_small.html' %}
+ {% endpp_consensus_get %}
+ <div class="iss_button">
+ {% ifequal 0
iss_obj.content_object.solutions %}
+ <a href="{% pp_url
template='submit_solution.html' object=iss_obj.content_object %}"
class="small button blue">Submit Solution</a>
+ {% else %}
+ <a href="{% pp_url
template='solutions.html' object=iss_obj.content_object
dimension=request.dimension start=0 end=20 %}" class="small button
blue">See {{ iss_obj.content_object.solutions}} Solution{{
iss_obj.content_object.solutions|pluralize }}</a>
+ {% endifequal %}
+ </div>
+ </div>
</div>
</div>
=======================================
--- /trunk/pirate-politics/new_templates/_solution.html Tue Feb 8 19:28:28
2011
+++ /trunk/pirate-politics/new_templates/_solution.html Thu Feb 17 01:26:13
2011
@@ -23,25 +23,18 @@
</div>
<div class="issueback">
-
-<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="issueinformation">
+<div class="issheader"><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}}
+submitted by <a href="{% pp_url template='user_profile.html'
object=iss_obj.content_object.user%}">
{{iss_obj.content_object.user.username}} </a> | {{ 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 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:
+
+ <div class="isstags">
+
{{iss_obj.content_object.submit_date|date:"(d/m/Y h:sA)"}} 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%}
@@ -49,7 +42,14 @@
N/A
{% endfor %}
{%
endpp_get_tags_for_object %}
- </div>
+ </div>
+ </div>
+ <div class="buttons">
+
+ {% 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>
</div>
=======================================
--- /trunk/pirate-politics/new_templates/_sourcetags.html Tue Feb 8
19:28:28 2011
+++ /trunk/pirate-politics/new_templates/_sourcetags.html Thu Feb 17
01:26:13 2011
@@ -6,7 +6,8 @@
{% load solutiontags %}
{% load sourcetags %}
{% load tag_helpers %}
-{% load tagging_tags %}
+{% load filetransfers %}
+
<div class="sourcetags">
<div class="sources">
@@ -14,11 +15,32 @@
<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 %}
+<a href="javascript:;" onmousedown="toggleSlide('mydiv2');">+image</a>
+
+<div id="mydiv2" style="display:none; overflow:hidden; height:250px;">
+{% pp_imgsource_form POST=request.POST object=request.object
user=request.user FILE=request.FILES request=request %}
+<form action="{{ pp_source.upload_url }}" method="POST"
enctype="multipart/form-data">
+ {{ pp_source.form.errors }}
+ {% render_upload_data pp_source.upload_data %}
+ <form method="post" action="">
+ {{ pp_source.imgform.as_p }}
+ {{ pp_source.imgform.form_id}}
+ {% csrf_token %}
+ <input type="submit" class="button green"
value="Submit IMG">
+ </form>
+ {% endpp_imgsource_form %}
+
+</div>
+
{% endifequal %}
{% pp_get_sources object=request.object %}
+ <ul>
+ {% for imgsource in pp_source.imgsource_list %}
+ <li><img src="/upload_images/{{imgsource.img}}"></li>
+ {% endfor %}
+ </ul>
+
<ul>
{% for urlsource in pp_source.urlsource_list %}
<li>
@@ -57,11 +79,9 @@
<b>Tags:</b>{% if request.user.is_authenticated and request.object %}<a
href="javascript:;" onmousedown="toggleSlide('tag_rightcol');">+tag</a>{%
endif %}
<ul class="d">
<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 %}
+ {% pp_get_link_tags_for_object object=request.object %}
+ {{pp_tag.tags|safe}}
+ {% endpp_get_link_tags_for_object %}
<div>
{% endif %}
@@ -69,7 +89,7 @@
{% if request.user.is_authenticated and request.object.taggable %}
- {% pp_tag_form POST=request.POST path=request.path
object=request.object %}
+ {% pp_tag_form POST=request.POST path=request.path
object=request.object user=request.user %}
<div id="tag_rightcol" style="display:none; overflow:hidden;
height:150px;">
{{ pp_tag.form.errors }}
<form method="post" action="">
=======================================
--- /trunk/pirate-politics/new_templates/argument_detail.html Tue Feb 8
19:28:28 2011
+++ /trunk/pirate-politics/new_templates/argument_detail.html Thu Feb 17
01:26:13 2011
@@ -32,28 +32,35 @@
{% 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 %}
+ {{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>
+
+
+
+<div class="buttons">
+ {% include '_voting.html' %}
+ {% ifequal request.object.user request.user %}
+<div class="edit">
{% ifequal
request.object.arg_type.arg "yea" %}
- <a href="{% pp_url
template='submit_yea_argument.html' object=request.object %}" class='button
blue'>edit</a>
+ <a href="{% pp_url
template='submit_yea_argument.html' object=request.object %}" class="small
button blue">edit</a>
{% else %}
{% ifequal
request.object.arg_type.arg "nay" %}
- <a href="{% pp_url
template='submit_nay_argument.html' object=request.object %}" class='button
blue'>edit</a>
+ <a href="{% pp_url
template='submit_nay_argument.html' object=request.object %}" class="small
button blue">edit</a>
{% endifequal %}
{% endifequal %}
{% endifequal %}
- {% endifequal %}</div>
+</div>
{% endpp_comment_count %}
- </div>
-
- {% include '_voting.html' %}
+
+
+
+</div></div>
- <div class="details">
+ <div class="description">
{{request.object.text|markdown}}
</div>
=======================================
--- /trunk/pirate-politics/new_templates/base.html Thu Feb 10 15:02:05 2011
+++ /trunk/pirate-politics/new_templates/base.html Thu Feb 17 01:26:13 2011
@@ -18,7 +18,7 @@
<link rel="stylesheet" type="text/css" href="/static/style.css" />
- <title>{{request.path|cut:"/"|cut:".html"|capfirst}} -
Nonrel-testapp</title>
+ <title>{{request.path|cut:"/"|cut:".html"|capfirst}} -
OpenAssembly</title>
{% block css %}
{% endblock %}
@@ -135,10 +135,12 @@
{% else %}
<body>
{% endif%}
+ <div id="container">
<div id="header">
<div class="headtitle">openassembly.org</div>
<ul>
+ <li><a href="{% pp_url template='feed.html' start=0
end=20 %}">feed</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>
@@ -211,9 +213,10 @@
{% endautoescape %}
</div>
- </div>
+ </div>
+ </div>
<div id="footer">
- <p><!--Copyright {% now "Y" %} pirate-politics--> </p>
+ <p>Copyright (c) {% now "Y" %}, <a
href="http://www.pirate-politics.org">pirate-politics</a></p>
</div>
</body>
</html>
=======================================
--- /trunk/pirate-politics/new_templates/issue_detail.html Tue Feb 8
19:28:28 2011
+++ /trunk/pirate-politics/new_templates/issue_detail.html Thu Feb 17
01:26:13 2011
@@ -19,8 +19,6 @@
{% block browser_bar %}
{% endblock %}
-
-
{% block content %}
@@ -42,6 +40,8 @@
<div class="issueback2">
<div class="header">{{pp_issue.issue.name}}</div>
+
+
<div class="userinfo">
@@ -49,27 +49,38 @@
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
-</div>
+</div></div>
+
<div class="buttons">
- {% 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 %}
-
-<a href="{% pp_url template='solutions.html' object=pp_issue.issue
dimension=request.dimension start=0 end=20 %}" class="button blue">see_{{
pp_issue.issue.solutions}}_solution{{ pp_issue.issue.solutions|pluralize
}}</a>
-</div>
-
-</div>
-
+
+<div class="iss_button">
+ {% ifequal 0 pp_issue.issue.solutions %}
+ <a href="{% pp_url template='submit_solution.html'
object=pp_issue.issue %}" class="small button blue">Submit Solution</a>
+ {% else %}
+ <a href="{% pp_url template='solutions.html'
object=pp_issue.issue dimension=request.dimension start=0 end=20 %}"
class="small button blue">see {{ pp_issue.issue.solutions}} solution{{
pp_issue.issue.solutions|pluralize }}</a>
+ {% endifequal %}
+
+ {% ifequal pp_issue.issue.user request.user %}
+
+ <a href="{% pp_url template='submit_issue.html'
object=pp_issue.issue %}" class="small button blue">edit</a>
+ {% endifequal %}
+
+</div>
+
+ {% include "_voting.html" %}
+
+</div>
{% endpp_comment_count %}
</div>
- <div class="details">
+ <div class="description">
{% autoescape on %}
{{pp_issue.issue.text|markdown }}
{% endautoescape %}
=======================================
--- /trunk/pirate-politics/new_templates/issues.html Tue Feb 8 19:28:28
2011
+++ /trunk/pirate-politics/new_templates/issues.html Thu Feb 17 01:26:13
2011
@@ -27,8 +27,8 @@
<div class="issuemask">
{% if request.object %}
- <div class="pagehead">{{ request.object.text }} issues </div>
- {% else %}<div class="pagehead"> all issues </div>
+ <div class="pagehead">{{ request.object.text|title }}
{{request.dimension|title}} Issues </div>
+ {% else %}<div class="pagehead"> All {{request.dimension|
title}} Issues </div>
{% endif %}
<div class="issuebound">
=======================================
--- /trunk/pirate-politics/new_templates/solution_detail.html Thu Feb 10
14:21:57 2011
+++ /trunk/pirate-politics/new_templates/solution_detail.html Thu Feb 17
01:26:13 2011
@@ -39,32 +39,33 @@
<div class="issueback2">
<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}} |
{{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>
-
-
- {% include '_voting.html' %}
-
-
- <div class="details">
- {% autoescape on %}
- {{pp_solution.solution.text|markdown }}
- {% endautoescape %}
+{{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 </div>
+
+<div class="buttons">
+<div class="iss_button">
+{% ifequal pp_solution.solution.user request.user %}
+ <a href="{% pp_url
template='submit_solution.html' object=pp_solution.solution %}"
class='small button blue'>edit</a>
+ {% endifequal %}</div>
+
+
+
+
+ {% include '_voting.html' %}
</div>
- {% include "_sourcetags.html" %}
-
+
+
+{% endpp_comment_count %}</div>
+
+ <div class="description">{{pp_solution.solution.text|markdown }}</div>
+
+
+ {% include "_sourcetags.html" %}
<div class="argument">
=======================================
--- /trunk/pirate-politics/new_templates/solutions.html Tue Feb 8 19:28:28
2011
+++ /trunk/pirate-politics/new_templates/solutions.html Thu Feb 17 01:26:13
2011
@@ -22,9 +22,9 @@
<div class="issuemask">
<div class="pagehead">
{% if request.object %}
- Solutions for {{request.object.name}}
+ {{request.dimension|title}} Solutions for
{{request.object.name}}
{% else %}
- All Solutions
+ All {{request.dimension|title}} Solutions
{% endif %}
</div>
<div class="issuebound">
@@ -37,8 +37,9 @@
{% include '_solution.html' %}
{% empty %}
- <br>
- No solutions yet! Add a solution.
+ <div class="pagehead">
+ There doesn't seem to be anything here yet.
+ </div>
{% endfor %}
=======================================
--- /trunk/pirate-politics/new_templates/submit_issue.html Wed Feb 9
00:35:14 2011
+++ /trunk/pirate-politics/new_templates/submit_issue.html Thu Feb 17
01:26:13 2011
@@ -13,7 +13,7 @@
<div class="issuemask">
<div class="submissionbound">
{% if request.object %}
-{% pp_issue_form POST=request.POST path=request.path request=request
object=request.object %}
+{% pp_issue_form POST=request.POST path=request.path user=request.user
object=request.object %}
<div class="add">
<h2> {{pp_issue.contextname }}</h2>
<div class="errors">{{ pp_issue.form.errors }}</div>
@@ -27,14 +27,14 @@
</div>
{% endpp_issue_form %}
{% else %}
-{% pp_issue_form POST=request.POST path=request.path request=request %}
+{% pp_issue_form POST=request.POST path=request.path user=request.user %}
<div class="add">
<h2>{{pp_issue.contextname }}</h2>
<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 }}
+ Summary of Issue: <br>{{ pp_issue.form.name }}<br>
+ Description: <br>{{ pp_issue.form.text }}
{{ pp_issue.form.form_id}}
{% csrf_token %}
<input type="submit" class="button green" value="Submit Issue" />
=======================================
--- /trunk/pirate-politics/new_templates/submit_nay_argument.html Wed Feb
9 00:35:14 2011
+++ /trunk/pirate-politics/new_templates/submit_nay_argument.html Thu Feb
17 01:26:13 2011
@@ -11,7 +11,7 @@
<div class="stage">
<div class="issuemask">
<div class="submissionbound">
-{% pp_argument_form POST=request.POST path=request.path
object=request.object request=request arg_type='nay' %}
+{% pp_argument_form POST=request.POST path=request.path
object=request.object user=request.user arg_type='nay' %}
<div class="add">
<h2>Submit a new Nay argument for <br>{{request.object.name}}</h2>
<div class="errors">{{ pp_argumentation.form.errors }}</div>
=======================================
--- /trunk/pirate-politics/new_templates/submit_yea_argument.html Thu Feb
10 14:21:57 2011
+++ /trunk/pirate-politics/new_templates/submit_yea_argument.html Thu Feb
17 01:26:13 2011
@@ -12,7 +12,7 @@
<div class="issuemask">
<div class="submissionbound">
<h2>Submit a new Yea argument for:
<fragrobr>{{request.object.name}}</h2>
-{% pp_argument_form POST=request.POST object=request.object
request=request arg_type='yea' %}
+{% pp_argument_form POST=request.POST object=request.object
user=request.user arg_type='yea' %}
<div class="add">
<div class="errors">{{ pp_argumentation.form.errors }}</div>
<form method="post" action="">
=======================================
--- /trunk/pirate-politics/new_templates/user_profile.html Sun Feb 6
23:05:17 2011
+++ /trunk/pirate-politics/new_templates/user_profile.html Thu Feb 17
01:26:13 2011
@@ -7,6 +7,8 @@
{% load reputationtags %}
{% load notificationtags %}
{% load markup %}
+{% load badgetags %}
+{% load subscriptiontags %}
{% block browser_bar %}
@@ -24,12 +26,26 @@
{% pp_get_user_profile user=request.object %}
<div class="submissionbound">
-
-
{% pp_get_reputation user=request.object %}
<fieldset class="username">
<legend>Username</legend>
- {{request.object.username}}
+ {{request.object.username}}
+ {% pp_has_subscription subscriber=request.user
subscribee=request.object %}
+ {% if not pp_subscription.has_subscription %}
+ {% pp_subscription_form POST=request.POST
subscribee=request.object subscriber=request.user %}
+
+ {% if pp_subscription.form %}
+ {{ pp_subscription.form.errors }}
+ <form method="post" action="">
+ {{pp_subscription.form.form_id}}
+ {% csrf_token %}
+ <input type="submit" class='button green'
value="Subscribe to User">
+ </form>
+ {% endif %}
+ {% endpp_subscription_form %}
+ {% endif %}
+
+ {% endpp_has_subscription %}
</fieldset>
<fieldset class="reputation">
<legend>Reputation</legend>
@@ -39,12 +55,20 @@
{% if pp_profile.profile %}
<fieldset class="memberSince">
<legend>Member since</legend>
- MM/DD/YY
+ {{request.object.date_joined|date:"d M Y" }}
</fieldset>
<fieldset class="dateOfBirth">
<legend>Date of birth</legend>
{{pp_profile.profile.birth_date|date:"m/d/Y"}}<br><br>
</fieldset>
+ <fieldset class="subscribers">
+ <legend>Subscriber{{pp_subscription.count|pluralize}}</legend>
+ {% pp_subscriber_count user=request.object %}
+
+ {{pp_subscription.count}}
+
+ {% endpp_subscriber_count %}
+ </fieldset>
<fieldset class="bio">
<legend>Bio</legend>
{{pp_profile.profile.bio|markdown }}
@@ -73,36 +97,83 @@
{% endif %}
{% endifequal %}
{% endif %}
-
- <hr>
+ <hr>
+ {% ifequal request.object request.user %}
+ {% pp_get_subscribees_for_user user=request.user %}
+ You are subscribed to <b> {{pp_subscription.count}} </b> users:
+ {% for i in pp_subscription.subscribees %}
+ <a href="{% pp_url template='user_profile.html'
object=i.subscribee %}">{{i.subscribee.username}}</a>
+ {% endfor %}
+ {% endpp_get_subscribees_for_user %}
+
+ {% endifequal %}
+
+ <h3> Badges </h3>
+
+ {% ifequal request.object request.user %}
+
+ {% pp_check_badges user=request.object %}
+
+ {% for badge in pp_badge.new_badges %}
+
+ {{ badge.verbose_name }}
+
+ {% endfor %}
+
+ {% endpp_check_badges %}
+
+ {% endifequal %}
+
+ {% pp_get_badges user=request.object %}
+ {% for badge in pp_badge.badges %}
+ {{ badge.dimension.verbose_name }}
+
+ {% endfor %}
+ {% endpp_get_badges %}
+ <hr>
+ <h3> Reputation Dimensions </h3>
+ <ul>
+ {% pp_get_reputation user=request.object %}
+ {% for rep_dim, rep_score in pp_reputation.reputation_keys %}
+ <li>{{rep_dim}} : {{rep_score}}</li>
+ {% endfor %}
+ </ul>
+ {% endpp_get_reputation %}
+
{% if user.is_authenticated %}
- <div class="notifications">
- <h3> Notifications </h3>
-
- <h4> Unread Notifications: </h4>
- {% pp_notification_unread_list_get user=request.user %}
- <ul>
- {% for note in pp_messages.notifications %}
- <li><a href="{{note.link}}">{{ note.text }}</a></li>
- {% empty %}None for the moment.
- {% endfor %}
- </ul>
- {% endpp_notification_unread_list_get %}
- <h4> Read Notifications: </h4>
- {% pp_notification_read_list_get user=request.user %}
- <ul>
- {% for note in pp_messages.notifications %}
- <li><a href="{{note.link}}">{{ note.text }}</a></li>
- {% empty %}None for the moment.
- {% endfor %}
- </ul>
- {% endpp_notification_read_list_get %}
+ {% ifequal request.user request.object %}
+ <hr>
+ <div class="notifications">
+ <h3> Notifications </h3>
+
+
+ <h4> Unread Notifications: </h4>
+ {% pp_notification_unread_list_get user=request.user %}
+ <ul>
+ {% for note in pp_messages.notifications %}
+ <li><a href="{{note.link}}">{{ note.text }}</a></li>
+ {% empty %}None for the moment.
+ {% endfor %}
+ </ul>
+ {% endpp_notification_unread_list_get %}
+
+
+ <h4> Read Notifications: </h4>
+ {% pp_notification_read_list_get user=request.user %}
+ <ul>
+ {% for note in pp_messages.notifications %}
+ <li><a href="{{note.link}}">{{ note.text }}</a></li>
+ {% empty %}None for the moment.
+ {% endfor %}
+ </ul>
+ {% endpp_notification_read_list_get %}
+ </div>
+ {% endifequal %}
{% endif %}
+
{% if request.user.is_staff %}
<hr>
-
-
<h3> Staff Control Panel </h3>
{% pp_topic_form POST=request.POST path=request.path %}
<b>Add Topic (Use at discretion) </b><br>
@@ -121,9 +192,8 @@
{% endpp_get_user_profile %}
- </div>
</div>
-<div class="rightcol">
+ <div class="rightcol">
<!-- <ul><a href="{% pp_url
template='submit_solution.html' %}"><img src="/static/submit_solution.png"
/></a></ul> -->
{% include '_rightcol.html' %}
=======================================
--- /trunk/pirate-politics/new_templates/welcome.html Tue Feb 8 19:28:28
2011
+++ /trunk/pirate-politics/new_templates/welcome.html Thu Feb 17 01:26:13
2011
@@ -22,7 +22,7 @@
<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 non-partisan, well cited, 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 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 intelligent
representive first learns your preferences based on your activity on
OpenAssembly. 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>
=======================================
--- /trunk/pirate-politics/pirate_comments/templatetags/commenttags.py Thu
Feb 10 14:21:57 2011
+++ /trunk/pirate-politics/pirate_comments/templatetags/commenttags.py Thu
Feb 17 01:26:13 2011
@@ -8,11 +8,11 @@
from django.contrib.contenttypes.models import ContentType
from pirate_profile.models import Profile
from django.utils.encoding import smart_str
-from ajaxapi.views import clean_html
+from pirate_core.helpers import clean_html
from pirate_core.views import template_for_model
import datetime
-from pirate_signals.models import notification_send
+from pirate_signals.models import notification_send, relationship_event
from django.shortcuts import get_object_or_404
@@ -185,6 +185,7 @@
newcomment.save()
if comment is None: #if comment is new and not editted
notification_send.send(sender=newcomment,obj=newcomment,reply_to=newcomment.content_object)
+
relationship_event.send(sender=newcomment,obj=newcomment,parent=newcomment.content_object)
raise
HttpRedirectException(HttpResponseRedirect(newcomment.get_absolute_url()))
if POST and POST.get("form_id") == "pp_reply_form":
=======================================
--- /trunk/pirate-politics/pirate_consensus/models.py Sun Feb 6 23:05:17
2011
+++ /trunk/pirate-politics/pirate_consensus/models.py Thu Feb 17 01:26:13
2011
@@ -6,6 +6,7 @@
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
+from pirate_signals.models import vote_created
#Generic conesensus object that acts as parent for all votes
class Consensus(models.Model):
@@ -49,11 +50,10 @@
super(UpDownVote, self).save(force_insert, force_update)
self.parent.votes += 1 #update consensus object vote count
self.parent.save()
- vote_created.send(sender=self,
parent=self.parent,vote_type=self.vote_type)
+
#upvotes = models.IntegerField()
###SIGNALS
-vote_created = django.dispatch.Signal()
admin.site.register(Consensus)
admin.site.register(UpDownVote)
=======================================
--- /trunk/pirate-politics/pirate_core/forms.py Mon Oct 18 09:56:02 2010
+++ /trunk/pirate-politics/pirate_core/forms.py Thu Feb 17 01:26:13 2011
@@ -1,5 +1,8 @@
import hashlib
+from django.utils.translation import ugettext_lazy as _
+from google.appengine.api import images
+
from exceptions import ValueError, TypeError
from django import forms
from django.utils.datastructures import SortedDict
@@ -213,3 +216,47 @@
def create_form(self, POST=None, path=None):
return self.ComboForm.create(POST, path)
+# Django's built-in ImageField doesn't work on AppEngine because
+# it relies on unavailable PIL APIs. Here's my own version that works.
+
+def image_bytes_are_valid(image_bytes):
+ try:
+ test_image = images.Image(image_bytes)
+ # Unfortunately the only way to validate image bytes on AppEngine
is to
+ # perform a transform. Lame.
+ ignored_output = test_image.execute_transforms(images.PNG)
+ except images.Error:
+ return False
+ return True
+
+class AppEngineImageField(forms.FileField):
+ default_error_messages = {
+ 'invalid_image': _(u"Upload a valid image. The file you uploaded
was either not an image or was a corrupted image."),
+ }
+
+ def clean(self, data, initial=None):
+ raw_file = super(AppEngineImageField, self).clean(data, initial)
+ if raw_file is None:
+ return None
+ elif not data and initial:
+ return initial
+
+ if hasattr(data, 'read'):
+ bytes = data.read()
+ else:
+ try:
+ bytes = data['content']
+ except:
+ bytes = None
+
+ if bytes is None:
+ raise
forms.ValidationError(self.error_messages['invalid_image'])
+
+ if (len(bytes) > 0) and (not image_bytes_are_valid(bytes)):
+ raise
forms.ValidationError(self.error_messages['invalid_image'])
+
+ if hasattr(raw_file, 'seek') and callable(raw_file.seek):
+ raw_file.seek(0)
+
+ return raw_file
+
=======================================
--- /trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py Thu Feb
10 14:21:57 2011
+++ /trunk/pirate-politics/pirate_core/templatetags/tag_helpers.py Thu Feb
17 01:26:13 2011
@@ -8,6 +8,11 @@
from pirate_deliberation.models import Argument
from django.db.models import get_model
+from pirate_core.helpers import clean_html
+
+from pirate_social.models import RelationshipEvent
+from pirate_signals.models import relationship_event
+from pirate_social.models import register_relationship_event
from pirate_core import HttpRedirectException, namespace_get, FormMixin,
template_for_model
from customtags.decorators import block_decorator
@@ -19,7 +24,7 @@
"""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):
+def get_link_tag_list(obj,add_tags_in_object=True):
"""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."""
@@ -29,19 +34,23 @@
mod = opts.module_name
model = get_model(al, mod)
-
- tags = Tag.objects.get_for_object(obj)
+ filters = {'pk':obj.pk}
+ tags = Tag.objects.cloud_for_model(obj,filters=filters)
+
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>"
+ rels = RelationshipEvent.objects.all() #breaking modularity
saves some DB space here, RelationShip event stores the info we need
+ rels = rels.filter(ini_object_pk=t.pk,tar_object_pk=obj.pk)
+ count = rels.count()
+ link = '<li><a href="/tag_detail.html?_t=' + str(c_type.id)
+ '&_o=' + str(t.id) + '">' + str(t.name) + " (" + str(count) + ")"
+"</a></li>"
taglist += link
return taglist
-def get_tag_list(obj,add_tags_in_object=False):
+def get_tag_list(obj,add_tags_in_object=True):
"""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."""
@@ -70,7 +79,7 @@
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>"
+ 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) + "</a></font>"
if last != True: link += ", "
except: link = "(err: " + str(t.name) + ")"
taglist += link
@@ -103,6 +112,7 @@
'''
This block tag can create or process forms to get tags.
Usage is as follows:
+
'''
@@ -110,27 +120,23 @@
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)
-
+
+ filters = {'pk':obj.pk}
+ try: tags = Tag.objects.cloud_for_model(obj,filters=filters)
+ except: tags = []
+
namespace['tags'] = tags
output = nodelist.render(context)
context.pop()
return output
-
@block
def pp_get_tags_for_object(context, nodelist, *args, **kwargs):
'''
This block tag can create or process forms to get tags.
Usage is as follows:
+
'''
@@ -138,22 +144,33 @@
namespace = get_namespace(context)
obj = kwargs.get('object',None)
-
- try: tags = Tag.objects.get_for_object(obj)
+
+ filters = {'pk':obj.pk}
+ try: tags = Tag.objects.cloud_for_model(obj,filters=filters)
except: tags = []
- #if str(ContentType.objects.get_for_model(obj.__class__)) ==
u'solution':
- # tags1 = Tag.objects.get_for_object(obj.issue)
- # tags2 = []
-
- #elif str(ContentType.objects.get_for_model(obj.__class__)) ==
u'argument':
- # tags1 = Tag.objects.get_for_object(obj.parent.issue)
- # tags2 = Tag.objects.get_for_object(obj.parent)
- #else:
- # tags1 = []
- # tags2 = []
-
- namespace['tags'] = list(tags)
+ namespace['tags'] = tags
+
+ output = nodelist.render(context)
+ context.pop()
+ return output
+
+
+@block
+def pp_get_link_tags_for_object(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)
+
+ tags = get_link_tag_list(obj)
+
+ namespace['tags'] = tags
#namespace['tags'].extend(tags1)
#namespace['tags'].extend(tags2)
output = nodelist.render(context)
@@ -213,8 +230,14 @@
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)
+ tag_list = form.cleaned_data['tag'].split(',')
+ for t in tag_list:
+ if len(t) > 0:
+ clean_tag = clean_html(t.replace(' ','_'))
+ Tag.objects.add_tag(obj, clean_tag)
+ tag =
TaggedItem.objects.get(tag_name=clean_tag,object_id=obj.pk)
+ new_tag = tag.tag
+
relationship_event.send(sender=new_tag,obj=new_tag,parent=obj,initiator=user)
raise
HttpRedirectException(HttpResponseRedirect(obj.get_absolute_url()))
else:
form = TagForm()
=======================================
--- /trunk/pirate-politics/pirate_deliberation/templatetags/argumenttags.py
Thu Feb 10 15:02:05 2011
+++ /trunk/pirate-politics/pirate_deliberation/templatetags/argumenttags.py
Thu Feb 17 01:26:13 2011
@@ -7,12 +7,12 @@
from pirate_deliberation.models import Argument, Stance
from pirate_consensus.models import Consensus, UpDownVote
from pirate_reputation.models import ReputationDimension
-from ajaxapi.views import clean_html
+from pirate_core.helpers import clean_html
from pirate_core import HttpRedirectException, namespace_get, FormMixin
from pirate_issues.models import Topic, Issue
-from pirate_signals.models import aso_rep_event,notification_send
+from pirate_signals.models import aso_rep_event,notification_send,
relationship_event
from customtags.decorators import block_decorator
register = template.Library()
@@ -122,7 +122,7 @@
solution = arg.parent
else: arg, solution = (None, None)
- if POST and POST.get("form_id") == "pp_argument_form":
+ if POST and POST.get("form_id") == "pp_argument_form" and user != None:
form = ArgumentForm(POST) if arg is None else ArgumentForm(POST,
instance=arg)
if form.is_valid() and user.is_authenticated():
new_arg = form.save(commit=False)
@@ -139,8 +139,9 @@
object_pk=obj_pk,parent_pk=new_arg.parent.id)
if is_new: #if this is a new issue/consensus, send signal for
reputation
- aso_rep_event.send(sender=new_arg,event_score=4,
user=new_arg.user,
dimension=ReputationDimension.objects.get('add_argument'))
+ aso_rep_event.send(sender=new_arg,event_score=4,
user=new_arg.user, dimension=ReputationDimension.objects.get('Argument
Author'))
notification_send.send(sender=new_arg.user,obj=new_arg,reply_to=new_arg.parent)
+
relationship_event.send(sender=new_arg,obj=new_arg,parent=new_arg.parent)
new_arg.parent.arguments += 1
new_arg.parent.issue.arguments +=1
new_arg.parent.issue.save()
=======================================
--- /trunk/pirate-politics/pirate_issues/models.py Sun Feb 6 23:05:17 2011
+++ /trunk/pirate-politics/pirate_issues/models.py Thu Feb 17 01:26:13 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=100, default = "DEF", blank=True)
+ name = models.CharField(max_length=100, blank=True, unique=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=100, default = "DEF", blank=True,
null=True)
+ name = models.CharField(max_length=100, blank=True, null=True,
unique=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 Thu Feb
10 14:21:57 2011
+++ /trunk/pirate-politics/pirate_issues/templatetags/issuetags.py Thu Feb
17 01:26:13 2011
@@ -10,9 +10,9 @@
from pirate_consensus.models import UpDownVote, Consensus
from django.utils.translation import ugettext as _
from pirate_reputation.models import ReputationDimension
-from ajaxapi.views import clean_html
-
-from pirate_signals.models import aso_rep_event
+from pirate_core.helpers import clean_html
+
+from pirate_signals.models import aso_rep_event, relationship_event
from customtags.decorators import block_decorator
register = template.Library()
@@ -242,14 +242,11 @@
obj = kwargs.get('object',None)
user = kwargs.get('user',None)
- #question: issue_consensus doesn't seem to be used. Is there a future
need for it?
- #issue_consensus = kwargs.get('consensus', None)
-
#try:
# 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 POST and POST.get("form_id") == "pp_issue_form":
+ if POST and POST.get("form_id") == "pp_issue_form" and user is not
None:
if isinstance(obj, Issue):
topic = obj.topic
issue = obj
@@ -284,6 +281,7 @@
topic_pk = topic.pk
else:
topic_pk = form.cleaned_data['topics'].pk
+ issue.topic = form.cleaned_data['topics']
issue.save()
contype = ContentType.objects.get_for_model(Issue)
@@ -293,7 +291,8 @@
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'))
+ aso_rep_event.send(sender=issue,event_score=3,
user=issue.user, dimension=ReputationDimension.objects.get('Issue Author'))
+ relationship_event.send(sender=issue,obj=issue,parent=None)
raise
HttpRedirectException(HttpResponseRedirect(issue.get_absolute_url()))
else: namespace['errors'] = form.errors
=======================================
--- /trunk/pirate-politics/pirate_issues/templatetags/solutiontags.py Wed
Feb 9 00:35:14 2011
+++ /trunk/pirate-politics/pirate_issues/templatetags/solutiontags.py Thu
Feb 17 01:26:13 2011
@@ -10,7 +10,8 @@
from pirate_consensus.models import UpDownVote, Consensus
from django.utils.translation import ugettext as _
from pirate_reputation.models import ReputationDimension
-from ajaxapi.views import clean_html
+from pirate_core.helpers import clean_html
+from pirate_signals.models import relationship_event
from pirate_signals.models import aso_rep_event, notification_send
@@ -177,14 +178,18 @@
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'))
+ aso_rep_event.send(sender=new_sol,event_score=5,
user=new_sol.user, dimension=ReputationDimension.objects.get('Solution
Author'))
notification_send.send_robust(sender=new_sol.user,obj=new_sol,reply_to=new_sol.issue)
+
relationship_event.send(sender=new_sol,obj=new_sol,parent=new_sol.issue)
issue.solutions = issue.solutions+1
issue.save()
raise
HttpRedirectException(HttpResponseRedirect(new_sol.get_absolute_url()))
- path = new_sol.get_absolute_url()
- raise HttpRedirectException(HttpResponseRedirect(path))
+ path = new_sol.get_absolute_url()
+ raise HttpRedirectException(HttpResponseRedirect(path))
+ else: namespace['errors'] = form.errors
+
+
else:
form = SolutionForm() if solution is None else
SolutionForm(instance=solution)
=======================================
--- /trunk/pirate-politics/pirate_issues/templatetags/topictags.py Wed Dec
15 16:12:15 2010
+++ /trunk/pirate-politics/pirate_issues/templatetags/topictags.py Thu Feb
17 01:26:13 2011
@@ -170,7 +170,7 @@
else:
new_topic.parent = Topic.objects.null_dimension()
new_topic.save()
- raise HttpRedirectException(HttpResponseRedirect(path))
+ raise
HttpRedirectException(HttpResponseRedirect("/topics.html"))
else:
form = TopicForm() if topic is None else TopicForm(instance=topic)
=======================================
--- /trunk/pirate-politics/pirate_messages/models.py Sun Feb 6 23:05:17
2011
+++ /trunk/pirate-politics/pirate_messages/models.py Thu Feb 17 01:26:13
2011
@@ -8,13 +8,13 @@
from django.contrib.auth.models import User
from pirate_signals.models import notification_send
-# Create your models here.
class Message(models.Model):
-
sender = models.ForeignKey(User, null=True,
related_name="message_sender")
receiver = models.ForeignKey(User, related_name="message_receiver")
text = models.TextField(max_length=1200)
+ created_dt = models.DateTimeField()
+ read = models.BooleanField()
class Notification(models.Model):
receiver = models.ForeignKey(User,
related_name="notification_receiver")
@@ -36,14 +36,15 @@
#obj specifies the obj being replied to, new_obj specifies the new object
def create_notification(obj,reply_to,**kwargs):
- content_type = ContentType.objects.get_for_model(obj)
- 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
- 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()
+ if obj.user != reply_to.user:
+ content_type = ContentType.objects.get_for_model(obj)
+ 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
+ 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()
notification_send.connect(create_notification)
=======================================
--- /trunk/pirate-politics/pirate_messages/templatetags/notificationtags.py
Fri Jan 28 02:56:45 2011
+++ /trunk/pirate-politics/pirate_messages/templatetags/notificationtags.py
Thu Feb 17 01:26:13 2011
@@ -8,7 +8,7 @@
from django.contrib.contenttypes.models import ContentType
from pirate_profile.models import Profile
from django.utils.encoding import smart_str
-from ajaxapi.views import clean_html
+from pirate_core.helpers import clean_html
from pirate_core.views import template_for_model
import datetime
=======================================
--- /trunk/pirate-politics/pirate_profile/templatetags/profiletags.py Mon
Jan 31 18:26:02 2011
+++ /trunk/pirate-politics/pirate_profile/templatetags/profiletags.py Thu
Feb 17 01:26:13 2011
@@ -6,7 +6,7 @@
from django.contrib.contenttypes.models import ContentType
from tagging.models import Tag, TaggedItem
from pirate_profile.models import Profile
-from ajaxapi.views import clean_html
+from pirate_core.helpers import clean_html
from pirate_core import HttpRedirectException, namespace_get, FormMixin,
template_for_model
=======================================
--- /trunk/pirate-politics/pirate_ranking/callbacks.py Tue Jan 11 02:15:49
2011
+++ /trunk/pirate-politics/pirate_ranking/callbacks.py Thu Feb 17 01:26:13
2011
@@ -1,80 +0,0 @@
-from pirate_consensus.models import UpDownVote,Consensus,vote_created
-from django.contrib.contenttypes.models import ContentType
-from pirate_issues.models import Solution
-import math, datetime
-
-
-def calc_new(obj):
- return 0
-
-
-def calc_controversial(obj):
- up = UpDownVote.objects.filter(parent=obj,vote_type=1).count() #This
expensive operation needs to be optimized
- down = UpDownVote.objects.filter(parent=obj,vote_type=-1).count()
- neut = UpDownVote.objects.filter(parent=obj,vote_type=0).count()
-
- #difference from Distant Date to make time discount more gradual
- timeDiff = (obj.submit_date - datetime.datetime(2010, 7, 5, 20, 16,
19, 539498)).seconds
- timeNormFactor=(obj.submit_date - datetime.datetime.now()).seconds
-
- timeDiscounting=timeDiff/timeNormFactor
-
- score=(up+down-neut)*timeDiscounting
-
- return 10
-
-def calc_hot(obj):
- up = UpDownVote.objects.filter(parent=obj,vote_type=1).count() #This
expensive operation needs to be optimized
- down = UpDownVote.objects.filter(parent=obj,vote_type=-1).count()
- neut = UpDownVote.objects.filter(parent=obj,vote_type=0).count()
- #calculate time difference between some arbitrary date to lessen score
of old posts
- #time = (obj.submit_date - datetime.datetime(2010, 7, 5, 20, 16, 19,
539498)).seconds
- x = up - down
- #general score according to up - vote, need to work in way to make
neut important...
- if x > 0: y = 1
- elif x == 0: y = 0
- else: y = -1
- #now if the obj is siginficant, i.e. been viewed extensively we take
into account it's popularity
- k = abs(x)
- if k > 1: z = k
- else: z = 1
- #now calculate final score
- score = math.log(z) + y
- return score
-
-#When a vote is created via the consensus engine, this callback updates
-#the issue ranked score, for each dimension
-def vote_created_callback(sender, **kwargs):
- #udpate hot
- cons = kwargs.pop('parent',None)
- vt = kwargs.pop('vote_type',None)
- pis = cons.content_object #parent of the consensus object
- #For the HOT dimension
- ###TODO: Only should rerank when a unique user creates a vote. If a
user
- ### has created a vote before it should not be counted toward the
reranking.
- ### This closes a process that allows users to maliciously inflate hot
ranking
-
-
- if cons.content_type.name == u'argument': #just update argument
- sols = [( ('hot', calc_hot(cons)), ('cont',
calc_controversial(cons)) ) ]
- if cons.content_type.name == u'solution': #also update issue ranking
- sols = [( ('hot', calc_hot(cons)), ('cont',
calc_controversial(cons)) ) ]
- cons_is =
Consensus.objects.get(object_pk=cons.content_object.issue.id)
- vote_created.send(sender=cons, parent=cons_is,vote_type=vt)
- elif cons.content_type.name == u'issue': #update issue based on
solutions below
- solutions = Solution.objects.all()
- solutions = Solution.objects.filter(issue__pk=cons.object_pk)
- sols= [( ('hot', calc_hot(Consensus.objects.get(object_pk=s.id))),
('cont', calc_controversial(Consensus.objects.get(object_pk=s.id))) ) for s
in solutions]
- ###I don't know why, but this fails if it's where it should be up
above...
- from pirate_ranking.models import Ranking
- for scores in sols:
- for dim, sc in scores:
- try:
- obj = Ranking.objects.get(object_pk=pis.id, dimension=dim)
- if cons.content_type.name == u'issue': obj.score += abs(sc)
- else: obj.score = sc
- obj.save()
- except:
- contype = ContentType.objects.get_for_model(pis)
- newrank =
Ranking(content_object=pis,dimension=dim,score=sc,consensus_pk=cons.id,content_type=contype,object_pk=pis.id)
- newrank.save()
=======================================
--- /trunk/pirate-politics/pirate_ranking/models.py Tue Jan 11 02:15:49 2011
+++ /trunk/pirate-politics/pirate_ranking/models.py Thu Feb 17 01:26:13 2011
@@ -1,11 +1,16 @@
from django.db import models
-from pirate_consensus.models import vote_created, Consensus
+from pirate_consensus.models import Consensus, UpDownVote
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
import datetime
from django.utils.translation import ugettext as _
from django.contrib import admin
-from pirate_ranking.callbacks import vote_created_callback
+from pirate_signals.models import vote_created
+from django.contrib.contenttypes.models import ContentType
+from pirate_issues.models import Solution
+import math, datetime
+
+
# Create your models here.
class Ranking(models.Model):
@@ -35,6 +40,73 @@
cons.save()
except: #if not this is in error
pass
+
+
+def calc_new(obj):
+ return 0
+
+
+def calc_controversial(obj):
+ up = UpDownVote.objects.filter(parent=obj,vote_type=1).count() #This
expensive operation needs to be optimized
+ down = UpDownVote.objects.filter(parent=obj,vote_type=-1).count()
+ neut = UpDownVote.objects.filter(parent=obj,vote_type=0).count()
+
+ #difference from Distant Date to make time discount more gradual
+ timeDiff = (obj.submit_date - datetime.datetime(2010, 7, 5, 20, 16,
19, 539498)).seconds
+ timeNormFactor=(obj.submit_date - datetime.datetime.now()).seconds
+
+ timeDiscounting=timeDiff/timeNormFactor
+
+ score=(up+down-neut)*timeDiscounting
+
+ return score
+
+def calc_hot(obj):
+ up = UpDownVote.objects.filter(parent=obj,vote_type=1).count() #This
expensive operation needs to be optimized
+ down = UpDownVote.objects.filter(parent=obj,vote_type=-1).count()
+ neut = UpDownVote.objects.filter(parent=obj,vote_type=0).count()
+ #calculate time difference between some arbitrary date to lessen score
of old posts
+ #time = (obj.submit_date - datetime.datetime(2010, 7, 5, 20, 16, 19,
539498)).seconds
+ x = up - down
+ #general score according to up - vote, need to work in way to make
neut important...
+ if x > 0: y = 1
+ elif x == 0: y = 0
+ else: y = -1
+ #now if the obj is siginficant, i.e. been viewed extensively we take
into account it's popularity
+ k = abs(x)
+ if k > 1: z = k
+ else: z = 1
+ #now calculate final score
+ score = math.log(z) + y
+ return score
+
+#When a vote is created via the consensus engine, this callback updates
+#the issue ranked score, for each dimension
+def vote_created_callback(sender, **kwargs):
+ #udpate hot
+ cons = kwargs.pop('parent',None)
+ vt = kwargs.pop('vote_type',None)
+ pis = cons.content_object #parent of the consensus object
+ #For the HOT dimension
+ ###TODO: Only should rerank when a unique user creates a vote. If a
user
+ ### has created a vote before it should not be counted toward the
reranking.
+ ### This closes a process that allows users to maliciously inflate hot
ranking
+
+ sols = [( ('hot', calc_hot(cons)), ('cont', calc_controversial(cons))
) ]
+
+ ###I don't know why, but this fails if it's where it should be up
above...
+ from pirate_ranking.models import Ranking
+ for scores in sols:
+ for dim, sc in scores:
+ try:
+ obj = Ranking.objects.get(object_pk=pis.id, dimension=dim)
+ obj.score = sc
+ obj.save()
+ except:
+ contype = ContentType.objects.get_for_model(pis)
+ newrank =
Ranking(content_object=pis,dimension=dim,score=sc,consensus_pk=cons.id,content_type=contype,object_pk=pis.id)
+ newrank.save()
+
vote_created.connect(vote_created_callback)
admin.site.register(Ranking)
=======================================
--- /trunk/pirate-politics/pirate_reputation/templatetags/reputationtags.py
Wed Jan 26 16:01:25 2011
+++ /trunk/pirate-politics/pirate_reputation/templatetags/reputationtags.py
Thu Feb 17 01:26:13 2011
@@ -33,13 +33,19 @@
if user is not None and isinstance(user, User):
#get argument score
+ scores = {}
tot_score = 0
for dim in ReputationDimension.objects.all():
rep = Reputation.objects.get_user_score(user, dim)
- try: tot_score+=rep.score
+ try:
+ scores[str(dim)]=rep.score
+ tot_score+=rep.score
except: pass #rep does not yet exist
- else: tot_score = 0
-
+ else:
+ scores ={}
+ tot_score = 0
+
+ namespace['reputation_keys'] = scores.items()
namespace['reputation'] = tot_score
output = nodelist.render(context)
=======================================
--- /trunk/pirate-politics/pirate_signals/models.py Fri Jan 28 02:56:45 2011
+++ /trunk/pirate-politics/pirate_signals/models.py Thu Feb 17 01:26:13 2011
@@ -4,5 +4,7 @@
aso_rep_event =
django.dispatch.Signal(providing_args=["event_score", "user"])
aso_rep_delete =
django.dispatch.Signal(providing_args=["event_score", "user"])
notification_send =
django.dispatch.Signal(providing_args=["obj","reply_to"])
+relationship_event =
django.dispatch.Signal(providing_args=["obj","parent"])
+vote_created = django.dispatch.Signal()
=======================================
--- /trunk/pirate-politics/pirate_sources/models.py Fri Jan 21 16:05:49 2011
+++ /trunk/pirate-politics/pirate_sources/models.py Thu Feb 17 01:26:13 2011
@@ -18,7 +18,7 @@
user = models.ForeignKey(User)
class IMGSource(models.Model):
- #img = models.ImageField(upload_to="/uploads")
+ file = models.FileField(upload_to='uploads/')
submit_date = models.DateTimeField(_('date/time submitted'),
auto_now_add=True)
content_type = models.ForeignKey(ContentType,
verbose_name=_('content type'),
@@ -26,7 +26,7 @@
object_pk = models.IntegerField(_('object ID'))
content_object = generic.GenericForeignKey(ct_field="content_type",
fk_field="object_pk")
user = models.ForeignKey(User)
- thumbnail = models.URLField(max_length=400)
+ thumbnail = models.CharField(max_length=400)
admin.site.register(URLSource)
admin.site.register(IMGSource)
=======================================
--- /trunk/pirate-politics/pirate_sources/templatetags/sourcetags.py Mon
Jan 17 10:25:31 2011
+++ /trunk/pirate-politics/pirate_sources/templatetags/sourcetags.py Thu
Feb 17 01:26:13 2011
@@ -6,6 +6,8 @@
from pirate_core.views import HttpRedirectException, namespace_get
from django.template import Library
+from filetransfers.api import prepare_upload
+
from django.conf import settings
from customtags.decorators import block_decorator
@@ -19,7 +21,6 @@
context.push()
namespace = get_namespace(context)
-
obj = kwargs.get('object',None)
if obj:
@@ -51,6 +52,7 @@
source = kwargs.get('source',None)
obj = kwargs.get('object',None)
user = kwargs.get('user',None)
+ request = kwargs.get('request',None)
if POST and POST.get("form_id") == "pp_imgsource_form":
form = IMGSourceForm(POST,FILE) if source is None else
IMGSourceForm(POST, FILE, instance=source)
@@ -59,21 +61,18 @@
new_source.user = user
new_source.content_type =
ContentType.objects.get_for_model(obj.__class__)
new_source.object_pk = obj.pk
- new_source.content_object = obj
#now create thumbnail
-
-
- new_source.thumbnail = '/'
+ new_source.thumbnail = '/thumb' + str(object_pk)
new_source.save()
- else:
- print form
path = obj.get_absolute_url()
raise HttpRedirectException(HttpResponseRedirect(path))
else:
-
+ view_url = obj.get_absolute_url()
+ upload_url, upload_data = prepare_upload(request, view_url)
form = IMGSourceForm() if source is None else
IMGSourceForm(instance=source)
-
+ namespace['upload_url'] = upload_url
+ namespace['upload_data'] = upload_data
namespace['imgform'] = form
output = nodelist.render(context)
context.pop()
@@ -91,7 +90,6 @@
exclude =
('content_type','object_pk','content_object','user','thumbnail')
form_id = forms.CharField(widget=forms.HiddenInput(),
initial="pp_imgsource_form")
- img = forms.ImageField()
@block
=======================================
--- /trunk/pirate-politics/settings.py Fri Jan 28 02:56:45 2011
+++ /trunk/pirate-politics/settings.py Thu Feb 17 01:26:13 2011
@@ -16,6 +16,7 @@
'customtags',
'tagging',
'hello',
+ 'filetransfers',
'pirate_core',
'pirate_issues',
'pirate_deliberation',
@@ -29,6 +30,8 @@
'pirate_profile',
'pirate_sources',
'pirate_comments',
+ 'pirate_badges',
+ 'pirate_social',
)
=======================================
--- /trunk/pirate-politics/static/style.css Wed Feb 9 00:54:02 2011
+++ /trunk/pirate-politics/static/style.css Thu Feb 17 01:26:13 2011
@@ -1,17 +1,25 @@
#header { font-family: "Times New Roman", Times, serif ; font-size:105%;}
-
body {font-family: Helvetica, sans-serif; }
-
-
-html, body { margin: 0; padding: 0; }
+html, body { margin: 0; padding: 0; height: 100%; }
body{
background:#eee;
}
+
a { text-decoration: none; color: #194466; }
a:hover { color: #194466; text-decoration:underline; }
-
pre { background: #fff; width: 460px; padding: 10px 20px; border-left: 5px
solid #ccc; margin: 0 0 20px; }
input { margin: 0; padding: 0; }
+
+#container {
+min-height: 100%;
+margin: 0 auto;
+}
+
+#footer {
+background:#eee;
+text-align: right;
+margin: -50px auto 0 auto;
+}
hr {
border: none;
@@ -28,12 +36,6 @@
#tutorialTable {
display: none;
}
-
-.voting {
- width:95%;
- float:right;
- margin-left:10%;
-}
.pagehead {
top:10px;
@@ -424,7 +426,10 @@
margin: 2px 0px 0px 0px;
}
-
+.description {
+ padding-top:5%;
+ padding-left:5%;
+}
.issueback2 {
float:right;
@@ -433,26 +438,16 @@
font-size:150%;
font-style:bold;
min-width:20%;
- height:native;background-color:#B2C2C0;
+ height:native;
+ background-color:#B2C2C0;
border:10px solid #B2C2C0;
border-radius: 10px; /*css3 only*/
-moz-border-radius: 10px; /*firefox specific code*/
/*-moz-box-shadow: 5px 5px 2px #888;
-webkit-box-shadow: 5px 5px 2px #888;
box-shadow: 5px 5px 2px #888;*/
- overflow:visible;
border-bottom:10px solid #B2C2C0;
- background-color:#B2C2C0;
- border:10px solid #B2C2C0;
- border-radius: 10px; /*css3 only*/
- -moz-border-radius: 10px; /*firefox specific code*/
- /*-moz-box-shadow: 5px 5px 2px #888;
- -webkit-box-shadow: 5px 5px 2px #888;
- box-shadow: 5px 5px 2px #888;*/
- overflow:visible;
- border-bottom:10px solid #B2C2C0;
- }
-
+ }
.issueback a {
font-weight: bold;
@@ -471,21 +466,50 @@
}
.userinfo {
- font-size:60%;
+ font-size:65%;
border-bottom:0;
- margin-top:8px;
}
.userinfo .info {
- width:69%;
+ width:65%;
float:left;
}
-.userinfo .buttons {
- width:30%;
+.issueinformation{
+ float:left;
+ width:75%;
+ position:relative;
+}
+
+.issheader {
+ width:75%;
+ float:left;
+}
+
+.iss_button {
+ position: relative;
float:right;
}
+.issueback2 .buttons {
+ position:relative;
+ margin-top:2%;
+ width:100%;
+ float:left;
+
+}
+
+.buttons {
+ position:relative;
+ width:20%;
+ float:right;
+}
+
+.voting {
+ float:right;
+}
+
+.voting img { cursor:pointer; }
.username {
width: 200px;
@@ -498,10 +522,10 @@
text-align: left;
}
-.reputation {
+.reputation, .subscribers {
width: 120px;
- float: right;
text-align: center;
+ float:right;
}
.dateOfBirth {
@@ -514,7 +538,8 @@
float: left;
}
-.username, .reputation, .dateOfBirth, .memberSince {
+.username, .reputation, .dateOfBirth, .memberSince, .subscribers {
+ text-align: center;
height: 40px;
}
@@ -524,7 +549,6 @@
}
.issue. issueback2 .userinfo {
- width:native;
font-size:50%;
border-bottom:0;
}
@@ -613,7 +637,7 @@
.isstags{
margin-left:2%;
font-size:60%; /* width of whole page */
- width:64%;
+ width:100%;
float:left;
position:relative;
@@ -682,14 +706,6 @@
width:90%;
}
-
-.details {
- position:relative;
- max-width:90%;
- margin-top:12.5%;
- margin-bottom:2.5%;
- margin-left:2.5%;
-}
.sourcetags {
position:relative;
@@ -762,7 +778,7 @@
.iss_col1 {
font-size:60%;
- width:75%;
+ width:100%;
margin-left:2%;
}
@@ -853,13 +869,13 @@
overflow:visible;
}
-.button:hover, .issueback .iss_col2 .button:hover, .issueback2 .userinfo .button:hover
{
+.button:hover {
background-position: 0 center;
color: #EFEFEF;
text-decoration:none;
}
-.button:active, .issueback .iss_col2 .button:active, .issueback2 .userinfo .button:active
{
+.button:active {
background-position: 0 top;
position: relative;
top: 1px;
@@ -871,10 +887,10 @@
.button.purple { background-color: #9400bf; }
.button.green { background-color: #58aa00; }
.button.orange { background-color: #ff9c00; }
-.button.blue, .issueback .iss_col2 .button.blue, .issueback2 .userinfo .button.blue
{
background-color: #194466; }
+.button.blue, .issueback .button.blue, .issueback2 .button.blue {
background-color: #194466; }
.button.black { background-color: #333; }
.button.white { background-color: #fff; color: #000; text-shadow: 1px 1px
#fff; }
-.button.small { font-size: 90%; padding: 1px 5px; }
+.button.small { font-size: 80%; padding: 2px 6px; }
.button.small:active { padding: 4px 7px 2px; background-position: 0 top; }
.button.large { font-size: 125%; padding: 7px 12px; }
.button.large:active { padding: 8px 12px 6px; background-position: 0 top; }