Use flask-bower.

This commit is contained in:
Alexis Lahouze 2015-07-29 15:14:44 +02:00
parent fb4214f405
commit 7d2d21deb8
2 changed files with 47 additions and 7 deletions

View File

@ -20,6 +20,7 @@ import logging
from flask import Flask from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.bower import Bower
from . import config from . import config
@ -72,5 +73,12 @@ def session_aware(f):
from .api import api from .api import api
from .frontend import frontend from .frontend import frontend
app.register_blueprint(frontend, url_prefix='') app.register_blueprint(frontend, url_prefix='/app')
app.register_blueprint(api, url_prefix='/api') app.register_blueprint(api, url_prefix='/api')
app.config['BOWER_COMPONENTS_ROOT'] = "../bower_components"
app.config['BOWER_TRY_MINIFIED'] = not config.debug
bower = Bower(app)

View File

@ -23,17 +23,49 @@
<base href="{{ url_for('.index') }}"> <base href="{{ url_for('.index') }}">
<!-- third-party.css --> <!-- Bootstrap -->
<link href="static/build/css/vendor.css" rel="stylesheet"> <link href="{{ url_for('bower.static', filename='bootstrap/dist/css/bootstrap.css') }}" rel="stylesheet">
<!-- Bootstrap Additions -->
<link href="{{ url_for('bower.static', filename='bootstrap-additions/dist/bootstrap-additions.css') }}" rel="stylesheet">
<!-- Font Awesome -->
<link href="{{ url_for('bower.static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<!-- Pines Notify -->
<link href="{{ url_for('bower.static', filename='pines-notify/pnotify.core.css') }}" rel="stylesheet">
<link href="{{ url_for('bower.static', filename='pines-notify/pnotify.buttons.css') }}" rel="stylesheet">
<link href="{{ url_for('bower.static', filename='pines-notify/pnotify.history.css') }}" rel="stylesheet">
<link href="{{ url_for('bower.static', filename='pines-notify/pnotify.picon.css') }}" rel="stylesheet">
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.core.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.buttons.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.callbacks.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.confirm.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.desktop.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.history.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='pines-notify/pnotify.nonblock.js') }}"></script>
<!-- main css --> <!-- main css -->
<link href="static/css/main.css" rel="stylesheet"> <link href="static/css/main.css" rel="stylesheet">
<!-- Font Awesome --> <!-- JQuery -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <script type="text/javascript" src="{{ url_for('bower.static', filename='jquery/dist/jquery.js') }}"></script>
<!-- Vendor javascripts. --> <!-- Moment.js -->
<script type="text/javascript" src="static/build/js/vendor.js"></script> <script type="text/javascript" src="{{ url_for('bower.static', filename='moment/min/moment-with-locales.js') }}"></script>
<!-- Highstocks -->
<script type="text/javascript" src="{{ url_for('bower.static', filename='highstock-release/highstock.js') }}"></script>
<!-- AngularJS core -->
<script type="text/javascript" src="{{ url_for('bower.static', filename='angular/angular.js') }}"></script>
<!-- AngularJS modules -->
<script type="text/javascript" src="{{ url_for('bower.static', filename='angular-resource/angular-resource.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='angular-route/angular-route.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='angular-strap/dist/angular-strap.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='angular-strap/dist/angular-strap.tpl.js') }}"></script>
<script type="text/javascript" src="{{ url_for('bower.static', filename='highcharts-ng/dist/highcharts-ng.js') }}"></script>
</head> </head>
<body style="padding-bottom: 50px; padding-top: 70px"> <body style="padding-bottom: 50px; padding-top: 70px">