Skip to content

Commit

Permalink
Updating fields for new share buttons. (#1121)
Browse files Browse the repository at this point in the history
* Updating fields for new share buttons.

* Fixing share progress csp
  • Loading branch information
ScottDowne authored Mar 2, 2018
1 parent a34c3ff commit 56b8254
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion env.default
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ XSS_PROTECTION=True
# CSP config

CSP_DEFAULT_SRC="'none'"
CSP_SCRIPT_SRC='self' 'unsafe-inline' cdn.optimizely.com https://www.google-analytics.com/analytics.js https://c.shpg.org/352/sp.js
CSP_SCRIPT_SRC='self' 'unsafe-inline' cdn.optimizely.com https://www.google-analytics.com/analytics.js https://*.shpg.org/
CSP_STYLE_SRC='self' 'unsafe-inline' code.cdn.mozilla.net fonts.googleapis.com
CSP_IMG_SRC=* data:
CSP_FONT_SRC='self' fonts.gstatic.com fonts.googleapis.com code.cdn.mozilla.net
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-28 21:39
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('campaign', '0003_auto_20180206_2116'),
]

operations = [
migrations.AddField(
model_name='petition',
name='share_email',
field=models.CharField(blank=True, help_text='Share Progress id for email button', max_length=20),
),
migrations.AddField(
model_name='petition',
name='share_facebook',
field=models.CharField(blank=True, help_text='Share Progress id for facebook button', max_length=20),
),
migrations.AddField(
model_name='petition',
name='share_twitter',
field=models.CharField(blank=True, help_text='Share Progress id for twitter button', max_length=20),
),
migrations.AlterField(
model_name='petition',
name='share_link',
field=models.URLField(blank=True, editable=False, help_text='Link that will be put in share button', max_length=1024),
),
migrations.AlterField(
model_name='petition',
name='share_link_text',
field=models.CharField(blank=True, default='Share this', editable=False, help_text='Text content of the share button', max_length=20),
),
]
22 changes: 21 additions & 1 deletion network-api/networkapi/campaign/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,33 @@ class Petition(models.Model):
share_link = models.URLField(
max_length=1024,
help_text="Link that will be put in share button",
blank=True
blank=True,
editable=False
)

share_link_text = models.CharField(
max_length=20,
help_text="Text content of the share button",
default="Share this",
blank=True,
editable=False
)

share_twitter = models.CharField(
max_length=20,
help_text="Share Progress id for twitter button",
blank=True
)

share_facebook = models.CharField(
max_length=20,
help_text="Share Progress id for facebook button",
blank=True
)

share_email = models.CharField(
max_length=20,
help_text="Share Progress id for email button",
blank=True
)

Expand Down

0 comments on commit 56b8254

Please sign in to comment.