mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-16 15:15:45 +03:00
Add 5ftf plugin from https://github.com/coreymckrill/5ftf
This commit is contained in:
parent
1db9ec9203
commit
697a4b2329
12 changed files with 943 additions and 0 deletions
99
plugins/wporg-5ftf/views/front-end.php
Executable file
99
plugins/wporg-5ftf/views/front-end.php
Executable file
|
@ -0,0 +1,99 @@
|
|||
<?php // todo i18n
|
||||
//// change all id/class prefixes to fftf (or something better) b/c not valid to start w/ number
|
||||
/// ?>
|
||||
|
||||
<article class="5ftf">
|
||||
<section class="about">
|
||||
<h3>
|
||||
<?php _e( 'Five for the Future', 'wordpressdotorg' ); ?>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<?php _e( 'Many companies in the WordPress ecosystem choose to contribute 5% of their time back towards sustaining and improving the WordPress project. This helps to ensure that WordPress remains a vibrant platform to build a business on, and prevents a <a href="">tragedy of the commons</a>.', 'wordpressdotorg' ); ?>
|
||||
<?php // link to CTA page ?>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="people">
|
||||
<h3>
|
||||
<?php _e( "Thank you to all of the companies that participate in Five for the Future.", 'wordpressdotorg' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php /*
|
||||
// sort filter options
|
||||
// this should be js - backbone or react? react
|
||||
// in page or api? start in page, can iterate later to add infinite scroll or something
|
||||
*/ ?>
|
||||
|
||||
<form>
|
||||
<label for="5ftf-search">
|
||||
<?php _e( 'Search:' ); ?>
|
||||
</label>
|
||||
|
||||
<input type="text" id="5ftf-search" name="5ftf-search" />
|
||||
</form>
|
||||
|
||||
<table class="fftf-companies">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fftf-sorted-ascending">
|
||||
Company
|
||||
<button class="fftf-sorting-indicator" data-field="name"></button>
|
||||
</th>
|
||||
<th>
|
||||
Total # Employees
|
||||
<button class="fftf-sorting-indicator" data-field="total_employees"></button>
|
||||
</th>
|
||||
<th>
|
||||
# Sponsored Employees
|
||||
<button class="fftf-sorting-indicator" data-field="sponsored_employees"></button>
|
||||
</th>
|
||||
<th>
|
||||
Hours Pledged per Week
|
||||
<button class="fftf-sorting-indicator" data-field="hours_per_week"></button>
|
||||
</th>
|
||||
<th>
|
||||
Teams Contributing To
|
||||
<?php // This can't really be sorted in a meaningful way, since multiple teams are listed here ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="5ftf-companies-body">
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<?php _e( 'Loading…' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<script id="tmpl-5ftf-companies" type="text/template">
|
||||
<# _.each( data, function( company ) { #>
|
||||
<tr class="company">
|
||||
<th>
|
||||
<a href="{{company.url}}">
|
||||
{{company.name}}
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<td>{{company.total_employees}}</td>
|
||||
<td>{{company.sponsored_employees}}</td>
|
||||
<td>{{company.hours_per_week}}</td>
|
||||
<td>
|
||||
{{company.teams_contributing_to}}
|
||||
<!-- todo link to team p2 -->
|
||||
</td>
|
||||
</tr>
|
||||
<# } ) #>
|
||||
</script>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="join">
|
||||
<h3>Take the Next Step</h3>
|
||||
|
||||
<p>Have a question? Ready to get started? Get in touch and we'll help you find where you're needed the most.</p>
|
||||
|
||||
<?php // link to pledge form ?>
|
||||
</section>
|
||||
</article>
|
39
plugins/wporg-5ftf/views/metabox-company-information.php
Executable file
39
plugins/wporg-5ftf/views/metabox-company-information.php
Executable file
|
@ -0,0 +1,39 @@
|
|||
<table>
|
||||
<tbody>
|
||||
url
|
||||
total # employees
|
||||
# employees pledged at least part time
|
||||
total # hours pleged
|
||||
what else was there?
|
||||
|
||||
<?php /*
|
||||
<tr>
|
||||
<th>
|
||||
<label for="_5ftf_wporg_username">
|
||||
<?php _e( 'WordPress.org Username:', 'wordpressorg' ); ?>
|
||||
</label>
|
||||
</th>
|
||||
|
||||
<td>
|
||||
<input id="_5ftf_wporg_username" name="_5ftf_wporg_username" type="text" value="<?php echo esc_attr( $company->_5ftf_wporg_username ); ?>" required class="regular-text" />
|
||||
|
||||
<?php if ( $avatar_url ) : ?>
|
||||
<img src="<?php echo esc_url( $avatar_url ); ?>" width="95" height="95" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label for="_5ftf_hours_per_month">
|
||||
<?php _e( 'Hours per Month:', 'wordpressorg' ); ?>
|
||||
</label>
|
||||
</th>
|
||||
|
||||
<td>
|
||||
<input id="_5ftf_hours_per_month" name="_5ftf_hours_per_month" type="number" value="<?php echo esc_attr( $company->_5ftf_hours_per_month ); ?>" required class="regular-text" />
|
||||
</td>
|
||||
</tr>
|
||||
*/ ?>
|
||||
</tbody>
|
||||
</table>
|
155
plugins/wporg-5ftf/views/pledge-form.php
Executable file
155
plugins/wporg-5ftf/views/pledge-form.php
Executable file
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
/** @var array $messages */
|
||||
?>
|
||||
|
||||
<?php if ( ! empty( $messages ) ) : ?>
|
||||
<?php foreach ( $messages as $message ) : ?>
|
||||
<div class="notice notice-error">
|
||||
<?php echo wpautop( $message ); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="" method="post">
|
||||
<fieldset>
|
||||
<legend><?php _e( 'Company Details', 'wporg' ); ?></legend>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-company-name">
|
||||
<?php _e( 'Company Name', 'wporg' ); ?>
|
||||
<input
|
||||
type="text"
|
||||
id="5ftf-company-name"
|
||||
name="company-name"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'company-name' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-company-url">
|
||||
<?php _e( 'Company URL', 'wporg' ); ?>
|
||||
<input
|
||||
type="url"
|
||||
id="5ftf-company-url"
|
||||
name="company-url"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'company-url' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-company-email">
|
||||
<?php _e( 'Company Email', 'wporg' ); ?>
|
||||
<input
|
||||
type="email"
|
||||
id="5ftf-company-email"
|
||||
name="company-email"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'company-email' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-company-phone">
|
||||
<?php _e( 'Company Phone Number', 'wporg' ); ?>
|
||||
<input
|
||||
type="text"
|
||||
id="5ftf-company-phone"
|
||||
name="company-phone"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'company-phone' ) ); ?>"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-company-total-employees">
|
||||
<?php _e( 'Total Employees', 'wporg' ); ?>
|
||||
<input
|
||||
type="number"
|
||||
id="5ftf-company-total-employees"
|
||||
name="company-total-employees"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'company-total-employees' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php _e( 'Pledge Manager', 'wporg' ); ?></legend>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-contact-name">
|
||||
<?php _e( 'Name', 'wporg' ); ?>
|
||||
<input
|
||||
type="text"
|
||||
id="5ftf-contact-name"
|
||||
name="contact-name"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'contact-name' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-contact-wporg-username">
|
||||
<?php _e( 'WordPress.org User Name', 'wporg' ); ?>
|
||||
<input
|
||||
type="text"
|
||||
id="5ftf-contact-wporg-username"
|
||||
name="contact-wporg-username"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'contact-wporg-username' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php _e( 'Pledge', 'wporg' ); ?></legend>
|
||||
|
||||
<div>
|
||||
<label for="5ftf-pledge-hours">
|
||||
<?php _e( 'Pledged Hours Per Week', 'wporg' ); ?>
|
||||
<input
|
||||
type="number"
|
||||
id="5ftf-pledge-hours"
|
||||
name="pledge-hours"
|
||||
value="<?php echo esc_attr( filter_input( INPUT_POST, 'pledge-hours' ) ); ?>"
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
printf(
|
||||
__( 'The company pledges that it meets the <a href="%s">expectations</a> of the Five For The Future program and that it will dedicate this amount of employee time per week to the WordPress project', 'wporg' ),
|
||||
esc_url( '#' )
|
||||
);
|
||||
?>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="5ftf-pledge-agreement"
|
||||
name="pledge-agreement"
|
||||
<?php checked( filter_input( INPUT_POST, 'pledge-agreement', FILTER_VALIDATE_BOOLEAN ) ) ?>
|
||||
required
|
||||
/>
|
||||
<?php _e( 'Yes', 'wporg' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div>
|
||||
<input type="submit" id="5ftf-pledge-submit" name="action" class="button button-primary" value="<?php esc_attr_e( 'Submit', 'wporg' ); ?>" />
|
||||
</div>
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue