Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Part 3 of pedant day: replaced all tabs in Django with spaces. Python…
… the way Guido intended it, baby!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Jul 21, 2006
1 parent a926046 commit 1687b02
Show file tree
Hide file tree
Showing 18 changed files with 808 additions and 810 deletions.
4 changes: 2 additions & 2 deletions django/contrib/admin/media/css/changelists.css
Expand Up @@ -42,9 +42,9 @@

/* PAGINATOR */
.paginator { font-size:11px; padding-top:10px; padding-bottom:10px; line-height:22px; margin:0; border-top:1px solid #ddd; }
.paginator a:link, .paginator a:visited { padding:2px 6px; border:solid 1px #ccc; background:white; text-decoration:none; }
.paginator a:link, .paginator a:visited { padding:2px 6px; border:solid 1px #ccc; background:white; text-decoration:none; }
.paginator a.showall { padding:0 !important; border:none !important; }
.paginator a.showall:hover { color:#036 !important; background:transparent !important; }
.paginator .end { border-width:2px !important; margin-right:6px; }
.paginator .end { border-width:2px !important; margin-right:6px; }
.paginator .this-page { padding:2px 6px; font-weight:bold; font-size:13px; vertical-align:top; }
.paginator a:hover { color:white; background:#5b80b2; border-color:#036; }
4 changes: 2 additions & 2 deletions django/contrib/admin/media/css/forms.css
Expand Up @@ -7,10 +7,10 @@
form .form-row p { padding-left:0; font-size:11px; }

/* FORM LABELS */
form h4 { margin:0 !important; padding:0 !important; border:none !important; }
form h4 { margin:0 !important; padding:0 !important; border:none !important; }
label { font-weight:normal !important; color:#666; font-size:12px; }
label.inline { margin-left:20px; }
.required label, label.required { font-weight:bold !important; color:#333 !important; }
.required label, label.required { font-weight:bold !important; color:#333 !important; }

/* RADIO BUTTONS */
form ul.radiolist li { list-style-type:none; }
Expand Down
6 changes: 3 additions & 3 deletions django/contrib/admin/media/css/global.css
Expand Up @@ -31,7 +31,7 @@ fieldset { margin:0; padding:0; }
blockquote { font-size:11px; color:#777; margin-left:2px; padding-left:10px; border-left:5px solid #ddd; }
code, pre { font-family:"Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; background:inherit; color:#666; font-size:11px; }
pre.literal-block { margin:10px; background:#eee; padding:6px 8px; }
code strong { color:#930; }
code strong { color:#930; }
hr { clear:both; color:#eee; background-color:#eee; height:1px; border:none; margin:0; padding:0; font-size:1px; line-height:1px; }

/* TEXT STYLES & MODIFIERS */
Expand Down Expand Up @@ -81,7 +81,7 @@ table.orderable tbody tr td:first-child { padding-left:14px; background-image:ur
table.orderable-initalized .order-cell, body>tr>td.order-cell { display:none; }

/* FORM DEFAULTS */
input, textarea, select { margin:2px 0; padding:2px 3px; vertical-align:middle; font-family:"Lucida Grande", Verdana, Arial, sans-serif; font-weight:normal; font-size:11px; }
input, textarea, select { margin:2px 0; padding:2px 3px; vertical-align:middle; font-family:"Lucida Grande", Verdana, Arial, sans-serif; font-weight:normal; font-size:11px; }
textarea { vertical-align:top !important; }
input[type=text], input[type=password], textarea, select, .vTextField { border:1px solid #ccc; }

Expand All @@ -92,7 +92,7 @@ input[type=submit].default, .submit-row input.default { border:2px solid #5b80b2
input[type=submit].default:active { background-image:url(../img/admin/default-bg-reverse.gif); background-position:top; }

/* MODULES */
.module { border:1px solid #ccc; margin-bottom:5px; background:white; }
.module { border:1px solid #ccc; margin-bottom:5px; background:white; }
.module p, .module ul, .module h3, .module h4, .module dl, .module pre { padding-left:10px; padding-right:10px; }
.module blockquote { margin-left:12px; }
.module ul, .module ol { margin-left:1.5em; }
Expand Down
8 changes: 4 additions & 4 deletions django/contrib/admin/media/css/layout.css
Expand Up @@ -4,7 +4,7 @@
#header { width:100%; }
#content-main { float:left; width:100%; }
#content-related { float:right; width:18em; position:relative; margin-right:-19em; }
#footer { clear:both; padding:10px; }
#footer { clear:both; padding:10px; }

/* COLUMN TYPES */
.colMS { margin-right:20em !important; }
Expand All @@ -16,14 +16,14 @@
.dashboard #content { width:500px; }

/* HEADER */
#header { background:#417690; color:#ffc; overflow:hidden; }
#header { background:#417690; color:#ffc; overflow:hidden; }
#header a:link, #header a:visited { color:white; }
#header a:hover { text-decoration:underline; }
#branding h1 { padding:0 10px; font-size:18px; margin:8px 0; font-weight:normal; color:#f4f379; }
#branding h2 { padding:0 10px; font-size:14px; margin:-8px 0 8px 0; font-weight:normal; color:#ffc; }
#user-tools { position:absolute; top:0; right:0; padding:1.2em 10px; font-size:11px; text-align:right; }
#user-tools { position:absolute; top:0; right:0; padding:1.2em 10px; font-size:11px; text-align:right; }

/* SIDEBAR */
#content-related h3 { font-size:12px; color:#666; margin-bottom:3px; }
#content-related h4 { font-size:11px; }
#content-related .module h2 { background:#eee url(../img/admin/nav-bg.gif) bottom left repeat-x; color:#666; }
#content-related .module h2 { background:#eee url(../img/admin/nav-bg.gif) bottom left repeat-x; color:#666; }
2 changes: 1 addition & 1 deletion django/contrib/admin/media/css/rtl.css
Expand Up @@ -16,7 +16,7 @@ th { text-align: right; }


/* layout styles */
#user-tools { right:auto; left:0; text-align:left; }
#user-tools { right:auto; left:0; text-align:left; }
div.breadcrumbs { text-align:right; }
#content-main { float:right;}
#content-related { float:left; margin-left:-19em; margin-right:auto;}
Expand Down
144 changes: 72 additions & 72 deletions django/contrib/admin/media/js/admin/CollapsedFieldsets.js
Expand Up @@ -3,83 +3,83 @@
// link when the fieldset is visible.

function findForm(node) {
// returns the node of the form containing the given node
if (node.tagName.toLowerCase() != 'form') {
return findForm(node.parentNode);
}
return node;
// returns the node of the form containing the given node
if (node.tagName.toLowerCase() != 'form') {
return findForm(node.parentNode);
}
return node;
}

var CollapsedFieldsets = {
collapse_re: /\bcollapse\b/, // Class of fieldsets that should be dealt with.
collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden.
collapsed_class: 'collapsed',
init: function() {
var fieldsets = document.getElementsByTagName('fieldset');
var collapsed_seen = false;
for (var i = 0, fs; fs = fieldsets[i]; i++) {
// Collapse this fieldset if it has the correct class, and if it
// doesn't have any errors. (Collapsing shouldn't apply in the case
// of error messages.)
if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) {
collapsed_seen = true;
// Give it an additional class, used by CSS to hide it.
fs.className += ' ' + CollapsedFieldsets.collapsed_class;
// (<a id="fieldsetcollapser3" class="collapse-toggle" href="#">Show</a>)
var collapse_link = document.createElement('a');
collapse_link.className = 'collapse-toggle';
collapse_link.id = 'fieldsetcollapser' + i;
collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;');
collapse_link.href = '#';
collapse_link.innerHTML = gettext('Show');
var h2 = fs.getElementsByTagName('h2')[0];
h2.appendChild(document.createTextNode(' ('));
h2.appendChild(collapse_link);
h2.appendChild(document.createTextNode(')'));
}
}
if (collapsed_seen) {
// Expand all collapsed fieldsets when form is submitted.
addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); });
}
},
fieldset_has_errors: function(fs) {
// Returns true if any fields in the fieldset have validation errors.
var divs = fs.getElementsByTagName('div');
for (var i=0; i<divs.length; i++) {
if (divs[i].className.match(/\berror\b/)) {
return true;
}
}
return false;
},
show: function(fieldset_index) {
var fs = document.getElementsByTagName('fieldset')[fieldset_index];
// Remove the class name that causes the "display: none".
fs.className = fs.className.replace(CollapsedFieldsets.collapsed_re, '');
// Toggle the "Show" link to a "Hide" link
var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index);
collapse_link.onclick = new Function('CollapsedFieldsets.hide('+fieldset_index+'); return false;');
collapse_link.innerHTML = gettext('Hide');
},
hide: function(fieldset_index) {
var fs = document.getElementsByTagName('fieldset')[fieldset_index];
// Add the class name that causes the "display: none".
fs.className += ' ' + CollapsedFieldsets.collapsed_class;
// Toggle the "Hide" link to a "Show" link
var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index);
collapse_re: /\bcollapse\b/, // Class of fieldsets that should be dealt with.
collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden.
collapsed_class: 'collapsed',
init: function() {
var fieldsets = document.getElementsByTagName('fieldset');
var collapsed_seen = false;
for (var i = 0, fs; fs = fieldsets[i]; i++) {
// Collapse this fieldset if it has the correct class, and if it
// doesn't have any errors. (Collapsing shouldn't apply in the case
// of error messages.)
if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) {
collapsed_seen = true;
// Give it an additional class, used by CSS to hide it.
fs.className += ' ' + CollapsedFieldsets.collapsed_class;
// (<a id="fieldsetcollapser3" class="collapse-toggle" href="#">Show</a>)
var collapse_link = document.createElement('a');
collapse_link.className = 'collapse-toggle';
collapse_link.id = 'fieldsetcollapser' + i;
collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;');
collapse_link.href = '#';
collapse_link.innerHTML = gettext('Show');
var h2 = fs.getElementsByTagName('h2')[0];
h2.appendChild(document.createTextNode(' ('));
h2.appendChild(collapse_link);
h2.appendChild(document.createTextNode(')'));
}
}
if (collapsed_seen) {
// Expand all collapsed fieldsets when form is submitted.
addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); });
}
},
fieldset_has_errors: function(fs) {
// Returns true if any fields in the fieldset have validation errors.
var divs = fs.getElementsByTagName('div');
for (var i=0; i<divs.length; i++) {
if (divs[i].className.match(/\berror\b/)) {
return true;
}
}
return false;
},
show: function(fieldset_index) {
var fs = document.getElementsByTagName('fieldset')[fieldset_index];
// Remove the class name that causes the "display: none".
fs.className = fs.className.replace(CollapsedFieldsets.collapsed_re, '');
// Toggle the "Show" link to a "Hide" link
var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index);
collapse_link.onclick = new Function('CollapsedFieldsets.hide('+fieldset_index+'); return false;');
collapse_link.innerHTML = gettext('Hide');
},
hide: function(fieldset_index) {
var fs = document.getElementsByTagName('fieldset')[fieldset_index];
// Add the class name that causes the "display: none".
fs.className += ' ' + CollapsedFieldsets.collapsed_class;
// Toggle the "Hide" link to a "Show" link
var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index);
collapse_link.onclick = new Function('CollapsedFieldsets.show('+fieldset_index+'); return false;');
collapse_link.innerHTML = gettext('Show');
},
collapse_link.innerHTML = gettext('Show');
},

uncollapse_all: function() {
var fieldsets = document.getElementsByTagName('fieldset');
for (var i=0; i<fieldsets.length; i++) {
if (fieldsets[i].className.match(CollapsedFieldsets.collapsed_re)) {
CollapsedFieldsets.show(i);
}
}
}
uncollapse_all: function() {
var fieldsets = document.getElementsByTagName('fieldset');
for (var i=0; i<fieldsets.length; i++) {
if (fieldsets[i].className.match(CollapsedFieldsets.collapsed_re)) {
CollapsedFieldsets.show(i);
}
}
}
}

addEvent(window, 'load', CollapsedFieldsets.init);
22 changes: 11 additions & 11 deletions django/contrib/admin/templates/admin/login.html
Expand Up @@ -13,17 +13,17 @@
{% endif %}
<div id="content-main">
<form action="{{ app_path }}" method="post" id="login-form">
<div class="form-row">
<label for="id_username">{% trans 'Username:' %}</label> <input type="text" name="username" id="id_username" />
</div>
<div class="form-row">
<label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" />
<input type="hidden" name="this_is_the_login_form" value="1" />
<input type="hidden" name="post_data" value="{{ post_data }}" /> {% comment %}<span class="help">{% trans 'Have you <a href="/password_reset/">forgotten your password</a>?' %}</span>{% endcomment %}
</div>
<div class="submit-row">
<label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />
</div>
<div class="form-row">
<label for="id_username">{% trans 'Username:' %}</label> <input type="text" name="username" id="id_username" />
</div>
<div class="form-row">
<label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" />
<input type="hidden" name="this_is_the_login_form" value="1" />
<input type="hidden" name="post_data" value="{{ post_data }}" /> {% comment %}<span class="help">{% trans 'Have you <a href="/password_reset/">forgotten your password</a>?' %}</span>{% endcomment %}
</div>
<div class="submit-row">
<label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />
</div>
</form>

<script type="text/javascript">
Expand Down
16 changes: 8 additions & 8 deletions django/contrib/admin/templates/admin_doc/index.html
Expand Up @@ -9,17 +9,17 @@
<h1>Documentation</h1>

<div id="content-main">
<h3><a href="tags/">Tags</a></h3>
<p>List of all the template tags and their functions.</p>
<h3><a href="tags/">Tags</a></h3>
<p>List of all the template tags and their functions.</p>

<h3><a href="filters/">Filters</a></h3>
<p>Filters are actions which can be applied to variables in a template to alter the output.</p>
<h3><a href="filters/">Filters</a></h3>
<p>Filters are actions which can be applied to variables in a template to alter the output.</p>

<h3><a href="models/">Models</a></h3>
<p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p>
<h3><a href="models/">Models</a></h3>
<p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p>

<h3><a href="views/">Views</a></h3>
<p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p>
<h3><a href="views/">Views</a></h3>
<p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p>

<h3><a href="bookmarklets/">Bookmarklets</a></h3>
<p>Tools for your browser to quickly access admin functionality.</p>
Expand Down
Expand Up @@ -9,9 +9,9 @@
<h1>Documentation</h1>

<div id="content-main">
<h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3>
<h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3>

<p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p>
<p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p>
</div>

{% endblock %}
2 changes: 1 addition & 1 deletion django/contrib/comments/models.py
Expand Up @@ -51,7 +51,7 @@ def get_list_with_karma(self, **kwargs):
extra_kwargs.setdefault('select', {})
extra_kwargs['select']['_karma_total_good'] = 'SELECT COUNT(*) FROM comments_karmascore, comments_comment WHERE comments_karmascore.comment_id=comments_comment.id AND score=1'
extra_kwargs['select']['_karma_total_bad'] = 'SELECT COUNT(*) FROM comments_karmascore, comments_comment WHERE comments_karmascore.comment_id=comments_comment.id AND score=-1'
return self.filter(**kwargs).extra(**extra_kwargs)
return self.filter(**kwargs).extra(**extra_kwargs)

def user_is_moderator(self, user):
if user.is_superuser:
Expand Down

0 comments on commit 1687b02

Please sign in to comment.