Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Compartmentalise icekit's bower deps #307

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions icekit/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "static/icekit/bower_components"
}
8 changes: 4 additions & 4 deletions icekit/admin_tools/templates/admin/base_site.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
{% compress css %}
{# Bootstrap, then default admin styles, then our styles. #}
{# This avoids overriding the admin with Bootstrap, and allows us to override anything. #}
<link rel="stylesheet" href="{% static 'bootstrap/dist/css/bootstrap.css' %}" />
<link rel="stylesheet" href="{% static 'icekit/bower_components/bootstrap/dist/css/bootstrap.css' %}" />
<link rel="stylesheet" href="{% static 'admin/css/base.css' %}" />
<link type="text/less" rel="stylesheet" href="{% static 'admin/css/icekit_dashboard.less' %}" />
<link type="text/less" rel="stylesheet" href="{% static 'admin/css/override.less' %}" />
{% endcompress %}
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="{% static 'icekit/bower_components/font-awesome/css/font-awesome.css' %}">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an incidental fix that I've been meaning to make for at least a year.

There's no benefit to using a CDN for the admin, and it adds another point of failure.

My guess is that it was added in by Pat during initial prototyping and no one has never corrected it.

{% endblock %}

{% block extrahead %}
{% compress js %}
<script src="{% static 'jquery/dist/jquery.js' %}"></script>
<script src="{% static 'bootstrap/dist/js/bootstrap.js' %}"></script>
<script src="{% static 'icekit/bower_components/jquery/dist/jquery.js' %}"></script>
<script src="{% static 'icekit/bower_components/bootstrap/dist/js/bootstrap.js' %}"></script>
{% endcompress %}
{% endblock %}

Expand Down
5 changes: 4 additions & 1 deletion icekit/bin/setup-django.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ fi
# Install Node modules.
waitlock.sh npm-install.sh "$ICEKIT_PROJECT_DIR"

# Install Bower components.
# Install Bower components for the project.
waitlock.sh bower-install.sh "$ICEKIT_PROJECT_DIR"

# Install Bower components for icekit.
waitlock.sh bower-install.sh "$ICEKIT_DIR"

# Install Python requirements.
waitlock.sh pip-install.sh "$ICEKIT_PROJECT_DIR"

Expand Down
17 changes: 17 additions & 0 deletions icekit/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "icekit",
"dependencies": {
"alloyeditor": "^1.2.3",
"bootstrap": "^3.3.7",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"font-awesome": "^4.6.3",
"jquery": "^3.1.0",
"lodash": "^4.14.2",
"jquery-ui": "^1.11.4",
"fullcalendar": "^3.0.1",
"iframe-resizer": "^2.8.7",
"skveege-rrule": "^2.1.3",
"js-cookie": "^2.1.3"
},
"private": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h2>Upcoming Events</h2>

{% block base_js %}
{{ block.super }}
<script src="{% static 'lodash/lodash.js' %}"></script>
<script src="{% static 'icekit/js/google_map.js' %}"></script>
<script src="{% static 'icekit/bower_components/lodash/lodash.js' %}"></script>
<script src="{% static 'icekit/bower_components/icekit/js/google_map.js' %}"></script>
{% endblock %}
{% endblock body %}
2 changes: 1 addition & 1 deletion icekit/project/settings/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
# DJANGO_WYSIWYG_MEDIA_URL = '/' # See redirects in `icekit.project.urls`

DJANGO_WYSIWYG_FLAVOR = 'alloyeditor'
DJANGO_WYSIWYG_MEDIA_URL = STATIC_URL + 'alloyeditor/dist/alloy-editor/'
DJANGO_WYSIWYG_MEDIA_URL = STATIC_URL + 'icekit/bower_components/alloyeditor/dist/alloy-editor/'

BASIC_PLUGINS = [
'RawHtmlPlugin',
Expand Down
8 changes: 4 additions & 4 deletions icekit/templates/icekit/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
{# Base CSS files #}
{% compress css file %}
{% block icekit_css %}
<link rel="stylesheet" href="{% static 'bootstrap/dist/css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'font-awesome/css/font-awesome.css' %}">
<link rel="stylesheet" href="{% static 'icekit/bower_components/bootstrap/dist/css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'icekit/bower_components/font-awesome/css/font-awesome.css' %}">
<link rel="stylesheet" type="text/x-scss" href="{% static 'icekit/styles/icekit.scss' %}">
{% endblock %}
{# Default styling for a project, designed to be overridden once a build is underway #}
Expand Down Expand Up @@ -86,8 +86,8 @@
{# Base JS files #}
{% compress js file %}
{% block base_js %}
<script src="{% static 'jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'icekit/js/link_share.js' %}"></script>
<script src="{% static 'icekit/bower_components/jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'icekit/bower_components/icekit/js/link_share.js' %}"></script>
{% endblock %}
{% endcompress %}
{# Extra JS files - section/page specific, etc #}
Expand Down
2 changes: 1 addition & 1 deletion icekit_events/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class EventAdmin(ChildModelPluginPolymorphicParentModelAdmin,

class Media:
css = {
'all': ('font-awesome/css/font-awesome.css',),
'all': ('icekit/bower_components/font-awesome/css/font-awesome.css',),
}

def get_queryset(self, request):
Expand Down
6 changes: 3 additions & 3 deletions icekit_events/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class Media:
'all': ('icekit_events/css/recurrence_rule_widget.css', ),
}
js = (
'lodash/lodash.js',
'skveege-rrule/lib/rrule.js',
'skveege-rrule/lib/nlp.js',
'icekit/bower_components/lodash/lodash.js',
'icekit/bower_components/skveege-rrule/lib/rrule.js',
'icekit/bower_components/skveege-rrule/lib/nlp.js',
)

def __init__(self, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'jquery-ui/themes/base/jquery-ui.css' %}">
<link rel="stylesheet" href="{% static 'icekit/bower_components/jquery-ui/themes/base/jquery-ui.css' %}">
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -74,7 +74,7 @@ <h2>Occurrences</h2>
{% block js %}
{{ block.super }}
<script src="{% static 'icekit_events/js/jquery-querystring.js' %}"></script>
<script src="{% static 'jquery-ui/jquery-ui.min.js' %}"></script>
<script src="{% static 'icekit/bower_components/jquery-ui/jquery-ui.min.js' %}"></script>

{# Configure behaviour of start/end field datepicker widgets #}
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2>{{ start|date }}</h2>
{% block js %}
{{ block.super }}
<script src="{% static 'icekit_events/js/jquery-querystring.js' %}"></script>
<script src="{% static 'jquery-ui/jquery-ui.min.js' %}"></script>
<script src="{% static 'icekit/bower_components/jquery-ui/jquery-ui.min.js' %}"></script>
<script src="{% static 'icekit_events/js/events_datepicker.js' %}"></script>
{% endblock %}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<html>
<head>
<link rel='stylesheet' href='{% static "fullcalendar/dist/fullcalendar.css" %}' />
<link rel='stylesheet' href='{% static "icekit/bower_components/fullcalendar/dist/fullcalendar.css" %}' />
<style>
html, body {
/*height: 100%;*/
Expand Down Expand Up @@ -44,11 +44,11 @@
opacity: 0.4;
}
</style>
<script src='{% static "jquery/dist/jquery.js" %}'></script>
<script src='{% static "moment/moment.js" %}'></script>
<script src='{% static "fullcalendar/dist/fullcalendar.min.js" %}'></script>
<script src='{% static "iframe-resizer/src/iframeResizer.contentWindow.js" %}'></script>
<script src='{% static "js-cookie/src/js.cookie.js" %}'></script>
<script src='{% static "icekit/bower_components/jquery/dist/jquery.js" %}'></script>
<script src='{% static "icekit/bower_components/moment/moment.js" %}'></script>
<script src='{% static "icekit/bower_components/fullcalendar/dist/fullcalendar.min.js" %}'></script>
<script src='{% static "icekit/bower_components/iframe-resizer/src/iframeResizer.contentWindow.js" %}'></script>
<script src='{% static "icekit/bower_components/js-cookie/src/js.cookie.js" %}'></script>

<script>
var icekit_events = icekit_events || {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
}

</style>
<script src='{% static "iframe-resizer/src/iframeResizer.js" %}'></script>
<script src='{% static "js-cookie/src/js.cookie.js" %}'></script>
<script src='{% static "icekit/bower_components/iframe-resizer/src/iframeResizer.js" %}'></script>
<script src='{% static "icekit/bower_components/js-cookie/src/js.cookie.js" %}'></script>

<div id="calendar-container">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
width: 100%;
}
</style>
<script src='{% static "iframe-resizer/src/iframeResizer.js" %}'></script>
<script src='{% static "js-cookie/src/js.cookie.js" %}'></script>
<script src='{% static "icekit/bower_components/iframe-resizer/src/iframeResizer.js" %}'></script>
<script src='{% static "icekit/bower_components/js-cookie/src/js.cookie.js" %}'></script>
<div class="results">
<iframe id="calendar" src="{% url "admin:icekit_events_eventbase_calendar" %}?{{ request.GET.urlencode }}" scrolling="no"></iframe>
<script>
Expand Down
9 changes: 1 addition & 8 deletions project_template/bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
{
"name": "project_template",
"dependencies": {
"alloyeditor": "^1.2.3",
"bootstrap": "^3.3.7",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
"font-awesome": "^4.6.3",
"jquery": "^3.1.0",
"lodash": "^4.14.2",
"jquery-ui": "~1.11.4",
"fullcalendar": "^3.0.1",
"iframe-resizer": "~2.8.7",
"skveege-rrule": "~2.1.3",
"js-cookie": "^2.1.3"
"lodash": "^4.14.2"
},
"private": true
}