Commit graph

8 commits

Author SHA1 Message Date
Kelly Dwan 60b5ca5d2a Manage Pledge: Enable Manage Form functionality
* 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
2019-11-26 13:08:42 -05:00
Jb Audras 0754ae0b28 Use a unique text-domain, wporg-5ftf (#110)
* 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
2019-11-23 13:24:37 -05:00
Ian Dunn bac15d21fc
Pledge Form: Improve placeholders for clarity.
* Make the usernames look more like realistic usernames.
* Add placeholders where specific formats are needed.
2019-11-02 08:14:22 -05:00
Kelly Dwan 2ec665bcbb
Pledge Form: Don't show logo upload field in wp-admin
In wp-admin, the logo should be managed with the featured image UI.
2019-10-28 13:33:44 -04:00
Kelly Dwan f9d4a0bd59
Create a Pledge: Upload a logo (#45)
* 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
2019-10-28 11:47:56 -04:00
Corey McKrill 838a490776
Pledge: Count number of confirmed contributors instead of using arbitrary number input (#52)
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
2019-10-25 13:39:13 -07:00
Kelly Dwan 0f675ae6c3
Create Pledge: Make form functional (#31)
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
2019-10-08 18:29:35 -04:00
Corey McKrill ded645fabc
Plugin: Refactor to use as foundation for planned pledge workflows (#23)
This starts to address several items in the roadmap, but probably doesn't fully address any of them. It takes the plugin code that was written several months ago, before the scope of this project was fully sorted out, and refactors it to be a starting point for the roadmap.

* Adds template files for form inputs that can be used to both create new pledges and manage existing pledges
* Does some validation and sanitization work on form submissions
* Adds a custom post status for deactivated pledges
2019-10-04 12:35:02 -07:00