fak3 avatar fak3 committed 634d49b Draft Merge

Comments (0)

Files changed (3)

admin_tools/dashboard/views.py

 from django.http import HttpResponse
 from django.template import RequestContext
 from django.shortcuts import render_to_response
+from django.contrib import messages
 
 try:
     from django.views.decorators.csrf import csrf_exempt
             preferences = form.save()
             if request.is_ajax():
                 return HttpResponse('true')
-            request.user.message_set.create(message='Preferences saved')
+            messages.success(request, 'Preferences saved')
         elif request.is_ajax():
             return HttpResponse('false')
     else:

admin_tools/menu/views.py

 from django.http import HttpResponse, HttpResponseRedirect
 from django.shortcuts import get_object_or_404, render_to_response
 from django.template import RequestContext
+from django.contrib import messages
 
 try:
     from django.views.decorators.csrf import csrf_exempt
         if form.is_valid():
             bookmark = form.save()
             if not request.is_ajax():
-                request.user.message_set.create(message='Bookmark added')
+                messages.success(request, 'Bookmark added')
                 if request.POST.get('next'):
                     return HttpResponseRedirect(request.POST.get('next'))
                 return HttpResponse('Added')
         if form.is_valid():
             form.save()
             if not request.is_ajax():
-                request.user.message_set.create(message='Bookmark updated')
+                messages.success(request, 'Bookmark updated')
                 if request.POST.get('next'):
                     return HttpResponseRedirect(request.POST.get('next'))
             return HttpResponse('Saved')
     if request.method == "POST":
         bookmark.delete()
         if not request.is_ajax():
-            request.user.message_set.create(message='Bookmark removed')
+            messages.success(request, 'Bookmark removed')
             if request.POST.get('next'):
                 return HttpResponseRedirect(request.POST.get('next'))
             return HttpResponse('Deleted')

admin_tools/theming/templates/admin/base.html

-{% load theming_tags admin_static %}
+{% load theming_tags staticfiles %}
 {% load url from future %}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
 <head>
 <title>{% block title %}{% endblock %}</title>
-<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% static "admin/css/base.css" %}{% endblock %}" />
+<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
 {% block extrastyle %}{% endblock %}
-<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
+<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
 {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
 {% render_theming_css %}
 <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
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.