<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
} // if accessed directly exit

/**
 * @var \GemBoards\Entities\UserInvitation $invitation
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<?php wp_head(); ?>
	<title><?php echo esc_html( get_bloginfo() ); ?></title>
</head>
<body>
<div class="gemboards_invite_board_form_wrap">
	<div class="gemboards_invite_board_invite">
		<h3><?php echo esc_html(apply_filters( 'gemboards/invitation_form_title', 'GemBoards' )); ?></h3>
		<p><?php echo esc_html(apply_filters( 'gemboards/invitation_form_registration_text', __( 'Quick Registration Form', 'gemboards' ) )); ?></p>
	</div>
	<form action="<?php echo esc_attr( admin_url( 'admin-post.php' ) ); ?>" method="post" class="gemboards_invite_reg_form">
		<?php wp_nonce_field( 'gemboards_invite_registration_nonce' ); ?>
		<input type="hidden" name="action" value="gemboards_invite_registration"/>
		<input type="hidden" name="hash" value="<?php echo esc_attr( $invitation->get_hash() ); ?>"/>

		<div class="form-field">
			<label for="email"><?php esc_html_e( 'Email', 'gemboards' ); ?></label>
			<input type="email" name="email" id="email" value="<?php echo esc_attr( $invitation->get_email() ); ?>" readonly required/>
		</div>

		<div class="form-field">
			<label for="firstname"><?php esc_html_e( 'First Name', 'gemboards' ); ?></label>
			<input type="text" name="firstname" id="firstname" required/>
		</div>

		<div class="form-field">
			<label for="lastname"><?php esc_html_e( 'Last Name', 'gemboards' ); ?></label>
			<input type="text" name="lastname" id="lastname" required/>
		</div>

		<div class="form-field">
			<label for="password"><?php esc_html_e( 'Password', 'gemboards' ); ?></label>
			<input type="password" name="password" id="password" required/>
		</div>

		<div class="form-field">
			<label for="confirm-password"><?php esc_html_e( 'Confirm Password', 'gemboards' ); ?></label>
			<input type="password" name="confirm_password" id="confirm-password" required/>
		</div>
		<div class="form-field">
			<button type="submit"><?php esc_html_e( 'Submit', 'gemboards' ); ?></button>
		</div>
	</form>
</div>
</body>
</html>

