Commit graph

171 commits

Author SHA1 Message Date
Ian Dunn dc8ef43ebd
Remove links to non-existent locale variants.
Fixes #76
2019-11-04 13:04:17 -06:00
Melissa Ashforth c7e329ec32
Pledge List: Remove unused prototype.
Fixes #62
Closes #79
2019-11-03 15:14:03 -06:00
Caleb Burks 1576a18d24 Disallow create_posts for the Pledges and Contributors (#78)
Pledges and contributors should not be creatable from the normal WP UI "Add New".

Fixes #77 
Props icaleb
2019-11-03 14:21:16 -06:00
Ian Dunn 11b9bf3604
Pledge List: Sort randomly by default for fairness.
See #70
2019-11-02 13:26:22 -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 f55054f56c
My Pledge List: Add the My Pledges header to logged out views 2019-11-01 16:09:29 -05:00
Ian Dunn fe437cc880
My Pledges: Hide menu item when logged out. 2019-11-01 15:37:49 -05:00
Ian Dunn b3d52c8719
Pledge Meta: Clarify function/job names. 2019-11-01 04:24:11 -05:00
Ian Dunn 2686c9873b
Pledge Meta: Add cron to update all cached pledge data.
Fixes #71
2019-10-31 21:41:35 -05:00
Ian Dunn 87eb8ec43a
Pledge Log: Capture email events. 2019-10-31 20:39:57 -05:00
Ian Dunn 33d3bc1933
Pledge List: Show hours because it's a more meaningful statistic. 2019-10-31 16:27:27 -05:00
Corey McKrill 7273057950
Pledge: Update wording of pledge confirmation email 2019-10-31 14:39:17 -05:00
Corey McKrill dd4c08d87b
Pledge form: Add ID to form messages and hash to form action
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
2019-10-31 12:49:47 -05:00
Ian Dunn 5c50b1fcc6
My Pledges: Prompt to fill out profile data if haven't already. 2019-10-31 11:08:04 -05:00
Ian Dunn 069dcc8c20
Pledge Form: Ask for updates to w.org profiles to get needed data. 2019-10-31 07:27:58 -05:00
Ian Dunn 00e88cc2de
Pledge Form: Always insert user_login for consistency.
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
2019-10-30 23:30:34 -05:00
Ian Dunn e61ce467cb
Pledge Form: Allow HTML within descriptions.
Fixes #63
2019-10-30 13:32:32 -07:00
Ian Dunn 782a40bcda
Pledge Form: Improve contributor username field UX. 2019-10-30 13:10:21 -07:00
Ian Dunn df78e3de80
Pledge Form: Also allow user_nicename to improve UX.
Fixes #57
2019-10-30 13:10:20 -07:00
Kelly Dwan 0b26fad482
My Pledges: Update styles and format to match design
- 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
2019-10-30 13:24:48 -05:00
Corey McKrill 454962522d
Re-enable logo validation
It was disabled for testing, and I forgot and committed it. 🤦
2019-10-29 17:22:11 -07:00
Corey McKrill 14109a1b3e
Pledges: Add columns to pledge list table
It's useful to have some at-a-glance info about pledges when scrolling
the list table.
2019-10-29 17:18:52 -07:00
Corey McKrill 83125dd8b2
Update pledge UI and email copy (#64)
Fixes #61
2019-10-29 16:37:14 -07:00
Kelly Dwan 9f47f83ef4
Pledge CPT: Remove "has contributors" check from the single pledge view 2019-10-29 18:09:44 -05:00
Ian Dunn 858d70b045
My Pledges: Mark up page with live data.
See #56
2019-10-29 12:54:13 -07:00
Corey McKrill 5c5ae83287
Plugin: Add a system for logging events related to pledges and contributors (#54)
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
2019-10-29 12:46:13 -07:00
Ian Dunn 6209060eb2
Pledge List: Re-enable condition to only show staffed pledges.
Closes #43
2019-10-29 11:20:08 -07:00
Ian Dunn 189c61bfe8
Flip placeholder pending status to publish now that testing done. 2019-10-29 10:15:22 -07:00
Ian Dunn f409dbd3a6
XProfile: Return early when no contributors to avoid error. 2019-10-29 10:08:26 -07:00
Kelly Dwan 310a6876de
Pledge Form: Use slightly more screen reader friendly link text 2019-10-28 20:10:53 -04:00
Kelly Dwan aa8b1838cd
Pledge Form: Use agreement text as label content
This calls more attention to the agreement text, and correctly associates it with the input for screen reader users.
2019-10-28 20:09:38 -04:00
Ian Dunn 67958d9a1a
Contributors: Create functionality for My Pledges page.
This don't add the styling yet, just the functionality.

See #56
Fixes #51
Fixes #30
2019-10-28 12:08:21 -07:00
Corey McKrill dbdcf26bd9 Theme: Single pledge view (#43)
* 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
2019-10-28 13:38:49 -04: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
Ian Dunn 3f774fdb78
Pledge Form: Add ability to resend pledge confirmation email.
Fixes #49.
2019-10-26 22:18:28 -07:00
Ian Dunn 63f718bd9a
Pledge Form: Apply coding standards. 2019-10-26 11:00:03 -07:00
Ian Dunn c10699f97c
Contributors: Add ability to resend confirmation email.
Fixes: #50.
2019-10-26 10:59:06 -07:00
Ian Dunn 62f5335b51
Pledge: Email contributors for confirmation when pledge published.
Fixes #12
2019-10-26 10:55:00 -07:00
Ian Dunn 438173c10f
Email: Add notes about auth tokens. 2019-10-26 10:11:45 -07:00
Ian Dunn ff9767f478
Pledge: Correct action to prevent invalid early return.
This bug was introduced in 5ffca9420f, and prevented pledges from being updated when submitting via wp-admin.

See https://github.com/WordPress/five-for-the-future/pull/46#discussion_r339273741
2019-10-26 09:07:23 -07:00
Ian Dunn c4f2fe58ab
Pledge Form: Make email naming consistent.
This helps distinguish between _pledge_ and _contributor_ emails, and _verifying_ auth tokens and _confirming_ pledges.
2019-10-26 08:23:41 -07:00
Ian Dunn 35fa99324e
Email: Compare token with hash_equals() to mitigate timing attacks.
Props timothyblynjacobs
See #46
See https://make.wordpress.org/meta/2019/10/25/security-review-of-authentication-tokens/
2019-10-25 13:50:53 -07: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 553247cbf7
Pledge List: Display pledges in list with sort and search ability (#33)
* 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
2019-10-25 16:34:46 -04:00
Kelly Dwan f47024efda
Contributors: Check if a pledge exists before displaying the pledge name
If somehow a pledge is deleted, the contributors listing in wp-admin shows an error trying to display the linked pledge.
2019-10-25 16:21:33 -04:00
Ian Dunn 5ffca9420f
Email: Send pledge confirmation with authentication token. (#46)
Email: Send pledge confirmation with authentication token.

Fixes #34.
Fixes #10.
2019-10-25 12:07:09 -07:00
Ian Dunn 284e616c84
Pledge Form: Clarify that we're asking for WordPress.org usernames. 2019-10-25 07:57:33 -07:00
Corey McKrill 847e99f44e
Pledge Form: Hide 'manage existing pledge' link for the time being 2019-10-24 21:04:44 -07:00
Corey McKrill 59713ca0f1
Pledges: Move contributor management UI to separate file (#47)
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.
2019-10-24 20:06:47 -07:00
Ian Dunn 6fe5a92c7b
Composer: Document why PHPUnit 7 is used instead of 8. 2019-10-24 16:22:55 -07:00
Ian Dunn f888fd85c8
Apply coding standards. 2019-10-24 08:12:55 -07:00
Ian Dunn 33d8ed54b1
Pledge Form: Encourge group email addresses for perennial access.
Also, clarfy that the field is referring to an address, rather than a piece of email.
2019-10-24 08:12:55 -07:00
Ian Dunn 6b33c4dbd0
Pledge Form: Update string to reflect latest flows.
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.
2019-10-24 08:12:55 -07:00
Ian Dunn 8020e43fb9
Pledge Form: Use relative link for cross-environment compatibility. 2019-10-24 08:12:55 -07:00
Ian Dunn c527b5f8a0
Composer: Warn about bug in test watcher interactive mode. 2019-10-24 08:12:48 -07:00
Ian Dunn eec9f5cb61
Tests: Setup PHPUnit and PHPUnit Watcher. 2019-10-23 14:27:26 -07:00
Corey McKrill 65bd3ad5af
Pledge form: Add a blurb for the "Agree" checkbox (#44)
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
2019-10-23 13:47:15 -07:00
Ian Dunn 427cacc87c
Directory: Rename to refect current file structure. 2019-10-22 13:44:15 -07:00
Corey McKrill 266ba447b4
Add a Contributor custom post type (#42)
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
2019-10-21 15:43:20 -07:00
Ian Dunn 2927532544
Pledges: Rename input field to match handler expectation.
Previously the field wasn't being saved when a new pledge was created.
2019-10-21 13:34:14 -07:00
Ian Dunn fff279aa34
Pledge: Temporarily disable capability checks to enable development. 2019-10-21 13:34:14 -07:00
Ian Dunn cc5303fa11
Pledges: URL encode JSON data to avoid i18n character issues. 2019-10-21 13:34:14 -07:00
Corey McKrill 609ff42620
Pledge form: Add todo list on manage form 2019-10-21 11:10:55 -07:00
Corey McKrill 9c08692d5d
New Pledge: Validate submitted form values and generate a draft pledge post (#35)
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
2019-10-18 16:56:21 -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
Kelly Dwan 0111c36db4
Move comments to issues 2019-10-08 12:16:17 -04:00
Kelly Dwan bd9019556b
Auto-fix some PHPCS errors 2019-10-08 11:21:50 -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
Corey McKrill 9bf2f9dd1a
Update company to pledge, some code cleanup 2019-09-30 17:04:49 -07:00
Corey McKrill 697a4b2329
Add 5ftf plugin from https://github.com/coreymckrill/5ftf 2019-09-27 17:41:19 -07:00