diff --git a/plugins/wporg-5ftf/includes/pledge-form.php b/plugins/wporg-5ftf/includes/pledge-form.php index 11a5d20..9e75ce6 100755 --- a/plugins/wporg-5ftf/includes/pledge-form.php +++ b/plugins/wporg-5ftf/includes/pledge-form.php @@ -12,6 +12,7 @@ use WP_Error; defined( 'WPINC' ) || die(); +// Todo make this into simple optionless blocks instead? add_shortcode( '5ftf_pledge_form_new', __NAMESPACE__ . '\render_form_new' ); add_shortcode( '5ftf_pledge_form_manage', __NAMESPACE__ . '\render_form_manage' ); diff --git a/plugins/wporg-5ftf/includes/pledge-meta.php b/plugins/wporg-5ftf/includes/pledge-meta.php index ac14688..5713fb0 100755 --- a/plugins/wporg-5ftf/includes/pledge-meta.php +++ b/plugins/wporg-5ftf/includes/pledge-meta.php @@ -136,25 +136,24 @@ function add_meta_boxes() { */ function render_meta_boxes( $pledge, $box ) { $editable = current_user_can( 'edit_pledge', $pledge->ID ); + $data = array(); + + foreach ( get_pledge_meta_config() as $key => $config ) { + $data[ $key ] = get_post_meta( $pledge->ID, META_PREFIX . $key, $config['single'] ); + } switch ( $box['id'] ) { case 'pledge-email': - $email = get_post_meta( $pledge->ID, META_PREFIX . 'pledge-email', true ); - $confirmed = get_post_meta( $pledge->ID, META_PREFIX . 'pledge-email-confirmed', true ); + require FiveForTheFuture\get_views_path() . 'inputs-pledge-org-email.php'; break; case 'org-info': - $data = array(); - - foreach ( get_pledge_meta_config( 'user_input' ) as $key => $config ) { - $data[ $key ] = get_post_meta( $pledge->ID, META_PREFIX . $key, $config['single'] ); - } + require FiveForTheFuture\get_views_path() . 'inputs-pledge-org-info.php'; break; - case 'pledge-contributors': + case 'pledge-contributors': + require FiveForTheFuture\get_views_path() . 'inputs-pledge-contributors.php'; break; } - - require dirname( __DIR__ ) . '/views/metabox-' . sanitize_file_name( $box['id'] ) . '.php'; } /** diff --git a/plugins/wporg-5ftf/index.php b/plugins/wporg-5ftf/index.php index 2c083a8..c234741 100755 --- a/plugins/wporg-5ftf/index.php +++ b/plugins/wporg-5ftf/index.php @@ -28,3 +28,39 @@ function load() { require_once PATH . 'includes/pledge-form.php'; require_once PATH . 'includes/shortcodes.php'; } + +/** + * Shortcut to the assets directory. + * + * @return string + */ +function get_assets_path() { + return PATH . 'assets/'; +} + +/** + * Shortcut to the assets URL. + * + * @return string + */ +function get_assets_url() { + return URL . 'assets/'; +} + +/** + * Shortcut to the includes directory. + * + * @return string + */ +function get_includes_path() { + return PATH . 'includes/'; +} + +/** + * Shortcut to the views directory. + * + * @return string + */ +function get_views_path() { + return PATH . 'views/'; +} diff --git a/plugins/wporg-5ftf/views/form-pledge-manage.php b/plugins/wporg-5ftf/views/form-pledge-manage.php index 0fa4736..bce888f 100644 --- a/plugins/wporg-5ftf/views/form-pledge-manage.php +++ b/plugins/wporg-5ftf/views/form-pledge-manage.php @@ -1,8 +1,21 @@ + +
+ + +
+ +
+
diff --git a/plugins/wporg-5ftf/views/form-pledge-new.php b/plugins/wporg-5ftf/views/form-pledge-new.php index 7ba8f30..5e26434 100755 --- a/plugins/wporg-5ftf/views/form-pledge-new.php +++ b/plugins/wporg-5ftf/views/form-pledge-new.php @@ -1,7 +1,7 @@ -
-
- - -
- -
- Logo TODO -
- -
- - - 280 characters -
- -
- - - This user will be responsible for managing your organization's pledge. -
- -
- - - Separate each username with a comma. -
- -
- -
+ +
diff --git a/plugins/wporg-5ftf/views/inputs-pledge-contributors.php b/plugins/wporg-5ftf/views/inputs-pledge-contributors.php new file mode 100644 index 0000000..f4f7aed --- /dev/null +++ b/plugins/wporg-5ftf/views/inputs-pledge-contributors.php @@ -0,0 +1,34 @@ + + + + +
+ + +

+ +

+
+ + + +
+ +
+ + diff --git a/plugins/wporg-5ftf/views/inputs-pledge-new-misc.php b/plugins/wporg-5ftf/views/inputs-pledge-new-misc.php new file mode 100644 index 0000000..edb3ca6 --- /dev/null +++ b/plugins/wporg-5ftf/views/inputs-pledge-new-misc.php @@ -0,0 +1,22 @@ + + +
+

+ +

+ + + +
diff --git a/plugins/wporg-5ftf/views/inputs-pledge-org-email.php b/plugins/wporg-5ftf/views/inputs-pledge-org-email.php new file mode 100644 index 0000000..654f170 --- /dev/null +++ b/plugins/wporg-5ftf/views/inputs-pledge-org-email.php @@ -0,0 +1,34 @@ + + +
+ + + /> + + + + + + + + + + + +
diff --git a/plugins/wporg-5ftf/views/inputs-pledge-org-info.php b/plugins/wporg-5ftf/views/inputs-pledge-org-info.php new file mode 100644 index 0000000..aa87d0a --- /dev/null +++ b/plugins/wporg-5ftf/views/inputs-pledge-org-info.php @@ -0,0 +1,51 @@ + + +
+ + + /> +
+ +
+ + + /> +
+ +
+ + +
diff --git a/plugins/wporg-5ftf/views/inputs-pledge-org-logo.php b/plugins/wporg-5ftf/views/inputs-pledge-org-logo.php new file mode 100644 index 0000000..50f842d --- /dev/null +++ b/plugins/wporg-5ftf/views/inputs-pledge-org-logo.php @@ -0,0 +1,17 @@ + + +
+ + +
diff --git a/plugins/wporg-5ftf/views/metabox-org-info.php b/plugins/wporg-5ftf/views/metabox-org-info.php deleted file mode 100755 index e012115..0000000 --- a/plugins/wporg-5ftf/views/metabox-org-info.php +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - -
- - - - /> -
- - - - /> -
- - - -
diff --git a/plugins/wporg-5ftf/views/metabox-pledge-contributors.php b/plugins/wporg-5ftf/views/metabox-pledge-contributors.php deleted file mode 100644 index a792de7..0000000 --- a/plugins/wporg-5ftf/views/metabox-pledge-contributors.php +++ /dev/null @@ -1,5 +0,0 @@ - - -TBD diff --git a/plugins/wporg-5ftf/views/metabox-pledge-email.php b/plugins/wporg-5ftf/views/metabox-pledge-email.php deleted file mode 100644 index 13ef541..0000000 --- a/plugins/wporg-5ftf/views/metabox-pledge-email.php +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -/> - - - - - - - - -