Skip to content

Commit

Permalink
p1 tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gvn committed Oct 1, 2018
1 parent b07c1dc commit 6a66f77
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 9 deletions.
1 change: 1 addition & 0 deletions network-api/networkapi/buyersguide/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Meta:
url = Faker('url')
price = random.randint(49, 1500)
camera_app = Faker('boolean')
meets_minimum_security_standards = Faker('boolean')
camera_device = Faker('boolean')
microphone_app = Faker('boolean')
microphone_device = Faker('boolean')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-28 22:47
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0012_auto_20180928_2139'),
]

operations = [
migrations.RemoveField(
model_name='product',
name='customer_support_easy_helptext',
),
migrations.AlterField(
model_name='product',
name='privacy_policy_reading_level',
field=models.CharField(blank='True', choices=[('0', "Can't Determine"), ('7', 'Grade 7'), ('8', 'Grade 8'), ('9', 'Grade 9'), ('10', 'Grade 10'), ('11', 'Grade 11'), ('12', 'Grade 12'), ('13', 'Grade 13'), ('14', 'Grade 14'), ('15', 'Grade 15'), ('16', 'Grade 16'), ('17', 'Grade 17'), ('18', 'Grade 18'), ('19', 'Grade 19')], default='0', max_length=2),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-28 22:50
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0013_auto_20180928_2247'),
]

operations = [
migrations.AlterField(
model_name='product',
name='privacy_policy_reading_level',
field=models.CharField(choices=[('0', "Can't Determine"), ('7', 'Grade 7'), ('8', 'Grade 8'), ('9', 'Grade 9'), ('10', 'Grade 10'), ('11', 'Grade 11'), ('12', 'Grade 12'), ('13', 'Grade 13'), ('14', 'Grade 14'), ('15', 'Grade 15'), ('16', 'Grade 16'), ('17', 'Grade 17'), ('18', 'Grade 18'), ('19', 'Grade 19')], default='0', max_length=2),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 17:30
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0014_auto_20180928_2250'),
]

operations = [
migrations.AddField(
model_name='product',
name='has_moz_approval',
field=models.NullBooleanField(help_text='Does this product bear the Mozilla seal of approval?'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 17:33
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0015_product_has_moz_approval'),
]

operations = [
migrations.AlterField(
model_name='product',
name='has_moz_approval',
field=models.NullBooleanField(help_text='Does this product meet minimum security standards?'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-10-01 17:34
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0016_auto_20181001_1733'),
]

operations = [
migrations.RenameField(
model_name='product',
old_name='has_moz_approval',
new_name='meets_minimum_security_standards',
),
]
9 changes: 4 additions & 5 deletions network-api/networkapi/buyersguide/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ class Product(models.Model):
blank=True,
)

meets_minimum_security_standards = models.NullBooleanField(
help_text='Does this product meet minimum security standards?',
)

# Can it spy on me?

camera_device = models.NullBooleanField(
Expand Down Expand Up @@ -217,11 +221,6 @@ class Product(models.Model):
blank="True"
)

customer_support_easy_helptext = models.TextField(
max_length=5000,
blank="True"
)

phone_number = models.CharField(
max_length=100,
help_text='Phone Number',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h3 class="h3-heading h3-heading-small">What does it know about me?</h3>
<h3 class="h3-heading h3-heading-small">Can I control it?</h3>

<div class="mb-5">
{% criterion "must_change_default_password" "Must change the default password" product.must_change_default_password product.must_change_default_password_helptext %}
{% criterion "must_change_default_password" "If a password is required, you must change the default password" product.must_change_default_password product.must_change_default_password_helptext "Not required" %}
{% criterion "security_updates" "Automatic security updates" product.security_updates product.security_updates_helptext %}
{% criterion "need_account" "Requires an account" product.need_account product.need_account_helptext %}
{% criterion "delete_data" "Deletes data it stores on you" product.delete_data product.delete_data_helptext %}
Expand Down
6 changes: 3 additions & 3 deletions network-api/networkapi/buyersguide/templatetags/criterion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


@register.inclusion_tag('tags/criterion.html')
def criterion(id, question, answer, helptext=None):
def criterion(id, question, answer, helptext=None, indeterminate_copy="Can't determine"):
cssClassSuffix = "null"

if answer is None:
formattedAnswer = "Can't determine"
formattedAnswer = indeterminate_copy
elif isinstance(answer, str):
if answer is "0":
cssClassSuffix = "0"
formattedAnswer = "Can't Determine"
formattedAnswer = indeterminate_copy
else:
cssClassSuffix = answer
formattedAnswer = ("Grade {answer}".format(answer=answer))
Expand Down

0 comments on commit 6a66f77

Please sign in to comment.