8000 Use add-another CSS class in app config select by stefanw · Pull Request #6319 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Use add-another CSS class in app config select #6319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Fixed a bug where the direct children of the homepage would get a leading ``/``
character when the homepage was moved or published.
* Fixed a bug where non-staff user would be able to open empty structure board
* Fixed a bug where a static file from Django admin was referenced that no
longer existed in Django 1.9 and up.


=== 3.5.1 (2018-03-05) ===
Expand Down
8 changes: 3 additions & 5 deletions cms/forms/widgets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from cms.utils.compat import DJANGO_1_10
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.auth import get_permission_codename
from django.contrib.sites.models import Site
from django.core.urlresolvers import NoReverseMatch, reverse_lazy
Expand Down Expand Up @@ -306,10 +305,9 @@ def render(self, name, value, attrs=None, renderer=None):
output.append(self._build_script(name, value, attrs))

related_url = ''
output.append('<a href="%s" class="add-another" id="add_%s" onclick="return showAddAnotherPopup(this);"> '
% (related_url, name))
output.append('<img src="%s" width="10" height="10" alt="%s"/></a>'
% (static('admin/img/icon_addlink.gif'), _('Add Another')))
output.append('<a href="%s" class="add-another" id="add_%s" title="%s" onclick="return showAddAnotherPopup(this);">'
% (related_url, name, _('Add Another')))
output.append('</a>')
return mark_safe(''.join(output))
else:
return super(ApplicationConfigSelect, self).render(name, value, attrs, renderer)
4 changes: 1 addition & 3 deletions cms/templates/cms/widgets/applicationconfigselect.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n static %}
{% include 'django/forms/widgets/select.html' %}
{{ widget.script_init|safe }}
<a href="" class="add-another" id="add_{{ widget.name }}" onclick="return showAddAnotherPopup(this);"
><img src="{% static 'admin/img/icon_addlink.gif' %}" width="10" height="10" alt="{% trans 'Add Another' %}"
/></a>
<a href="" class="add-another" id="add_{{ widget.name }}" onclick="return showAddAnotherPopup(this);" title="{% trans 'Add Another' %}"></a>
0