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
* Theme: Create template part for single pledge
* Plugin: Add functions for handling xprofile data
* Plugin: Add helper function for getting contributor user objects
* Theme: Display aggregated contributor data on single pledge view
* Theme: Add functions, markup, and styles to show team badges
* Theme: Add badge for Test team
* Theme: Add tentative URL for report a pledge link
* Theme: Add support for post thumbnails
* Theme: Add org logo to single pledge view
* Theme: Update `$content_width` to 960
This matches the width of the content in the global header and
the About page.
* Move pledge template to a file used by the template heirarchy
* Clean up some PHPCS errors
* Move pledge structure out to just the list items
* Create file for single pledge styles
* style badge grid into a grid.
* Add a custom image size for the logo
* Update styles
* Un-hide pledges with no confirmed contributors
* Fix content width
* 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
* Use the post-type when choosing template partial
* Add pledge archive templates
* Style pledge list page
* Style individual pledge
* Use pledge featured image for the logo
* Fix aspect ratio of image
* Add real contributors to the pledges
* Enable sorting and searching of pledges
* Add pledge sorting markup
* Style the page header
* Restrict any pledges with no contributors from being shown on the frontend
* Update contributor count key name
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.
When submitting the form for a new pledge, the submitter must check a box to acknowledge that they understand and agree with the program expectations. The agreement blurb links to a separate page on the 5ftF site outlining what those expectations are.
Fixes#40
Contributors associated with pledges have a state: they can be confirmed or unconfirmed. They also have some important meta data, namely when they were confirmed. Thus, managing contributor data for pledges is more robust if we treat them as their own post type instead of as a multidimensional array of post meta data.
This also reorganizes some of the functions related to pledges so that things are more consistent between the pledge CPT and the contributior CPT.
Fixes#11
Ensures that a submission to the new pledge form has:
* A unique email address compared to existing pledges
* A unique domain in the URL, compared to existing pledges
* Has at least one valid contributor listed
Error messages when one or more of these conditions isn't met are descriptive so that the submitter can correct the issue.
Fixes#15
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
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