Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skin EL to look like a DC project #153

Merged
merged 28 commits into from
Oct 5, 2019
Merged

Skin EL to look like a DC project #153

merged 28 commits into from
Oct 5, 2019

Conversation

boffbowsh
Copy link
Collaborator

This removes a load of old unneeded frontend code, specifically all the Ember and Gulp stuff and switches to using dc_base_theme and django-pipelines.

This is best reviewed commit by commit as there's a few decisions about removing things.

To take it for a test drive, see staging: https://staging.democracyclub.org/ and the test page https://staging.democracyclub.org/test/

☝️ actually these are down at the moment as AWS has broken the deployment.

screencapture-127-0-0-1-8000-2019-09-09-19_30_08

As a result we also add `django-pipeline` and configure it to use
`assets` as the base assets storage directory. We'll remove `assets-src`
and the gulp pipeline in another commit.
Now supports Session Tokens for Lambda
Also add an "in the last month" leaflet counter.
Use CSS Grid to display a grid of 3 cols on desktop, 1 on mobile
The "this year" count actually means "since 2015". So let's just remove
it and speed everything up a whole bunch.
The data is broken, don't try to use it for now
Hard-coded start date
If there was no analysis for a particular party, we were showing the
overall leaflet stats for that party.

Easiest thing to do is exclude the party from the list
These aren't working yet, and could be server side rendered and cached.
We're hitting our Lambda function and layer limit, so we need to trim
the archives we're uploading.

The `media/` directory is no longer needed at all now we're using the
DC Base Theme.

We can use a newer version of serverless-python-requirements that will
allow us to exclude certain directories from the requirements archive.
We don't need the translations from `localflavor`, just a GB Postcode
field.
Editable doesn't work properly with Pipenv and
serverless-python-requirements
@boffbowsh boffbowsh requested review from symroe and chris48s September 9, 2019 19:05
@symroe
Copy link
Member

symroe commented Sep 16, 2019

Sorry it's taken me a while to look at this!

Everything looks good to me. There is a load of stuff that might break the deployment (S3 stuff, for example) or might need work later (odd styling issues here and there), but I reckon it's best to deploy this and fix stuff later, rather than try to anticipate it all up front.

Great improvement in general – especially deleting loads of old stuff :)

We want to have staging and production staticfiles coexist in the same
S3 bucket, so we switch to using ManifestFileMixin and the PipelineMixin
to generate hashes and manifest files per environment.

We add a hook to the serverless deployment script so that collectstatic
is run automatically for us
We use Django Pipeline now, no need for Gulp
Visiting `/test` will generate a list of links to various pages across
the site for testing purposes. It links to random leaflets,
constituencies etc.
This is no longer needed, but gets used for local development, so
shouldn't be committed
They bloat the upload and are not actually used for tests
We need to include the correct `ManifestFinder` in
`STATICFILES_FINDERS` in order to use the versioned styles.css instead
of the generic one.

Also use the `static` templatetag to get the hashed URL
@boffbowsh boffbowsh merged commit 24f42bb into master Oct 5, 2019
@boffbowsh boffbowsh deleted the dc-base-theme branch October 5, 2019 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants