Commit graph

187 commits

Author SHA1 Message Date
Kelly Dwan ee8583d91d
Tools: Move from Travis to GitHub Actions for CI checks (#154) 2020-12-10 12:25:03 -05:00
Ian Dunn 13a417ce8e
Apply coding standards. 2020-11-13 12:24:03 -08:00
Ian Dunn c1ce72d447
Track number of sponsored contributors and hours. 2020-11-13 12:24:02 -08:00
Ian Dunn 7464a9e585
Stats: Display snapshot times as dates for readability.
Eventually should be charts, etc. In the meantime, though, dates are more useful than timestamps.
2020-11-10 08:34:59 -08:00
Dion Hulse d835246f3f
When a pledge has no contributors, return zero contributors/hours
This avoids a PHP Notice during the cron task to update the contributor/hour counters.

By returning 0 here we have "valid" metadata attached to the pledge posts, which removes the need for further logic there.

Closes #151
2020-10-07 13:46:00 +10:00
Kelly Dwan 7847fb546a
Theme: Sync change from wporg base theme 2020-06-11 11:36:55 -04:00
dependabot[bot] 762b83db93
Bump websocket-extensions from 0.1.3 to 0.1.4 in /themes/wporg-5ftf (#145)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-11 11:36:14 -04:00
Steven Dufresne ba529d54f7
Overwrite Gutenberg link button hover/visited styles. 2020-04-24 09:51:52 -07:00
Kelly Dwan 2d8932cbd5
Manage Pledge: Add more information to the manage link email (#138) 2019-12-20 17:20:24 -05:00
Kelly Dwan 83fa522c9f
Bump cachebuster 2019-12-16 17:50:07 -05:00
Kelly Dwan a70212bc22
Pledge List: Add sorting by total contributor count (#133)
Add a "Total Contributors" option to the sorting menu on the pledge list. This will sort the list from most confirmed contributors to least.

Fixes #94
2019-12-16 17:48:33 -05:00
Kelly Dwan 183f7a95bc
Manage Pledge: Notify removed contributors (#109)
If a contributor is removed from a pledge, they should be notified of the change. This will send an email to any confirmed contributors letting them know.
2019-12-16 17:33:43 -05:00
Kelly Dwan b1cbcdb01b
Theme: Fix text overlap in parallelograms when font is small
This uses pixels to set a padding because the positioning is done in pixels, so the overlap is static pixels, not related to the font size.

Fixes #73
2019-12-16 17:06:00 -05:00
Ian Dunn b68664c231
Reset grossly inaccurate team hours to improve stats reliability.
See #125
2019-12-13 14:36:16 -08:00
Kelly Dwan 3b97459b15
Pledge List: Change list order hourly (#132)
Using a seed for the RAND function, based on the date & time, will randomize the list every hour, while keeping the order consistent across any pagination. This also removes the increase to posts_per_page, since pagination is functional again.

Fixes #70
2019-12-13 15:41:00 -05:00
Kelly Dwan e9aeb72c9b
Bump cachebuster 2019-12-11 16:23:04 -05:00
Kelly Dwan a91c2733d2
Pledge Management: Add "request link" form to the manage pledge (#126)
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
2019-12-11 16:12:23 -05:00
Kelly Dwan a5d4228c6d
My Pledges: Add an edit link to take you to your profile (#128) 2019-12-11 16:11:41 -05:00
Kelly Dwan 636753bb00
My Pledges: Require profile to be filled out before confirming a pledge (#127)
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.
2019-12-11 16:11:13 -05:00
Kelly Dwan bdbf6d573e
Pledge Management: Allow pledge admins to remove the pledge (#123)
* 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
2019-12-10 14:07:48 -05:00
Kelly Dwan 619af97bd1
Forms: Use button class directly on buttons for consistent display
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.
2019-12-09 11:15:39 -05:00
Ian Dunn fda5842e86
Regularly store stats snapshots to track historical trends.
Fixes #37
2019-12-06 08:03:54 -08:00
Ian Dunn 152964f5cf
Fix Theme Review Theme name.
It was updated incorrectly in 7d304c0796.

See #83
2019-12-05 15:13:18 -08:00
Ian Dunn 7d304c0796
Update team names to reflect clarified versions.
See #83
2019-12-05 15:01:40 -08:00
Ian Dunn 24a73b6324
Use FIELD_IDS instead of hardcoding for DRYness. 2019-12-05 15:01:40 -08:00
Ian Dunn fac9c24310
Modify existing team data to match new names, etc.
See #83
2019-12-05 15:01:40 -08:00
Kelly Dwan 8807efb96d
Pledges: Add UI for setting "deactivated" status (#115)
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
2019-12-05 13:20:11 -05:00
Ian Dunn e4deb6809a
Apply coding standards 2019-12-03 12:09:35 -08:00
Kelly Dwan a71a1abd74
Theme: Bump cachebuster 2019-11-26 17:42:58 -05:00
Kelly Dwan 089b458032
Remove feature gate 2019-11-26 17:35:51 -05:00
Kelly Dwan 829947fd7d
Log changes to the pledge logo (#117)
* Log changes to the pledge logo
* Add a log record when the featured image (logo) is removed
2019-11-26 16:52:32 -05:00
Kelly Dwan f37800fca6
Creating a Pledge: Unhook email change trigger from sending duplicate emails
The docs were not exactly correct for this function, and it is called both on update and creation - causing two emails to go out. The email sent from this function uses the wrong page for a new pledge, so we'll keep the current email in `create_new_pledge`, and only send this email on `updated_postmeta`.
2019-11-26 16:06:10 -05:00
Kelly Dwan 80b88399ae
Manage Pledge: Allow pledge admins to change email (#113)
* 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
2019-11-26 15:37:19 -05:00
Kelly Dwan 544fe39199 Manage Pledge: Enable pledge admins to edit contributors from manage form (#108)
* 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
2019-11-26 13:08:42 -05:00
Kelly Dwan 286e6d55ef Manage Pledge: Save a new logo if one is uploaded
- Add logo display & field to manage form
- Save the new logo if submitted (do nothing if not)
- Delete the original logo when a new one is uploaded, checking that the attachment parent is the pledge (just in case of changes via Media Library)
2019-11-26 13:08:42 -05:00
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
Kelly Dwan b898dc23f3 Pledges: Move parse_contributors function 2019-11-26 13:08:42 -05:00
Kelly Dwan a99b3b478e Pledges: Move has_existing_pledge function 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
Jb Audras aec40e6c7e Add missing empty alt attribute to 404’s logo image (#111) 2019-11-23 12:17:17 -05:00
Kelly Dwan a11e3c5fa5
Manage Pledge: Update email dialog to use JS submission (#104)
Use the proper dialog behavior for submitting an email to generate a manage link.

Fixes #98.
2019-11-21 15:31:29 -05:00
Kelly Dwan a67ef04505
Move "send mange email" code to ajax endpoint (#103)
Add an admin-ajax endpoint to request an authorized email to edit an existing pledge. The email submitted needs to match the submitted organizer email for the given pledge. If it does, an email will be sent out with the link to the pledge management form. If not, it will return an error.

See #98.
2019-11-20 18:04:40 -05:00
Kelly Dwan 72b5a159c9
Sync with pub/wporg r9248 2019-11-20 12:06:11 -05:00
Kelly Dwan 82192eea4c
Manage a Pledge: Enable adding/removing contributors from wp-admin. (#99)
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
2019-11-20 11:01:00 -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