Skip to content

Commit cd5f7af

Browse files
author
Stephan Jaensch
committed
Merge branch 'master' of git://github.com/sehmaschine/django-grappelli
2 parents 3b35f52 + 07137f7 commit cd5f7af

File tree

247 files changed

+14686
-11423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+14686
-11423
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
*.pyc
22
docs/_build/
3-
.DS_Store
3+
.DS_Store
4+
dist/*
5+
django_grappelli.egg-info/*
6+
grappelli/compass/.sass-cache/
7+
fabfile.py
8+
.sass-cache

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include AUTHORS
2+
include README.rst
13
include LICENSE
24
recursive-include docs *
35
recursive-include grappelli/static *

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ http://readthedocs.org/docs/django-grappelli/
1818
Releases
1919
--------
2020

21-
The latest release is Grappelli 2.3.3, which requires Django 1.3
21+
The latest release is Grappelli 2.3.8 (April 3rd, 2012), which requires Django 1.3.

docs/changelog.rst

+39-9
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,41 @@
88
Changelog
99
=========
1010

11-
2.3.5 (not yet released)
11+
2.3.8 (April 03, 2012)
12+
----------------------
13+
14+
* TinyMCE Update (3.5b2)
15+
16+
2.3.7 (February 11, 2012)
17+
-------------------------
18+
19+
* Fixed compatibility issue with Python 2.5.
20+
* Fixed some translations.
21+
22+
2.3.6 (February 10, 2012)
23+
-------------------------
24+
25+
* Fixed issue where autocomplete/related settings could not use tuples.
26+
* Fixed a bug with toggle all actions on the changlist
27+
* Fixed a bug with adding dynamic-forms to tabular and stacked inlines (which caused the remove-handler to throw an error)
28+
* Autocompletes: Only do a lookup with generics, if content-type is defined.
29+
* Support for new URL tags, see https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi.
30+
* Fixed a bug with m2m-lookups (return obj.pk instead of obj.id).
31+
* Fixed a bug with very long filters (hidden behind the footer).
32+
* Added german and french UI-datepicker.
33+
* Added support for non-integer IDs with generic relations.
34+
* Added pre_content and post_content to dashboard.
35+
* Added inline_classes.
36+
* Added polish translation for TinyMCE and grappelli contextmenu.
37+
* Removed ``title_url`` from dashboard-docs (it hasn´t been used anyway so far).
38+
39+
2.3.5 (October 11, 2011)
1240
------------------------
1341

14-
2.3.4 (08/09/2011)
15-
------------------
42+
* Improved performance for autocomplete lookups (staticmethod autocomplete_search_fields is required from now on)
43+
44+
2.3.4 (September 8, 2011)
45+
-------------------------
1646

1747
* Moved |grappelli| to GitHub
1848
* Fixed a bug with the View on Site link (tabular/stacked inlines)
@@ -23,8 +53,8 @@ Changelog
2353
* Added error-messages to the login form
2454
* Fixed a bug with hidden-fields in tabular-inlines
2555

26-
2.3.3 (28/05/2011)
27-
------------------
56+
2.3.3 (May 28, 2011)
57+
--------------------
2858

2959
* Documentation update
3060
* FileBrowser-related updates
@@ -38,17 +68,17 @@ Changelog
3868
* Reversed asc-/desc-icons
3969
* Updated TinyMCE to 3.4.2
4070

41-
2.3.2 (16/02/2011)
42-
------------------
71+
2.3.2 (February 16, 2011)
72+
-------------------------
4373

4474
* Some smaller bugfixes on the changelist.
4575
* Finally deleted folder ``media`` (media-files are now in ``static``).
4676
* Added class submit-link for custom admin-pages.
4777
* Removed save-button on changelist if there is no formset.
4878
* Fixed a bug with using generic relations within generic-inlines (tabular and stacked).
4979

50-
2.3.1 (03/02/2011)
51-
------------------
80+
2.3.1 (February 3, 2011)
81+
------------------------
5282

5383
* Added ``related_lookup_fields`` for defining related lookups (fk, m2m, generic).
5484
* Fixed the limiation for using ``content_type_*`` and ``object_id_*`` with Generic Relations.

docs/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242

4343
# General information about the project.
4444
project = u'Django Grappelli'
45-
copyright = u'2011, Patrick Kranzlmueller'
45+
copyright = u'2012, Patrick Kranzlmueller'
4646

4747
# The version info for the project you're documenting, acts as replacement for
4848
# |version| and |release|, also used in various other places throughout the
4949
# built documents.
5050
#
5151
# The short X.Y version.
52-
version = '2.3.5'
52+
version = '2.3.8'
5353
# The full version, including alpha/beta/rc tags.
54-
release = '2.3.5'
54+
release = '2.3.8'
5555

5656
# The language for content autogenerated by Sphinx. Refer to documentation
5757
# for a list of supported languages.

docs/customization.rst

+14-11
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ A ModelAdmin example::
4040
}),
4141
)
4242

43-
An InlineModelAdmin example::
43+
With `StackedInlines <https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.StackedInline>`_, an additional property ``inline_classes`` is available to define the default collapsible state of the inline items (in contrast to the whole group)::
4444

4545
class NavigationItemInline(admin.StackedInline):
4646
classes = ('collapse open',)
47+
inline_classes = ('collapse open',)
4748

48-
.. note::
49-
With Inlines, only the Inline-Group (and not the Inline-items) are affected by the ``classes`` property.
5049

5150
.. _customizationinlinessortables:
5251

@@ -150,11 +149,19 @@ For the represantation of an object, we first check for a callable ``related_lab
150149
Autocomplete Lookups
151150
--------------------
152151

152+
.. versionchanged:: 2.3.5
153+
staticmethod ``autocomplete_search_fields`` is required, ``related_autocomplete_lookup`` has been removed.
153154
.. versionadded:: 2.3.4
154155
``autocomplete_lookup_fields``.
155156

156-
.. note::
157-
Please note that this feature is fairly new. It´s well tested, but we still consider it experimental with this version of |grappelli|.
157+
Add the staticmethod ``autocomplete_search_fields`` to all models you want to search for::
158+
159+
class MyModel(models.Model):
160+
name = models.CharField(u"Name", max_length=50)
161+
162+
@staticmethod
163+
def autocomplete_search_fields():
164+
return ("id__iexact", "name__icontains",)
158165

159166
Defining autocomplete lookups is very similar to related lookups::
160167

@@ -202,17 +209,13 @@ If your generic relation points to a model using a custom primary key, you need
202209
def id(self):
203210
return self.cpk
204211

205-
For the represantation of an object, we first check for a callable ``related_label``. If not given, ``__unicode__`` is being used.
206-
The lookup checks for a callable ``related_autocomplete_lookup`` with your model. If not given, ``__unicode__`` is being used::
212+
For the represantation of an object, we first check for a callable ``related_label``. If not given, ``__unicode__`` is being used::
207213

208214
def __unicode__(self):
209215
return u"%s" % self.name
210216
211217
def related_label(self):
212218
return u"%s (%s)" % (self.name, self.id)
213-
214-
def related_autocomplete_lookup(self):
215-
return u"%s,%s,%s" % (self.id, self.name, self.category)
216219

217220
.. warning::
218221
Due to a bug in Django 1.3, raw_id_fields (including autocomplete-lookups) are not working with list_editables.
@@ -235,4 +238,4 @@ Using TinyMCE with Inlines is a bit more tricky because of the hidden empty-form
235238
* ``onBeforeRemoved``: remove TinyMCE instance(s) from the form.
236239

237240
.. note::
238-
TinyMCE with Inlines is not supported by default.
241+
TinyMCE with Inlines is not supported by default.

docs/dashboard_api.rst

-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ Dashboard modules have the following properties:
7676
gettext functions if your application is multilingual.
7777
Default value: ''.
7878

79-
``title_url``
80-
String that contains the module title URL. If given the module
81-
title will be a link to this URL. Default value: ``None``.
82-
8379
``css_classes``
8480
A list of css classes to be added to the module ``div`` class
8581
attribute. Default value: ``None``.

docs/dashboard_setup.rst

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ Open your ``settings.py`` file and add the following::
5555

5656
GRAPPELLI_INDEX_DASHBOARD = 'yourproject.dashboard.CustomIndexDashboard'
5757

58+
If you´re using a custom admin-site (not ``django.contrib.admin.site``), you need to define the dashboard like this::
59+
60+
GRAPPELLI_INDEX_DASHBOARD = {
61+
'yourproject.admin.admin_site': 'yourproject.my_dashboard.CustomIndexDashboard',
62+
}
63+
5864
Create custom Dashboards for multiple admin sites
5965
-------------------------------------------------
6066

docs/index.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
contain the root `toctree` directive.
55
.. |grappelli| replace:: Grappelli
66
.. |filebrowser| replace:: FileBrowser
7+
.. |version| replace:: 2.3.8
78

89
.. _index:
910

@@ -12,10 +13,10 @@ Documentation
1213

1314
**A jazzy skin for the Django admin interface**.
1415

15-
This documentation covers version 2.3.5 of |grappelli|. |grappelli| is a grid-based alternative/extension to the `Django <http://www.djangoproject.com>`_ administration interface.
16+
This documentation covers version |version| of |grappelli|. |grappelli| is a grid-based alternative/extension to the `Django <http://www.djangoproject.com>`_ administration interface.
1617

1718
.. note::
18-
|grappelli| 2.3.5 requires Django 1.3. |grappelli| is always developed against the lastest stable Django release and is NOT tested with Djangos trunk.
19+
|grappelli| |version| requires Django 1.3. |grappelli| is always developed against the lastest stable Django release and is NOT tested with Djangos trunk.
1920

2021
Installation & Setup
2122
--------------------
@@ -64,6 +65,11 @@ Code
6465

6566
https://github.com/sehmaschine/django-grappelli
6667

68+
Screenshots
69+
-----------
70+
71+
http://sehmaschine.github.com/django-grappelli/
72+
6773
Discussion
6874
----------
6975

grappelli/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '2.3.5'
1+
VERSION = '2.3.8'

grappelli/dashboard/dashboards.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class MyDashboard(Dashboard):
6262
columns = 3
6363
6464
def __init__(self, **kwargs):
65+
super(MyDashboard, self).__init__(**kwargs)
6566
6667
# append an app list module for "Applications"
6768
self.children.append(modules.AppList(

grappelli/dashboard/templates/grappelli/dashboard/module.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ <h2 class="module_title{% if module.collapsible %} collapse-handler{% endif %}">
1414
<h{% if subindex %}3{% else %}2{% endif %} class="module_title{% if module.collapsible %} collapse-handler{% endif %}">{{ module.title }}</h{% if subindex %}3{% else %}2{% endif %}>
1515
{% endif %}
1616
{% endif %}
17-
18-
{# TODO: need to know in what dom we wrap the pre_content/post_content #}
19-
{# if module.pre_content %}{{ module.pre_content }}{% endif #}
20-
17+
{% if module.pre_content %}{{ module.pre_content|safe }}{% endif %}
2118
{% block module_content %}
2219
{% for child in module.children %}
2320
{{ child }}
2421
{% endfor %}
2522
{% endblock %}
26-
27-
{# TODO: need to know in what dom we wrap the pre_content/post_content #}
28-
{# if module.post_content %}{{ module.post_content }}{% endif #}
23+
{% if module.post_content %}{{ module.post_content|safe }}{% endif %}
2924

3025
</div>
3126

grappelli/dashboard/templates/grappelli/dashboard/modules/app_list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block module_content %}
44
{% spaceless %}
55
{% for child in module.children %}
6-
<div class="module">
6+
<div class="module" id="module-{{child.title|lower}}">
77
<h{% if subindex %}4{% else %}3{% endif %}><a href="{{ child.url }}">{{ child.title }}</a></h{% if subindex %}4{% else %}3{% endif %}>
88
{% for model in child.models %}
99
<div class="row">

grappelli/static/grappelli/css/components.css

+15-3
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ fieldset.module .row + .module {
182182
------------------------------------------------------------------------------------------------------ */
183183

184184
fieldset.module .row {
185-
overflow: hidden;
186185
padding: 8px 10px;
187186
line-height: 18px;
188187
font-weight: normal;
189188
}
190189
fieldset.module .row.cells {
191190
white-space: nowrap;
191+
overflow: hidden;
192192
}
193193

194194

@@ -324,10 +324,22 @@ h2 + * + * + .module.table {
324324
padding: 3px 5px 2px 2px;
325325
min-height: 25px;
326326
font-weight: bold;
327+
/*line-height: 25px;*/
328+
/*text-indent: 25px;*/
329+
/*background: url('../img/icons/icon-searchbox.png') 6px 50% no-repeat;*/
330+
}
331+
.selector .selector-available .selector-filter {
327332
line-height: 25px;
328333
text-indent: 25px;
329334
background: url('../img/icons/icon-searchbox.png') 6px 50% no-repeat;
330335
}
336+
.selector .selector-chosen .selector-filter {
337+
margin: 0 0 -3px;
338+
padding: 6px 5px 2px 26px;
339+
/*line-height: 25px;*/
340+
/*text-indent: 25px;*/
341+
background: url('../img/icons/icon-searchbox.png') 6px 8px no-repeat;
342+
}
331343
.selector .selector-filter input[type=text] {
332344
position: relative;
333345
margin: 0;
@@ -342,7 +354,7 @@ h2 + * + * + .module.table {
342354
display: none;
343355
}
344356
.selector .selector-chosen .selector-filter:after {
345-
content: " " url('../img/icons/icon-selector_add-m2m_horizontal-hover.png');
357+
content: " " url('../img/icons/icon-selector_filter.png');
346358
opacity: .75;
347359
}
348360
.selector.stacked .selector-chosen .selector-filter:after {
@@ -553,7 +565,7 @@ ul.actions li a {
553565
.module.filter {
554566
position: relative;
555567
float: right;
556-
z-index: 990;
568+
z-index: 1001;
557569
padding: 8px 10px;
558570
}
559571
.module.filter + .module.search {

0 commit comments

Comments
 (0)