Commit graph

163 commits

Author SHA1 Message Date
Kelly Dwan 75e2ca4f7b
Trim stray whitespace 2019-11-20 10:55:49 -05:00
Kelly Dwan d2f3fbe73a
Import correct namespace, use correct variable 2019-11-20 10:51:51 -05:00
Kelly Dwan 171c70e03e
Endpoints: Update handler to "manage contributors" 2019-11-20 10:44:18 -05:00
Kelly Dwan 4594c44597
Use new auth/email refactored code 2019-11-20 10:44:07 -05:00
Kelly Dwan 531e71a552
Hide the "resend confirmation" button on draft pledges
The confirmation hasn't been sent in the first place, so this button is misleading
2019-11-20 10:43:29 -05:00
Kelly Dwan d0dc2f0a14
Send contributors the confirmation email when created by the ajax endpoint
This will only send the email for published pledges.
2019-11-20 10:43:28 -05:00
Kelly Dwan f7a253027c
phpcs fixes
issues introduced in this PR
2019-11-20 10:43:28 -05:00
Kelly Dwan a53b074314
Indicate to screen readers that the message section will update 2019-11-20 10:43:28 -05:00
Kelly Dwan a67d2a45af
Support the unlikely case of no contributors 2019-11-20 10:43:28 -05:00
Kelly Dwan 17f1c86be8
Add wp-util as a dependency 2019-11-20 10:43:27 -05:00
Kelly Dwan 2d2447ac94
Tweak design 2019-11-20 10:43:27 -05:00
Kelly Dwan 88b5c746dd
Fix unescaped content 2019-11-20 10:43:27 -05:00
Kelly Dwan 5d4d1b7f4c
Update display to use new design 2019-11-20 10:43:26 -05:00
Kelly Dwan 5a72ff8b53
Enable "add contributors" functionality 2019-11-20 10:43:26 -05:00
Kelly Dwan b0672a6f6e
Refactor to use JSON + templates for contributors
This will make it easier to show contributors as they're added
2019-11-20 10:43:26 -05:00
Kelly Dwan aa79c8147e
Add the "Add Contributors" input to the form 2019-11-20 10:43:26 -05:00
Kelly Dwan eacd2bf3f2
Hook up "Remove" button 2019-11-20 10:43:26 -05:00
Kelly Dwan d5c740ae84
Use JS + AJAX to resend the confirmation email 2019-11-20 10:43:25 -05:00
Kelly Dwan 7dbc725581
Style contributors list (first pass) 2019-11-20 10:42:27 -05:00
Kelly Dwan da76512d55
Style the email status indicator 2019-11-20 10:42:27 -05:00
Kelly Dwan f32d26ef47
Organize email & authentication code (#101)
* Split Auth functionality out to new file

* Move email-related code into the email file

* Use `assertFalse` for boolean assertions

* Add `can_manage_pledge` to check user or token against a given pledge

Pulled out of e9763f6678

* Remove duplicate test
2019-11-20 10:40:45 -05:00
Kelly Dwan 03949905c0
Tests: Update infrastructure & add travis config (#100)
* Tests: Move tests infrastructure, set up travis

Consolidates the composer files so we can run install once in travis.

* Return empty array if no values are $_POST'ed to the form

Fixes an issue with tests + null values in logs

* Clean up some naming & create helper functions for tests

* Debug travis

* Remove debug

* Fix notices on form

* Turn on multisite flag
2019-11-15 17:40:53 -05:00
Kelly Dwan 5c2041442a
Remove unused file 2019-11-14 13:48:22 -05:00
Kelly Dwan 42d44f7dc9
Plugin: Fix all phpcs errors
This includes autofixes, along with some manual fixes; mostly syntax-related. Some `phpcs:ignore` comments were added for overzealous rules that don't apply.
2019-11-14 13:48:17 -05:00
Kelly Dwan e1909dfccf
Sync with SVN: Bump cachebuster 2019-11-13 17:23:41 -05:00
Ian Dunn 7bcc82286c Theme: Display the Edit Pledge shortcode on individual pledges.
Fixes #5
2019-11-12 08:35:06 -08:00
Ian Dunn 2e8912e9d5 Manage Pledge: Add shortcode to email link for updating.
See #5
2019-11-12 08:35:06 -08:00
Ian Dunn 414c4809e3 Email: Allow tokens to be reused when necessary. 2019-11-12 08:35:06 -08:00
Kelly Dwan 469e3437b1
Pledge List: Fix margin overflow when only 1 contributor on a pledge
Fixes #95
2019-11-08 17:20:45 -05:00
Kelly Dwan beb2db453e
My Pledges: Add border only when multiple pledge lists exist 2019-11-08 17:14:14 -05:00
Ian Dunn 521ce58de7
Contributors: Return default array when posts empty to avoid notices.
Previously there were `undefined index` notices on `wp-admin/edit.php?post_type=5ftf_pledge` when a pledge had `0` posts in either status.
2019-11-07 16:14:27 -08:00
Ian Dunn 93d2bafd34
Pledge Form: Generate correct URL for the directory.
It's no longer a page, and instead uses the post type archive with a rewrite rule.
2019-11-07 16:14:27 -08:00
Ian Dunn 963dbd41e3
Views: Modularize success/error notices for DRYness. 2019-11-07 16:14:26 -08:00
Ian Dunn 7e89d1794a
Email: Send no-cache headers when auth token present for security. 2019-11-07 16:07:51 -08:00
Ian Dunn 18228d367c
Pledge Log: Log user of CLI actions. 2019-11-07 11:31:00 -08:00
Ian Dunn c524d1b21b
Tests: Disable logger to avoid errors. 2019-11-07 11:16:12 -08:00
Ian Dunn ffebacb42a
My Pledges: Rename status variable for clarity. 2019-11-07 10:08:18 -08:00
Caleb Burks 7cbe722202
My Pledges: Only trigger status changes when needed. 2019-11-07 10:08:18 -08:00
Caleb Burks 1023fdeb55
My Pledges: Verify current user is authorized to edit contribution.
Closes #90
2019-11-07 10:08:06 -08:00
Caleb Burks 8e3ba2db96
My Pledges: Append ID to nonce action to make it more unique.
Fixes #87
2019-11-06 09:02:29 -08:00
Caleb Burks 8230963ea4
My Pledges: Ensure the submitted contributor_post_id is valid.
See #87
2019-11-06 08:58:50 -08:00
Caleb Burks c47679a5cc
My Pledges: Return early if contributor_post_id is missing.
`process_my_pledges_form()` is actually called on page load in `render_my_pledges()`.

So to prevent the unnecessary get_post() queries, let’s just return early if the form wasn’t really submitted.

See #87
2019-11-06 08:58:07 -08:00
Caleb Burks 4b3586a487 Add more exclusions to .gitignore (#85) 2019-11-06 11:51:40 -05:00
Ian Dunn 85de3422ea
Theme: Bump cachebuster
It was reverted in the production repo in [dotorg 15511].
2019-11-04 15:19:49 -06:00
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