Hynek Cernoch avatar Hynek Cernoch committed b0545ab

Cleanup old stuff pre Django 1.4

Comments (0)

Files changed (3)

livesettings/templates/livesettings/group_settings.html

 {% extends "admin/base_site.html" %}
-{% load i18n admin_modify config_tags %}{% load url from future %}
+{% load i18n config_tags %}{% load url from future %}
 {% block extrastyle %}
 {{ block.super }}
-<link rel="stylesheet" type="text/css" href="{{ ADMIN_MEDIA_PREFIX }}css/base.css" />
+<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" />
 {% endblock %}
 
-{% block stylesheet %}{{ ADMIN_MEDIA_PREFIX }}css/forms.css{% endblock %}
+{% block stylesheet %}{% static "admin/css/forms.css" %}{% endblock %}
 {% block coltype %}colMS{% endblock %}
 {% block bodyclass %}dashboard{% endblock %}
 {% block userlinks %}<a href="{% url 'admin:index' %}doc/">{% trans 'Documentation' %}</a> / <a href="{% url 'admin:index' %}password_change/">{% trans 'Change password' %}</a> / <a href="{% url 'admin:index' %}logout/">{% trans 'Log out' %}</a>{% endblock %}

livesettings/templates/livesettings/site_settings.html

 {% extends "admin/base_site.html" %}
-{% load i18n admin_modify config_tags %}{% load url from future %}
+{% load i18n admin_static config_tags %}{% load url from future %}
 
-{% block stylesheet %}{{ ADMIN_MEDIA_PREFIX }}css/forms.css{% endblock %}
+{% block stylesheet %}{% static "admin/css/forms.css" %}{% endblock %}
+
 {% block extrahead %}{{ block.super }}
 <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
-<script type="text/javascript" src="{{ ADMIN_MEDIA_PREFIX }}js/core.js"></script>
-{% if DJANGO_PRE_12 %}
-<script type="text/javascript" src="{{ ADMIN_MEDIA_PREFIX }}js/admin/CollapsedFieldsets.js"></script>
-<script type="text/javascript">
-var uncollapse = function () {
-    CollapsedFieldsets.uncollapse_all();
-    return false;
-}
-</script>
-{% else %}
-<script type="text/javascript" src="{{ ADMIN_MEDIA_PREFIX }}js/jquery.init.js"></script>
-<script type="text/javascript" src="{{ ADMIN_MEDIA_PREFIX }}js/collapse.js"></script>
+<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
+<script type="text/javascript" src="{% static "admin/js/jquery.js" %}"></script>
+<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
+<script type="text/javascript" src="{% static "admin/js/collapse.js" %}"></script>
 <script type="text/javascript">
 var $ = django.jQuery,
 uncollapse = function() {
            return false
 };
 </script>
-{% endif %}
 {% endblock %}
+
 {% block extrastyle %}
 {{ block.super }}
-<link rel="stylesheet" type="text/css" href="{{ ADMIN_MEDIA_PREFIX }}css/base.css" />
+<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" />
 <style type="text/css">
-ul.fieldref { margin: 0; padding: 0; font-size: 9px; }
-ul.fieldref li { float: left; margin: 0 10px 0 0; list-style: none; }
-fieldset.collapsed h2 { display: block !important; }
-fieldset.collapsed h2 a { display: inline !important; }
-div.fieldcontainer { float: left; margin-right: 0; }
+    ul.fieldref { margin: 0; padding: 0; font-size: 9px; }
+    ul.fieldref li { float: left; margin: 0 10px 0 0; list-style: none; }
+    fieldset.collapsed h2 { display: block !important; }
+    fieldset.collapsed h2 a { display: inline !important; }
+    div.fieldcontainer { float: left; margin-right: 0; }
 </style>
 {% endblock %}
+
 {% block coltype %}colMS{% endblock %}
+
 {% block bodyclass %}dashboard{% endblock %}
+
 {% block userlinks %}<a href="{% url 'admin:index' %}doc/">{% trans 'Documentation' %}</a> / <a href="{% url 'admin:index' %}password_change/">{% trans 'Change password' %}</a> / <a href="{% url 'admin:index' %}logout/">{% trans 'Log out' %}</a>{% endblock %}
+
 {% block breadcrumbs %}{% if not is_popup %}
 <div class="breadcrumbs">
 	<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> &rsaquo;

livesettings/views.py

-from django.conf import settings as djangosettings
 from django.contrib import messages
 from django.contrib.auth.decorators import permission_required
 from django.http import HttpResponseRedirect
 from django.views.decorators.cache import never_cache
 from livesettings import ConfigurationSettings, forms
 from livesettings.overrides import get_overrides
-import django
 import logging
 
 log = logging.getLogger('livesettings.views')
 
-def _pre_12():
-    return django.VERSION < (1, 2)
-
 @csrf_protect
 def group_settings(request, group, template='livesettings/group_settings.html'):
     # Determine what set of settings this editor is used for
     else:
         form = None
 
-    if django.VERSION < (1, 4):
-        ADMIN_MEDIA_PREFIX = djangosettings.ADMIN_MEDIA_PREFIX
-    else:
-        ADMIN_MEDIA_PREFIX = djangosettings.STATIC_URL + 'admin/'
-
     return render_to_response(template, {
         'title': title,
         'group' : group,
         'form': form,
         'use_db' : use_db,
-        'ADMIN_MEDIA_PREFIX' : ADMIN_MEDIA_PREFIX,
-        'DJANGO_PRE_12' : _pre_12()
     }, context_instance=RequestContext(request))
 group_settings = never_cache(permission_required('livesettings.change_setting')(group_settings))
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.