Giter Site home page Giter Site logo

whitehouse / petitions Goto Github PK

View Code? Open in Web Editor NEW
1.1K 194.0 334.0 15.09 MB

Drupal installation profile powering We The People at petitions.whitehouse.gov

Home Page: https://petitions.whitehouse.gov/

PHP 39.64% CSS 14.18% JavaScript 43.78% Shell 0.01% Ruby 0.05% HTML 1.72% CoffeeScript 0.61% ApacheConf 0.02%

petitions's Introduction

We The People petitions application

Drupal 7 code base used to build an application that lets users create and sign petitions.

This application is under active development and will continue to be modified and improved over time. The current release is an "alpha." (see “Roadmap” section below).

Goals

President Obama is committed to creating the most open and participatory government in our nation’s history, and this petitioning platform is a key part of that initiative. In September, 2011, the White House launched We the People, a powerful and simple way to petition the Obama Administration to take action on a range of issues. If a petition gathers a minimum number of signatures in a defined amount of time, policy officials review it and publish an official response.

Among our commitments, we’re launching a new online tool -- called “We the People” -- to allow Americans to directly petition the White House, and we’ll share that technology so any government in the world can enable its citizens to do the same.

-- President Barack Obama, September 20, 2011

Releasing the source code for this application is meant to empower other governments and organizations to use similar petitioning platforms to engage their own citizens and constituencies. In addition, public review and contribution to the application’s code base will help strengthen and improve the platform.

Requirements

  • Drupal 7.x
  • MySQL 5.x
  • PHP 5.2+

Recommended:

  • RAM +512 M

Usage

Site visitors can create a user account, log in, and create petitions. Petition creators can share the URL for their petition to generate signatures. When the petition crosses a certain threshold, the petition becomes "public" and is listed as an open petition on the site's "open petitions" page.

Visitors can sign petitions. Petitions that receive a designated number of signatures (at the White House the number is 100,000 in one month) get a response.

For installation instructions, see INSTALL.md.

NOTE: Setting up the application and configuring it for use in your organization’s context requires Drupal development experience. The application ships with a similar design (theme) to what is used on petitions.whitehouse.gov and needs to be customized for use by others using standard Drupal 7 themeing conventions. The application also ships with various user interface elements, user account settings, and other configurations that users should expect to customize using standard Drupal 7 techniques and conventions.

Roadmap

We the People is a work in progress and currently exists at a very basic level of functionality. Priorities for future development are detailed below.

The following descriptions are for informational purposes only and should not be interpreted as commitments or guarantees of future code releases in any way.

Install Profile

The codebase is released as-is and currently supports a specific, standalone website. In the future we would like to provide an install profile that supports a wider range of applications.

Generic Theme

The current codebase replicates the theme used on the White House website. In the future, we would like to provide a generic, "white label" Drupal 7 theme.

Improved Social Media Integration

The current platform allows basic sharing of petitions, responses and other content on the site via social media platforms like Facebook and Twitter. In the future, we would like reduce the friction of signing a petition by making it possible to sign a petition in the context of a social network (e.g. by “liking” an object on facebook).

Contributing

Anyone is encouraged to contribute to the project by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.)

By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Gnu General Public License v2 or later.

All comments, messages, pull requests, and other submissions received through official White House pages including this GitHub page are subject to the Presidential Records Act and may be archived. Learn more http://WhiteHouse.gov/privacy

License

This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105.

The project utilizes code licensed under the terms of the GNU General Public License and therefore is licensed under GPL v2 or later.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

petitions's People

Contributors

benbunk avatar bjaspan avatar bryanbraun avatar ethanteague avatar fmizzell avatar grasmash avatar ian-rose avatar marianoasselborn avatar maxwellhansen avatar nfitzsimmons avatar pborreli avatar robertfoleyjr avatar sheldonrampton avatar swirtsjw avatar theneonlobster avatar traviscarden avatar weitzman avatar welschp avatar wh-newmedia avatar xpsusa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

petitions's Issues

Localization

Are you planning on having any localization features and functionality for Spanish and other languages?

If so, will you have an XML for easy translation or will you be using any services to crowdsource this functionality?

Include all petitions in the bulk download

Only petitions with at least 150 signatures are included in the bulk download (SQL) file at present. That limits substantially the value of that bulk download, although I appreciate that there are many purposes for which it's best not to bother with petitions that get virtually no signatures. Provide an alternate bulk download that includes all petitions.

Factual information in successful petitions is ignored

Steps to repeat:

  1. Create a petition pointing out a number verifiable facts related to something wrong with government or how America is run.
  2. Get many signatures, enough to cross the current petition threshold.
  3. Receive a letter from the White House blatantly ignoring or contradicting the factual information in the petition, and explaining the pre-existing position of the administration.
  4. Have approximately the same petition be repeated periodically, because people are still upset about the issue because the White House hasn't actually done anything about the issue.

For example

https://petitions.whitehouse.gov/petition/abolish-tsa-and-use-its-monstrous-budget-fund-more-sophisticated-less-
intrusive-counter-terrorism/c7L94bFB?utm_source=wethepeople&utm_medium=response&utm_campaign=tsa

Petition body:

"It has failed approximately 70% of undercover efficacy tests, and for all its excesses, has been unable to catch even a single terrorist since its creation."

Petition response:

"Over the past 10 years, TSA has strengthened security by creating successful programs and deploying technologies that were not in place prior to September 11, while also taking steps whenever possible to enhance the passenger experience."

What is the branch for the mysql only version?

On the README, you mention working on it, but I didn't find (or didn't understand) which of the branch is the one where it happens.

And the usual PITA question of the FLOSS world: ETA?

Password reset bug

Password reset did not work for me with Apple's Safari browser, version 7.0.3. It did use the one time login to get me logged in, but did not present the password reset form. It took me right to petitions. I don't know if this was because I had visited a direct link to a petition prior to needing a password reset or if it's just a bug with some JavaScript somewhere that doesn't work with Safari.

Further, I could not find the password reset or user "screen" from the dashboard or petitions area and I also could not find a link to report a bug as an end user. Had I not thought to click on developers (being a programmer myself), I would not have ever found this github repo.

Feature: Ability to request multiple petitions (by id) in one request

I am developing an iOS app in which the user will watch/follow many petitions. I need a way to request multiple petitions in one request for easier implementation and less network overhead on their phones and We the People's servers.

In my app, there is maintained a list of petition id's which the user is watching. I want to be able to specify multiple id's of the petitions I want in one API request. That way, I won't have to worry about exceeding my 10 request/second limit, and the We the People servers will not be bogged down with around 50 requests each time my users want to view their favorite petitions. Instead, one request would be sent.

An example request may look like the following:
https://api.whitehouse.gov/v1/petitions.json?&id=1234&id=5678.

...or even
https://api.whitehouse.gov/v1/petitions.json.&id=1234%205678

This functionality is critical to the performance of my app.

Why not just cache every petition and filter among those cached petitions?
I don't want to cache every single petition on the device and simply filter from among those. Users follow petitions in order to stay up to date with petitions. So, this doesn't make sense to cache petitions on which users want to stay up to date. API requests will nonetheless have to be made whenever the users view their followed petitions. So, under the current design, users will ask the We the People API for 1000-2000 petitions at once rather than ~20-100.

This seems to make sense for both the clients and We the People servers regarding network performance and optimization.

User accounts can't change their location after creation

On petitions.whitehouse.org, whenever I sign a petition I am listed as being from Berkeley, CA. I do not live in Berkeley; in fact, I've moved three different times since my We the People account was created. But there is no way to change your location or other account information after the fact, at least that I've ever been able to find! This seems like a tremendous oversight, given how often people move.

If there is a user-facing way to do this, a second feature request should be opened for making that functionality more prominent, or visible at all.

Sorry, the profile you have chosen cannot be loaded.

At Step 5,
After select profile 'petition' and select language,
installer shows only message 'Sorry, the profile you have chosen cannot be loaded.' without progress.

Surely, 1,2,3,4 steps went well, and I checked 'phpinfo' for mongodb and mysql extentions.

confirmation email seems to ignore hyphenated domain names

Not sure if that's the specific issue or not, but my domain with a hyphen in the name (hosted via google apps) is unable to receive any sort of confirmation or password-reset emails from the whitehouse petitions website.

This has the effect of preventing me from registering.

When attempting to re-register, the system confirms that an account exists with my email address (and claims to send verification emails when I request them).

Plaintext signature confirmation email contains broken link

In the plaintext version of the email with the subject line Action Needed: Verify your signature, there are a number of links starting with http://mandrillapp.com/track/click/. The first of these links is to complete the verification process.

Following this link brings me to a page with the following text:

The page you're looking for is currently unavailable to view
We've been upgrading our site. It is possible that this page has been moved or renamed. You can use your browser's Back button to return to the previous page, go to the homepage, or you can browse or search for the information you're looking for.

If you think that you have reached this page due to an error on our part, please let us know.

Also, the top of the plaintext email contains css at the top, which should only be for the HTML version of the email.

Transparently present existing and pending reponses

There should be a way to browse all petitions eligible for response sorted by how long these responses are overdue.
There should also be a way to browse responses that were given (if I understand correctly, the only way to get to a response is if from the page of the petition that requested it), and also enable sorting them by how long they took to answer.
This information can make the petition system's effect on the White House measurable - especially if it's also made available in machine readable form (see #44).

installation / Drush

I'm not familiar with Drush and get stuck on step 4.

  1. Use Drush make to download contrib projects like this:
drush -y make --no-core --contrib-destination=. drupal-org.make

I keep getting this response:

Make new site in the current directory? (y/n): y
file_get_contents(drupal-org.make): failed to open stream: No such file or directory make.utilities.inc:456    [warning]
Invalid or empty make file: drupal-org.make          

I've had very little luck finding the answer with a web search. Any information would be helpful. thanks!

installation issue

Form some reason the step 5 is not working as expected for me:

  1. Follow the normal Drupal installation process. When prompted to select a profile, select "Petitions". Drupal will rewrite your settings.php file. After it does, you will be prompted to add a snippet like this to the end of settings.php. Do this before you visit your site, otherwise Drupal will be unhappy:

I did not find a step on the web installer where its prompts me to add the mongo config lines. I arrived to the normal db selection and mongo is not one of the options. I assume I dont have to seup anything here because mysql and other wont be needed.

Yes, when a profile was asked on the instatter (first one) I did choose petitions.

Please tell me what I am doing wrong.

Geocode and expose an API endpoint for geosearches

When a petition is created, identify any place names within it and store their coordinates (such as with Yahoo Placefinder). Then expose those coordinates as a part of the JSON, and permit proximity searches. Likewise, when a petition is signed, geocode that using a free ZIP centroid database (e.g., 1, 2, 3), and expose those in the same manner. This will enable a variety of location-based services based on We The People data.

Bug when trying to creat a new petition (404 error) --re: issue #48

I've downloaded drupal 7.24 and petitions 7.x-2.0-beta19. Everything seemed to worked smoothly during installation and a clone of the Whitehouse Petitions website is available.

However, petitions cannot be created since a 404 error is produced when trying to access "/petitions/create" within the iframe.

I've seen that this very same issue has been reported before (#48). However, the issue appears as closed and this pull request is provided as a solution (#49).

Unfortunately, changing the file wh_petitions.form.inc with the version provided in pull request 49 does not solve the problem but, instead, produces a new one. The whole page is loaded into the iframe and the petition is still not created.

Export petition data?

I don't use Drupal and haven't used this module, and this may be more of a MongoDB issue or feature, but I see a need to be able to export the petition data - name, city, state, date and signature # - to a CSV file or other export format.

Is there already a feature within the Drupal module for this? Is this a possible feature for a future version? Once the module uses MySQL?

Right now, I'd like to be able to download datasets from some of the current petitions for research. Yes, as data sets, the petitions have problems in sampling, anonymity, verification of users, etc. But still, it would be nice to export or download the data of a petition.

Missing schema cache_petitions_api_keys

Failure when trying to run petitions_install1:

WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'petitions.cache_petitions_api_keys' doesn't

It appears there was no cache_petitions_api_keys table created during install.

install error - unknown type list_text

During install (install profile step) I am getting the error bellow. The list module does exist in modules/field/modules/list and this is a fresh Drupal and Petitions download as of today. OSX, PHP5.4, MySQL5.5, Mongo2.4.7 Any ideas would be appreciated, Thanks!

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://localhost/install.php?profile=petitions&locale=en&id=1&op=do StatusText: OK ResponseText: Home | Drupal @import url("http://localhost/modules/system/system.theme.css?0"); @import url("http://localhost/modules/system/system.messages.css?0"); @import url("http://localhost/modules/system/system.menus.css?0"); @import url("http://localhost/modules/system/system.base.css?0"); @import url("http://localhost/modules/field/theme/field.css?0"); @import url("http://localhost/modules/node/node.css?0"); @import url("http://localhost/modules/user/user.css?0"); @import url("http://localhost/profiles/petitions/modules/contrib/views/css/views.css?0"); @import url("http://localhost/modules/system/system.admin.css?0"); @import url("http://localhost/modules/system/system.maintenance.css?0"); @import url("http://localhost/profiles/petitions/modules/contrib/ctools/css/ctools.css?0"); @import url("http://localhost/themes/seven/reset.css?0"); @import url("http://localhost/themes/seven/style.css?0"); Home Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure site Finished Attempt to create a field of unknown type list_text.

Document Failure States for Petitions API

During the fall of 2013 government shutdown the WeThePeople Petitions API was unavailable.

The service endpoint returned a correctly parsing JSON file with an error message about the shutdown. However the returned JSON was in an undocumented format, so while it was human readable, services using the feed silently failed. (Which is desired behavior).

Can we get added to the documentation the service status message so it can be presented to end users in case of further issues?

Thanks and welcome back guys.

missing petition_install modules - step 6

the modules mentioned in step seem to be missing

$drush en -y petition_install1
petition_install1 was not found and will not be enabled. [warning]
There were no extensions that could be enabled. [ok]

$ drush en -y petition_install2
petition_install2 was not found and will not be enabled. [warning]
There were no extensions that could be enabled. [ok]

$ drush en -y petition_install3
petition_install3 was not found and will not be enabled. [warning]
There were no extensions that could be enabled. [ok]

$ drush en -y petition_install4
petition_install4 was not found and will not be enabled. [warning]
There were no extensions that could be enabled. [ok]

step 7 (if there is any) is also missing from the installation instructions

Error on installing petition_install2

Initial install seemed to be working, and petition_install1 proceeded normally. The site itself still functions despite this error, but presumably one of the rules configurations is incomplete.

A quick Google suggests we might need this patch: https://drupal.org/node/1952170 or possibly it might also be a dependency issue: https://drupal.org/node/1412452.

drush en -y petition_install2
The following extensions will be enabled: petition_install2, wh_user_ss_data, wh_response_feature, wh_petition_page, taxonomy_sync, petitions_user_registration, petitions_logintoboggan_settings
Do you really want to continue? (y/n): y
Creating default object from empty value entity.module:660                                                                          [warning]
WD rules_config: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO        [error]
{rules_config} (name, status, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
(
    [:db_insert_placeholder_0] => rules_user_validate_redirect
    [:db_insert_placeholder_1] => 2
    [:db_insert_placeholder_2] => petitions_user_registration
)
 in drupal_write_record() (line 7136 of /home/owen/workspace/petitions/includes/common.inc).
WD php: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO {rules_config}  [error]
(name, status, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
(
    [:db_insert_placeholder_0] => rules_user_validate_redirect
    [:db_insert_placeholder_1] => 2
    [:db_insert_placeholder_2] => petitions_user_registration
)
 in drupal_write_record() (line 7136 of /home/owen/workspace/petitions/includes/common.inc).
Cannot modify header information - headers already sent by (output started at /home/owen/workspace/drush/includes/output.inc:38)    [warning]
bootstrap.inc:1212
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO {rules_config} (name, status, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
(
    [:db_insert_placeholder_0] => rules_user_validate_redirect
    [:db_insert_placeholder_1] => 2
    [:db_insert_placeholder_2] => petitions_user_registration
)
 in drupal_write_record() (line 7136 of /home/owen/workspace/petitions/includes/common.inc).
Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]

Move from using a Profile to a Suite of modules

This feature set would be better served as a suite of modules a la Ubercart.

That way the petition system can be used in conjunction with other profile distros out there or added to established sites. The way installation works as it is such that you can't have more than one install profile running at a time, so keeping this suite of modules in a profile context limits use in other scenarios. If you want to be able to default configure the setup just add a one-button "set me up" under an administration page.

Provide an embeddable thermometer showing how many signatures a petition has

Individual petitions should provide an embeddable thermometer that petition creators, and signers, can display on their own sites.

It should display:

  • The petition's headline and creation date
  • The signature threshold and deadline
  • How many signatures the petition has
  • How many it needs to reach the response threshold
  • Buttons to share the petition via Twitter and Facebook
  • A link to click and view the petition
  • The option of retrieving the embed code from the embed itself

The embed should be small enough to be embedded on most blog posts (e.g. roughly 500px x 300px).

The petitions data necessary to do this can be retrieved using the We the People API. Sheldon Rampton built a thermometer Drupal module at the first White House hackathon and several other hackathon participants have done similar work, including Douglas Back's Widget the People.

Example:

thermometer-example

Sidebar clashes with footer at the bottom of /petitions and specific petition pages

  1. Navigate to https://petitions.whitehouse.gov/petitions or navigate to specific petition (e.g. this one)
  2. Scroll to bottom of page
  3. Expand a sidebar section if there isn't one expanded already, e.g. Recent Petitions

Expected: Footer section should be completely in the foreground, sidebar should disappear underneath
Actual: Parts of the sidebar are in the foreground, and parts of the footer are in the foreground, creating a very sloppy effect!

snapshot 6 22 13 2 59 pm

Provide an embeddable map showing where signatures for a petition come from

Individual petitions should provide an embeddable map that shows where its signatures come from based on the associated zip code. The embed should be small enough to be embedded on most blog posts (e.g. roughly 500px x 300px).

Additional requirements / options TK.

Several participants at previous White House hackathons have worked on mapping projects based on data from the We the People API. These projects include Catherine D'Ignazio's We the People Map and Mick Thompson Where the People, both of which are available on GitHub.

Case-insensitive search terms

It appears that the text-based arguments (title and body for sure) for the API are case-sensitive (e.g. "Freedom" != "freedom"). This means that searches for petitions with "guns" in the title will be different than those for "Guns" as shown below:

https://api.whitehouse.gov/v1/petitions.json?title=guns&limit=1

{"metadata":{"responseInfo":{"status":200,"developerMessage":"OK"},"resultset":{"count":5,"offset":0,"limit":1},"executionTime":0.049998},"results":[{"id":"50e0abe3c988d4dd53000022","type":"petition","title":"Tax sales of guns and ammunition","body":"We request that Congress and the President institute a federal sales tax on guns and ammunition.  Revenue from the tax should be used to pay for enforcement of existing gun laws, improved mental health care, gun safety programs, violence prevention programs, a national firearms injury/mortality database, and a compensation fund for victims of gun violence.","issues":[{"id":"3","name":"Budget and Taxes"},{"id":"10","name":"Criminal Justice and Law Enforcement"},{"id":"22","name":"Firearms"}],"signatureThreshold":25000,"signatureCount":3393,"signaturesNeeded":21607,"url":"https://petitions.whitehouse.gov/petition/tax-sales-guns-and-ammunition/HQQmBzW1","deadline":1359493347,"status":"closed","response":null,"created":1356901347}]}

https://api.whitehouse.gov/v1/petitions.json?title=Guns&limit=1

{"metadata":{"responseInfo":{"status":200,"developerMessage":"OK"},"resultset":{"count":3,"offset":0,"limit":1},"executionTime":0.03},"results":[{"id":"50f62a5d6ce61ca803000007","type":"petition","title":"Impeach President Barack Obama if Executive Orders are signed to ban Assault Rifles, Guns & High Capacity Magazines","body":"The Vice President has made it clear that 19 Executive Orders could / will come about if an Assault Rifle / High Capacity Magazine ban is not passed through the House. This is a violation of our 2nd Amendment. I propose that our elected officials Impeach President Barack Obama if he signs executive orders to take away this right to bear arms. Our 2nd Amendment was written to stand up against a tyrant government. Our government has F18s and F16s, we the people should be allowed a Semi Automatic Rifles to defend ourselves from a possible tyrant government take over. ","issues":[{"id":"22","name":"Firearms"},{"id":"193","name":"Government Reform"},{"id":"175","name":"Urban Policy"}],"signatureThreshold":100000,"signatureCount":8992,"signaturesNeeded":91008,"url":"https://petitions.whitehouse.gov/petition/impeach-president-barack-obama-if-executive-orders-are-signed-ban-assault-rifles-guns-high-capacity/rVVBsPhM","deadline":1360901981,"status":"closed","response":null,"created":1358309981}]}

I would expect that these two queries would return the same results.

Provide a per-signer endpoint

We the People tracks individual signers internally, but only exposes each signature via the API. For the signatures endpoint, provide each signer's unique ID, and then provide a new endpoint for a query about that signer, to display the same data as in the existing signature query, but for every petition that they have signed.

No testing

The only test code provided is some selenium tests that test core drupal functionality. All code unique to your application should have associated tests with the code. Drupal provides a testing framework to do this via the simpletest module.

JSON "response" object contained in petition JSON should decouple presentation from White House

The JSON representing a petition needs to have a "response" object that decouples presentation from the White House website.

Presently, developers have no choice but to forward their users to the White House website in order to view this response.

"response": {
"id": "681",
"url": "https://petitions.whitehouse.gov/response/message-president-obama-about-your-petition-reducing-gun-violence",
"associationTime": "1355963976"
}

So in this case users would have to browse to https://petitions.whitehouse.gov/response/message-president-obama-about-your-petition-reducing-gun-violence to view the response.

Instead of being redirected to the White House website to view the response, developers should be able to present the response in their applications.

Below is how the "response" object should be formatted to facilitate custom presentation of White House responses to petitions.

"response": {
"id": "681",
"author": "Bruce Reed",
"authorBio": "Bruce Reed is Chief of Staff to Vice President Biden",
"authorThumbnailUrl": "http://urlToAuthorThumbnailPic"
"body": "In the days since the tragedy in Newtown, Americans from all over the country have called for action to deter mass shootings and reduce gun violence. Hundreds of thousands of you have signed petitions on the White House's We the People petitions platform....[shortened to be concise]",
"videoUrl": "http://www.youtube.com/watch?feature=player_embedded&v=u5ynVMBxOus",
"url": "https://petitions.whitehouse.gov/response/message-president-obama-about-your-petition-reducing-gun-violence",
"applicablePetitions": ["681", "682", "683"],
"associationTime": "1355963976"
}

Description of key JSON values:
-author: author of the response
-authorBio: brief description of the author
-body: the body of the response.
-videoUrl: url of the video response, if there is one. If there is no video response, this value could be null.
-url: url of the White House response hosted on WhiteHouse.gov in case developers wish to defer to the White House's presentation.
applicablePetitions: an array of petition id's which reference the petitions for which this response is applicable.

If it is decided that it doesn't make sense to store all of these values as part of the petition response, then developers should be able to make a request for this response resource that provides the key information listed above.

Add a button to clear the search field

It would be great to have an "x" button within the text field that clears the current search term. Currently, you have to select and delete or hit backspace.

snapshot 6 22 13 3 49 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.