Files
once-campfire/app/views/accounts/bots/_form.html.erb
Kevin McConnell df76a227dc Hello world
First open source release of Campfire 🎉
2025-08-21 09:31:59 +01:00

33 lines
1.5 KiB
Plaintext

<h1 class="for-screen-reader">Chat Bot Setup</h1>
<label class="align-center center avatar__form gap" data-controller="upload-preview">
<div class="btn input--file">
<%= image_tag "camera.svg", aria: { hidden: "true" }, size: 20 %>
<%= form.file_field :avatar, class: "input", accept: "image/*",
data: { upload_preview_target: "input", action: "upload-preview#previewImage" } %>
<span class="for-screen-reader">Upload bot avatar</span>
</div>
<div class="avatar input--file txt-xx-large" style="--avatar-size: var(--btn-size);">
<%= image_tag bot.avatar.attached? ? bot.avatar : "default-bot-avatar.svg", alt: "Bot avatar", size: 48, data: { upload_preview_target: "image" } %>
</div>
</label>
<div class="flex align-center gap">
<%= translation_button(:bot_name) %>
<label class="flex align-center gap flex-item-grow txt-large input input--actor">
<%= form.text_field :name, class: "input", autocomplete: "name", placeholder: "Name the bot", autofocus: true, required: true,
data: { "1p-ignore": true } %>
<%= image_tag "bot.svg", aria: { hidden: "true" }, size: 24, class: "colorize--black" %>
</label>
</div>
<div class="flex align-center gap">
<%= translation_button(:webhook_url) %>
<label class="flex align-center gap flex-item-grow txt-large input input--actor">
<%= form.url_field :webhook_url, class: "input", placeholder: "Webhook URL" %>
<%= image_tag "web.svg", aria: { hidden: "true" }, size: 24, class: "colorize--black" %>
</label>
</div>
<%= profile_form_submit_button %>