When a pledge is selected but the auth token is missing/incorrect, show the email form. Like on the pledge page, submitting the correct email will trigger a new auth token + link to be emailed to the pledge manager. This makes for a clearer path for re-requesting a valid link.
Fixes#114
* Rename generic "frontend" file to dialog
* Add a "remove pledge" action
* Process pledge deactivation
* Trigger an email on user-initiated pledge deactivation
* Show an error when trying to manage a deactivated pledge
* Add a label for "deactivated" pledges
This adds the ability to deactivate/reactivate pledges from the wp-admin list table. Once deactivated, the pledge is removed from the "published" list, as if it were trashed. It is not rendered in the frontend pledge list either. You can still access the edit screen, but no edits can be made (saving the pledge is disabled by JS, as otherwise it would reactivate itself). This way we can remove a pledge, but still see the activity log.
Fixes#112
* Add contributor management to manage form
* Check `pledge_id` to prevent returning all contributors
* Return a plain text error string – this is used in an alert box, so it can't contain HTML
* Hide confirmation when pledge is a draft
* Only enqueue script if the user is authorized
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
This broadly enables & styles the pledge forms across the frontend and wp-admin.
- Switches field `readonly` control to a variable called `$readonly`
- Create `PledgeMeta\get_pledge_meta()` which will fetch data from `$_POST`, a pledge post, or defaults.
- Add Number of Employees field
- Update form content to match mockup:
- fields now have help text
- success message uses content from mockup
- logo field is moved to the "org info" section
- Style form in theme, add some similar styles to the admin
Fixes#7, fixes#28