Commit graph

362 commits

Author SHA1 Message Date
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
Kelly Dwan 157b73e13f
Homepage: clean up item positioning
- Remove accidental drop-shadow (mistake in Figma)
- Use the correct fonts for callout text
- Switch to a fixed width of rems over percentages to make alignment easier
- Use rems to outdent quote so it lines up with the edge of the photo
- Overlap the blue box + photo on larger screens, and offset the quote down
- Remove unused selectors
- Fix quote display in the editor
2019-10-24 13:10:40 -04: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 a2fba5250e
Unify the plugin and theme namespaces 2019-10-22 10:57:04 -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
Ian Dunn 78822c4323
Theme: Iterate on pullquotes and other hero areas.
See #2.
2019-10-18 14:29:26 -07:00
Ian Dunn 9c700e59cb
Theme: Iterate on About fonts and block styles. 2019-10-18 09:19:27 -07:00
Kelly Dwan 91ed1e933d
Use correct heading level for list pages 2019-10-09 14:40:02 -04:00
Kelly Dwan fd40341aaa
Update color variables to match core 2019-10-09 14:39:48 -04: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 fc51de3a90
Add all current textdomains
Once we decide on the correct domain we can use that, until then this is causing potentially false errors
2019-10-08 12:16:00 -04:00
Kelly Dwan bd9019556b
Auto-fix some PHPCS errors 2019-10-08 11:21:50 -04:00
Kelly Dwan bb12bce7ab
Fix exclude/include patterns
Using include + exclude was accidentally excluding the whole plugin directory. Instead, use only exclude and exclude everything but our plugin.
2019-10-08 11:14:38 -04:00
Kelly Dwan b08effbe8b
Move layout-related code to separate component files 2019-10-07 17:11:35 -04:00
Kelly Dwan 3ebc219416
Remove build files (#19)
* Remove build CSS files

* Ignore built files

* Remove call to RTL styles
2019-10-07 15:59:38 -04:00
Ian Dunn 883ed29374
Theme: Align header text left on mobile. 2019-10-05 09:48:26 -07: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
Kelly Dwan 7a355b8314
Theme: Fix interior page layout (#18)
Fixes #4
2019-10-04 11:32:57 -04:00
Kelly Dwan e20a834cb0
Use columns block for the parallelogram style (#16)
This avoids the complex mutliply-nested blocks and makes the block style less reliant on a custom class. On mid-sized screens, we switch to plain horizontally-overlapping rectangles, and on small screens we stack the columns, and vertically-overlap.

Also, remove the parallelogram styles from the editor display. The skew and positioning don't work well in the editor context.
2019-10-03 15:09:06 -04:00
Kelly Dwan f8558fe9c2
More blocks styles moved to the appropriate object/utilities folders
Simplifies pullquote and fixes the issues with editor styles; move color classes utilities.
2019-10-02 17:08:14 -04:00
Kelly Dwan e6b3fbd989
Move blocks and block styles to the correct places in the CSS structure
There should be no visual changes
2019-10-02 15:54:45 -04:00