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

57 lines
2.5 KiB
Plaintext

<li class="flex flex-column gap flush fill-shade border-radius pad-block pad-inline-double">
<div class="flex align-center gap">
<figure class="avatar flex-item--no-shrink" style="--avatar-size: 2.65em;">
<%= avatar_tag bot, loading: :lazy %>
</figure>
<div class="min-width">
<div class="overflow-ellipsis txt-large"><strong><%= bot.name %></strong></div>
</div>
<%= link_to edit_account_bot_path(bot), class: "btn flex-item-justify-end", style: "view-transition-name: chat-bot-#{ bot.id }" do %>
<%= image_tag "pencil.svg", aria: { hidden: "true" }, size: 20 %>
<span class="for-screen-reader">Edit <%= bot.name %></span>
<% end %>
</div>
<% bot.rooms.without_directs.ordered.each do |room| %>
<fieldset class="gap max-width pad border border-radius">
<legend class="min-width txt-align-start pad-inline">
<strong class="overflow-ellipsis"><%= room_display_name(room) %></strong>
</legend>
<% curl_text_line = "curl -d 'Hello!' #{room_bot_messages_url(room, bot.bot_key)}" %>
<div class="flex align-center gap">
<%= image_tag "messages-outlined.svg", aria: { hidden: "true" }, size: 24, class: "colorize--black" %>
<div class="flex-item-grow">
<input type="text" class="input full-width fill-white" value="<%= curl_text_line %>" aria-label="curl command for posting messages" readonly>
</div>
<div class="txt-small">
<%= button_to_copy_to_clipboard(curl_text_line) do %>
<%= image_tag "copy-paste.svg", aria: { hidden: "true" }, size: 20 %>
<span class="for-screen-reader">Copy message command</span>
<% end %>
</div>
</div>
<% curl_upload_line = %[curl -F "attachment=@/path/to/file" #{room_bot_messages_url(room, bot.bot_key)}] %>
<div class="flex align-center gap">
<%= image_tag "attachment.svg", aria: { hidden: "true" }, size: 24, class: "colorize--black" %>
<div class="flex-item-grow">
<input type="text" class="input full-width fill-white" value="<%= curl_upload_line %>" aria-label="curl command for posting attachments" readonly>
</div>
<div class="txt-small">
<%= button_to_copy_to_clipboard(curl_upload_line) do %>
<%= image_tag "copy-paste.svg", aria: { hidden: "true" }, size: 20 %>
<span class="for-screen-reader">Copy attachment command</span>
<% end %>
</div>
</div>
</fieldset>
<% end %>
</li>