This updates the display of contributors into a table view, and adds the ability to add and remove contributors to existing pledges.
The display has been refactored to use JS templates & JSON contributor data– the data is output onto the page when loaded from the server, and rendered when the page finishes loading. Adding & removing contributors now submits to an admin-ajax.php endpoint, which, if successful, return the new list of contributors. This ensures the display is always up to date.
Fixes#3
* Split Auth functionality out to new file
* Move email-related code into the email file
* Use `assertFalse` for boolean assertions
* Add `can_manage_pledge` to check user or token against a given pledge
Pulled out of e9763f6678
* Remove duplicate test
* Tests: Move tests infrastructure, set up travis
Consolidates the composer files so we can run install once in travis.
* Return empty array if no values are $_POST'ed to the form
Fixes an issue with tests + null values in logs
* Clean up some naming & create helper functions for tests
* Debug travis
* Remove debug
* Fix notices on form
* Turn on multisite flag
This includes autofixes, along with some manual fixes; mostly syntax-related. Some `phpcs:ignore` comments were added for overzealous rules that don't apply.
`process_my_pledges_form()` is actually called on page load in `render_my_pledges()`.
So to prevent the unnecessary get_post() queries, let’s just return early if the form wasn’t really submitted.
See #87
This way when the form is submitted, the page loads at the location
where the success or error message will be shown, skipping the content
above the form.
Fixes#67
df78e3de80 started allowing `user_nicename`s in the form field, but we need to always create the contributor posts with the `user_login`, because there are many other places in the code that expect the `post_title` to be the `user_login` and not the `user_nicename`.
See #57
- Add a single-pledge view so we can separate out the pending from published
- Update layout and styles of my pledges list
- Adds link and danger button styles
Uses action hooks to capture relevant events as log entries on a per-pledge basis. This provides a running history of a pledge and can be used as an audit log if questions arise about changes to a pledge or there are weird bugs.
Fixes#39