ubicloud/views/components/form/textarea.erb
Jeremy Evans 996931d35b Show link to SSH public key management page on VM create page
If the user has not already registered an SSH public key, and they
have permission to do so, show a link to the page. This makes it
more likely users will be aware of this feature.

If the project has a registered SSH public key, we don't need to
explain the benefit of an SSH public key, so hide the description
in that case.
2025-10-04 01:36:33 +09:00

20 lines
1 KiB
Text

<%# locals: (name:, value: nil, label: nil, description: nil, escape_description: true, attributes: {}) %>
<% value = typecast_body_params.str(name) || value
escaped_description = escape_description ? h(description) : description
error = flash.dig("errors", name) %>
<div class="space-y-2">
<% if label %>
<label for="<%= name %>" class="block text-sm font-medium leading-6 text-gray-900"><%= label %></label>
<% end %>
<textarea
id="<%= name %>"
name="<%= name %>"
class="block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset focus:ring-2 focus:ring-inset text-sm sm:leading-6 <%= error ? "text-red-900 ring-red-300 placeholder:text-red-300 focus:ring-red-500" : "text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-orange-600" %>"
<%== html_attrs(attributes) %>
><%= value %></textarea>
<% if description %>
<p class="text-sm text-gray-500 leading-6" id="<%= name %>-description"><%== escaped_description %></p>
<% end %>
<%== part("components/form/error", name:, error:) if error %>
</div>