Commit 25f61539 authored by John James Jacoby's avatar John James Jacoby
Browse files

Split messages into separate template parts.

parent 3b7c33bb
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'already_member' ); ?>
</div>
<?php
// Messages
wp_join_page_get_template_part( 'messages/already-member' );
<div class="ui basic segment">
// Page output
?><div class="ui basic segment">
<div class="ui two column middle aligned very relaxed stackable grid">
<div class="column">
<div class="ui centered card">
......
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'cannot_join' ); ?>
</div>
<?php
// Messages
wp_join_page_get_template_part( 'messages/cannot-join' );
<div class="ui basic segment">
// Page output
?><div class="ui basic segment">
<div class="ui centered card">
<div class="image">
<?php echo get_avatar( wp_get_current_user()->user_email, 300 ); ?>
......
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'success_create' ); ?>
</div>
<?php
// Messages
wp_join_page_get_template_part( 'messages/created' );
<div class="ui basic segment">
// Page output
?><div class="ui basic segment">
<div class="ui two column middle aligned very relaxed stackable grid">
<div class="column"><?php
do_action( 'wp_join_page_created_left_column' );
......
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'already_logged_in' ); ?>
</div>
<?php
// Messages
wp_join_page_get_template_part( 'messages/request-access' );
<div class="ui basic segment">
// Page output
?><div class="ui basic segment">
<div class="ui two column middle aligned very relaxed stackable grid">
<div class="column">
<div class="ui centered card">
......
<?php
// Errors have occurred, so alert the user
if ( ! empty( $_REQUEST['error'] ) ) :
// Username taken
if ( 'username' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_username' ); ?></div><?php
// Email already registered
elseif ( 'email' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_email' ); ?></div><?php
// User ID came back empty
elseif ( 'unknown' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_unknown' ); ?></div><?php
endif;
// Only show message if no success or errors
else :
?><div class="ui blue message"><i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'create_account' ); ?></div><?php
endif;
// Messages
wp_join_page_get_template_part( 'messages/sign-up' );
// Page output
?><div class="ui basic segment">
<div class="ui two column middle aligned very relaxed stackable grid">
<div class="column sign-up">
......
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'already_member' ); ?>
</div>
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'cannot_join' ); ?>
</div>
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'success_create' ); ?>
</div>
<div class="ui blue message">
<i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'already_logged_in' ); ?>
</div>
<?php
// Errors have occurred, so alert the user
if ( ! empty( $_REQUEST['error'] ) ) :
// Username taken
if ( 'username' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_username' ); ?></div><?php
// Email already registered
elseif ( 'email' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_email' ); ?></div><?php
// User ID came back empty
elseif ( 'unknown' === $_REQUEST['error'] ) :
?><div class="ui red message"><i class="warning circle icon"></i><?php echo wp_join_page_get_string( 'err_unknown' ); ?></div><?php
endif;
// Only show message if no success or errors
else :
?><div class="ui blue message"><i class="dashboard icon"></i><?php echo wp_join_page_get_string( 'create_account' ); ?></div><?php
endif;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment