[pirate-politics] r626 committed - made the header fixed, got rid of all the frames, made everything divs...

4 views
Skip to first unread message

pirate-...@googlecode.com

unread,
Feb 17, 2011, 12:28:24 PM2/17/11
to pirate-poli...@googlegroups.com
Revision: 626
Author: fragro
Date: Thu Feb 17 09:27:41 2011
Log: made the header fixed, got rid of all the frames, made everything
divs. added some error information when you enter your login info
incorrectly
http://code.google.com/p/pirate-politics/source/detail?r=626

Modified:
/trunk/pirate-politics/new_templates/_issue.html
/trunk/pirate-politics/new_templates/_rightcol.html
/trunk/pirate-politics/new_templates/_sourcetags.html
/trunk/pirate-politics/new_templates/_voting.html
/trunk/pirate-politics/new_templates/base.html
/trunk/pirate-politics/new_templates/issue_detail.html
/trunk/pirate-politics/new_templates/register.html
/trunk/pirate-politics/new_templates/solution_detail.html
/trunk/pirate-politics/new_templates/welcome.html
/trunk/pirate-politics/pirate_comments/templatetags/commenttags.py
/trunk/pirate-politics/pirate_login/templatetags/usertags.py
/trunk/pirate-politics/static/style.css

=======================================
--- /trunk/pirate-politics/new_templates/_issue.html Thu Feb 17 01:26:13
2011
+++ /trunk/pirate-politics/new_templates/_issue.html Thu Feb 17 09:27:41
2011
@@ -57,7 +57,11 @@
{% 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>
+ {% if
request.user.is_authenticated %}
+ <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='register.html' return_path=request.META.PATH_INFO
return_query=request.META.QUERY_STRING object=iss_obj.content_object %}"
class="small button blue">Submit Solution</a>
+ {% endif %}
{% 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 %}
=======================================
--- /trunk/pirate-politics/new_templates/_rightcol.html Wed Feb 9 00:35:14
2011
+++ /trunk/pirate-politics/new_templates/_rightcol.html Thu Feb 17 09:27:41
2011
@@ -9,15 +9,15 @@
{% load usertags %}

<ul class="d">
- <div id="login" style="display:none; overflow:hidden; height:85px;">
{% pp_user_login_form request=request
return_path=request.META.PATH_INFO return_query=request.META.QUERY_STRING %}
- {{ pp_login.form.errors }}
+ <div id="login" style="{{pp_login.display}}; overflow:hidden;
height:120px;">
<form method="post" action="">
<li>name: {{ pp_login.form.name }}</li>
<li>pass: {{ pp_login.form.password }}</li>
{{ pp_login.form.form_id}}
{% csrf_token %}
<li><input type="submit" class="button green"
value="Login"></li>
+ <div class="error">{{pp_login.errors}}<br>{{
pp_login.form.errors }}</div>
</form>
</div>
{% endpp_user_login_form %}
=======================================
--- /trunk/pirate-politics/new_templates/_sourcetags.html Thu Feb 17
01:26:13 2011
+++ /trunk/pirate-politics/new_templates/_sourcetags.html Thu Feb 17
09:27:41 2011
@@ -15,6 +15,8 @@
<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>

<div id="mydiv2" style="display:none; overflow:hidden; height:250px;">
@@ -31,6 +33,8 @@
{% endpp_imgsource_form %}

</div>
+
+{% endcomment %}

{% endifequal %}

=======================================
--- /trunk/pirate-politics/new_templates/_voting.html Thu Feb 10 14:21:57
2011
+++ /trunk/pirate-politics/new_templates/_voting.html Thu Feb 17 09:27:41
2011
@@ -1,6 +1,6 @@


-<div class = "voting">
+<div class = "bigvoting">
{% 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}}','');"/>

=======================================
--- /trunk/pirate-politics/new_templates/base.html Thu Feb 17 01:26:13 2011
+++ /trunk/pirate-politics/new_templates/base.html Thu Feb 17 09:27:41 2011
@@ -16,9 +16,9 @@

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

- <link rel="stylesheet" type="text/css" href="/static/style.css" />
-
- <title>{{request.path|cut:"/"|cut:".html"|capfirst}} -
OpenAssembly</title>
+ <link rel="stylesheet" type="text/css" href="/static/style_fix.css" />
+
+ <title> {% block title %} {{request.path|cut:"/"|cut:".html"|capfirst}}
- OpenAssembly {% endblock %}</title>

{% block css %}
{% endblock %}
@@ -135,26 +135,28 @@
{% else %}
<body>
{% endif%}
- <div id="container">
-
- <div id="header">
+<div class="master">
+ <div class="fullheader">
+ <div class="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>
-
+ <li><a href="/platform.html">platform</a></li>
{% if request.user.is_authenticated %}
<li><a href="{% pp_url template='user_profile.html'
object=request.user%}">profile</a></li>
{% else %}
<li><a href="{% pp_url template='register.html'
return_path=request.META.PATH_INFO
return_query=request.META.QUERY_STRING %}">profile</a></li>
{% endif %}
- <li><a href="/platform.html">platform</a></li>
+
<li><a href="/welcome.html">about</a></li>
</ul>
- </div>
- <div id="mainContent">
+ </div>
+
+
+ <div class="mainContent">
{% block content-header %}

<div class="threecol">
@@ -192,11 +194,14 @@
{% endif %}
</ul>
{% endblock %}
+
</div>
</div>
</div>
</div>

+
+
{% if error %}<div class="error">{{ error }}</div>{% endif %}
{% if info %}<div class="info">{{ info }}</div>{% endif %}
{% if messages %}
@@ -205,7 +210,12 @@
{% endfor %}
{% endif %}
{% endblock %}
-
+ </div>
+</div>
+
+
+
+ <div class="container">
{% autoescape on %}
{% block content %}
These aren't the droids you are looking for.
@@ -214,9 +224,10 @@

</div>
</div>
- </div>
- <div id="footer">
+ </div>
+ </div>
+ <div class="footer">
<p>Copyright (c) {% now "Y" %}, <a
href="http://www.pirate-politics.org">pirate-politics</a></p>
- </div>
- </body>
+ </div>
+ </body>
</html>
=======================================
--- /trunk/pirate-politics/new_templates/issue_detail.html Thu Feb 17
01:26:13 2011
+++ /trunk/pirate-politics/new_templates/issue_detail.html Thu Feb 17
09:27:41 2011
@@ -13,7 +13,7 @@
{% load commenttags %}

{% block title %}
-{% if request.object %}{{ request.object.text }}{% endif %} Issues
+{% if request.object %}{{ request.object.name|title }}{% endif %} Details
{% endblock title %}

{% block browser_bar %}
@@ -39,7 +39,7 @@

<div class="issueback2">

-<div class="header">{{pp_issue.issue.name}}</div>
+<div class="issheader">{{pp_issue.issue.name}}</div>

=======================================
--- /trunk/pirate-politics/new_templates/register.html Thu Feb 10 14:21:57
2011
+++ /trunk/pirate-politics/new_templates/register.html Thu Feb 17 09:27:41
2011
@@ -17,7 +17,7 @@

{% block content%}

-
+<div class="stage">
<div class="register_title">
<h2>Welcome to OpenAssembly: Alpha</h2>
</div>
@@ -47,7 +47,6 @@
<div class="register_login">
<h3> Login to existing account!</h3>
{% pp_user_login_form request=request
returnurl=request.returnurl %}
- {{ pp_login.form.errors }}
<form method="post" action="">
Username:
<br> {{ pp_login.form.name }}<br>
@@ -55,13 +54,14 @@
{{ pp_login.form.form_id}}
{% csrf_token %}
<input type="submit" class="button green" value="Login">
+ <div class="error">{{pp_login.errors}}<br>{{
pp_login.form.errors }}</div>
</form>
{% endpp_user_login_form %}
</div>

</div>

-
+</div>

{% endblock content %}

=======================================
--- /trunk/pirate-politics/new_templates/solution_detail.html Thu Feb 17
01:26:13 2011
+++ /trunk/pirate-politics/new_templates/solution_detail.html Thu Feb 17
09:27:41 2011
@@ -38,7 +38,7 @@

<div class="issueback2">

-<div class="header">{{pp_solution.solution.name}}</div>
+<div class="issheader">{{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>
=======================================
--- /trunk/pirate-politics/new_templates/welcome.html Thu Feb 17 01:26:13
2011
+++ /trunk/pirate-politics/new_templates/welcome.html Thu Feb 17 09:27:41
2011
@@ -2,7 +2,7 @@
{% load pp_url %}
{% load usertags %}

-{% block title %}Register Page{% endblock %}
+{% block title %}OpenAssembly.org{% endblock %}
{% block css %}
{% endblock %}

=======================================
--- /trunk/pirate-politics/pirate_comments/templatetags/commenttags.py Thu
Feb 17 01:26:13 2011
+++ /trunk/pirate-politics/pirate_comments/templatetags/commenttags.py Thu
Feb 17 09:27:41 2011
@@ -79,7 +79,7 @@
comment_tree.append(get_children(object_pk,c))

tree_html = render_to_comment_tree_html(comment_tree, user, request)
- tree_html = "<ul id='collapsible_comments'>" + tree_html + "</ul>"
+ tree_html = "<ul class='collapsible_comments'>" + tree_html + "</ul>"
namespace['comments'] = tree_html
namespace['debug_comments'] = comment_tree

@@ -128,7 +128,7 @@
if count == 0 or count > 1: plural = "s"
else: plural = ""
"""returns the relevant html for a single atomic comment given the
comment object"""
- return "<div id='comment" + str(comment_obj.id) + "'> <div
class='comment_user'> <a href='/user_profile.html" + "?_t=" +
str(content_type.pk) + "&_o=" + str(comment_obj.user.pk) + "'>" +
str(comment_obj.user.username)+ "</a>" +
generate_time_string(comment_obj.submit_date, datetime.datetime.now())
+ ":</div><div>" + smart_str(comment_obj.text, encoding='utf-8',
strings_only=False, errors='strict') +"</div><div class='comment_reply'>"
+ " <a href='javascript:;' onmousedown=" + "'toggleSlide(" + '"add_reply' +
str(comment_obj.id) + '"' + ");'>reply</a> <a href='/" + path
+ "'>permalink</a><div id='add_reply" + str(comment_obj.id) + "'
style='display:none; overflow:hidden; height:250px;'><form
id='add_reply_form" + str(comment_obj.id) +"' method='post' action=''><div
style='display:none'><input type='hidden' name='csrfmiddlewaretoken'
value='" + str(csrf.get_token(request)) + "' /><input id='reply_to_object'
type='hidden' name='reply_to_object' value='" +
str(comment_obj.id)+ "'/></div>" + str(form.as_p()) + "<input type='submit'
class='button green' value='Submit Comment'></form></div></div></div>"
+ return "<div class='comment" + str(comment_obj.id) + "'> <div
class='comment_user'> <a href='/user_profile.html" + "?_t=" +
str(content_type.pk) + "&_o=" + str(comment_obj.user.pk) + "'>" +
str(comment_obj.user.username)+ "</a>" +
generate_time_string(comment_obj.submit_date, datetime.datetime.now())
+ ":</div><div>" + smart_str(comment_obj.text, encoding='utf-8',
strings_only=False, errors='strict') +"</div><div class='comment_reply'>"
+ " <a href='javascript:;' onmousedown=" + "'toggleSlide(" + '"add_reply' +
str(comment_obj.id) + '"' + ");'>reply</a> <a href='/" + path
+ "'>permalink</a><div id='add_reply" + str(comment_obj.id) + "'
style='display:none; overflow:hidden; height:250px;'><form
id='add_reply_form" + str(comment_obj.id) +"' method='post' action=''><div
style='display:none'><input type='hidden' name='csrfmiddlewaretoken'
value='" + str(csrf.get_token(request)) + "' /><input id='reply_to_object'
type='hidden' name='reply_to_object' value='" +
str(comment_obj.id)+ "'/></div>" + str(form.as_p()) + "<input type='submit'
class='button green' value='Submit Comment'></form></div></div></div>"

def get_children(object_pk,cur_comment):
get_list = []
=======================================
--- /trunk/pirate-politics/pirate_login/templatetags/usertags.py Wed Feb 9
00:35:14 2011
+++ /trunk/pirate-politics/pirate_login/templatetags/usertags.py Thu Feb 17
09:27:41 2011
@@ -75,7 +75,7 @@
user = authenticate(username=new_user.name,
password=new_user.password1)
if user is not None:
if user.is_active:
- login(request, user)
+ pass
raise
HttpRedirectException(HttpResponseRedirect(returnurl))
else:
namespace['errors'] = "Passwords are not the same. Try
again."
@@ -139,25 +139,27 @@
returnurl = '/issues.html?_s=0&_e=20&_d=hot'

if POST and POST.get("form_id") == "pp_user_login_form":
- try:
- form = LoginForm(POST)
- if form.is_valid():
- new_user = form.save()
- user = authenticate(username=new_user.name,
password=new_user.password)
- if user is not None:
- if user.is_active:
- login(request, user)
- else: #TODO: form is erroneous somehow, need to find out
how and add to error text
- pass
-
- raise
HttpRedirectException(HttpResponseRedirect(returnurl))
- else: #TODO: form is empty in some way, add this message to
error
- pass
-
- except HttpRedirectException, e:
- raise e
+ if return_path != None: namespace['display'] = 'display:inline;'
#for ajax, this changes the DIV to stay open if the user login info is
incorrect
+ form = LoginForm(POST)
+ if form.is_valid():
+ new_user = form.save()
+ user = authenticate(username=new_user.name,
password=new_user.password)
+ if user is not None:
+ if user.is_active:
+ login(request, user)
+ raise
HttpRedirectException(HttpResponseRedirect(returnurl))
+ else: namespace['errors'] = "Inactive Account"
+
+ else: #TODO: form is erroneous somehow, need to find out how
and add to error text
+ try:
+ User.objects.get(username=new_user.name)
+ namespace['errors'] = "Incorrect Password"
+ except: namespace['errors'] = "Username Not Found"
+ else: #TODO: form is empty in some way, add this message to error
+ pass
else:
form = LoginForm()
+ if return_path != None: namespace['display'] = 'display:none;'
#for ajax

namespace['form'] = form
output = nodelist.render(context)
=======================================
--- /trunk/pirate-politics/static/style.css Thu Feb 17 01:26:13 2011
+++ /trunk/pirate-politics/static/style.css Thu Feb 17 09:27:41 2011
@@ -1,4 +1,4 @@
-#header { font-family: "Times New Roman", Times, serif ; font-size:105%;}
+.header { font-family: "Times New Roman", Times, serif ; font-size:105%;}
body {font-family: Helvetica, sans-serif; }
html, body { margin: 0; padding: 0; height: 100%; }
body{
@@ -10,12 +10,12 @@
pre { background: #fff; width: 460px; padding: 10px 20px; border-left: 5px
solid #ccc; margin: 0 0 20px; }
input { margin: 0; padding: 0; }

-#container {
+.container {
min-height: 100%;
margin: 0 auto;
}

-#footer {
+.footer {
background:#eee;
text-align: right;
margin: -50px auto 0 auto;
@@ -97,7 +97,7 @@
padding-left: 5px;
}

-#header {
+.header {
width:100%;
background-color:#202B2E;
-moz-border-radius-bottomleft: 20px;
@@ -108,18 +108,18 @@
box-shadow: 0px 0px 50px #888;
}

-#header .headtitle {
+.header .headtitle {
position:relative;
color:#EFEFEF;
font-size:200%;
font-style:bold;
}

-#header .headtitle a:visited, #header .headtitle a:link {
+.header .headtitle a:visited, .header .headtitle a:link {
color:#EFEFEF;
}

-#header ul {
+.header ul {
top:-3px;
list-style-type:none;
/*padding:5px;*/
@@ -130,7 +130,7 @@
position:relative;
}

-#header ul li {
+.header ul li {
overflow:hidden;
font-weight:bold;
margin-left:5px;
@@ -144,15 +144,15 @@
-moz-border-radius-topleft:10px;
}

-#header ul li a {
+.header ul li a {
text-decoration:none;
}

-#header ul li a:link, #header ul li a:visited, #header ul li a:active {
+.header ul li a:link, .header ul li a:visited, .header ul li a:active {
color:#EFEFEF;
}

-#header ul li a:hover {
+.header ul li a:hover {
background-position: 0 center;
color:#BCBCBC;
}
@@ -457,7 +457,7 @@
text-align: center;
}

-#add {
+.add {
margin-left: 30%;
}

@@ -471,7 +471,7 @@
}

.userinfo .info {
- width:65%;
+ width:100%;
float:left;
}

@@ -482,7 +482,7 @@
}

.issheader {
- width:75%;
+ width:100%;
float:left;
}

@@ -506,10 +506,16 @@
}

.voting {
+ margin:2px;
float:right;
}

-.voting img { cursor:pointer; }
+.bigvoting {
+ float:left;
+}
+
+
+.voting img, .bigvoting img{ cursor:pointer; }

.username {
width: 200px;
@@ -591,7 +597,7 @@
padding:5px;
}

-#collapsible_comments {
+.collapsible_comments {
list-style-type: none;
border-left: 1px solid #ccc;
padding: 0;
@@ -599,13 +605,13 @@
margin-left: 5px;
}

-#collapsible_comments li ul {
+.collapsible_comments li ul {
list-style-type: none;
border-left: 1px solid #ccc;
margin-left: 50px;
}

-#collapsible_comments li ul li {
+.collapsible_comments li ul li {
margin-left: -40px;
}

@@ -881,6 +887,10 @@
top: 1px;
padding: 6px 10px 4px;
}
+
+.button {
+ white-space:nowrap;
+}

.button:visited { color: white;}
.button.red { background-color: #990000; }

Reply all
Reply to author
Forward
0 new messages