Skip to content

Commit

Permalink
Reorganize inclusions, move Bootstrap CSS and JS to app base template
Browse files Browse the repository at this point in the history
  • Loading branch information
mbourqui committed May 19, 2017
1 parent 712eb85 commit bbc35b3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 23 deletions.
3 changes: 1 addition & 2 deletions publications_bootstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
__authors__ = ['Lucas Theis <lucas@theis.io>', 'Marc Bourqui <https://github.com/mbourqui>']
__docformat__ = 'epytext'
__version__ = '1.0.2'
__version_info__ = tuple(
[int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
__version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
__status__ = 'Stable'
43 changes: 23 additions & 20 deletions publications_bootstrap/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,42 @@
{% block head %}
{% endblock head %}

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->

<!-- Latest compiled and minified Bootstrap 4 Alpha 6 CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi"
crossorigin="anonymous">
<style type="text/css">
body {
font-family: "Hiragino Sans GB", "Helvetica Neue", "Lucida Grande", Helvetica, Arial, sans-serif;
font-size: 10pt;
line-height: 14pt;
padding: 20px;
}
</style>

{% block css %}
{# Additional CSS overriden by the pages #}
<style type="text/css">
body {
font-family: "Hiragino Sans GB", "Helvetica Neue", "Lucida Grande", Helvetica, Arial, sans-serif;
font-size: 10pt;
line-height: 14pt;
padding: 20px;
}
</style>
{% endblock %}
</head>

<body>

{% if messages %}
{% for message in messages %}
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">{{ message }}</div>
{% endfor %}
{% endif %}

<div class="container">
{% block content %}
<p>Use this document as a way to quick start any new project.</p>
{% endblock content %}
</div> <!-- /container -->

{% block js %}
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->

{% endblock js %}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends "base.html" %}
{% load static %}


{% block head %}
{{ block.super }}
<link rel="unapi-server" type="application/xml" title="unAPI" href="{% url 'publications_bootstrap:unapi' %}"/>
Expand All @@ -10,7 +9,13 @@
{% endblock %}

{% block css %}
{{ block.super }}
<!-- Latest compiled and minified Bootstrap 4 Alpha 6 CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link href="{% static 'publications_bootstrap/css/style.css' %}" rel="stylesheet">
{% block page_css %}
{# Page specific CSS #}
{% endblock %}
{% endblock css %}

{% block content %}
Expand All @@ -25,3 +30,15 @@
{% endif %}
</div>
{% endblock %}

{% block js %}
{{ block.super }}
<!-- Required by Bootstrap v4 Alpha 6 -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>

{% block app_js %}
{# Page specific JS #}
{% endblock app_js %}
{% endblock js %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% extends "publications_bootstrap/base.html" %}

{% for publication in publications %}
{% include "publications_bootstrap/components/publication.html" %}
{% endfor %}

0 comments on commit bbc35b3

Please sign in to comment.