Skip to content

Commit

Permalink
Merge pull request #3754 from yakky/remerge_3
Browse files Browse the repository at this point in the history
Sync develop with support/3.0.x
  • Loading branch information
yakky committed Jan 15, 2015
2 parents cb836a6 + 89a95b7 commit e0d7fda
Show file tree
Hide file tree
Showing 259 changed files with 17,999 additions and 20,003 deletions.
23 changes: 21 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Current and previous core designers:

* Christian Bertschy

Contributors (based on gitlog) (421):
Contributors (based on gitlog) (440):

* A. Bram Neijt
* aaloy
Expand All @@ -41,8 +41,10 @@ Contributors (based on gitlog) (421):
* Alexey Subbotin
* Aleš Kocjančič
* Alvin Mites
* Anatoly Ivanov
* Andi Albrecht
* Andre Bossard
* Andrea Stagi
* Andrei Avram
* Andrei Fokau
* Andrew Cassidy
Expand Down Expand Up @@ -84,6 +86,7 @@ Contributors (based on gitlog) (421):
* brightwhitefox
* Calvin Cheng
* Carlos de Paula
* casio
* Catalin Dragomirescu
* centralniak
* Chanita Siridechkun
Expand All @@ -107,6 +110,7 @@ Contributors (based on gitlog) (421):
* Conrado Bührer
* Corey Farwell
* Craig de Stigter
* Craig Ricciuto
* Damian Moore
* Damir Arbula
* DamirArbula
Expand All @@ -133,6 +137,7 @@ Contributors (based on gitlog) (421):
* Diógenes Augusto Fernandes Hermínio
* dlamotte
* Dmitry Akinin
* Donatas
* Donatas Kučinskas
* dstufft
* Dylann CORDEL
Expand Down Expand Up @@ -163,6 +168,7 @@ Contributors (based on gitlog) (421):
* floppya
* Frank Bieniek
* FrankBie
* frost-nzcr4
* Gabe Jackson
* Gabriel Hurley
* GaretJax
Expand Down Expand Up @@ -222,6 +228,8 @@ Contributors (based on gitlog) (421):
* Jorge Vargas
* Jorge Vargas (elpargo)
* Joseph Bergantine
* Josh Kalderimis
* Josh Schneier
* Kalle Bronsen
* kar1m
* kater169
Expand All @@ -240,6 +248,7 @@ Contributors (based on gitlog) (421):
* Lars van de Kerkhof
* limpbrains :P
* littlepea
* lovmat
* Lucas Vogelsang
* Lucio Asnaghi
* lug
Expand All @@ -257,7 +266,7 @@ Contributors (based on gitlog) (421):
* marcor
* Mark Rogers
* Markus Holtermann
* Markus Zapke-Gründemann
* Markus Zapke-Gründemann
* Markus Zapke-Gründemann
* Marti Raudsepp
* Martin
Expand All @@ -271,6 +280,7 @@ Contributors (based on gitlog) (421):
* Mateusz Marzantowicz
* mathijs
* Matt Chisholm
* Max Shkurygin
* Maxim Bodyansky
* Maxime Haineault
* mbouchar
Expand All @@ -282,11 +292,13 @@ Contributors (based on gitlog) (421):
* Michael Thornhill
* Mike Dory
* Mike Johnson
* mikek
* Milo Price
* Mitar
* Mokys
* Morgan Wahl
* Motiejus Jakštys
* motleytech
* mrlundis
* mvaerle
* MW
Expand All @@ -301,8 +313,10 @@ Contributors (based on gitlog) (421):
* Orne Brocaar
* Oyvind Saltvik
* padelt
* Pankrat
* Paolo
* Pascal Mouret
* pascal.beyeler
* Patrick Arminio
* Patrick Lauber
* Patrick Toal
Expand Down Expand Up @@ -377,6 +391,7 @@ Contributors (based on gitlog) (421):
* Simon Hedberg
* Simon Meers
* sleytr
* Sophie Leroy
* spookylukey
* srj55
* ssteinerX
Expand All @@ -388,12 +403,14 @@ Contributors (based on gitlog) (421):
* Stefano Crosta
* Stefano Morandi
* Stephan
* Stephan Hepper
* Stephan Herzog
* Stephan Jaekel
* Stephen Muss
* Stephen Watkin
* Steve R. Jones
* Steve Steiner
* Steven Laroche
* Tanel Külaots
* tdelam
* tehfink
Expand All @@ -413,8 +430,10 @@ Contributors (based on gitlog) (421):
* Tom S
* Tom V
* Ulrich Petri
* unknown
* User
* Vasil Vangelovski
* Venelin Stoykov
* Viktor Nagy
* Viliam Segeda
* Vinit (Vermicelli on IRC)
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,26 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
- Added list of retired core developers
- Added branch policy documentaion

<<<<<<< HEAD
=== 3.1 (unreleased) ===
=======
=== 3.0.8 (2015-01-11) ===
- Add require_parent option to CMS_PLACEHOLDER_CONF
- Fix django-mptt version depenency to be PEP440 compatible
- Fix some Django 1.4 compatibility issues
- Add toolbar sanity check
- Fix behavior with CMSPluginBase.get_render_template()
- Fix issue on django >= 1.6 with page form fields.
- Resolve jQuery namespace issues in admin page tree and changeform
- Fix issues for PageField in Firefox/Safari
- Fix some Python 3.4 compatibility issue when using proxy modles
- Fix corner case in plugin copy
- Documentation fixes
- Minor code cleanups

=== 3.0.9 (2015-01-11) ===
- Revert a change that caused a regression in toolbar login
- Fix an error in a translated phrase
- Fix error when moving items in the page tree

>>>>>>> upstream/support/3.0.x
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Key points:
If you think you have discovered a security issue in our code, please report
it **privately**, by emailing us at `security@django-cms.org`_.

Please don't raise it on:
Please **do not** raise it on:

* IRC
* GitHub
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##########
django CMS
##########
.. image:: https://api.travis-ci.org/divio/django-cms.svg?branch=develop
.. image:: https://travis-ci.org/divio/django-cms.svg?branch=support%2F3.0.x
:target: http://travis-ci.org/divio/django-cms
.. image:: https://pypip.in/v/django-cms/badge.svg
:target: https://pypi.python.org/pypi/django-cms/
Expand Down
12 changes: 9 additions & 3 deletions cms/admin/pageadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
from cms.utils import helpers, permissions, get_language_from_request, admin as admin_utils, copy_plugins
from cms.utils.i18n import get_language_list, get_language_tuple, get_language_object, force_language
from cms.utils.admin import jsonify_request
from cms.utils.compat import DJANGO_1_4
from cms.utils.compat.dj import force_unicode, is_installed
from cms.utils.compat.urls import unquote
from cms.utils.conf import get_cms_setting
from cms.utils.helpers import find_placeholder_relation
from cms.utils.permissions import has_global_page_permission, has_generic_permission
from cms.utils.plugins import current_site
from cms.utils.compat import DJANGO_1_4
from cms.utils.transaction import wrap_transaction
from cms.utils.urlutils import add_url_parameters, admin_reverse

Expand Down Expand Up @@ -1366,7 +1366,10 @@ def add_page_type(self, request):

def resolve(self, request):
if not request.user.is_staff:
return HttpResponse('', content_type='text/plain')
if DJANGO_1_4:
return HttpResponse('', mimetype='text/plain')
else:
return HttpResponse('', content_type='text/plain')
if request.session.get('cms_log_latest', False):
log = LogEntry.objects.get(pk=request.session['cms_log_latest'])
try:
Expand Down Expand Up @@ -1483,7 +1486,10 @@ def get_published_pagelist(self, *args, **kwargs):
}
)

return HttpResponse(json.dumps(results), content_type='application/json')
if DJANGO_1_4:
return HttpResponse(json.dumps(results), mimetype='application/json')
else:
return HttpResponse(json.dumps(results), content_type='application/json')

else:
return HttpResponseForbidden()
Expand Down
16 changes: 13 additions & 3 deletions cms/admin/placeholderadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from django.http import HttpResponseRedirect

from cms.utils import copy_plugins, permissions, get_language_from_request
from cms.utils.compat import DJANGO_1_4
from cms.utils.i18n import get_language_list
from cms.utils.transaction import wrap_transaction

Expand Down Expand Up @@ -266,7 +267,10 @@ def add_plugin(self, request):
args=[plugin.pk])),
'breadcrumb': plugin.get_breadcrumb(),
}
return HttpResponse(json.dumps(response), content_type='application/json')
if DJANGO_1_4:
return HttpResponse(json.dumps(response), mimetype='application/json')
else:
return HttpResponse(json.dumps(response), content_type='application/json')

@method_decorator(require_POST)
@xframe_options_sameorigin
Expand Down Expand Up @@ -336,7 +340,10 @@ def copy_plugins(self, request):
)
self.post_copy_plugins(request, source_placeholder, target_placeholder, plugins)
json_response = {'plugin_list': reduced_list, 'reload': reload_required}
return HttpResponse(json.dumps(json_response), content_type='application/json')
if DJANGO_1_4:
return HttpResponse(json.dumps(json_response), mimetype='application/json')
else:
return HttpResponse(json.dumps(json_response), content_type='application/json')

@xframe_options_sameorigin
def edit_plugin(self, request, plugin_id):
Expand Down Expand Up @@ -476,7 +483,10 @@ def move_plugin(self, request):
x += 1
self.post_move_plugin(request, source_placeholder, placeholder, plugin)
json_response = {'reload': requires_reload(PLUGIN_MOVE_ACTION, [plugin])}
return HttpResponse(json.dumps(json_response), content_type='application/json')
if DJANGO_1_4:
return HttpResponse(json.dumps(json_response), mimetype='application/json')
else:
return HttpResponse(json.dumps(json_response), content_type='application/json')

@xframe_options_sameorigin
def delete_plugin(self, request, plugin_id):
Expand Down
12 changes: 12 additions & 0 deletions cms/extensions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ def delete_model(self, request, obj):
raise PermissionDenied()
obj.delete()

def get_model_perms(self, request):
"""
Return empty perms dict thus hiding the model from admin index.
"""
return {}

def get_queryset(self, request):
return super(PageExtensionAdmin, self).get_queryset(request).filter(extended_object__publisher_is_draft=True)

Expand Down Expand Up @@ -69,6 +75,12 @@ def delete_model(self, request, obj):
raise PermissionDenied()
obj.delete()

def get_model_perms(self, request):
"""
Return empty perms dict thus hiding the model from admin index.
"""
return {}

def get_queryset(self, request):
return super(TitleExtensionAdmin, self).get_queryset(request).filter(extended_object__page__publisher_is_draft=True)

Expand Down
8 changes: 8 additions & 0 deletions cms/forms/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ def compress(self, data_list):
return None

def _has_changed(self, initial, data):
is_empty = data and (len(data) >= 2 and data[1] in [None, ''])

if isinstance(self.widget, RelatedFieldWidgetWrapper):
self.widget.decompress = self.widget.widget.decompress

if is_empty and initial is None:
# when empty data will have [u'1', u'', u''] as value
# this will cause django to always return True because of the '1'
# so we simply follow django's default behavior when initial is None and data is "empty"
data = ['' for x in range(0, len(data))]
return super(PageSelectFormField, self)._has_changed(initial, data)

class PageSmartLinkField(forms.CharField):
Expand Down
10 changes: 5 additions & 5 deletions cms/forms/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def render(self, name, value, attrs=None):
};
var handlePageChange = function(page_id) {
if (page_id) {
$("#id_%(name)s_2 option").removeAttr('selected');
$("#id_%(name)s_2 option[value=" + page_id + "]").attr('selected','selected');
$("#id_%(name)s_2 option").prop('selected', false);
$("#id_%(name)s_2 option[value=" + page_id + "]").prop('selected', true);
} else {
$("#id_%(name)s_2 option[value=]").attr('selected','selected');
$("#id_%(name)s_2 option[value=]").prop('selected', true);
};
};
$("#id_%(name)s_0").change(function(){
Expand Down Expand Up @@ -181,7 +181,7 @@ def render(self, name=None, value=None, attrs=None):
}
});
})
})(django.jQuery);
})(CMS.$);
</script>''' % {
'element_id': id_,
'placeholder_text': final_attrs.get('placeholder_text', ''),
Expand All @@ -198,7 +198,7 @@ class Media:
'all': ('cms/js/select2/select2.css',
'cms/js/select2/select2-bootstrap.css',)
}
js = (#'cms/js/libs/jquery.min.js',
js = ('cms/js/modules/cms.base.js',
'cms/js/select2/select2.js',)


Expand Down
Binary file modified cms/locale/af/LC_MESSAGES/django.mo
Binary file not shown.

0 comments on commit e0d7fda

Please sign in to comment.