Django

Code

Changeset 3464

Show
Ignore:
Timestamp:
07/27/06 17:38:02 (2 years ago)
Author:
clong
Message:

[per-object-permissions] Update to trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/per-object-permissions/django/bin/compile-messages.py

    r2352 r3464  
    33import os 
    44import sys 
    5 import getopt 
    65 
    76def compile_messages(): 
  • django/branches/per-object-permissions/django/bin/make-messages.py

    r2352 r3464  
    11#!/usr/bin/env python 
     2 
     3# Need to ensure that the i18n framework is enabled 
     4from django.conf import settings 
     5settings.configure(USE_I18N = True) 
    26 
    37from django.utils.translation import templatize 
  • django/branches/per-object-permissions/django/conf/global_settings.py

    r3310 r3464  
    6363    ('sr', gettext_noop('Serbian')), 
    6464    ('sv', gettext_noop('Swedish')), 
     65    ('ta', gettext_noop('Tamil')), 
    6566    ('uk', gettext_noop('Ukrainian')), 
    6667    ('zh-cn', gettext_noop('Simplified Chinese')), 
  • django/branches/per-object-permissions/django/conf/__init__.py

    r3271 r3464  
    88 
    99import os 
    10 import sys 
    1110from django.conf import global_settings 
    1211 
  • django/branches/per-object-permissions/django/contrib/admin/filterspecs.py

    r3136 r3464  
    124124        for title, param_dict in self.links: 
    125125            yield {'selected': self.date_params == param_dict, 
    126                    'query_string': cl.get_query_string(param_dict, self.field_generic), 
     126                   'query_string': cl.get_query_string(param_dict, [self.field_generic]), 
    127127                   'display': title} 
    128128 
  • django/branches/per-object-permissions/django/contrib/admin/media/css/changelists.css

    r3064 r3464  
    4343/* PAGINATOR */ 
    4444.paginator { font-size:11px; padding-top:10px; padding-bottom:10px; line-height:22px; margin:0; border-top:1px solid #ddd; } 
    45 .paginator a:link, .paginator a:visited        { padding:2px 6px; border:solid 1px #ccc; background:white; text-decoration:none; } 
     45.paginator a:link, .paginator a:visited { padding:2px 6px; border:solid 1px #ccc; background:white; text-decoration:none; } 
    4646.paginator a.showall { padding:0 !important; border:none !important; } 
    4747.paginator a.showall:hover { color:#036 !important; background:transparent !important; } 
    48 .paginator .end        { border-width:2px !important; margin-right:6px; } 
     48.paginator .end { border-width:2px !important; margin-right:6px; } 
    4949.paginator .this-page { padding:2px 6px; font-weight:bold; font-size:13px; vertical-align:top; } 
    5050.paginator a:hover { color:white; background:#5b80b2; border-color:#036; } 
  • django/branches/per-object-permissions/django/contrib/admin/media/css/forms.css

    r2809 r3464  
    88 
    99/* FORM LABELS */ 
    10 form h4        { margin:0 !important; padding:0 !important; border:none !important; } 
     10form h4 { margin:0 !important; padding:0 !important; border:none !important; } 
    1111label { font-weight:normal !important; color:#666; font-size:12px; } 
    1212label.inline { margin-left:20px; } 
    13 .required label, label.required        { font-weight:bold !important; color:#333 !important; } 
     13.required label, label.required { font-weight:bold !important; color:#333 !important; } 
    1414 
    1515/* RADIO BUTTONS */ 
  • django/branches/per-object-permissions/django/contrib/admin/media/css/global.css

    r3084 r3464  
    3232code, pre { font-family:"Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; background:inherit; color:#666; font-size:11px; } 
    3333pre.literal-block { margin:10px; background:#eee; padding:6px 8px; } 
    34 code strong    { color:#930; } 
     34code strong { color:#930; } 
    3535hr { clear:both; color:#eee; background-color:#eee; height:1px; border:none; margin:0; padding:0; font-size:1px; line-height:1px; } 
    3636 
     
    8282 
    8383/* FORM DEFAULTS */ 
    84 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; } 
     84input, 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; } 
    8585textarea { vertical-align:top !important; } 
    8686input[type=text], input[type=password], textarea, select, .vTextField { border:1px solid #ccc; } 
     
    9393 
    9494/* MODULES */ 
    95 .module        { border:1px solid #ccc; margin-bottom:5px; background:white; } 
     95.module { border:1px solid #ccc; margin-bottom:5px; background:white; } 
    9696.module p, .module ul, .module h3, .module h4, .module dl, .module pre { padding-left:10px; padding-right:10px; } 
    9797.module blockquote { margin-left:12px; } 
  • django/branches/per-object-permissions/django/contrib/admin/media/css/layout.css

    r3065 r3464  
    55#content-main { float:left; width:100%; } 
    66#content-related { float:right; width:18em; position:relative; margin-right:-19em; } 
    7 #footer        { clear:both; padding:10px; } 
     7#footer { clear:both; padding:10px; } 
    88 
    99/*  COLUMN TYPES  */ 
     
    1717 
    1818/*  HEADER  */ 
    19 #header        { background:#417690; color:#ffc; overflow:hidden; } 
     19#header { background:#417690; color:#ffc; overflow:hidden; } 
    2020#header a:link, #header a:visited { color:white; } 
    2121#header a:hover { text-decoration:underline; } 
    2222#branding h1 { padding:0 10px; font-size:18px; margin:8px 0; font-weight:normal; color:#f4f379; } 
    2323#branding h2 { padding:0 10px; font-size:14px; margin:-8px 0 8px 0; font-weight:normal; color:#ffc; } 
    24 #user-tools    { position:absolute; top:0; right:0; padding:1.2em 10px; font-size:11px; text-align:right; } 
     24#user-tools { position:absolute; top:0; right:0; padding:1.2em 10px; font-size:11px; text-align:right; } 
    2525 
    2626/* SIDEBAR */ 
    2727#content-related h3 { font-size:12px; color:#666; margin-bottom:3px; } 
    2828#content-related h4 { font-size:11px; } 
    29 #content-related .module h2    { background:#eee url(../img/admin/nav-bg.gif) bottom left repeat-x; color:#666; } 
     29#content-related .module h2 { background:#eee url(../img/admin/nav-bg.gif) bottom left repeat-x; color:#666; } 
  • django/branches/per-object-permissions/django/contrib/admin/media/css/rtl.css

    r3121 r3464  
    1717 
    1818/* layout styles */ 
    19 #user-tools    { right:auto; left:0; text-align:left; } 
     19#user-tools { right:auto; left:0; text-align:left; } 
    2020div.breadcrumbs { text-align:right; } 
    2121#content-main { float:right;} 
  • django/branches/per-object-permissions/django/contrib/admin/media/js/admin/CollapsedFieldsets.js

    r3114 r3464  
    44 
    55function findForm(node) { 
    6        // returns the node of the form containing the given node 
    7        if (node.tagName.toLowerCase() != 'form') { 
    8                return findForm(node.parentNode); 
    9        
    10        return node; 
     6    // returns the node of the form containing the given node 
     7    if (node.tagName.toLowerCase() != 'form') { 
     8        return findForm(node.parentNode); 
     9   
     10    return node; 
    1111} 
    1212 
    1313var CollapsedFieldsets = { 
    14        collapse_re: /\bcollapse\b/,   // Class of fieldsets that should be dealt with. 
    15        collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden. 
    16        collapsed_class: 'collapsed', 
    17        init: function() { 
    18                var fieldsets = document.getElementsByTagName('fieldset'); 
    19                var collapsed_seen = false; 
    20                for (var i = 0, fs; fs = fieldsets[i]; i++) { 
    21                        // Collapse this fieldset if it has the correct class, and if it 
    22                        // doesn't have any errors. (Collapsing shouldn't apply in the case 
    23                        // of error messages.) 
    24                        if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) { 
    25                                collapsed_seen = true; 
    26                                // Give it an additional class, used by CSS to hide it. 
    27                                fs.className += ' ' + CollapsedFieldsets.collapsed_class; 
    28                                // (<a id="fieldsetcollapser3" class="collapse-toggle" href="#">Show</a>) 
    29                                var collapse_link = document.createElement('a'); 
    30                                collapse_link.className = 'collapse-toggle'; 
    31                                collapse_link.id = 'fieldsetcollapser' + i; 
    32                                collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;'); 
    33                                collapse_link.href = '#'; 
    34                                collapse_link.innerHTML = gettext('Show'); 
    35                                var h2 = fs.getElementsByTagName('h2')[0]; 
    36                                h2.appendChild(document.createTextNode(' (')); 
    37                                h2.appendChild(collapse_link); 
    38                                h2.appendChild(document.createTextNode(')')); 
    39                        
    40                
    41                if (collapsed_seen) { 
    42                        // Expand all collapsed fieldsets when form is submitted. 
    43                        addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); }); 
    44                
    45        }, 
    46        fieldset_has_errors: function(fs) { 
    47                // Returns true if any fields in the fieldset have validation errors. 
    48                var divs = fs.getElementsByTagName('div'); 
    49                for (var i=0; i<divs.length; i++) { 
    50                        if (divs[i].className.match(/\berror\b/)) { 
    51                                return true; 
    52                        
    53                
    54                return false; 
    55        }, 
    56        show: function(fieldset_index) { 
    57                var fs = document.getElementsByTagName('fieldset')[fieldset_index]; 
    58                // Remove the class name that causes the "display: none". 
    59                fs.className = fs.className.replace(CollapsedFieldsets.collapsed_re, ''); 
    60                // Toggle the "Show" link to a "Hide" link 
    61                var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); 
    62                collapse_link.onclick = new Function('CollapsedFieldsets.hide('+fieldset_index+'); return false;'); 
    63                collapse_link.innerHTML = gettext('Hide'); 
    64        }, 
    65        hide: function(fieldset_index) { 
    66                var fs = document.getElementsByTagName('fieldset')[fieldset_index]; 
    67                // Add the class name that causes the "display: none". 
    68                fs.className += ' ' + CollapsedFieldsets.collapsed_class; 
    69                // Toggle the "Hide" link to a "Show" link 
    70                var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); 
     14    collapse_re: /\bcollapse\b/,   // Class of fieldsets that should be dealt with. 
     15    collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden. 
     16    collapsed_class: 'collapsed', 
     17    init: function() { 
     18        var fieldsets = document.getElementsByTagName('fieldset'); 
     19        var collapsed_seen = false; 
     20        for (var i = 0, fs; fs = fieldsets[i]; i++) { 
     21            // Collapse this fieldset if it has the correct class, and if it 
     22            // doesn't have any errors. (Collapsing shouldn't apply in the case 
     23            // of error messages.) 
     24            if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) { 
     25                collapsed_seen = true; 
     26                // Give it an additional class, used by CSS to hide it. 
     27                fs.className += ' ' + CollapsedFieldsets.collapsed_class; 
     28                // (<a id="fieldsetcollapser3" class="collapse-toggle" href="#">Show</a>) 
     29                var collapse_link = document.createElement('a'); 
     30                collapse_link.className = 'collapse-toggle'; 
     31                collapse_link.id = 'fieldsetcollapser' + i; 
     32                collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;'); 
     33                collapse_link.href = '#'; 
     34                collapse_link.innerHTML = gettext('Show'); 
     35                var h2 = fs.getElementsByTagName('h2')[0]; 
     36                h2.appendChild(document.createTextNode(' (')); 
     37                h2.appendChild(collapse_link); 
     38                h2.appendChild(document.createTextNode(')')); 
     39           
     40       
     41        if (collapsed_seen) { 
     42            // Expand all collapsed fieldsets when form is submitted. 
     43            addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); }); 
     44       
     45    }, 
     46    fieldset_has_errors: function(fs) { 
     47        // Returns true if any fields in the fieldset have validation errors. 
     48        var divs = fs.getElementsByTagName('div'); 
     49        for (var i=0; i<divs.length; i++) { 
     50            if (divs[i].className.match(/\berror\b/)) { 
     51                return true; 
     52           
     53       
     54        return false; 
     55    }, 
     56    show: function(fieldset_index) { 
     57        var fs = document.getElementsByTagName('fieldset')[fieldset_index]; 
     58        // Remove the class name that causes the "display: none". 
     59        fs.className = fs.className.replace(CollapsedFieldsets.collapsed_re, ''); 
     60        // Toggle the "Show" link to a "Hide" link 
     61        var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); 
     62        collapse_link.onclick = new Function('CollapsedFieldsets.hide('+fieldset_index+'); return false;'); 
     63        collapse_link.innerHTML = gettext('Hide'); 
     64    }, 
     65    hide: function(fieldset_index) { 
     66        var fs = document.getElementsByTagName('fieldset')[fieldset_index]; 
     67        // Add the class name that causes the "display: none". 
     68        fs.className += ' ' + CollapsedFieldsets.collapsed_class; 
     69        // Toggle the "Hide" link to a "Show" link 
     70        var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); 
    7171        collapse_link.onclick = new Function('CollapsedFieldsets.show('+fieldset_index+'); return false;'); 
    72                collapse_link.innerHTML = gettext('Show'); 
    73        }, 
     72        collapse_link.innerHTML = gettext('Show'); 
     73    }, 
    7474 
    75        uncollapse_all: function() { 
    76                var fieldsets = document.getElementsByTagName('fieldset'); 
    77                for (var i=0; i<fieldsets.length; i++) { 
    78                        if (fieldsets[i].className.match(CollapsedFieldsets.collapsed_re)) { 
    79                                CollapsedFieldsets.show(i); 
    80                        
    81                
    82        
     75    uncollapse_all: function() { 
     76        var fieldsets = document.getElementsByTagName('fieldset'); 
     77        for (var i=0; i<fieldsets.length; i++) { 
     78            if (fieldsets[i].className.match(CollapsedFieldsets.collapsed_re)) { 
     79                CollapsedFieldsets.show(i); 
     80           
     81       
     82   
    8383} 
    8484 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/base.html

    r3282 r3464  
    2121        {% block branding %}{% endblock %} 
    2222        </div> 
    23         {% if not user.is_anonymous %}{% if user.is_staff %} 
     23        {% if user.is_authenticated and user.is_staff %} 
    2424        <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="doc/">{% trans 'Documentation' %}</a> / <a href="password_change/">{% trans 'Change password' %}</a> / <a href="logout/">{% trans 'Log out' %}</a>{% endblock %}</div> 
    25         {% endif %}{% endif %} 
     25        {% endif %} 
    2626        {% block nav-global %}{% endblock %} 
    2727    </div> 
    2828    <!-- END Header --> 
    29     {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</div>{% endblock %} 
     29    {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title|escape }}{% endif %}</div>{% endblock %} 
    3030    {% endif %} 
    3131 
     
    3737    <div id="content" class="{% block coltype %}colM{% endblock %}"> 
    3838        {% block pretitle %}{% endblock %} 
    39         {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %} 
     39        {% block content_title %}{% if title %}<h1>{{ title|escape }}</h1>{% endif %}{% endblock %} 
    4040        {% block content %}{{ content }}{% endblock %} 
    4141        {% block sidebar %}{% endblock %} 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/base_site.html

    r2809 r3464  
    22{% load i18n %} 
    33 
    4 {% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %} 
     4{% block title %}{{ title|escape }} | {% trans 'Django site admin' %}{% endblock %} 
    55 
    66{% block branding %} 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/change_form.html

    r3023 r3464  
    1212<div class="breadcrumbs"> 
    1313     <a href="../../../">{% trans "Home" %}</a> &rsaquo; 
    14      <a href="../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo; 
    15      {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18"|escape }}{% endif %} 
     14     <a href="../">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo; 
     15     {% if add %}{% trans "Add" %} {{ opts.verbose_name|escape }}{% else %}{{ original|truncatewords:"18"|escape }}{% endif %} 
    1616</div> 
    1717{% endif %}{% endblock %} 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/change_list.html

    r2809 r3464  
    44{% block bodyclass %}change-list{% endblock %} 
    55{% block userlinks %}<a href="../../doc/">{% trans 'Documentation' %}</a> / <a href="../../password_change/">{% trans 'Change password' %}</a> / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %} 
    6 {% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}</div>{% endblock %}{% endif %} 
     6{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst|escape }}</div>{% endblock %}{% endif %} 
    77{% block coltype %}flex{% endblock %} 
    88{% block content %} 
    99<div id="content-main"> 
    1010{% if has_add_permission %} 
    11 <ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul> 
     11<ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name|escape as name %}Add {{ name }}{% endblocktrans %}</a></li></ul> 
    1212{% endif %} 
    1313<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist"> 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/date_hierarchy.html

    r1434 r3464  
    22<div class="xfull"> 
    33<ul class="toplinks"> 
    4 {% if back %}<li class="date-back"><a href="{{ back.link }}">&lsaquo; {{ back.title }}</a></li>{% endif %} 
     4{% if back %}<li class="date-back"><a href="{{ back.link }}">&lsaquo; {{ back.title|escape }}</a></li>{% endif %} 
    55{% for choice in choices %} 
    6 <li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li> 
     6<li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title|escape }}{% if choice.link %}</a>{% endif %}</li> 
    77{% endfor %} 
    88</ul><br class="clear" /> 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin/delete_confirmation.html

    r2809 r3464  
    55<div class="breadcrumbs"> 
    66     <a href="../../../../">{% trans "Home" %}</a> &rsaquo; 
    7      <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo; 
    8      <a href="../">{{ object|striptags|truncatewords:"18" }}</a> &rsaquo; 
     7     <a href="../../">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo; 
     8     <a href="../">{{ object|escape|truncatewords:"18" }}</a> &rsaquo; 
    99     {% trans 'Delete' %} 
    1010</div> 
     
    1212{% block content %} 
    1313{% if perms_lacking %} 
    14     <p>{% blocktrans %}Deleting the {{ object_name }} '{{ object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p> 
     14    <p>{% blocktrans with object|escape as escaped_object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p> 
    1515    <ul> 
    1616    {% for obj in perms_lacking %} 
    17         <li>{{ obj }}</li> 
     17        <li>{{ obj|escape }}</li> 
    1818    {% endfor %} 
    1919    </ul> 
    2020{% else %} 
    21     <p>{% blocktrans %}Are you sure you want to delete the {{ object_name }} "{{ object }}"? All of the following related items will be deleted:{% endblocktrans %}</p> 
     21    <p>{% blocktrans with object|escape as escaped_object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}</p> 
    2222    <ul>{{ deleted_objects|unordered_list }}</ul> 
    2323    <form action="" method="post"> 
  • django/branches/per-object-permissions/django/contrib/admin/templates/admin_doc/index.html

    r2809 r3464  
    1010 
    1111<div id="content-main"> 
    12        <h3><a href="tags/">Tags</a></h3> 
    13        <p>List of all the template tags and their functions.</p> 
     12  <h3><a href="tags/">Tags</a></h3> 
     13  <p>List of all the template tags and their functions.</p> 
    1414 
    15        <h3><a href="filters/">Filters</a></h3> 
    16        <p>Filters are actions which can be applied to variables in a template to alter the output.</p> 
     15  <h3><a href="filters/">Filters</a></h3> 
     16  <p>Filters are actions which can be applied to variables in a template to alter the output.</p> 
    1717 
    18        <h3><a href="models/">Models</a></h3> 
    19        <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> 
     18  <h3><a href="models/">Models</a></h3> 
     19  <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> 
    2020