xref: /webtrees/resources/views/contact-page.phtml (revision 45ebc6c6221f90468111ed2015b8449dca331d93)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ContactAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Tree;
8
9/**
10 * @var string $body
11 * @var string $captcha
12 * @var string $from_email
13 * @var string $from_name
14 * @var string $subject
15 * @var string $title
16 * @var string $to
17 * @var string $to_name
18 * @var string $url
19 * @var Tree   $tree
20 */
21
22?>
23
24<h2><?= $title ?></h2>
25
26<form method="post" action="<?= e(route(ContactAction::class, ['tree' => $tree->name()])) ?>">
27    <?= $captcha ?>
28    <input type="hidden" name="tree" value="<?= e($tree->name()) ?>">
29    <input type="hidden" name="url" value="<?= e($url) ?>">
30
31    <div class="row mb-3">
32        <label class="col-sm-3 col-form-label" for="to">
33            <?= I18N::translateContext('Email recipient', 'To') ?>
34        </label>
35        <div class="col-sm-9">
36            <input type="hidden" name="to" value="<?= e($to) ?>">
37            <input class="form-control" id="to" type="text" value="<?= e($to_name) ?>" disabled>
38        </div>
39    </div>
40
41    <div class="row mb-3">
42        <label class="col-sm-3 col-form-label" for="from-name">
43            <?= I18N::translate('Your name') ?>
44        </label>
45        <div class="col-sm-9">
46            <input class="form-control" id="from-name" type="text" name="from_name" value="<?= e($from_name) ?>" required="required">
47        </div>
48    </div>
49    <div class="row mb-3">
50        <label class="col-sm-3 col-form-label" for="from-email">
51            <?= I18N::translate('Email address') ?>
52        </label>
53        <div class="col-sm-9">
54            <input class="form-control" id="from-email" type="email" name="from_email" value="<?= e($from_email) ?>" required="required">
55        </div>
56    </div>
57
58    <div class="row mb-3">
59        <label class="col-sm-3 col-form-label" for="subject">
60            <?= I18N::translate('Subject') ?>
61        </label>
62        <div class="col-sm-9">
63            <input class="form-control" id="subject" type="text" name="subject" value="<?= e($subject) ?>" required="required">
64        </div>
65    </div>
66
67    <div class="row mb-3">
68        <label class="col-sm-3 col-form-label" for="body">
69            <?= I18N::translate('Message') ?>
70        </label>
71        <div class="col-sm-9">
72            <textarea class="form-control" id="body" type="text" name="body" rows="5" dir="auto" required="required"><?= e($body) ?></textarea>
73        </div>
74    </div>
75
76    <div class="row mb-3">
77        <div class="col-sm-3 col-form-label"></div>
78        <div class="col-sm-9">
79            <button type="submit" class="btn btn-primary">
80                <?= I18N::translate('Send') ?>
81            </button>
82            <a class="btn btn-link" href="<?= e($url) ?>">
83                <?= I18N::translate('cancel') ?>
84            </a>
85        </div>
86    </div>
87
88    <?= csrf_field() ?>
89</form>
90