From 1095319c96fc4f1b4645f9d26a872beb31e57d98 Mon Sep 17 00:00:00 2001 From: Mark Finger Date: Tue, 31 Oct 2017 16:24:22 +1100 Subject: [PATCH 1/6] Install icekit's bower deps into icekit itself - re #286 --- icekit/.bowerrc | 3 +++ icekit/bin/setup-django.sh | 5 ++++- icekit/bower.json | 17 +++++++++++++++++ project_template/bower.json | 9 +-------- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 icekit/.bowerrc create mode 100644 icekit/bower.json diff --git a/icekit/.bowerrc b/icekit/.bowerrc new file mode 100644 index 00000000..93afdbb4 --- /dev/null +++ b/icekit/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory" : "static/icekit/bower_components" +} diff --git a/icekit/bin/setup-django.sh b/icekit/bin/setup-django.sh index 6b573bdf..bce306ae 100755 --- a/icekit/bin/setup-django.sh +++ b/icekit/bin/setup-django.sh @@ -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" diff --git a/icekit/bower.json b/icekit/bower.json new file mode 100644 index 00000000..c3fe2f44 --- /dev/null +++ b/icekit/bower.json @@ -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 +} diff --git a/project_template/bower.json b/project_template/bower.json index 47d57592..e2280602 100644 --- a/project_template/bower.json +++ b/project_template/bower.json @@ -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 } From 92edc466fbdca1b55925a8ec52a6a99667973766 Mon Sep 17 00:00:00 2001 From: Mark Finger Date: Tue, 31 Oct 2017 16:33:28 +1100 Subject: [PATCH 2/6] Redirecting bower_component deps to icekit's vendored deps - re #286 --- icekit/admin_tools/templates/admin/base_site.html | 6 +++--- .../templates/icekit/plugins/location/location.html | 4 ++-- icekit/project/settings/_base.py | 2 +- icekit/templates/icekit/base.html | 8 ++++---- icekit_events/admin.py | 2 +- icekit_events/forms.py | 6 +++--- .../advancedeventlisting/layouts/default.html | 4 ++-- .../eventlistingfordate/layouts/default.html | 2 +- .../admin/icekit_events/eventbase/calendar.html | 12 ++++++------ .../admin/icekit_events/eventbase/change_form.html | 4 ++-- .../admin/icekit_events/eventbase/change_list.html | 4 ++-- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/icekit/admin_tools/templates/admin/base_site.html b/icekit/admin_tools/templates/admin/base_site.html index e3edb8dd..62099be8 100644 --- a/icekit/admin_tools/templates/admin/base_site.html +++ b/icekit/admin_tools/templates/admin/base_site.html @@ -18,7 +18,7 @@ {% compress css %} {# Bootstrap, then default admin styles, then our styles. #} {# This avoids overriding the admin with Bootstrap, and allows us to override anything. #} - + @@ -28,8 +28,8 @@ {% block extrahead %} {% compress js %} - - + + {% endcompress %} {% endblock %} diff --git a/icekit/plugins/location/templates/icekit/plugins/location/location.html b/icekit/plugins/location/templates/icekit/plugins/location/location.html index 6835d99d..d548ba61 100644 --- a/icekit/plugins/location/templates/icekit/plugins/location/location.html +++ b/icekit/plugins/location/templates/icekit/plugins/location/location.html @@ -68,7 +68,7 @@

Upcoming Events

{% block base_js %} {{ block.super }} - - + + {% endblock %} {% endblock body %} diff --git a/icekit/project/settings/_base.py b/icekit/project/settings/_base.py index eb86c29a..01f1e950 100644 --- a/icekit/project/settings/_base.py +++ b/icekit/project/settings/_base.py @@ -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', diff --git a/icekit/templates/icekit/base.html b/icekit/templates/icekit/base.html index be69bf7b..124fe5f4 100644 --- a/icekit/templates/icekit/base.html +++ b/icekit/templates/icekit/base.html @@ -43,8 +43,8 @@ {# Base CSS files #} {% compress css file %} {% block icekit_css %} - - + + {% endblock %} {# Default styling for a project, designed to be overridden once a build is underway #} @@ -86,8 +86,8 @@ {# Base JS files #} {% compress js file %} {% block base_js %} - - + + {% endblock %} {% endcompress %} {# Extra JS files - section/page specific, etc #} diff --git a/icekit_events/admin.py b/icekit_events/admin.py index cef36631..7e00e387 100644 --- a/icekit_events/admin.py +++ b/icekit_events/admin.py @@ -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): diff --git a/icekit_events/forms.py b/icekit_events/forms.py index 212110ad..e1fb8890 100644 --- a/icekit_events/forms.py +++ b/icekit_events/forms.py @@ -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): diff --git a/icekit_events/page_types/advancedeventlisting/templates/advancedeventlisting/layouts/default.html b/icekit_events/page_types/advancedeventlisting/templates/advancedeventlisting/layouts/default.html index e1157383..b7963293 100644 --- a/icekit_events/page_types/advancedeventlisting/templates/advancedeventlisting/layouts/default.html +++ b/icekit_events/page_types/advancedeventlisting/templates/advancedeventlisting/layouts/default.html @@ -6,7 +6,7 @@ {% block css %} {{ block.super }} - + {% endblock %} {% block content %} @@ -74,7 +74,7 @@

Occurrences

{% block js %} {{ block.super }} - + {# Configure behaviour of start/end field datepicker widgets #} - + {% endblock %} diff --git a/icekit_events/templates/admin/icekit_events/eventbase/calendar.html b/icekit_events/templates/admin/icekit_events/eventbase/calendar.html index 65f6fa01..4da55475 100644 --- a/icekit_events/templates/admin/icekit_events/eventbase/calendar.html +++ b/icekit_events/templates/admin/icekit_events/eventbase/calendar.html @@ -4,7 +4,7 @@ - + - - - - - + + + + + - + +
diff --git a/icekit_events/templates/admin/icekit_events/eventbase/change_list.html b/icekit_events/templates/admin/icekit_events/eventbase/change_list.html index 60d3f2ae..7baf22d1 100644 --- a/icekit_events/templates/admin/icekit_events/eventbase/change_list.html +++ b/icekit_events/templates/admin/icekit_events/eventbase/change_list.html @@ -20,8 +20,8 @@ width: 100%; } - - + +
- + {% endblock %} {% endblock body %} diff --git a/icekit/templates/icekit/base.html b/icekit/templates/icekit/base.html index 124fe5f4..efb7df02 100644 --- a/icekit/templates/icekit/base.html +++ b/icekit/templates/icekit/base.html @@ -87,7 +87,7 @@ {% compress js file %} {% block base_js %} - + {% endblock %} {% endcompress %} {# Extra JS files - section/page specific, etc #} From a506d9f6799b28db48fc7e81b13ea02fd072a19c Mon Sep 17 00:00:00 2001 From: Mark Finger Date: Wed, 1 Nov 2017 08:28:29 +1100 Subject: [PATCH 6/6] Mo' docker, mo' problems - re #286 --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 79ce2094..2b38db38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,12 +57,15 @@ COPY project_template/bower.json /opt/django-icekit/project_template/ RUN bower install --allow-root && rm -rf /root/.cache/bower RUN md5sum bower.json > bower.json.md5 -WORKDIR /opt/django-icekit/ +WORKDIR /opt/django-icekit/icekit -COPY icekit/bower.json /opt/django-icekit/ +COPY icekit/.bowerrc /opt/django-icekit/icekit/ +COPY icekit/bower.json /opt/django-icekit/icekit/ RUN bower install --allow-root RUN md5sum bower.json > bower.json.md5 +WORKDIR /opt/django-icekit/ + COPY README.rst requirements.txt setup.py /opt/django-icekit/ RUN bash -c 'pip install --no-cache-dir -r <(grep -v setuptools requirements.txt)' # Unpin setuptools dependencies. See: https://github.com/pypa/pip/issues/4264 RUN md5sum requirements.txt > requirements.txt.md5