Cleanup the way stylesheets and scripts are injected into pages by modules.

This commit is contained in:
Dave Page
2015-02-13 14:48:31 +00:00
parent 45d536f524
commit b5abf2c640
6 changed files with 62 additions and 52 deletions

View File

@@ -14,41 +14,42 @@
<meta name="dcterms.rights" content="All rights reserved">
<meta name="dcterms.dateCopyrighted" content="2014 - 2015">
<!-- Base template stylesheets -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-layout/layout-default.css') }}" />
{% if config.DEBUG %}<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.css') }}" />{% else %}<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" />{% endif %}
{% if config.DEBUG %}<link rel="stylesheet" href="{{ url_for('static', filename='css/alertifyjs/alertify.css') }}" />{% else %}<link rel="stylesheet" href="{{ url_for('static', filename='css/alertifyjs/alertify.min.css') }}" />{% endif %}
{% if config.DEBUG %}<link rel="stylesheet" href="{{ url_for('static', filename='css/alertifyjs/themes/bootstrap.css') }}" />{% else %}<link rel="stylesheet" href="{{ url_for('static', filename='css/alertifyjs/themes/bootstrap.min.css') }}" />{% endif %}
{% if config.DEBUG %}<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-ui/jquery-ui.css') }}" />{% else %}<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-ui/jquery-ui.min.css') }}" />{% endif %}
<style>
body {
padding-top: 50px;
padding-bottom: 20px;
}
</style>
{% if config.DEBUG %}<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-theme.min.css') }}">{% else %}<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-theme.min.css') }}">{% endif %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/overrides.css') }}">
{% if stylesheets is defined %}
<!-- View specified stylesheets -->
{% for stylesheet in stylesheets %}
<link rel="stylesheet" href="{{ stylesheet }}">
{% endfor %}
{% endif %}
<!-- Base template scripts -->
<script src="{{ url_for('static', filename='js/modernizr-2.6.2-respond-1.1.0.min.js') }}"></script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-1.11.2.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-1.11.2.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/bootstrap.js') }}">{% else %}<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/alertifyjs/alertify.js') }}">{% else %}<script src="{{ url_for('static', filename='js/alertifyjs/alertify.min.js') }}">{% endif %}</script>
<script src="{{ url_for('static', filename='js/alertifyjs/pgadmin.defaults.js') }}"></script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-ui/jquery-ui.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-ui/jquery-ui.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-layout/jquery.layout.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-layout/jquery.layout.min.js') }}">{% endif %}</script>
<script src="{{ url_for('static', filename='js/jquery-layout/plugins/jquery.layout.state.js') }}"></script>
{% if scripts is defined %}
<!-- View specified scripts -->
{% for script in scripts %}
<script src="{{ script }}"></script>
{% endfor %}
{% endif %}
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-1.11.2.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-1.11.2.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/bootstrap.js') }}">{% else %}<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/alertifyjs/alertify.js') }}">{% else %}<script src="{{ url_for('static', filename='js/alertifyjs/alertify.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-ui/jquery-ui.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-ui/jquery-ui.min.js') }}">{% endif %}</script>
{% if config.DEBUG %}<script src="{{ url_for('static', filename='js/jquery-layout/jquery.layout.js') }}">{% else %}<script src="{{ url_for('static', filename='js/jquery-layout/jquery.layout.min.js') }}">{% endif %}</script>
<script src="{{ url_for('static', filename='js/jquery-layout/plugins/jquery.layout.state.js') }}"></script>
<script>
alertify.defaults.transition = "zoom";
alertify.defaults.theme.ok = "btn btn-primary";
alertify.defaults.theme.cancel = "btn btn-danger";
alertify.defaults.theme.input = "form-control";
</script>
{% block body %}{% endblock %}
</body>