Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Bootstrap v. 3.3.7 [ref #4219] #4806

Merged
merged 3 commits into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/_static/navbarscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See: http://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header
*/
$jqTheme(document).ready(function() {
$jqTheme('a[href*=#]:not([href=#])').on('click', function() {
$jqTheme('a[href*="#"]:not([href="#"])').on('click', function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var target = $jqTheme(this.hash);
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx_bootstrap_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Sphinx bootstrap theme."""
import os

VERSION = (0, 4, 0)
VERSION = (0, 6, 1)

__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
Expand Down
46 changes: 7 additions & 39 deletions doc/sphinx_bootstrap_theme/bootstrap/layout.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
{% extends "basic/layout.html" %}

{% set theme_css_files = [] %}
{% if theme_bootstrap_version == "3" %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "3.1.0", "theme", "" %}
{% set bootstrap_version, navbar_version = "3.3.7", "" %}
{% set bs_span_prefix = "col-md-" %}
{% else %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "2.3.2", "responsive", "-2" %}
{% set bootstrap_version, navbar_version = "2.3.2", "-2" %}
{% set bs_span_prefix = "span" %}
{% endif %}

{% if theme_bootswatch_theme %}
{# BS2 needs "bootstrap-responsive.css". BS3 doesn't. #}
{% if theme_bootstrap_version == "3" %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}

{% if not bootswatch_css_custom %}
{% set bootswatch_css_custom = [] %}
{% endif %}
{% set css_files = css_files + theme_css_files + bootswatch_css_custom %}

{% set script_files = script_files + [
'_static/js/jquery-1.11.0.min.js',
'_static/js/jquery-3.1.0.min.js',
'_static/js/jquery-fix.js',
'_static/bootstrap-' + bootstrap_version + '/js/bootstrap.min.js',
'_static/bootstrap-sphinx.js',
Expand All @@ -65,9 +34,8 @@
{%- endblock %}

{%- block extrahead %}
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<link type="image/png" rel="icon" href="../_static/images/favicondataverse.png" />
{% endblock %}
Expand Down Expand Up @@ -114,7 +82,7 @@
<div class="container">
<div class="row">
{%- block sidebar1 %}{{ bsidebar() }}{% endblock %}
<div class="{{ bs_span_prefix }}{{ bs_content_width }}">
<div class="{{ bs_span_prefix }}{{ bs_content_width }} content">
{% block body %}{% endblock %}
</div>
{% block sidebar2 %} {# possible location for sidebar #} {% endblock %}
Expand All @@ -124,7 +92,7 @@

{%- block footer %}
<footer class="footer">
<div class="container small">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
{% if theme_source_link_position == "footer" %}
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx_bootstrap_theme/bootstrap/navbar-2.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="navbar" class="{{ theme_navbar_class }} {% if theme_navbar_fixed_top == 'true' -%} navbar-fixed-top{%- endif -%}">
<div id="navbar" class="{{ theme_navbar_class }} {% if theme_navbar_fixed_top|tobool -%} navbar-fixed-top{%- endif -%}">
<div class="navbar-inner">
<div class="container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
Expand Down
5 changes: 2 additions & 3 deletions doc/sphinx_bootstrap_theme/bootstrap/navbar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="navbar" class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top == 'true' -%} navbar-fixed-top{%- endif -%}">
<div id="navbar" class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top|tobool -%} navbar-fixed-top{%- endif -%}">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
Expand All @@ -9,7 +9,7 @@
</button>
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
{%- block sidebarlogo %}
{%- if logo %}<img src="{{ pathto('_static/' + logo, 1) }}">{%- endif %}
{%- if logo %}<span><img src="{{ pathto('_static/' + logo, 1) }}"></span>{%- endif %}
{%- endblock %}
{% if theme_navbar_title -%}{{ theme_navbar_title|e }}{%- else -%}{{ project|e }}{%- endif -%}
</a>
Expand All @@ -18,7 +18,6 @@

<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="divider-vertical"></li>
{% if theme_navbar_links %}
{%- for link in theme_navbar_links %}
<li><a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">{{ _('Page') }} <b class="caret"></b></a>
href="#">{{ _(theme_navbar_pagenav_name) }} <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc">{{ toc }}</ul>
Expand Down
6 changes: 4 additions & 2 deletions doc/sphinx_bootstrap_theme/bootstrap/relations.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
{%- if prev %}
<li>
<a href="{{ prev.link|e }}" title="{{ _('Previous Chapter: ') + prev.title|striptags }}">
{%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-left visible-tablet"></span>{%- endif -%}
{%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-left visible-sm"></span>{%- endif -%}
<span class="hidden-sm">{{ "&laquo;"|safe }} {{ prev.title|striptags|truncate(length=16, killwords=True) }}</span>
<span class="hidden-sm hidden-tablet">{{ "&laquo;"|safe }} {{ prev.title|striptags|truncate(length=16, killwords=True) }}</span>
</a>
</li>
{%- endif %}
{%- if next %}
<li>
<a href="{{ next.link|e }}" title="{{ _('Next Chapter: ') + next.title|striptags }}">
{%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-right visible-tablet"></span>{%- endif -%}
{%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-right visible-sm"></span>{%- endif -%}
<span class="hidden-sm">{{ next.title|striptags|truncate(length=16, killwords=True) }} {{ "&raquo;"|safe }}</span>
<span class="hidden-sm hidden-tablet">{{ next.title|striptags|truncate(length=16, killwords=True) }} {{ "&raquo;"|safe }}</span>
</a>
</li>
{%- endif %}
Loading