Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bryan BRANCOTTE
django-basetheme-bootstrap
Commits
a9830dba
Commit
a9830dba
authored
Sep 02, 2019
by
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
Changes
6
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
basetheme_bootstrap/static/css/basetheme_bootstrap4_pasteur.css
View file @
a9830dba
...
...
@@ -258,6 +258,8 @@ footer .inner-wrap {
display
:
inline-block
;
vertical-align
:
middle
;
flex
:
0
0
auto
;
display
:
flex
;
flex-direction
:
column
;
}
.footer__section
:last-child
{
flex
:
0
1
auto
;
...
...
@@ -313,9 +315,7 @@ footer .inner-wrap {
.footer__section
ul
.nav-link
{
padding
:
0px
;
}
.footer__section
:last-child
nav
+
span
{
position
:
absolute
;
bottom
:
0
;
.footer__section
:last-child
span
{
text-align
:
right
;
font-size
:
initial
;
}
...
...
basetheme_bootstrap/templates/basetheme_bootstrap/basePasteur.html
View file @
a9830dba
...
...
@@ -36,6 +36,7 @@
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarCollapse"
>
<ul
class=
"navbar-nav mr-auto"
>
{% include_if_exists "upper_nav_bar.html"|localize_template "basetheme_bootstrap/upper_nav_bar.example.html" %}
</ul>
{% block form_in_nav_bar %}
<form
class=
"form-inline mt-2 mt-md-0"
action=
"search/"
method=
"post"
>
...
...
@@ -70,9 +71,7 @@
</nav>
<div
class=
"header__middle"
>
<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"
>
</a>
<img
src=
"https://www.pasteur.fr/sites/default/files/logo_institut_pasteur_noir.png"
alt=
"Accueil"
>
</div>
<div
class=
"header__nav"
>
<nav
class=
"main-nav"
role=
"navigation"
>
...
...
@@ -145,25 +144,17 @@
</nav>
</div>
</div>
<div
class=
"footer__section
footer__menu-social
"
>
<div
class=
"footer__section"
>
<div
class=
"block block-menu block-menu-menu-footer-menu-social"
>
<nav>
<ul>
<li>
<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>
{% include_if_exists "credits.html"|localize_template "basetheme_bootstrap/credits.example.html" %}
</ul>
</nav>
</div>
<span
class=
"text-muted float-right"
>
{% include_if_exists "last_update.html"|localize_template "basetheme_bootstrap/last_update.example.html" %}
</span>
</div>
</div>
</div>
</footer>
...
...
basetheme_bootstrap/templates/basetheme_bootstrap/credits.example.html
0 → 100644
View file @
a9830dba
{% 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
basetheme_bootstrap/templates/basetheme_bootstrap/upper_nav_bar.example.html
0 → 100644
View file @
a9830dba
{% 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
basetheme_bootstrap/templatetags/basetheme_bootstrap.py
View file @
a9830dba
...
...
@@ -2,6 +2,7 @@ import logging
from
django
import
template
from
django.conf
import
settings
from
django.core.cache
import
cache
from
django.template.base
import
Token
from
django.template.loader
import
get_template
from
django.template.loader_tags
import
do_include
...
...
@@ -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
.
default_template_name
=
None
self
.
default_template_node
=
None
self
.
__template_seen
=
set
()
try
:
self
.
default_template_name
=
split_contents
[
2
]
self
.
default_template_node
=
do_include
(
parser
,
...
...
@@ -66,13 +68,18 @@ class IncludeIfExistsNode(template.Node):
try
:
return
self
.
template_node
.
render
(
context
)
except
template
.
TemplateDoesNotExist
:
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
''
cache_key
=
'Template_not_found_%s'
%
self
.
template_name
if
cache
.
get
(
cache_key
,
None
)
is
None
:
cache
.
set
(
cache_key
,
''
,
None
)
self
.
__template_seen
.
add
(
self
.
template_name
)
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
:
return
self
.
default_template_node
.
render
(
context
)
return
''
...
...
setup.py
View file @
a9830dba
...
...
@@ -7,7 +7,7 @@ readme = open('README.rst').read()
setup
(
name
=
'django-basetheme-bootstrap'
,
version
=
'0.2.1
1
'
,
version
=
'0.2.1
2
'
,
description
=
'Django Basetheme Bootstrap'
,
long_description
=
readme
,
author
=
'Bryan Brancotte'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment