Class: Oversee::Field::Display

Inherits:
Oversee::Field show all
Defined in:
app/components/oversee/field/display.rb

Instance Attribute Summary

Attributes inherited from Oversee::Field

#datatype, #key, #resource, #value

Instance Method Summary collapse

Methods inherited from Oversee::Field

#__FORM__, #__INPUT__, #__LABEL__, #__SET__, #__VALUE__, #field_form_id, #field_id, #field_name, #initialize, #resource_class_name

Constructor Details

This class inherits a constructor from Oversee::Field

Instance Method Details

#view_templateObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/components/oversee/field/display.rb', line 2

def view_template
  html_tag(
    id: dom_id(resource, key),
    href: helpers.resource_input_path(resource_class_name:, key:, datatype:),
    title: key.to_s.titleize,
    class: "bg-gray-100 h-10 flex items-center justify-between px-4 py-2 hover:bg-gray-200 transition-colors w-full cursor-pointer group",
    data: { turbo_stream: true }
  ) do
    render Oversee::Field::Value.new(key:, value:, datatype:, **@options)
    render Phlex::Icons::Iconoir::Edit.new(class: "text-gray-500 size-4 opacity-0 group-hover:opacity-100 transition-opacity", stroke_width: 1.75)
  end
end