Skip to content

Commit

Permalink
Include new rich_what and rich_why petition's fields
Browse files Browse the repository at this point in the history
  • Loading branch information
anero committed May 15, 2024
1 parent 197f6c5 commit 6de3687
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 8 deletions.
8 changes: 5 additions & 3 deletions source/includes/authenticated_api/_efforts.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Within the API, both Efforts and Landing Pages use the `efforts` URLs.
}
],
"what": "Stop selling pesticides containing neonicotinoids, which the EPA has found harmful to bees.",
"why": "Pollinators are important.",
"why": "<strong>Pollinators are important.</strong>",
"categories": "Environment",
"location": {
"venue": "Acme Hardware",
Expand Down Expand Up @@ -65,8 +65,10 @@ Within the API, both Efforts and Landing Pages use the `efforts` URLs.
"title": "Acme Hardware, Stop Selling Bee Poison!",
"updated_at": "2019-06-01T21:32Z",
"what": "Stop selling pesticides containing neonicotinoids, which the EPA has found harmful to bees.",
"rich_what": "<div>Stop selling pesticides containing neonicotinoids, which the EPA has found harmful to bees.</div>",
"who": null,
"why": "Pollinators are important.",
"rich_why": "<div><strong>Pollinators are important.</strong></div>",
"title_locked": false,
"what_locked": true,
"who_locked": false,
Expand Down Expand Up @@ -157,8 +159,8 @@ region[slug] | String | Unique identifier for an existing region this petition s
source | String | Optional, open-ended string representing where this petition came from | no; default is "API"
targets | List of 0-1 Target blocks ([see above](#json-type-target)) | Decision makers for this petition. If a block includes a `slug`, we’ll use it to look up an existing decision maker. Otherwise, we’ll try to create a new one. In a decision-makers-based effort, the specified decision maker will be added to the effort if it is not already associated with it. Any decision maker created this way will be set to "published". Specifying more than one decision maker is not yet supported. | no; default is no decision maker
title | String | Title of the petition. If a title is specified, it will be used, even if there is a different default. | yes, unless a default title has been specified for the effort/landing page
what | String | Text of the petition ask. If a value is specified, it will be used, even if there is a different default. | yes, unless a default "what" has been specified for the effort/landing page
what | String | Text of the petition ask in HTML format. If a value is specified, it will be used, even if there is a different default. | yes, unless a default "what" has been specified for the effort/landing page
who | String | Who the petition is addressed to. If a value is specified, it will be used, even if there is a different default. | yes, unless a default "who" has been specified for the effort/landing page or `targets` includes a decision maker
why | String | Text explaining why the petition is important. If a value is specified, it will be used, even if there is a different default. | yes, unless a default "why" has been specified for the effort/landing page
why | String | Text explaining why the petition is important in HTML format. If a value is specified, it will be used, even if there is a different default. | yes, unless a default "why" has been specified for the effort/landing page

<div></div>
14 changes: 9 additions & 5 deletions source/includes/authenticated_api/_petitions.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ Petition are pieces of content that can be signed by members.
"title": "No Taxes on Tea",
"updated_at": "1776-12-16T21:32Z",
"what": "Stop taxing our tea",
"rich_what": "<div>Stop taxing our tea</div>",
"who": "King George",
"why": "No taxation without representation!",
"rich_why": "<div><strong>No taxation without representation!</strong></div>",
"title_locked": false,
"what_locked": true,
"who_locked": false,
Expand Down Expand Up @@ -216,7 +218,7 @@ Get a paginated list of all petitions, including ones that are unlaunched or oth
"petition": {
"title": "No Taxes on Tea",
"what": "Stop taxing our tea",
"why": "No taxation without representation!",
"why": "<strong>No taxation without representation!</strong>",
"categories": ["Tax Policy", "End Colonialism"],
"creator": {
"first_name": "Patrick",
Expand Down Expand Up @@ -272,8 +274,10 @@ Get a paginated list of all petitions, including ones that are unlaunched or oth
"title": "No Taxes on Tea",
"updated_at": "1776-12-16T21:32Z",
"what": "Stop taxing our tea",
"rich_what": "<div>Stop taxing our tea</div>",
"who": null,
"why": "No taxation without representation!",
"rich_why": "<div><strong>No taxation without representation!</strong></div>",
"title_locked": null,
"what_locked": null,
"who_locked": null,
Expand Down Expand Up @@ -359,9 +363,9 @@ region[slug] | String | Unique identifier for an existing region this petition s
source | String | Optional, open-ended string representing where this petition came from | no; default is "API"
targets | List of 0-1 Target blocks ([see below](#json-type-target)) | Decision makers for this petition. If a block includes a `slug`, we’ll use it to look up an existing decision maker. Otherwise, we’ll try to create a new one. Any decision maker created this way will be set to "published". Specifying more than one decision maker is not yet supported. | no; default is no decision maker
title | String | Title of the petition | yes
what | String | Text of the petition ask | yes
what | String | Text of the petition ask in HTML format | yes
who | String | Who the petition is addressed to | yes, unless `targets` includes a decision maker
why | String | Text explaining why the petition is important | yes
why | String | Text explaining why the petition is important in HTML format | yes


<%= partial "includes/authenticated_api/json_type_location" %>
Expand Down Expand Up @@ -414,11 +418,11 @@ show_progress_bar | Boolean | Whether to show the signature progress bar on the
signature_count_add_amount | Integer | If set, the displayed signature total on the petition page will be this much higher than the actual number of signatures recorded by the platform. This is usually used to reflect signatures that were gathered elsewhere and cannot be added to the platform, or signers whose data has been anonymized. A negative number can be specified to subtract from the total.
title | String | Petition title
title_locked | Boolean | Petition creator cannot change the title
what | String | Petition text
what | String | Petition text in HTML format
what_locked | Boolean | Petition creator cannot change the "what" field
who | String | Name of the person this petition is targeting. Petitions associated with a decision maker will not necessarily use this setting.
who_locked | Boolean | Petition creator cannot change the "who" field
why | String | "Why is this important?" text
why | String | "Why is this important?" text in HTML format
why_locked | Boolean | Petition creator cannot change the "why" field

<div></div>
Expand Down
4 changes: 4 additions & 0 deletions source/includes/json/_category_petitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ $(document).ready(function(){
"title": "Let Dorothy Go Home!",
"who": " Oz, the Great and Terrible, Wizard",
"what": "Let poor Dorothy Gale go home to Kansas",
"rich_what": "<div>Let poor Dorothy Gale go home to Kansas</div>",
"why": "There's no place like home.",
"rich_why": "<div>There's no place like home.</div>",
"admin_status": "good",
"signature_count": 123,
"goal": 200,
Expand Down Expand Up @@ -81,7 +83,9 @@ $(document).ready(function(){
"title": "Repair the Yellow Brick Road",
"who": " Oz, the Great and Terrible, Wizard",
"what": "The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!",
"rich_what": "<div>The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!</div>",
"why": "The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.",
"rich_why": "<div>The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.</div>",
"admin_status": "good",
"signature_count": 223,
"goal": 500,
Expand Down
4 changes: 4 additions & 0 deletions source/includes/json/_effort_petitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ $(document).ready(function(){
"title": "Ossining: Support Drivers' Licenses For All",
"who": "Ossining Village Board of Trustees",
"what": "Pass a resolution in support of the Drivers' Licenses bill",
"rich_what": "<div>Pass a resolution in support of the Drivers' Licenses bill</div>",
"why": "Undocumented immigrants need access to drivers' licenses so they can drive to work, school, and everywhere else. This will improve road safety for everyone.",
"rich_why": "<div>Undocumented immigrants need access to drivers' licenses so they can drive to work, school, and everywhere else. This will improve road safety for everyone.</div>",
"admin_status": "good",
"signature_count": 223,
"goal": 500,
Expand Down Expand Up @@ -75,7 +77,9 @@ $(document).ready(function(){
"title": "Yonkers: Support Drivers' Licenses For All",
"who": "Yonkers City Council",
"what": "Pass a resolution in support of the Drivers' Licenses bill",
"rich_what": "<div>Pass a resolution in support of the Drivers' Licenses bill</div>",
"why": "Undocumented immigrants need access to drivers' licenses so they can drive to work, school, and everywhere else. This will improve road safety for everyone.",
"rich_why": "<div>Undocumented immigrants need access to drivers' licenses so they can drive to work, school, and everywhere else. This will improve road safety for everyone.</div>",
"admin_status": "good",
"signature_count": 300,
"goal": 500,
Expand Down
4 changes: 4 additions & 0 deletions source/includes/json/_featured_petitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ $(document).ready(function(){
"title": "Repair the Yellow Brick Road",
"who": " Oz, the Great and Terrible, Wizard",
"what": "The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!",
"rich_what": "<div>The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!</div>",
"why": "The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.",
"rich_why": "<div>The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.</div>",
"admin_status": "good",
"signature_count": 223,
"goal": 500,
Expand Down Expand Up @@ -92,7 +94,9 @@ $(document).ready(function(){
"title": "We Need More Bike Lanes",
"who": "My Mayor",
"what": "Build the bike lanes",
"rich_what": "<div>Build the bike lanes</div>",
"why": "Cyclists aren't safe.",
"rich_why": "<div>Cyclists aren't safe.</div>",
"admin_status": "good",
"signature_count": 5,
"goal": 100,
Expand Down
4 changes: 4 additions & 0 deletions source/includes/json/_partnership_petitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ $(document).ready(function(){
"title": "Let Dorothy Go Home!",
"who": " Oz, the Great and Terrible, Wizard",
"what": "Let poor Dorothy Gale go home to Kansas",
"rich_what": "<div>Let poor Dorothy Gale go home to Kansas</div>",
"why": "There's no place like home.",
"rich_why": "<div>There's no place like home.</div>",
"admin_status": "good",
"signature_count": 123,
"goal": 200,
Expand Down Expand Up @@ -81,7 +83,9 @@ $(document).ready(function(){
"title": "Repair the Yellow Brick Road",
"who": " Oz, the Great and Terrible, Wizard",
"what": "The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!",
"rich_what": "<div>The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!</div>",
"why": "The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.",
"rich_why": "<div>The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.</div>",
"admin_status": "good",
"signature_count": 223,
"goal": 500,
Expand Down
4 changes: 4 additions & 0 deletions source/includes/json/_petitions_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@
"ended_type": null,
"ended_reason": null,
"what": "The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!",
"rich_what": "<div>The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!</div>",
"goal": 500,
"signature_count": 223,
"creator_name": "Kristyn Arrighi",
"locale": "en",
"created_at": "2014-10-02T01:43:17Z",
"updated_at": "2018-05-07T15:38:39Z",
"why": "The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.",
"rich_why": "<div>The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.</div>",
"location": {
"query": "Land of Oz, Kensington Avenue, Buffalo, NY, United States",
"latitude": "42.9399637",
Expand Down Expand Up @@ -94,13 +96,15 @@
"ended_type": "won",
"ended_reason": "Yay, we defeated Saruman! ",
"what": "Stop cutting down the woods",
"rich_what": "<div>Stop cutting down the woods</div>",
"goal": 100,
"signature_count": 8780,
"creator_name": "Treebeard",
"locale": "en",
"created_at": "2016-10-25T18:40:42Z",
"updated_at": "2022-03-31T18:30:36Z",
"why": "Ents want a place to live in peace",
"rich_why": "<div>Ents want a place to live in peace</div>",
"location":
{
"latitude": "-26.3168162",
Expand Down
2 changes: 2 additions & 0 deletions source/includes/json/_single_petition.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ $(document).ready(function(){
"who": "Oz, the Great and Terrible, Wizard",
"what": "The Yellow Brick Road has been neglected; commit to repairing the damaged sections of the road in the next year!",
"what_format": "plain",
"rich_what": "<div>The Yellow Brick Road has been neglected; <strong>commit to repairing the damaged sections of the road in the next year!</strong></div>",
"why": "The Yellow Brick Road is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.",
"why_format": "plain",
"rich_why": "<div>The <em>Yellow Brick Road</em> is the main road connecting Munchkin Country to the Emerald City and in its current state it's impassable.</div>",
"created_at": "2014-10-02T01:43:17Z",
"updated_at": "2018-05-07T15:38:39Z",
"delivery_details": "We're off to see the wizard!",
Expand Down

0 comments on commit 6de3687

Please sign in to comment.