Профиль: телефон, сайт, должность, город и «о себе» — необязательные поля

This commit is contained in:
rsgrinko committed 2026-09-17 01:03:47 +03:00
1 parent 6751452281
commit 156c8c40c4
5 files changed
+111 -14

No files matched your search

+22
View File
@@ -70,6 +70,28 @@ $hint = $isNew ? 'пусто — придумаем сами' : 'пусто
</div>
<?php if (!$isNew) { ?>
<div class="card">
<h2>Профиль</h2>
<p class="muted small">Необязательные поля — заполняет сам человек в своём профиле.</p>
<dl class="props">
<dt>Телефон</dt>
<dd><?= $user->phone !== '' ? View::e((string) $user->phone) : '<span class="muted">—</span>' ?></dd>
<dt>Сайт</dt>
<dd><?php if ($user->website !== '') { ?><a href="<?= View::e((string) $user->website) ?>" target="_blank" rel="noopener"><?= View::e((string) $user->website) ?></a><?php } else { ?><span class="muted">—</span><?php } ?></dd>
<dt>Должность</dt>
<dd><?= $user->position !== '' ? View::e((string) $user->position) : '<span class="muted">—</span>' ?></dd>
<dt>Город</dt>
<dd><?= $user->location !== '' ? View::e((string) $user->location) : '<span class="muted">—</span>' ?></dd>
<dt>О себе</dt>
<dd><?= $user->bio !== '' ? nl2br(View::e((string) $user->bio)) : '<span class="muted">—</span>' ?></dd>
</dl>
</div>
<div class="card">
<h2>Устройства</h2>
+25
View File
@@ -36,6 +36,31 @@ use Rsgrinko\Proton\View\View;
<input type="email" name="email" value="<?= View::e((string) $user->email) ?>">
</label>
<label>
<span>Телефон</span>
<input type="tel" name="phone" value="<?= View::e((string) $user->phone) ?>" placeholder="+7 900 000-00-00">
</label>
<label>
<span>Сайт</span>
<input type="url" name="website" value="<?= View::e((string) $user->website) ?>" placeholder="https://example.com">
</label>
<label>
<span>Должность</span>
<input type="text" name="position" value="<?= View::e((string) $user->position) ?>">
</label>
<label>
<span>Город</span>
<input type="text" name="location" value="<?= View::e((string) $user->location) ?>">
</label>
<label>
<span>О себе</span>
<textarea name="bio" style="min-height: 70px;"><?= View::e((string) $user->bio) ?></textarea>
</label>
<button type="submit" class="primary">Сохранить</button>
</form>
</div>