This fixes an issue where adding the button block classes to the pledge form was creating double-button styles. This also fixes a mistakenly removed class on the remove contributor button.
Follow up to 5d76b97557
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
This will disable the "join organization" button until the profile is complete, and add a second warning message to explicitly tell the user why the button is disabled.
* 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
Adding the `button` mixin into `input[type="submit"] caused conflicts with the other button classes (`.button-primary`) due to specificity. The button classes should be used on all buttons instead. This also updates which button on the Manage Pledge form is the "primary" action, since it's easy to skip the Update button when it's not primary.
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 the admin email field to the manage form
* Fix admin email processing: When the email is changed, the pledge needs to be set back to pending, until the email is re-confirmed
* Send confirmation emails for existing pledges to the "Manage Pledge" page
* Process the email confirmation & resending emails actions on both shortcodes
* Add a message for unconfirmed pledges
* 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
* Fix issue with fetching data in `get_pledge_meta` when no submission has been POST'd
* Rename to `subset`, since `context` is also used elsewhere
* Show form content when there are form errors
* Fix warnings on new pledge form
* Skip wpautop before save, so editors don’t need to edit HTML unless they want to
* Use a unique text-domain, wporg-5ftf
* Fix plugin i18n strings
* Remove unwanted text-domains from WPCS checks and fix missed old text-domains
* Remove type=array from phpcs
* Re-add type=array
* Small WPCS fix
* WPCS: replace var with
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 includes autofixes, along with some manual fixes; mostly syntax-related. Some `phpcs:ignore` comments were added for overzealous rules that don't apply.
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
- 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
* Allow image uploads
* Add the logo as "generated" meta
This will be attached after we've processed the `$_FILES` object into an upload.
* Load image into media library, attach to the submitted pledge as a featured image.
* Move where image handling happens so we can pass back errors
* Pass back error if upload fails
* Create a validation function to do basic checking of form data
* Move logo uploading to a separate function, and rely on core checks for mime & filesize checking
* Tweak function name to be more clear
* Remove bmp, tiff, and ico file types
This will be more accurate and avoid confusion that could arise if the self-reported "Number of Employees Being Sponsored" didn't match the number of confirmed contributors listed on the pledge.
Having that counted number stored in post meta is still useful, though, so this also adds/updates that number for a pledge whenever a Contributor post changes its status.
Fixes#48
Having both the input for adding a comma separated list of contributors
to a new pledge and the UI for managing the contributors on an existing
pledge in the same file was confusing and it conflated two different
pieces of functionality. It also caused `undefined index` errors in some
views because `'pledge-contributors'` only exists when submitting the
new pledge form.
The link that they're emailed is to confirm their address, rather than to manage the pledge.
Their pledge will be published once the address is confirmed and contributors have confirmed their participation, rather than after moderation.