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

WIP: Split into South Africa #2644

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ web/down.default.html
/pombola/core/static/sass/admin.css
/pombola/core/static/sass/countdown.css
/pombola/core/static/sass/jquery-ui.css
/pombola/kenya/static/sass/kenya.css
/pombola/nigeria/static/sass/nigeria.css
/pombola/south_africa/static/sass/countdown.css
/pombola/south_africa/static/sass/south-africa.css
/staticfiles
Expand Down
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Vagrant.configure(2) do |config|
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
v.name = 'vagrant-pombola-' + ( ENV['COUNTRY_APP'] || "kenya" )
v.name = 'vagrant-pombola-' + ( ENV['COUNTRY_APP'] || "south_africa" )
v.memory = 4096
v.cpus = 2
end
Expand All @@ -13,7 +13,7 @@ Vagrant.configure(2) do |config|
config.vm.provision "shell",
env: {
"DATADIR" => ENV['DATADIR'] || "/home/vagrant",
"COUNTRY_APP" => ENV['COUNTRY_APP'] || "kenya"
"COUNTRY_APP" => ENV['COUNTRY_APP'] || "south_africa"
},
path: "bin/vagrant-install.bash",
privileged: false
Expand Down
7 changes: 2 additions & 5 deletions bin/vagrant-install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

COUNTRY_APP=${COUNTRY_APP:-kenya}
COUNTRY_APP=${COUNTRY_APP:-south_africa}
DATADIR=${DATADIR:-data}

DB_NAME="pombola"
Expand Down Expand Up @@ -53,9 +53,6 @@ bin/prepare_environment.bash

# Load data
case "$COUNTRY_APP" in
kenya )
LIVE_URL='http://info.mzalendo.com'
;;
south_africa )
LIVE_URL='https://www.pa.org.za'
;;
Expand Down Expand Up @@ -91,4 +88,4 @@ fi
echo "==> Installation done!"
echo "==> To view, first log in and run /vagrant/manage.py runserver 0.0.0.0:8000"
echo "==> Then visit http://localhost:8000 in your browser."
echo
echo
10 changes: 2 additions & 8 deletions conf/crontab.ugly
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ MAILTO=cron-!!(*= $site *)[email protected]

# Set the virtualenv and add it to the path so that the correct python is used -
# requires that scripts start with '#!/usr/bin/env python'
# If you are running this with a different location for the virtualenv, you'll
# If you are running this with a different location for the virtualenv, you'll
# need to update both `VIRTUAL_ENV` and `PATH` to reflect this.
VIRTUAL_ENV="/data/vhost/!!(*= $vhost *)!!/pombola-virtualenv"

# Commonlib now included from the system-wide installation (`/data/mysociety/bin`).
# If you want to use any of our generic scripts (e.g. `output-on-error`) you'll
# If you want to use any of our generic scripts (e.g. `output-on-error`) you'll
# need to clone this repository somewhere and add it to the `PATH`.
PATH=/data/vhost/!!(*= $vhost *)!!/pombola/bin:/data/mysociety/bin:/data/mysociety/commonlib/bin:/data/vhost/!!(*= $vhost *)!!/pombola-virtualenv/bin:/usr/local/bin:/usr/bin:/bin

Expand Down Expand Up @@ -55,12 +55,6 @@ PYTHONIOENCODING=utf-8
33 2 * * * !!(*= $user *)!! run_management_command core_export_to_popolo_json /data/vhost/!!(*= $vhost *)!!/media_root/popolo_json/ http://info.mzalendo.com
50 2 * * * !!(*= $user *)!! run_management_command core_export_to_popolo_json --pombola /data/vhost/!!(*= $vhost *)!!/media_root/popolo_json/ http://info.mzalendo.com

# Check for any recurring data problems:
47 4 * * * !!(*= $user *)!! run_management_command kenya_check_for_recurring_problems

# Import messages from SMS API
0 * * * * !!(*= $user *)!! output-on-error run_management_command kenya_sms_retrieve_messages

!!(* } elsif ($vhost eq 'www.shineyoureye.org') { *)!!
23 2 * * * !!(*= $user *)!! run_management_command core_export_to_popolo_json /data/vhost/!!(*= $vhost *)!!/media_root/popolo_json/ http://www.shineyoureye.org
40 2 * * * !!(*= $user *)!! run_management_command core_export_to_popolo_json --pombola /data/vhost/!!(*= $vhost *)!!/media_root/popolo_json/ http://www.shineyoureye.org
Expand Down
19 changes: 1 addition & 18 deletions conf/general.yml-example
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ GOOGLE_ANALYTICS_ACCOUNT: ''
SURVEYGIZMO_API_TOKEN: ''
SURVEYGIZMO_API_SECRET: ''

# If you're running the experiment with the county performance page
# test for Kenya, then put the experiment key here
COUNTY_PERFORMANCE_EXPERIMENT_KEY: ''

# If you're running the experiment with the youth employment bill page
# test for Kenya, then put the experiment key here
YOUTH_EMPLOYMENT_BILL_EXPERIMENT_KEY: ''

# The IEBC API credentials for fetching aspirant data:
IEBC_API_ID: ''
IEBC_API_SECRET: ''
Expand All @@ -56,10 +48,6 @@ FROM_EMAIL: '[email protected]'
# See https://docs.djangoproject.com/en/1.5/ref/settings/#std:setting-ALLOWED_HOSTS
ALLOWED_HOSTS: ['pombola.example.com', 'localhost']

# If the local version of pdftohtml is wrong (ie != 0.12.4) - blank means do it
# locally
KENYA_PARSER_PDF_TO_HTML_HOST: ''

# Where is the selenium server? (If empty then selenium tests can't run)
# download it from here: http://seleniumhq.org/download/
# Note - need a recent one so that the window resizing has been implemented -
Expand Down Expand Up @@ -87,7 +75,7 @@ POLLDADDY_WIDGET_ID: ''
# from other apps. Note that we also use this setting in a command
# (core_create_parliamentary_sessions) to determine the country that this
# instance of Pombola is set up for.
COUNTRY_APP: kenya
COUNTRY_APP: south_africa

# ZA Hansard Parsing config (can be left blank on for other instances)
# Username and password for pmg_scraper command
Expand Down Expand Up @@ -120,10 +108,5 @@ EMAIL_USE_TLS: false
# here:
GOOGLE_MAPS_GEOCODING_API_KEY: ''

# Config for Kenya SMS API
KENYA_SMS_API_URL: 'https://app.bongasms.co.ke/api/fetch-messages'
KENYA_SMS_API_SHORT_CODE: ''
KENYA_SMS_API_KEY: ''

# Config for Google Site verification
GOOGLE_SITE_VERIFICATION: ''
4 changes: 2 additions & 2 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ git clone https://github.com/mysociety/pombola.git

## Vagrant

The `Vagrantfile` will set up the Kenyan site by default. You can
The `Vagrantfile` will set up the South African site by default. You can
override this by setting `COUNTRY_APP` in the environment, e.g.:
```
COUNTRY_APP=south_africa vagrant up
COUNTRY_APP=kenya vagrant up
```
Or by creating/updating to relevant variable in `conf/general.yml`
manually (otherwise this will be created the first time you run
Expand Down
6 changes: 3 additions & 3 deletions docs/STYLING_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ You can compile the SASS using `make css` in the project root. This uses [compas
The main entry point for the SASS is the `<country_name>.scss` file. These are largely similar and let you include or not styles specific to the various apps. Note that often these will contain entries like:

``` scss
@import "colours_nigeria";
@import "colours_south_africa";
/// ... snip ...
@import "nigeria_overrides";
@import "south_africa_overrides";
```

All the `.scss` files should be considered generic for all countries apart from ones like those above, that contain specific tweaks for the specific country.
Expand All @@ -28,4 +28,4 @@ Your app will have a `base.html` template that should extend `default_base.html`

## Static assets (images, js, etc)

Novel assets, and overrides, should go into `/pombola/<country_app>/static` (eg [Kenya's](https://github.com/mysociety/pombola/tree/master/pombola/kenya/static)). Anything that appears here will be used in preference to assets from the core or other apps.
Novel assets, and overrides, should go into `/pombola/<country_app>/static` (eg [South Africa's](https://github.com/mysociety/pombola/tree/master/pombola/south_africa/static)). Anything that appears here will be used in preference to assets from the core or other apps.
1 change: 0 additions & 1 deletion pombola/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def add_settings( request ):
'POPIT_API_URL': settings.POPIT_API_URL,
'FACEBOOK_APP_ID': settings.FACEBOOK_APP_ID,
'GOOGLE_SITE_VERIFICATION': settings.GOOGLE_SITE_VERIFICATION,
'KENYA_SMS_API_SHORT_CODE': settings.KENYA_SMS_API_SHORT_CODE,
}
}

Expand Down

This file was deleted.

93 changes: 0 additions & 93 deletions pombola/core/kenya_import_scripts/extract_positions_from_db.pl

This file was deleted.

Loading