Permalink
Browse files

update tree location

  • Loading branch information...
1 parent bd0a089 commit a704219fedb5e452eb1198b75a0b608a27458b73 @FinalAngel FinalAngel committed Jan 18, 2013
View
@@ -1093,7 +1093,7 @@ def descendants(self, request, page_id):
"""
page = get_object_or_404(Page, pk=page_id)
return admin_utils.render_admin_menu_item(request, page,
- template="admin/cms/page/lazy_menu.html")
+ template="admin/cms/page/tree/lazy_menu.html")
@create_on_success
def add_plugin(self, request):
@@ -1,8 +0,0 @@
-{% load cms_admin i18n adminmedia %}{% with page.get_descendant_count as has_children %}<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if forloop.last %} last{% endif %}{% if has_move_page_permission %} moveable{% endif %}{% if has_children %} closed{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}">
-
- {% include 'admin/cms/page/menu_item.html' %}
-
- {% if has_children %}<ul{% if page.last %} class="last"{% endif %}>
- </ul>{% endif %}
-</li>
-{% endwith %}
@@ -1,6 +0,0 @@
-{% load cms_admin i18n adminmedia %}
- {% with page.children.all as children %}
- {% for child in children %}
- {% show_lazy_admin_menu child %}
- {% endfor %}
- {% endwith %}
@@ -1,18 +0,0 @@
-{% load cms_admin i18n adminmedia %}<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 %}">
-
- {% include 'admin/cms/page/menu_item.html' %}
-
- {% with page.childrens as children %}
- {% if children %}
- <ul{% if page.last %} class="last"{% endif %}>
- {% if page.id in open_menu_trees %}
- {% for child in children %}
- {% show_admin_menu child %}
- {% endfor %}
- {% endif %}
- </ul>
- {% endif %}
- {% endwith %}
-</li>
-
-
@@ -0,0 +1,8 @@
+{% load cms_admin i18n adminmedia %}{% with page.get_descendant_count as has_children %}
+<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if forloop.last %} last{% endif %}{% if has_move_page_permission %} moveable{% endif %}{% if has_children %} closed{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}">
+ {% include "admin/cms/page/tree/menu_item.html" %}
+ {% if has_children %}
+ <ul{% if page.last %} class="last"{% endif %}></ul>
+ {% endif %}
+</li>
+{% endwith %}
@@ -0,0 +1,6 @@
+{% load cms_admin i18n adminmedia %}
+{% with page.children.all as children %}
+ {% for child in children %}
+ {% show_lazy_admin_menu child %}
+ {% endfor %}
+{% endwith %}
@@ -0,0 +1,19 @@
+{% load cms_admin i18n adminmedia %}
+{% comment %}
+- This template is used within the pagetree as the root for the menu-items
+{% 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 %}">
+ {% include "admin/cms/page/tree/menu_item.html" %}
+ {% with page.childrens as children %}
+ {% if children %}
+ <ul{% if page.last %} class="last"{% endif %}>
+ {% if page.id in open_menu_trees %}
+ {% for child in children %}
+ {% show_admin_menu child %}
+ {% endfor %}
+ {% endif %}
+ </ul>
+ {% endif %}
+ {% endwith %}
+</li>
@@ -1,4 +1,8 @@
{% load cms_admin i18n adminmedia %}
+{% comment %}
+- This template is used within the pagetree as the menu-items for the menu
+{% endcomment %}
+
<div class="cont{% if CMS_MODERATOR %} moderatorstate{{ page_moderator_state.state }}{% endif %}">
<div class="col1">
{% if has_change_permission %}
@@ -22,15 +26,21 @@
{% if page.soft_root or page.is_home %}<div class="col-softroot"><span class="icon softroot-icon" title="{% if page.soft_root %}{% trans 'softroot' %}{% else %}{% trans 'home' %}{% endif %}"></span></div>{% endif %}
- <div class="col-language">{% for lang in page.get_languages|in_filtered:site_languages %}
- {% if has_change_permission %}<a href="{{ url }}{{ page.id }}/?language={{ lang }}" title="{% blocktrans with lang|upper as language %}Edit this page in {{ language }} {% endblocktrans %}">{{ lang }}</a>
- {% else %}{{ lang|upper }}
+ <div class="col-language">
+ {% for lang in page.get_languages|in_filtered:site_languages %}
+ {% if has_change_permission %}
+ <a href="{{ url }}{{ page.id }}/?language={{ lang }}" title="{% blocktrans with lang|upper as language %}Edit this page in {{ language }} {% endblocktrans %}">{{ lang }}</a>
+ {% else %}
+ {{ lang|upper }}
{% endif %}
{% if not forloop.last %} | {% endif %}
- {% endfor %}</div>
+ {% endfor %}
+ </div>
- <div class="col-actions">{% if not filtered %}
- {% if has_move_page_permission %}<a href="#" class="move" title="{% trans "Cut" %}" id="move-link-{{ page.id }}"><span>{% trans "cut" %}</span></a>{% endif %}{% endif %}
+ <div class="col-actions">
+ {% if not filtered %}
+ {% if has_move_page_permission %}<a href="#" class="move" title="{% trans "Cut" %}" id="move-link-{{ page.id }}"><span>{% trans "cut" %}</span></a>{% endif %}
+ {% endif %}
{% if has_change_permission %}<a href="#" class="copy" title="{% trans "Copy" %}" id="copy-link-{{ page.id }}"><span>{% trans "copy" %}</span></a>{% endif %}
{% if has_add_page_permission and has_add_on_same_level_permission %}
@@ -51,22 +61,27 @@
</label>
</div>
- {% if CMS_MODERATOR %}<div class="col-moderator">
- {% if has_moderate_permission %}{% for value, title, active, css_class in page|moderator_choices:user %}<input type="checkbox" class="moderator-checkbox hidden copy-{{ css_class }}"{% if active %} checked="checked"{% endif %} value="{{ value }}" title="{{ title }}"/>
- {% endfor %}{% endif %}
- </div>{% endif %}
-
-
- {% if CMS_MODERATOR %}<div class="col-draft">
+ {% if CMS_MODERATOR %}
+ <div class="col-moderator">
+ {% if has_moderate_permission %}
+ {% for value, title, active, css_class in page|moderator_choices:user %}
+ <input type="checkbox" class="moderator-checkbox hidden copy-{{ css_class }}"{% if active %} checked="checked"{% endif %} value="{{ value }}" title="{{ title }}"/>
+ {% endfor %}
+ {% endif %}
+ </div>
+ <div class="col-draft">
{% if moderator_should_approve %}<a href="./{{ page.id }}/approve/" class="icon approve" title="{% trans 'Approve directly' %}"></a>{% endif %}
<span class="state">{{ page_moderator_state.label }}</span>
<a href="./{{ page.id }}/preview/" class="icon selector-add viewpage" id="view-page-{{page.id}}"><span>{% trans "view" %}</span></a>
- </div>{% endif %}
+ </div>
+ {% endif %}
<div class="col-published">
{% if has_publish_permission %}
- {% if page.published %}<input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" checked="checked" value="1" title="{% trans 'Unpublish' %}"/>
- {% else %}<input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" value="0" title="{% trans 'Publish' %}"/>
+ {% if page.published %}
+ <input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" checked="checked" value="1" title="{% trans 'Unpublish' %}"/>
+ {% else %}
+ <input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" value="0" title="{% trans 'Publish' %}"/>
{% endif %}
{% endif %}
@@ -82,14 +97,14 @@
<div class="col-published">{{ page.publication_end_date|date:"Y-m-d" }}</div>
<div class="col-view-perms">{{ page|is_restricted:request }}</div>
-
- {% if CMS_MODERATOR %}<div class="col-lastchange">
- {% for state in page.last_page_states %}<span class="icon state-icon {{ state.css_class }}" title="{{ state.get_action_display }}"></span>
- {% endfor %}
-
-
- </div>{% endif %}
+ {% if CMS_MODERATOR %}
+ <div class="col-lastchange">
+ {% for state in page.last_page_states %}
+ <span class="icon state-icon {{ state.css_class }}" title="{{ state.get_action_display }}"></span>
+ {% endfor %}
+ </div>
+ {% endif %}
<div class="col-creator">{{ page.changed_by }}</div>
</div>
-</div>
+</div>
@@ -23,7 +23,7 @@
class ShowAdminMenu(InclusionTag):
name = 'show_admin_menu'
- template = 'admin/cms/page/menu.html'
+ template = 'admin/cms/page/tree/menu.html'
options = Options(
Argument('page')
@@ -56,7 +56,7 @@ def get_context(self, context, page):
class ShowLazyAdminMenu(InclusionTag):
name = 'show_lazy_admin_menu'
- template = 'admin/cms/page/lazy_child_menu.html'
+ template = 'admin/cms/page/tree/lazy_child_menu.html'
options = Options(
Argument('page')
View
@@ -85,7 +85,7 @@ def render_admin_menu_item(request, page, template=None):
must be reloaded over ajax.
"""
if not template:
- template = "admin/cms/page/menu_item.html"
+ template = "admin/cms/page/tree/menu_item.html"
if not page.pk:
return HttpResponse(NOT_FOUND_RESPONSE) # Not found - tree will remove item

0 comments on commit a704219

Please sign in to comment.