Commits

Morgan LEFIEUX committed dd7c644

Suppression du bouton 'Preview' de l'interface d'admin car devenu inutile

Comments (0)

Files changed (3)

 # -*- coding: utf-8 -*-
 from giag.blog.models import Entry,Tag
 from django.shortcuts import render
-from django.contrib.admin.views.decorators import staff_member_required
 from django.views.generic import DayArchiveView,MonthArchiveView,YearArchiveView,DateDetailView,ListView,DetailView
 
 class MainView(ListView):
 	c = Tag.objects.get(slug=monslug)
 	billets = Entry.objects.all().filter(tags=c).order_by('-pub_date')
 	return render(request, 'blog/list_by_tag.html', {'billets': billets,'tag': c})
-
-@staff_member_required
-def preview(request, object_id):
-	"Pré-visualisation d'un billet dans l'interface d'admin"
-	return DetailView.as_view(request, pk=object_id, queryset=Entry.objects.all(), template_object_name = 'object', )

templates/admin/blog/entry/change_form.html

-{% extends "admin/change_form.html" %} {% load i18n %}
-    {% block object-tools %}
-    {% if change %}{% if not is_popup %}
-      <ul class="object-tools">
-        <li><a href="history/" class="historylink">{% trans "History" %}</a></li>
-        <li><a href="preview/" class="viewsitelink" target="_blank">{% trans "View preview" %}</a></li>
-      {% if has_absolute_url %}<li>
-      <a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>
-      {% endif%}
-      </ul>
-    {% endif %}{% endif %}
-    {% endblock %}
 # -*- coding: utf-8 -*-
 from django.conf.urls import patterns, include, url
 #from giag.views import *
-from giag.blog.views import preview
 from django.views.generic import RedirectView
 from giag.feeds import LatestPosts,LatestComments,LatestPostsByTag
 
 		url(r'^feeds/tags/(?P<monslug>[-\w]+)/$', LatestPostsByTag(), name='blog-pbt-feeds'),
 		(r'^comments/', include('django.contrib.comments.urls')),
         #(r'^photos/$', auth_flatpage),
-		url(r'^admin/blog/entry/(?P<object_id>[0-9]+)/preview/$', preview),
 		
         # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
         # to INSTALLED_APPS to enable admin documentation: