Pluggable events app for Mozilla Webmaker
Перейти к файлу
gvn lazar suntop 9c7d5ac89b Update README.md 2014-03-18 15:29:05 -07:00
assets/css Bug 901975 - Implement an event creation confirmation dialog 2013-08-09 10:38:23 -04:00
controllers Fix bug 911239 - Only send event creation email to users when they permit it 2013-08-30 14:08:13 -04:00
docs modified events API docs 2013-07-22 13:23:39 -07:00
fixtures Better handling of fixtures, drop db before loading initial data. 2013-07-16 04:55:40 -07:00
lib Moved config -> lib and simplified orm/model loading. 2013-07-22 12:06:35 -07:00
migrations Moved config -> lib and simplified orm/model loading. 2013-07-22 12:06:35 -07:00
models Moved config -> lib and simplified orm/model loading. 2013-07-22 12:06:35 -07:00
scripts made fixture conversion script executable 2013-07-22 17:59:35 -07:00
static bug902458 - localized webmaker-events 2013-08-22 13:50:09 -04:00
views/events bug908331 - fixed events-guide URL 2013-08-22 14:57:04 -04:00
.gitignore [bug 890872] Prompt users to sign in to save events 2013-07-10 10:53:49 -04:00
README.md Update README.md 2014-03-18 15:29:05 -07:00
index.js Fixed 'intcomma' template filter. 2013-07-25 21:30:18 -07:00
package.json 0.1.20 2013-08-30 14:23:44 -04:00
routes.js Fix bug 911239 - Only send event creation email to users when they permit it 2013-08-30 14:08:13 -04:00
util.js Cleaned up event controller input filter code. 2013-07-17 01:32:17 -07:00

README.md

webmaker-events

Pluggable events app for Mozilla Webmaker

NOTE: Webmaker has moved to a new Events platform.

New Repo: http://github.com/mozilla/webmaker-events-2

Integrating into Webmaker

Add the following line to app.js:

require("webmaker-events").init(app, nunjucksEnv, lessMiddleWare, app_root);

where:

  • app is the Express app
  • nunjucksEnv is the nunjucks Environment for adding a custom fileloader before calling nunjucksEnv.express(app)
  • lessMiddleWare is the 'less-middleware' module, for compiling less stylesheets
  • app_root is the root dir for the express app, which is usually __dirname

Add webmaker-events to the dependency list in package.json:

"webmaker-events": "git://github.com/AmoebaConsulting/webmaker-events.git"

See mozilla/webmaker.org for all the changes required to get it working with Webmaker.

Importing Events to Fixtures

Events can be loaded at runtime by placing a JSON file with the Event fixture at fixtures/initial_data.json. This can be generated from the live webmaker events by running:

curl -L https://webmaker.org/events.json | ./scripts/transform_to_fixture.pl > fixtures/initial_data.json

This requires several Perl and several CPAN packages, which can be installed via cpanminus:

curl -L http://cpanmin.us | perl - -S App::cpanminus Modern::Perl JSON JE

Running Database Migrations

Database migrations must be run from within the webmaker.org dir using foreman:

cd webmaker.org
foreman run ./node_packages/webmaker-events/scripts/sequelize -m

To undo the latest migrations:

foreman run ./node_packages/webmaker-events/scripts/sequelize -mu

If you don't have foreman, you can also try:

source .env
./node_packages/webmaker-events/scripts/sequelize -m

To fill the city/country fields for Events, you can run the following script:

foreman run ./node_packages/webmaker-events/scripts/geocode_events.js

To convert the attendee field from the old enum/range format to an average number (this should only be run once):

foreman run ./node_packages/webmaker-events/scripts/convert_attendees.js

You can run a basic nodeJs repl with the orm loaded via the 'db_shell.js' script:

foreman run ./node_packages/webmaker-events/scripts/db_shell.js

Known Bugs

  • DateTime fields seem to not work with fixtures loaded into SQLite, when the fixtures where generated from data dumped from a webmaker.org server running mysql (default).