Skip to content

Commit

Permalink
Merge pull request #212 from rapidpro/develop
Browse files Browse the repository at this point in the history
Updates for deploy for 1.5.3
  • Loading branch information
Erin Mullaney authored Apr 10, 2017
2 parents 11dae88 + 32268da commit 06bcf33
Show file tree
Hide file tree
Showing 43 changed files with 474 additions and 134 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = "1.5.2"
release = "1.5.3"

# The short X.Y version.
version = "1.5"
Expand Down
14 changes: 11 additions & 3 deletions docs/releases/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ Tracpro's version is incremented upon each merge to master according to our
We recommend reviewing the release notes and code diffs before upgrading
between versions.

v1.5.3 (released 2017-04-10)
----------------------------

Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.3...v1.5.2

* Rename Regions to Panels and Reporter Groups to Cohorts
* Smart Categories on single date numeric charts

v1.5.2 (released 2017-03-17)
----------------------------

Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.2...develop
Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.2...v1.5.1

* Larger, sorted multi-select drop-downs
* Fixes for error emails from tasks
Expand All @@ -23,7 +31,7 @@ Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.2...develop
v1.5.1 (released 2017-02-28)
----------------------------

Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.1...develop
Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.1...v1.5.0

* API v2 Updates: Code now points to version 2 of the RapidPro API.

Expand All @@ -40,7 +48,7 @@ Code diff: https://github.com/rapidpro/tracpro/compare/v1.5.0...develop
v1.4.3 (released 2016-04-06)
----------------------------

Code diff: https://github.com/rapidpro/tracpro/compare/v1.4.2...develop
Code diff: https://github.com/rapidpro/tracpro/compare/v1.4.2...v1.4.1

* Update docs structure.
* Remove outdated docs.
Expand Down
8 changes: 4 additions & 4 deletions docs/users/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Preparing RapidPro

Before setting up your TracPro organization, one should ensure that the RapidPro organization has the following:

* A set of contact groups representing geographical regions, e.g. *Kigali*, *Florida*
* A set of contact groups representing reporting groups, e.g. *Males*, *Teachers*
* A set of contact groups representing panels, e.g. *Kigali*, *Florida*
* A set of contact groups representing cohorts, e.g. *Males*, *Teachers*

Obviously you will also want to define some flows in RapidPro which are suitable for running as polls.

Expand All @@ -31,8 +31,8 @@ Configuring An Organization
There won't be much to see until you tell TracPro about which flows and groups to use.

* Navigate to **Administration** > **Polls** and click **Select** to select which flows in RapidPro will be used as polls in TracPro
* Navigate to **Administration** > **Reporter Groups** and click **Select** to select which contact groups in RapidPro will be used as reporter groups in TracPro
* Navigate to **Administration** > **Regions** and click **Select** to select which contact groups in RapidPro will be used as regions in TracPro. This will trigger a fetch of all contacts from those groups.
* Navigate to **Administration** > **Cohorts** and click **Select** to select which contact groups in RapidPro will be used as cohorts in TracPro
* Navigate to **Administration** > **Panels** and click **Select** to select which contact groups in RapidPro will be used as panels in TracPro. This will trigger a fetch of all contacts from those groups.

Fetching old runs
------------------
Expand Down
18 changes: 9 additions & 9 deletions docs/users/technical-overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ Concepts
--------------------

* `Polls` are RapidPro flows. Click on the name of a poll to see a summary of the responses over time and dates it was conducted.
* `PollRuns` are the dates a poll was conducted. Click on a poll date to see a summary of just the responses for that date, participation among reporter groups, send a message to contacts, individual responses, and export responses.
* `PollRuns` are the dates a poll was conducted. Click on a poll date to see a summary of just the responses for that date, participation among cohorts, send a message to contacts, individual responses, and export responses.
* `Contacts` are the same as in RapidPro, they are the respondents of polls.
* `Supervisors` could be, for example, a provincial monitoring officer in a ministry. They are meant to see a particular region or multiple regions, and encourage participation by seeing who is responding, and restart polls. Supervisors also manage contacts.
* `Supervisors` could be, for example, a provincial monitoring officer in a ministry. They are meant to see a particular panel or multiple panels, and encourage participation by seeing who is responding, and restart polls. Supervisors also manage contacts.
* `Administrators` setup TracPro for an org and can manage everything supervisors can, in addition to managing supervisors.
* `Regions` are administrative areas, and can be anything, for example a city, county, or state in the USA. They must be configured as contact groups in RapidPro first. Regions can be made hierarchical in TracPro. For example, a supervisor who has access only to Kampala, would not have access to all of Africa's regional data, and a second supervisor who had access to Africa, would have access to data for all sub-regions within Africa.
* `Reporter groups` are types of contacts, such as head teachers, or grade 5 teachers. They must be configured as contact groups in RapidPro first.
* `Panels` are administrative areas, and can be anything, for example a city, county, or state in the USA. They must be configured as contact groups in RapidPro first. Panels can be made hierarchical in TracPro. For example, a supervisor who has access only to Kampala, would not have access to all of Africa's regional data, and a second supervisor who had access to Africa, would have access to data for all sub-panels within Africa. (Panels were previously called regions.)
* `Cohorts` are types of contacts, such as head teachers, or grade 5 teachers. They must be configured as contact groups in RapidPro first. (Cohorts were previously called reporter groups.)
* `Recent Indicators` allow users to compare baseline poll results to follow up poll results over time. For instance, if a poll was sent out to gather enrollment numbers at the start of the term, that could be selected as the baseline poll, and a follow up poll could be the poll sent out over the term asking for attendance numbers. Users may also spoof poll data to create sample results to chart on Recent Indicators.
* `Inbox Messages` allow users to view and send unsolicited messages, that is, messages outside of a flow, to contacts.

Features
--------------------

**Administrator accounts**: Configure a dashboard for any org, such as choosing polls, reporter groups, and regions to make available.
**Administrator accounts**: Configure a dashboard for any org, such as choosing polls, cohorts, and panels to make available.

**Supervisor management**: Administrators can easily add, remove, and configure supervisors. Administators set up any desired access to particular regions for supervisors. Supervisors have access to data for their regions and to Homepage Poll data, Contacts, Inbox Messages and Recent Indicators.
**Supervisor management**: Administrators can easily add, remove, and configure supervisors. Administators set up any desired access to particular panels for supervisors. Supervisors have access to data for their panels and to Homepage Poll data, Contacts, Inbox Messages and Recent Indicators.

**Contact management**: Supervisors can create, manage, and remove contacts, including changing their region, reporter group, facility and language, and all those changes are synchronized in the background with RapidPro.
**Contact management**: Supervisors can create, manage, and remove contacts, including changing their panel, cohort, facility and language, and all those changes are synchronized in the background with RapidPro.

**Start polls**: Supervisors can start any poll brought into TracPro from the Homepage.

**Send messages**: Send messages about polls to non-responsive contacts, responsive contacts or all contacts of a group. Select a Poll, select a date that the poll ran from the list of dates it was conducted on (PollRuns), choose the Participation tab, and click the button to "Send Message..." and choose whether to send it to respondents or non-respondents. These messages can be viewed from the Message Log.

**Activity**: See the most active regions and the most active reporter groups.
**Activity**: See the most active panels and the most active cohorts.

**Participation**: See participation of every contact in all polls on one page.

Expand All @@ -41,4 +41,4 @@ Features

**Edit poll names**: Change any poll description.

**Mobile-ready**: TracPro works in smartphone and tablet browsers.
**Mobile-ready**: TracPro works in smartphone and tablet browsers.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum34==1.1.2
Markdown==2.6.6
Pygments==2.1.3
ipdb==0.8.1
numpy==1.10.4
numpy==1.12.0
phonenumbers==7.1.1
pisa==3.0.33
psycopg2==2.6.1
Expand Down
2 changes: 1 addition & 1 deletion tracpro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# NOTE: Version must be updated in docs/conf.py as well.
VERSION = (1, 5, 2, "final")
VERSION = (1, 5, 3, "final")


def get_version(version):
Expand Down
6 changes: 3 additions & 3 deletions tracpro/baseline/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ class BaselineTermFilterForm(filters.DateRangeFilter, filters.DataFieldFilter,
"baseline data."))
region = forms.ModelChoiceField(
required=False,
label=_("Contact region"),
label=_("Contact panel"),
queryset=None,
empty_label=_("All regions"),
empty_label=_("All panels"),
help_text=_("If specified, only responses from contacts in this "
"region will be shown."))
"panel will be shown."))

def __init__(self, baseline_term, data_regions, *args, **kwargs):
if not kwargs.get('data'):
Expand Down
2 changes: 1 addition & 1 deletion tracpro/contacts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class ContactForm(forms.ModelForm):
urn = URNField(label=_("Phone/Twitter"))
region = ModifiedLevelTreeNodeChoiceField(
label=_("Region"), empty_label="", queryset=Region.objects.none())
label=_("Panel"), empty_label="", queryset=Region.objects.none())

class Meta:
model = models.Contact
Expand Down
29 changes: 29 additions & 0 deletions tracpro/contacts/migrations/0015_auto_20170307_1338.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('contacts', '0014_auto_20170210_1659'),
]

operations = [
migrations.AlterField(
model_name='contact',
name='group',
field=models.ForeignKey(related_name='contacts', verbose_name='Cohort', to='groups.Group', help_text='Cohort to which this contact belongs.', null=True),
),
migrations.AlterField(
model_name='contact',
name='groups',
field=models.ManyToManyField(help_text='All cohorts to which this contact belongs.', related_name='all_contacts', verbose_name='Cohorts', to='groups.Group'),
),
migrations.AlterField(
model_name='contact',
name='region',
field=models.ForeignKey(related_name='contacts', verbose_name='Panel', to='groups.Region', help_text='Panel of this contact.'),
),
]
18 changes: 9 additions & 9 deletions tracpro/contacts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ class Contact(models.Model):
max_length=255,
help_text=_("Phone number or Twitter handle of this contact."))
region = models.ForeignKey(
'groups.Region', verbose_name=_("Region"), related_name='contacts',
help_text=_("Region where this contact lives."))
'groups.Region', verbose_name=_("Panel"), related_name='contacts',
help_text=_("Panel of this contact."))
group = models.ForeignKey(
'groups.Group', null=True, verbose_name=_("Reporter group"),
'groups.Group', null=True, verbose_name=_("Cohort"),
related_name='contacts',
help_text=_("Reporter group to which this contact belongs."))
help_text=_("Cohort to which this contact belongs."))
groups = models.ManyToManyField(
'groups.Group', verbose_name=_("Groups"),
'groups.Group', verbose_name=_("Cohorts"),
related_name='all_contacts',
help_text=_("All groups to which this contact belongs."))
help_text=_("All cohorts to which this contact belongs."))
language = models.CharField(
max_length=3, verbose_name=_("Language"), null=True, blank=True,
help_text=_("Language for this contact"))
Expand Down Expand Up @@ -202,7 +202,7 @@ def _get_first(model_class, temba_objects):
if not region:
raise ValueError(
"Unable to save contact {c.uuid} ({c.name}) because none of "
"their groups match an active Region for this org.".format(
"their cohorts match an active Panel for this org.".format(
c=temba_contact))

# Use the first Temba group that matches one of the org's Groups.
Expand All @@ -227,9 +227,9 @@ def push(self, change_type):

def save(self, *args, **kwargs):
if self.org.pk != self.region.org_id:
raise ValidationError("Region does not belong to Org.")
raise ValidationError("Panel does not belong to Org.")
if self.group and self.org.pk != self.group.org_id:
raise ValidationError("Group does not belong to Org.")
raise ValidationError("Cohort does not belong to Org.")

# RapidPro might return blank or null values.
self.name = self.name or ""
Expand Down
2 changes: 1 addition & 1 deletion tracpro/groups/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class ContactGroupsForm(forms.Form):
groups = forms.MultipleChoiceField(
choices=(), label=_("Groups"),
choices=(), label=_("Contact groups"),
help_text=_("Contact groups to use."),
widget=forms.widgets.SelectMultiple(attrs={'size': '20'}),
)
Expand Down
42 changes: 42 additions & 0 deletions tracpro/groups/migrations/0009_auto_20170307_1338.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings


class Migration(migrations.Migration):

dependencies = [
('groups', '0008_uuid_is_unique_to_org'),
]

operations = [
migrations.AlterModelOptions(
name='group',
options={'verbose_name': 'cohort'},
),
migrations.AlterModelOptions(
name='region',
options={'verbose_name': 'panel'},
),
migrations.AlterField(
model_name='group',
name='name',
field=models.CharField(help_text='The name of this panel', max_length=128, verbose_name='Name', blank=True),
),
migrations.AlterField(
model_name='region',
name='name',
field=models.CharField(help_text='The name of this panel', max_length=128, verbose_name='Name', blank=True),
),
migrations.AlterField(
model_name='region',
name='users',
field=models.ManyToManyField(help_text='Users who can access this panel', related_name='regions', verbose_name='Users', to=settings.AUTH_USER_MODEL),
),
migrations.AlterUniqueTogether(
name='group',
unique_together=set([]),
),
]
10 changes: 7 additions & 3 deletions tracpro/groups/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AbstractGroup(models.Model):
'orgs.Org', verbose_name=_("Organization"), related_name="%(class)ss")
name = models.CharField(
verbose_name=_("Name"), max_length=128, blank=True,
help_text=_("The name of this region"))
help_text=_("The name of this panel"))
is_active = models.BooleanField(
default=True,
help_text=_("Whether this item is active"))
Expand Down Expand Up @@ -115,7 +115,7 @@ class Region(mptt.MPTTModel, AbstractGroup):
"""A geographical region modelled as a group."""
users = models.ManyToManyField(
settings.AUTH_USER_MODEL, verbose_name=_("Users"), related_name='regions',
help_text=_("Users who can access this region"))
help_text=_("Users who can access this panel"))
parent = mptt.TreeForeignKey(
'self', null=True, blank=True, related_name="children", db_index=True)
boundary = models.ForeignKey(
Expand All @@ -125,6 +125,9 @@ class Region(mptt.MPTTModel, AbstractGroup):
related_name='regions',
on_delete=models.SET_NULL)

class Meta:
verbose_name = 'panel'

class MPTTMeta:
order_insertion_by = ['name']

Expand Down Expand Up @@ -155,7 +158,8 @@ def sync_with_temba(cls, org, uuids):

class Group(AbstractGroup):
"""A data reporting group."""
pass
class Meta:
verbose_name = 'cohort'


# === Boundaries === #
Expand Down
Loading

0 comments on commit 06bcf33

Please sign in to comment.