Skip to content

Commit

Permalink
Added external libraries using bower and configured routes in templat…
Browse files Browse the repository at this point in the history
…e file
  • Loading branch information
tranbenny committed Aug 4, 2015
1 parent aea39df commit a51a6f1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "/wger/core/static/bower_components"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ target/

# IDE
.idea/

# External Libraries
wger/core/static/bower_components
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ icalendar
django-bootstrap-breadcrumbs
sphinx
django-sortedm2m
django-bower

# REST API
djangorestframework>=3.1,<3.2
Expand All @@ -24,4 +25,4 @@ django-tastypie
django-cors-headers

# Python3 compatibility
six
six
20 changes: 10 additions & 10 deletions wger/core/templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@
{% compress css %}
<link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager-common.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'bower_components/jquery-ui/themes/smoothness/jquery-ui.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui-custom.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'bower_components/bootstrap/dist/css/bootstrap.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-custom.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/datepicker3.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/shariff.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'bower_components/shariff/build/shariff.min.css' %}">
{% endcompress %}

<link rel="icon" href="{% static 'images/favicon.png' %}" type="image/png">

{% compress js %}
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/jquery-ui.js' %}"></script>
<script src="{% static 'js/d3.js' %}"></script>
<script src="{% static 'bower_components/jquery/dist/jquery.js' %}"></script>
<script src="{% static 'bower_components/jquery-ui/jquery-ui.js' %}"></script>
<script src="{% static 'bower_components/d3/d3.js' %}"></script>
<script src="{% static 'js/workout-manager.js' %}"></script>
<script src="{% static 'js/ubuntu-unity.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/bootstrap-datepicker/bootstrap-datepicker.min.js' %}"></script>
<script src="{% static 'bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
<script src="{% static 'bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %}"></script>
<script src="{% static 'js/exercises.js' %}"></script>
<script src="{% static 'js/weight.js' %}"></script>
<script src="{% static 'js/nutrition.js' %}"></script>
Expand Down Expand Up @@ -219,7 +219,7 @@ <h4 class="modal-title" id="ajax-info-title">Modal title</h4>
</div>
</footer>

<script src="{% static 'js/shariff.min.js' %}"></script>
<script src="{% static 'bower_components/shariff/build/shariff.min.js' %}"></script>
</body>
{% endspaceless_config %}
</html>
19 changes: 19 additions & 0 deletions wger/settings_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,23 @@

# CORS
'corsheaders',

#django-bower JS libraries automation
'djangobower',
)

BOWER_INSTALLED_APPS = (
'jquery',
'bootstrap',
'jquery-ui',
'bootstrap-datepicker',
'd3',
'shariff',
'tinymce-dist',
'DataTables',
)


MIDDLEWARE_CLASSES = (
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
Expand Down Expand Up @@ -143,6 +158,7 @@
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'djangobower.finders.BowerFinder',

# Django compressor
'compressor.finders.CompressorFinder',
Expand Down Expand Up @@ -281,6 +297,9 @@
# COMPRESS_ENABLED = True
COMPRESS_ROOT = STATIC_ROOT

# BOWER components route
BOWER_COMPONENTS_ROUTE = os.path.join(STATIC_ROOT, 'components')


#
# Django Rest Framework
Expand Down

0 comments on commit a51a6f1

Please sign in to comment.