Skip to content

Commit

Permalink
Merge branch 'stable/2.4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
sehmaschine committed Sep 18, 2012
2 parents cd4f041 + 544cc94 commit 841003f
Show file tree
Hide file tree
Showing 23 changed files with 578 additions and 100 deletions.
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -18,6 +18,7 @@ http://readthedocs.org/docs/django-grappelli/
Releases
--------

* Grappelli 2.4.2 (development version, not yet released): Compatible with Django 1.4
* Grappelli 2.4.1 (September 17 2012): Compatible with Django 1.4
* Grappelli 2.3.9 (September 06 2012): Compatible with Django 1.3

Expand Down
9 changes: 8 additions & 1 deletion docs/changelog.rst
Expand Up @@ -8,9 +8,16 @@
Changelog
=========

2.4.2 (not yet released)
2.4.3 (not yet released)
------------------------

2.4.2 (September 18, 2012)
--------------------------

* Fixed: Bug with change-permissions on ModelList (grappelli.dashboard).
* Added: Alternative ChangeList Template (with filters on the right hand side).
* Added: Alternative ChangeList Filter Template (displaying filters as list/options).

2.4.1 (September 17, 2012)
--------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -49,9 +49,9 @@
# built documents.
#
# The short X.Y version.
version = '2.4.1'
version = '2.4.2'
# The full version, including alpha/beta/rc tags.
release = '2.4.1'
release = '2.4.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
23 changes: 21 additions & 2 deletions docs/customization.rst
Expand Up @@ -271,10 +271,29 @@ Using TinyMCE with Inlines is a bit more tricky because of the hidden empty-form

.. _changelistfilters:

Changelist Templates
--------------------

.. versionadded:: 2.4.2

Grappelli comes with 2 different change–list templates. The standard template shows filters with a drop–down, the alternative template shows filters on the right hand side of the results (similar to djangos admin interface).

To use the alternative template, you need to add ``change_list_template`` to your ModelAdmin definition::

class MyModelOptions(admin.ModelAdmin):
change_list_template = "admin/change_list_filter_sidebar.html"


Changelist Filters
------------------

.. versionadded:: 2.4
.. versionadded:: 2.4.2

Grappelli comes with 2 different change–list filters. The standard filters are drop–downs, the alternative filters are list of options (similar to djangos admin interface).

To use the alternative filters, you need to add ``change_list_filter_template`` to your ModelAdmin definition::

class MyModelOptions(admin.ModelAdmin):
change_list_filter_template = "admin/filter_list.html"

TODO: Explain how to use different filter-styles with the changelist.

8 changes: 4 additions & 4 deletions docs/index.rst
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.
.. |grappelli| replace:: Grappelli
.. |filebrowser| replace:: FileBrowser
.. |version| replace:: 2.4.1
.. |version| replace:: 2.4.2

.. _index:

Expand Down Expand Up @@ -64,10 +64,10 @@ Code

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

Screenshots
-----------
Website
-------

http://sehmaschine.github.com/django-grappelli/
http://www.grappelliproject.com

Discussion
----------
Expand Down
2 changes: 1 addition & 1 deletion grappelli/__init__.py
@@ -1 +1 @@
VERSION = '2.4.1'
VERSION = '2.4.2'
12 changes: 12 additions & 0 deletions grappelli/compass/sass/partials/layout/_buttons.scss
Expand Up @@ -14,6 +14,12 @@
border: $grp-button-border-hover;
background-color: #eee;
}
.button-state-dark-grey {
color: $grp-font-color;
border: $grp-button-border-hover;
border-color: #ccc;
background-color: #dbdbdb;
}
.button-state-white {
border: $grp-button-border;
background-color: #fdfdfd;
Expand All @@ -36,6 +42,9 @@
@if $state == grey {
@extend .button-state-grey;
}
@if $state == darkgrey {
@extend .button-state-dark-grey;
}
@if $state == white {
@extend .button-state-white;
}
Expand All @@ -52,6 +61,9 @@
@if $state-hover == grey {
@extend .button-state-grey;
}
@if $state-hover == darkgrey {
@extend .button-state-dark-grey;
}
@if $state-hover == white {
@extend .button-state-white;
}
Expand Down
94 changes: 65 additions & 29 deletions grappelli/compass/sass/partials/layout/_changelist.scss
Expand Up @@ -116,8 +116,9 @@ form#grp-changelist-search {

@mixin grp-pulldown {
position: absolute;
z-index: 900;
top: 0;
width: inherit;
@include box-sizing(border-box);
@include border-radius($grp-border-radius + 1);
.grp-pulldown-handler {
display: block;
Expand All @@ -135,62 +136,100 @@ form#grp-changelist-search {
}
}
&.grp-pulldown-state-open {
z-index: 910;
float: left;
clear: both;
@include box-shadow(0 10px 50px #333);
.grp-pulldown-handler {
color: #444;
text-shadow: 0 1px 0 #fff;
@include border-bottom-radius(0 !important);
border-bottom: 0 !important;
border-bottom: 1px solid #ccc !important;
@include icons-sprite(pulldown-handler_selected, $offset-x: 100%);
@include grp-button-states(blue, blue);
&:hover {
color: #444;
border-bottom: 0 !important;
@include icons-sprite(pulldown-handler_selected, $offset-x: 100%);
}
}
.grp-pulldown-content {
float: left;
clear: both;
}
}
.grp-pulldown-content {
padding: 5px 10px;
padding: 0;
width: 100%;
@include border-bottom-radius($grp-border-radius);
@include grp-button-states(blue, blue);
border-top: 0 !important;
@include grp-button-states(grey, grey);
border-top: 1px solid #fff !important;
@include box-sizing(border-box);
&:hover {
border-top: 0 !important;
}
}
ul {
li {
position: relative;
margin-bottom: $grp-margin-size-s;
label {
@include grp-label();
display: block;
margin: 0 0 2px;
color: $grp-font-color-quiet;
font-weight: bold;
}
select {
width: 100% !important;
max-width: 100% !important;
}
color: $grp-font-color;
&:hover {
color: $grp-font-color;
}
}
}
.grp-pulldown-container {
@include grp-pulldown();
margin: -1px 0 0;
}


#grp-filters {
position: relative;
&.grp-module {
z-index: 800;
}
}

.grp-filter {
position: relative;
float: left;
clear: both;
width: 100%;
height: 28px;
&:not(.grp-module) {
height: 28px;
}
.grp-pulldown-container {
border: 1px solid #fff;
}
.grp-module:first-child {
h3 {
border-top: 0;
}
}
.grp-row {
label {
@include grp-label();
display: block;
margin: 0 0 2px;
color: $grp-font-color-quiet;
font-weight: bold;
}
select {
width: 100% !important;
max-width: 100% !important;
}
a {
display: block;
margin: -5px -10px;
padding: 2px 10px;
color: #59afcc;
font-size: $grp-font-size-s;
// font-weight: bold;
&:hover {
color: #444;
}
}
&.grp-selected {
a {
padding-left: 17px;
color: $grp-font-color;
@include icons-small-sprite(filter-choice-selected);
}
}
}
@include legacy-pie-clearfix;
}

Expand Down Expand Up @@ -259,9 +298,6 @@ li.grp-changelist-actions {
}

body.grp-change-list {
.grp-pulldown-container {
border: 1px solid #fff;
}
table {
margin: -1px !important;
tr.grp-selected {
Expand Down
3 changes: 2 additions & 1 deletion grappelli/compass/sass/partials/typography/_typo.scss
Expand Up @@ -99,7 +99,8 @@ p.file-upload {
}
}
tr & {
margin: 0;
margin: 1px 0 -2px;
line-height: 13px; // Firefox needs this, otherwise related-lookup buttons in context have an offset
}
}
p.preview {
Expand Down
1 change: 1 addition & 0 deletions grappelli/compass/sass/screen.scss
Expand Up @@ -410,6 +410,7 @@ header#grp-header {

@mixin grp-fixed-footer {
position: fixed;
z-index: 900;
float: left;
bottom: 0;
left: 0;
Expand Down
Expand Up @@ -3,11 +3,11 @@
{% block module_content %}
{% for child in module.children %}
<div class="grp-row">
{% if child.change_url %}<a href="{{ child.change_url }}"><strong>{{ child.title }}</strong></a>{% else %}<strong>{{ child.title }}</strong>{% endif %}
{% if child.add_url or child.change_url %}
{% if child.admin_url %}<a href="{{ child.admin_url }}"><strong>{{ child.title }}</strong></a>{% else %}<strong>{{ child.title }}</strong>{% endif %}
{% if child.add_url or child.admin_url %}
<ul class="grp-actions">
{% if child.add_url %}<li class="grp-add-link"><a href="{{ child.add_url }}">{% trans "Add" %}</a></li>{% endif %}
{% if child.change_url %}<li class="grp-change-link"><a href="{{ child.change_url }}">{% trans "Change" %}</a></li>{% endif %}
{% if child.admin_url %}<li class="grp-change-link"><a href="{{ child.admin_url }}">{% trans "Change" %}</a></li>{% endif %}
</ul>
{% endif %}
</div>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion grappelli/static/grappelli/stylesheets/rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grappelli/static/grappelli/stylesheets/screen.css

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions grappelli/templates/admin/change_list.html
Expand Up @@ -167,12 +167,14 @@ <h1>{{ cl.opts.verbose_name_plural|capfirst }}</h1>
<!-- FILTERS -->
{% if cl.has_filters %}
{% block filters %}
<div id="grp-filters" class="filter g-d-6 g-d-l">
<div class="grp-pulldown-container">
<a href="javascript://" class="grp-button grp-pulldown-handler">{% trans 'Filter' %}</a>
<ul class="grp-pulldown-content" style="display: none">
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</ul>
<div id="grp-filters" class="g-d-6 g-d-l">
<div class="grp-filter">
<div class="grp-pulldown-container">
<a href="javascript://" class="grp-button grp-pulldown-handler">{% trans 'Filter' %}</a>
<div class="grp-pulldown-content" style="display: none;">
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}
Expand Down

0 comments on commit 841003f

Please sign in to comment.