Skip to content

Commit

Permalink
Remove Kenya ephemera
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Jul 16, 2019
1 parent 6afd56d commit 5d2a820
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 91 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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/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_kenya";
@import "colours_south_africa";
/// ... snip ...
@import "kenya_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
28 changes: 0 additions & 28 deletions pombola/core/management/commands/core_database_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ def get_tables_to_dump(self):
'popolo_name_resolver_entityname',
'writeinpublic_configuration',
])
if settings.COUNTRY_APP in ('kenya',):
# Ignore SMS tables as they contain phone numbers.
tables_to_ignore.update([
'sms_message',
'sms_question',
])
tables_to_dump = [
t for t in tables if t not in tables_to_ignore
]
Expand Down Expand Up @@ -158,28 +152,6 @@ def get_tables_to_dump(self):
'spinner_quotecontent',
'spinner_slide',
]
if settings.COUNTRY_APP in ('kenya',):
# hansard, place_data, projects, votematch, wordcloud
expected_tables += [
'hansard_alias',
'hansard_entry',
'hansard_sitting',
'hansard_source',
'hansard_venue',
'place_data_entry',
'projects_project',
'votematch_answer',
'votematch_party',
'votematch_quiz',
'votematch_stance',
'votematch_statement',
]
if settings.COUNTRY_APP in ('kenya',):
# place_data, bills
expected_tables += [
'bills_bill',

]
unexpected = set(tables_to_dump) - set(expected_tables)
if unexpected:
print '''The following tables were found which weren't expected
Expand Down
5 changes: 0 additions & 5 deletions pombola/core/templates/core/organisation_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,4 @@ <h2>Contact Details</h2>
{% endif %}
{% endwith %}

{% if settings.COUNTRY_APP != 'kenya' %}
{# Kenyan comments are looked after by pombola/kenya/templates/core/object_base.html #}
{% include 'disqus_comments.html' %}
{% endif %}

{% endblock %}
12 changes: 2 additions & 10 deletions pombola/core/templates/core/person_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,12 @@ <h3>Constituency Offices</h3>
</ul>
{% endif %}

<h3>{% if settings.COUNTRY_APP == 'kenya' %}
Party &amp; Coalition
{% else %}
Party
{% endif %}</h3>
<h3>Party</h3>
<ul class="party-memberships">
{% for party in object.parties_and_coalitions %}
<li><a href="{{ party.get_absolute_url }}" class="party-membership party-membership--{{ party.kind.name | slugify }}">{{ party.name }}</a></li>
{% empty %}
<li>{% if settings.COUNTRY_APP == 'kenya' %}
Not a member of any parties or coalitions
{% else %}
Not a member of any party
{% endif %}</li>
<li>Not a member of any party</li>
{% endfor %}
</ul>
</div>
Expand Down
7 changes: 0 additions & 7 deletions pombola/core/templates/core/place_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,4 @@ <h2>CDF Projects</h2>
{% endwith %}
{% endif %}

{% block disqus_comments %}
{% if settings.COUNTRY_APP != 'kenya' %}
{# Kenyan comments are looked after by pombola/kenya/templates/core/object_base.html #}
{% include 'disqus_comments.html' %}
{% endif %}
{% endblock %}

{% endblock %}
1 change: 0 additions & 1 deletion run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ update_exit_code() {

TEST_SETTINGS_MODULES=(
'pombola.settings.tests'
'pombola.settings.tests_kenya'
'pombola.settings.tests_south_africa'
)

Expand Down

0 comments on commit 5d2a820

Please sign in to comment.