Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/pip/faker-0.9.2
- Loading branch information
Showing
63 changed files
with
1,539 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
network-api/networkapi/buyersguide/migrations/0008_product_slug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-18 20:46 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('buyersguide', '0007_auto_20181012_2045'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='product', | ||
name='slug', | ||
field=models.CharField(blank=True, default=None, editable=False, help_text='slug used in urls', max_length=256, null=True), | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
network-api/networkapi/buyersguide/migrations/0009_auto_20181018_2047.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-18 20:47 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
from django.utils.text import slugify | ||
|
||
|
||
def generate_slugs(apps, schema_editor): | ||
Product = apps.get_model('buyersguide', 'Product') | ||
for product in Product.objects.all(): | ||
product.slug = slugify(product.name) | ||
product.save() | ||
|
||
|
||
def remove_slug(): | ||
# It's safe for these to just get deleted | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('buyersguide', '0008_product_slug'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(generate_slugs, remove_slug) | ||
] |
20 changes: 20 additions & 0 deletions
20
network-api/networkapi/buyersguide/migrations/0010_auto_20181018_2053.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-18 20:53 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('buyersguide', '0009_auto_20181018_2047'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='product', | ||
name='slug', | ||
field=models.CharField(blank=True, default=None, editable=False, help_text='slug used in urls', max_length=256), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
network-api/networkapi/buyersguide/migrations/0011_auto_20181023_0005.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.16 on 2018-10-23 00:05 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('buyersguide', '0010_auto_20181018_2053'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='product', | ||
name='privacy_policy_reading_level_url', | ||
field=models.URLField(blank='True', help_text='Link to privacy policy reading level', max_length=2048), | ||
), | ||
migrations.AlterField( | ||
model_name='product', | ||
name='privacy_policy_url', | ||
field=models.URLField(blank='True', help_text='Link to privacy policy', max_length=2048), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 41 additions & 5 deletions
46
network-api/networkapi/buyersguide/templates/buyersguide_home.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,51 @@ | ||
{% extends "./bg_base.html" %} | ||
|
||
{% load env %} | ||
|
||
{% block body-id %}home{% endblock %} | ||
|
||
{% block guts %} | ||
<div class="container-fluid text-center page-header bg-gray"> | ||
<!-- home banner as css background --> | ||
</div> | ||
|
||
<div class="container"> | ||
<h1>Buyer's guide homepage!</h1> | ||
<div class="row"> | ||
<div class="product-listing bg-white col-12 col-md-10 offset-md-1"> | ||
<h1 class="h1-heading text-center mt-4">Shop Safe This Holiday Season</h1> | ||
|
||
{% for product in products %} | ||
<div><a href="./products/{{product.name | urlencode}}">{{product.name}}</a></div> | ||
{% endfor %} | ||
</div> | ||
<div class="row px-5 mx-4"> | ||
<p class="col body-large text-center"> | ||
Teddy bears that connect to the internet. | ||
Smart speakers that listen to commands. | ||
Great gifts—unless they spy on you. | ||
We created this guide to help you buy safe, secure products this holiday season. | ||
</p> | ||
</div> | ||
|
||
<div class="creepiness-slider sticky-top bg-white text-center"> | ||
<span class="current-creepiness"></span> | ||
</div> | ||
|
||
<div class="d-flex justify-content-center align-items-stretch flex-wrap"> | ||
{% for product in products %} | ||
<div class="product-box bg-gray" data-creepiness="{{ product.votes.creepiness.average }}"> | ||
{% if product.votes.confidence %} | ||
{% if product.votes.confidence.1 > product.votes.confidence.0 %} | ||
<div class="recommendation go-for-it m-2"></div> | ||
{% else %} | ||
<div class="recommendation stay-away m-2"></div> | ||
{% endif %} | ||
{% endif %} | ||
<a class="" href="/privacynotincluded/products/{{ product.slug }}"> | ||
<div> | ||
<img src="{{mediaUrl}}{{"AWS_LOCATION"|env}}/{{product.image }}"> | ||
</div> | ||
</a> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.