Commit a9830dba authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Populating upper nav_bar with pasteur link

Adding credits in footer
printing warnings only once
WIP #2
parent 9b8aab52
Pipeline #14191 passed with stage
in 1 minute and 47 seconds
...@@ -258,6 +258,8 @@ footer .inner-wrap { ...@@ -258,6 +258,8 @@ footer .inner-wrap {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
flex: 0 0 auto; flex: 0 0 auto;
display: flex;
flex-direction: column;
} }
.footer__section:last-child{ .footer__section:last-child{
flex: 0 1 auto; flex: 0 1 auto;
...@@ -313,9 +315,7 @@ footer .inner-wrap { ...@@ -313,9 +315,7 @@ footer .inner-wrap {
.footer__section ul .nav-link { .footer__section ul .nav-link {
padding:0px; padding:0px;
} }
.footer__section:last-child nav+span{ .footer__section:last-child span{
position: absolute;
bottom: 0;
text-align: right; text-align: right;
font-size: initial; font-size: initial;
} }
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
</button> </button>
<div class="collapse navbar-collapse" id="navbarCollapse"> <div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
{% include_if_exists "upper_nav_bar.html"|localize_template "basetheme_bootstrap/upper_nav_bar.example.html" %}
</ul> </ul>
{% block form_in_nav_bar %} {% block form_in_nav_bar %}
<form class="form-inline mt-2 mt-md-0" action="search/" method="post"> <form class="form-inline mt-2 mt-md-0" action="search/" method="post">
...@@ -70,9 +71,7 @@ ...@@ -70,9 +71,7 @@
</nav> </nav>
<div class="header__middle"> <div class="header__middle">
<div class="header__logo-wrapper"> <div class="header__logo-wrapper">
<a href="/" title="Accueil" rel="home"> <img src="https://www.pasteur.fr/sites/default/files/logo_institut_pasteur_noir.png" alt="Accueil">
<img src="https://www.pasteur.fr/sites/default/files/logo_institut_pasteur_noir.png" alt="Accueil">
</a>
</div> </div>
<div class="header__nav"> <div class="header__nav">
<nav class="main-nav" role="navigation"> <nav class="main-nav" role="navigation">
...@@ -145,25 +144,17 @@ ...@@ -145,25 +144,17 @@
</nav> </nav>
</div> </div>
</div> </div>
<div class="footer__section footer__menu-social"> <div class="footer__section">
<div class="block block-menu block-menu-menu-footer-menu-social"> <div class="block block-menu block-menu-menu-footer-menu-social">
<nav> <nav>
<ul> <ul>
<li> {% include_if_exists "credits.html"|localize_template "basetheme_bootstrap/credits.example.html" %}
<a class="suivre_pasteur_facebook" href="" target="_blank"></a>
</li>
<li>
<a class="suivre_pasteur_linkedin" href="" target="_blank"></a>
</li>
<li>
<a class="suivre_pasteur_twitter" href="" target="_blank"></a>
</li>
</ul> </ul>
</nav> </nav>
</div>
<span class="text-muted float-right"> <span class="text-muted float-right">
{% include_if_exists "last_update.html"|localize_template "basetheme_bootstrap/last_update.example.html" %} {% include_if_exists "last_update.html"|localize_template "basetheme_bootstrap/last_update.example.html" %}
</span> </span>
</div>
</div> </div>
</div> </div>
</footer> </footer>
......
{% load basetheme_bootstrap %}
{% load i18n %}
<li class="nav-item "><a href="https://www.pasteur.fr/" target="_blank" class="nav-link">{%trans "L'Institut Pasteur"%}</a></li>
<li class="nav-item "><a href="https://research.pasteur.fr/fr/team/bioinformatics-and-biostatistics-hub/" target="_blank" class="nav-link">{%trans "Bioinformatics and Biostatistics HUB"%}</a></li>
\ No newline at end of file
{% load i18n %}
<li class="nav-item "><a href="https://www.pasteur.fr/" target="_blank" class="nav-link">{%trans "L'Institut Pasteur"%}</a></li>
\ No newline at end of file
...@@ -2,6 +2,7 @@ import logging ...@@ -2,6 +2,7 @@ import logging
from django import template from django import template
from django.conf import settings from django.conf import settings
from django.core.cache import cache
from django.template.base import Token from django.template.base import Token
from django.template.loader import get_template from django.template.loader import get_template
from django.template.loader_tags import do_include from django.template.loader_tags import do_include
...@@ -55,6 +56,7 @@ class IncludeIfExistsNode(template.Node): ...@@ -55,6 +56,7 @@ class IncludeIfExistsNode(template.Node):
self.template_node = do_include(parser, Token(token.token_type, 'do_include %s' % split_contents[1])) self.template_node = do_include(parser, Token(token.token_type, 'do_include %s' % split_contents[1]))
self.default_template_name = None self.default_template_name = None
self.default_template_node = None self.default_template_node = None
self.__template_seen=set()
try: try:
self.default_template_name = split_contents[2] self.default_template_name = split_contents[2]
self.default_template_node = do_include(parser, self.default_template_node = do_include(parser,
...@@ -66,13 +68,18 @@ class IncludeIfExistsNode(template.Node): ...@@ -66,13 +68,18 @@ class IncludeIfExistsNode(template.Node):
try: try:
return self.template_node.render(context) return self.template_node.render(context)
except template.TemplateDoesNotExist: except template.TemplateDoesNotExist:
logger.warning( cache_key = 'Template_not_found_%s' % self.template_name
'Template %s was not found and could not be included.' % self.template_name + if cache.get(cache_key, None) is None:
( cache.set(cache_key, '', None)
('Please see %s to have an example' % self.default_template_name) self.__template_seen.add(self.template_name)
if self.default_template_name else '' print(self.__template_seen)
logger.warning(
'Template %s was not found and could not be included.' % self.template_name +
(
('Please see %s to have an example' % self.default_template_name)
if self.default_template_name else ''
)
) )
)
if self.default_template_node: if self.default_template_node:
return self.default_template_node.render(context) return self.default_template_node.render(context)
return '' return ''
......
...@@ -7,7 +7,7 @@ readme = open('README.rst').read() ...@@ -7,7 +7,7 @@ readme = open('README.rst').read()
setup( setup(
name='django-basetheme-bootstrap', name='django-basetheme-bootstrap',
version='0.2.11', version='0.2.12',
description='Django Basetheme Bootstrap', description='Django Basetheme Bootstrap',
long_description=readme, long_description=readme,
author='Bryan Brancotte', author='Bryan Brancotte',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment