Clickventure content type component for bulbs projects.
Using this project requires dependency setup and implementation of provided Django apps. The site refers to the site that this component is being installed in.
From the site using this component:
- Add a dependency for this project in
requirements.txt
, where<version>
is the version to install:
git+https://github.com/theonion/bulbs-component-clickventure.git@<version>#egg=bulbs-component-clickventure
-
Run
pip install -r requirements.txt
on requirements file in the correct context to install this project's Django apps. -
Install bower dependencies, where
<version>
is the version to install which should match the<version>
used inrequirements.txt
:
$ bower install --save https://github.com/theonion/bulbs-component-clickventure.git\#\<version>
- Create a clickventure package in the site's app directory.
- Add
"bulbs_component_clickventure"
toINSTALLED_APPS
in Django's settings file. - Add a
models.py
that implementsbulbs_component_clickventure.models.ClickventureMixin
. - Create a migration for your app with Django migrations as you would any other app.
To use the public templates, scripts, and styles:
-
Include
"bulbs_component_clickventure_public"
inINSTALLED_APPS
in Django's settings file. -
Create a detail page with the following template logic included:
{% include "clickventure/partials/clickventure.html" with content=<content-variable> share_partial_template="<share-template-path>" %}
Where <share-template-path>
is the path to a share template, and
<content-variable>
is the name of the variable containing the content's data.
Note: you can use the {% with %}
Django template tag to customize variables in
the share template.
To use the CMS templates, scripts, and styles:
-
Include
"bulbs_component_clickventure_cms"
inINSTALLED_APPS
in Django's settings file. -
Create a CMS page with the following html:
<clickventure-edit article="content"></clickventure-edit>
Where content
is an angular scope variable containing the content's data.
- Add
bulbs.clickventure
as a dependency for your CMS's Angular app.
compat-builds/django-bulbs-cms
should not be edited directly. This app exists only until
CMS files are completely migrated out of django. To make changes to this package,
edit files located in src/bulbs-cms
then run grunt build_bulbs_cms_for_django
to rebuild compat-builds/django-bulbs-cms
with your changes.
Commit your changes and the rebuilt package, then reinstall the app on whatever project(s) require the changes.
To prep your environment for development:
$ ./scripts/dev-setup
To run a continuous test:
$ ./scripts/test-js
To do a single test run:
$ ./scripts/test-js --single-run
For continuous builds while you develop:
./scripts/dev-start
or to run a single build, as in creating a build for release:
$ ./scripts/build
See django-bulbs-cms Package section for more info.