Skip to content
Browse files

restructure pagetree so it makes sense

  • Loading branch information...
1 parent a3a86c5 commit 4d42d9df9f7269cacec6bd943b55a283c7515231 @FinalAngel FinalAngel committed Jan 18, 2013
View
8 cms/admin/pageadmin.py
@@ -158,7 +158,7 @@ class PageAdmin(ModelAdmin):
exclude = []
mandatory_placeholders = ('title', 'slug', 'parent', 'site', 'meta_description', 'meta_keywords', 'page_title', 'menu_title')
add_general_fields = ['title', 'slug', 'language', 'template']
- change_list_template = "admin/cms/page/change_list.html"
+ change_list_template = "admin/cms/page/tree/base.html"
# take care with changing fieldsets, get_fieldsets() method removes some
# fields depending on permissions, but its very static!!
@@ -706,9 +706,9 @@ def changelist_view(self, request, extra_context=None):
context['has_change_permission'] = self.has_change_permission(request)
context.update(extra_context or {})
return render_to_response(self.change_list_template or [
- 'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
- 'admin/%s/change_list.html' % app_label,
- 'admin/change_list.html'
+ 'admin/%s/%s/base.html' % (app_label, opts.object_name.lower()),
+ 'admin/%s/base.html' % app_label,
+ 'admin/base.html'
], context, context_instance=RequestContext(request))
View
7 ...templates/admin/cms/page/change_list.html → cms/templates/admin/cms/page/tree/base.html
@@ -1,5 +1,9 @@
{% extends "admin/change_list.html" %}
{% load adminmedia admin_list i18n cms_admin cms_js_tags %}
+{% comment %}
+- This template is used within the pagetree as the main template
+{% endcomment %}
+
{% block title %}{% trans "List of pages" %}{% endblock %}
{% block bodyclass %}change-list{% endblock %}
@@ -115,7 +119,6 @@
{% block filters %}
{% if cl.has_filters %}
-
<a href="javascript:showchangelistfilter();" id="changelist-filter-button">{% trans "Filter:" %} {% if cl.is_filtered %}{% trans "on" %}{% else %}{% trans "off" %}{% endif %}</a>
<div id="changelist-filter" style="display:none;">
<h2>{% trans 'Filter' %}</h2>
@@ -126,7 +129,7 @@
{% endif %}
{% endblock %}
-{% include "admin/cms/page/change_list_tree.html" %}
+{% include "admin/cms/page/tree/base_header.html" %}
</div>
</div>
View
9 ...ates/admin/cms/page/change_list_tree.html → ...ates/admin/cms/page/tree/base_header.html
@@ -1,5 +1,9 @@
{% load i18n cms_admin %}
-<div id="sitemap" style="display:none">
+{% comment %}
+- This template is used within the pagetree as the table row header
+{% endcomment %}
+
+<div id="sitemap">
<ul class="header">
<li>
<div class="cont">
@@ -8,14 +12,11 @@
<div class="col-actions">{% trans "actions" %}</div>
<div class="col-navigation">{% trans "in navigation" %}</div>
{% if CMS_MODERATOR %}<div class="col-moderator">{% trans "moderate" %}</div>{% endif %}
-
{% if CMS_MODERATOR %}<div class="col-draft">{% trans "draft" %}</div>{% endif %}
<div class="col-published">{% trans "published" %}</div>
-
<div class="col-published">{% trans "start" %}</div>
<div class="col-published">{% trans "end" %}</div>
<div class="col-view-perms">{% trans "restricted" %}</div>
-
{% if CMS_MODERATOR %}<div class="col-lastchange">{% trans "last changes" %}</div>{% endif %}
<div class="col-creator">{% trans "changed by" %}</div>
</div>
View
2 cms/templates/admin/cms/page/tree/menu.html
@@ -1,6 +1,6 @@
{% load cms_admin i18n adminmedia %}
{% comment %}
-- This template is used within the pagetree as the root for the menu-items
+- This template is used within the pagetree as the menu-item
{% endcomment %}
<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if has_move_page_permission %} moveable{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}">
View
2 cms/templates/admin/cms/page/tree/menu_item.html
@@ -1,6 +1,6 @@
{% load cms_admin i18n adminmedia %}
{% comment %}
-- This template is used within the pagetree as the menu-items for the menu
+- This template is used within the pagetree menu-item as the content
{% endcomment %}
<div class="cont{% if CMS_MODERATOR %} moderatorstate{{ page_moderator_state.state }}{% endif %}">

0 comments on commit 4d42d9d

Please sign in to comment.
Something went wrong with that request. Please try again.