{%- from 'macro.html' import nav_item -%} {{ nav_item('Главная', url_for('index.index'), 'index.index') }} {{ nav_item('Поиск', url_for('search.main'), 'search.') }} {{ nav_item( 'Справка', url_for('staticpages.index', name='help'), matched=is_current_endpoint('staticpages.index', name='help') ) }} {%- set next_url = (url_for(request.endpoint, **request.view_args) if request.endpoint and request.view_args != None else None) -%} {%- if current_user.is_authenticated %} {{ nav_item( 'Избранное', url_for('object_lists.favorites', user_id=current_user.id), matched=is_current_endpoint('object_lists.favorites', user_id=current_user.id) ) }} {{ nav_item('Закладки', url_for('object_lists.bookmarks'), 'object_lists.bookmarks') }} {{ nav_item('Выход', url_for('auth.logout', next=next_url), right=True) }} {{ nav_item( 'Профиль', url_for('author.info', user_id=current_user.id), matched=is_current_endpoint('author.info', user_id=current_user.id), right=True ) }} {{ nav_item( 'Кабинет автора', url_for('author.info'), matched=is_current_endpoint('author.info', user_id=None), right=True ) }} {{ nav_item('Добавить рассказ', url_for('story.add'), 'story.add', right=True) }} {% if current_user.is_staff %} {{ nav_item('Новые ({})'.format(submitted_stories_count()), url_for('object_lists.submitted'), 'object_lists.submitted', right=True) }} {% endif %} {{ hook('nav') }} {%- else %} {%- if config.REGISTRATION_OPEN %} {{ nav_item('Регистрация', url_for('auth.registration'), 'auth.registration') }} {% endif %} {{ hook('nav') }}