menu update
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
from django.contrib import admin
|
||||
from cms.extensions import PageExtensionAdmin
|
||||
from parler.admin import TranslatableAdmin
|
||||
from django.contrib.admin.models import LogEntry, DELETION
|
||||
from django.utils.html import escape
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from project.models import ImageExtension, SliderItemQualification
|
||||
|
||||
|
||||
33
src/project/templates/project/includes/main_menu.html
Normal file
33
src/project/templates/project/includes/main_menu.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% load menu_tags thumbnail util_tags %}
|
||||
|
||||
<div class="navigation__main">
|
||||
{% for n in 'nn' %}
|
||||
<div class="{% cycle 'navigation__images' 'navigation__list' %}">
|
||||
{% for child in children %}
|
||||
{% thumbnail child.id|page_image 800x800 crop=True as thumb %}
|
||||
<div class="navigation__item data_id_{{ forloop.counter0 }}"
|
||||
{% if forloop.parentloop.first %}style="background-image: url('{{ thumb.url }}');"{% endif %}>
|
||||
<a href="#" class="navigation__item__title"
|
||||
data-id="{{ forloop.counter0 }}">
|
||||
<span>
|
||||
{% include 'project/assets/arrow-left.svg' %}
|
||||
{{ child.get_menu_title }}
|
||||
</span>
|
||||
</a>
|
||||
{% if child.children %}
|
||||
<ul class="navigation__item__list">
|
||||
{% for grandchild in child.children %}
|
||||
<li class="{% if grandchild.selected %}selected{% endif %}">
|
||||
<a href="{{ grandchild.attr.redirect_url|default:grandchild.get_absolute_url }}">
|
||||
{% include 'project/assets/arrow-right.svg' %}
|
||||
{{ grandchild.get_menu_title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -1,17 +1,7 @@
|
||||
{% load i18n cms_tags menu_tags %}
|
||||
|
||||
<div class="navigation">
|
||||
<div class="navigation__lists">
|
||||
<ul class="navigation__list__main">
|
||||
{% show_menu 0 1 100 1 %}
|
||||
</ul>
|
||||
<ul class="navigation__list__meta navigation__list__meta--top">
|
||||
{% show_menu_below_id 'meta' 0 0 0 0 %}
|
||||
</ul>
|
||||
<ul class="navigation__list__meta navigation__list__meta--bottom">
|
||||
{% show_menu_below_id 'footer' 0 0 0 0 %}
|
||||
</ul>
|
||||
</div>
|
||||
{% show_menu 0 1 100 1 'project/includes/main_menu.html' %}
|
||||
|
||||
<div class="navigation__footer">
|
||||
{% include 'project/includes/meta_navigation.html' %}
|
||||
|
||||
0
src/project/templatetags/__init__.py
Normal file
0
src/project/templatetags/__init__.py
Normal file
13
src/project/templatetags/util_tags.py
Normal file
13
src/project/templatetags/util_tags.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from cms.models import Page
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.filter
|
||||
def page_image(id):
|
||||
try:
|
||||
return Page.objects.get(pk=id).imageextension.image
|
||||
except:
|
||||
return None
|
||||
Reference in New Issue
Block a user