aboutsummaryrefslogtreecommitdiff
path: root/app/views/auth/register.phtml
blob: a56eff3ee11aa60fc726ae8716ba7ded4fb47938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php /** @var FreshRSS_View $this */ ?>
<main class="prompt">
	<h1><?= _t('gen.auth.registration') ?></h1>

	<form method="post" action="<?= _url('user', 'create') ?>">
		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />

		<div class="form-group">
			<label for="new_user_language"><?= _t('admin.user.language') ?></label>
			<select name="new_user_language" id="new_user_language">
			<?php $languages = Minz_Translate::availableLanguages(); ?>
			<?php foreach ($languages as $lang) { ?>
			<option value="<?= $lang ?>"<?= $this->preferred_language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option>
			<?php } ?>
			</select>
		</div>

		<div class="form-group">
			<label for="new_user_name"><?= _t('gen.auth.username') ?></label>
			<input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off"
				pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autocapitalize="off" />
			<p class="help"><?= _i('help') ?> <?= _t('gen.auth.username.format') ?></p>
		</div>

		<?php if ($this->show_email_field) { ?>
			<div class="form-group">
				<label for="new_user_email">
					<?= _t('gen.auth.email') ?>
				</label>
				<input id="new_user_email" name="new_user_email" type="email" required="required" />
			</div>
		<?php } ?>

		<div class="form-group">
			<label for="new_user_passwordPlain"><?= _t('gen.auth.password') ?></label>
			<div class="stick">
				<input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" required="required" autocomplete="new-password" pattern=".{7,}" />
				<button type="button" class="btn toggle-password" data-toggle="new_user_passwordPlain"><?= _i('key') ?></button>
			</div>
			<noscript><b><?= _t('gen.js.should_be_activated') ?></b></noscript>
			<p class="help"><?= _i('help') ?> <?= _t('gen.auth.password.format') ?></p>

		</div>

		<?php if ($this->show_tos_checkbox) { ?>
			<div class="form-group">
				<label class="checkbox" for="accept-tos">
					<input type="checkbox" name="accept_tos" id="accept-tos" value="1" required="required" />
					<?= _t('gen.auth.accept_tos', _url('index', 'tos')) ?>
				</label>
			</div>
		<?php } ?>

		<div class="form-group form-group-actions">
			<?php
				$redirect_url = urlencode(Minz_Url::display(
					array('c' => 'index', 'a' => 'index'),
					'php', true
				));
			?>
			<input type="hidden" name="r" value="<?= $redirect_url ?>" />

			<button type="submit" class="btn btn-important"><?= _t('gen.action.create') ?></button>

			<a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.cancel') ?></a>
		</div>
	</form>

	<p><a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a></p>
</main>