xref: /webtrees/resources/views/modals/create-media-from-file.phtml (revision d9efec4aaa9aefd6a527c75c15e437b9a1a6604c)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\CreateMediaObjectFromFile;
4use Fisharebest\Webtrees\I18N;
5
6/**
7 * @var array<int|string,string> $media_types
8 */
9?>
10
11<div class="modal" id="modal-create-media-from-file">
12    <form method="post" action="<?= e(route(CreateMediaObjectFromFile::class)) ?>" id="modal-create-media-from-file-form">
13        <?= csrf_field() ?>
14        <input type="hidden" name="action" value="create-media-object-from-file">
15        <input type="hidden" name="tree" id="tree" value="">
16        <div class="modal-dialog modal-lg" role="document">
17            <div class="modal-content">
18                <div class="modal-header">
19                    <h3 class="modal-title"><?= I18N::translate('Create a media object') ?></h3>
20                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<?= I18N::translate('close') ?>">
21                    </button>
22                </div>
23                <div class="modal-body">
24                    <div class="row form-group mb-3">
25                        <label class="col-form-label col-sm-2" for="file">
26                            <?= I18N::translate('Media file') ?>
27                        </label>
28                        <div class="col-sm-10">
29                            <input type="text" class="form-control" id="file" name="file" value="" readonly>
30                        </div>
31                    </div>
32                    <div class="row form-group mb-3">
33                        <label class="col-form-label col-sm-2" for="title">
34                            <?= I18N::translate('Title') ?>
35                        </label>
36                        <div class="col-sm-10">
37                            <input type="text" class="form-control" name="title" id="title">
38                        </div>
39                    </div>
40                    <div class="row form-group mb-3">
41                        <label class="col-form-label col-sm-2" for="type">
42                            <?= I18N::translate('Media type') ?>
43                        </label>
44                        <div class="col-sm-10">
45                            <?= view('components/select', ['name' => 'type', 'selected' => '', 'options' => $media_types]) ?>
46                        </div>
47                    </div>
48                    <div class="row form-group mb-3">
49                        <label class="col-form-label col-sm-2" for="note">
50                            <?= I18N::translate('Note') ?>
51                        </label>
52                        <div class="col-sm-10">
53                            <textarea class="form-control" id="note" name="note" rows="5" dir="auto"></textarea>
54                        </div>
55                    </div>
56                </div>
57                <div class="modal-footer">
58                    <button type="submit" class="btn btn-primary">
59                        <?= view('icons/save') ?>
60                        <?= I18N::translate('save') ?>
61                    </button>
62                    <button type="button" class="btn btn-text" data-bs-dismiss="modal">
63                        <?= view('icons/cancel') ?>
64                        <?= I18N::translate('cancel') ?>
65                    </button>
66                </div>
67            </div>
68        </div>
69    </form>
70</div>
71