- {gettext("These will appear in addition to other data when adding new members.")}
-
- <.button
- class="ml-auto"
- variant="primary"
- phx-click="new_custom_field"
- phx-target={@myself}
- >
- <.icon name="hero-plus" /> {gettext("New Custom field")}
-
-
+
+
+ {gettext("These will appear in addition to other data when adding new members.")}
+
+
+ <.button
+ class="ml-auto"
+ variant="primary"
+ phx-click="new_custom_field"
+ phx-target={@myself}
+ >
+ <.icon name="hero-plus" /> {gettext("New Custom field")}
+
- <%!-- Show form when creating or editing --%>
-
- <.live_component
- module={MvWeb.CustomFieldLive.FormComponent}
- id={@form_id}
- custom_field={@editing_custom_field}
- on_save={
- fn custom_field, action -> send(self(), {:custom_field_saved, custom_field, action}) end
- }
- on_cancel={fn -> send_update(__MODULE__, id: @id, show_form: false) end}
- />
-
-
- <%!-- Hide table when form is visible --%>
- <.table
- :if={!@show_form}
- id="custom_fields"
- rows={@streams.custom_fields}
- row_click={
- fn {_id, custom_field} ->
- JS.push("edit_custom_field", value: %{id: custom_field.id}, target: @myself)
- end
+
+ <%!-- Show form when creating or editing --%>
+
+ <.live_component
+ module={MvWeb.CustomFieldLive.FormComponent}
+ id={@form_id}
+ custom_field={@editing_custom_field}
+ on_save={
+ fn custom_field, action -> send(self(), {:custom_field_saved, custom_field, action}) end
}
+ on_cancel={fn -> send_update(__MODULE__, id: @id, show_form: false) end}
+ />
+
+
+ <%!-- Hide table when form is visible --%>
+ <.table
+ :if={!@show_form}
+ id="custom_fields"
+ rows={@streams.custom_fields}
+ row_click={
+ fn {_id, custom_field} ->
+ JS.push("edit_custom_field", value: %{id: custom_field.id}, target: @myself)
+ end
+ }
+ >
+ <:col :let={{_id, custom_field}} label={gettext("Name")}>{custom_field.name}
+
+ <:col :let={{_id, custom_field}} label={gettext("Value Type")}>
+ {@field_type_label.(custom_field.value_type)}
+
+
+ <:col :let={{_id, custom_field}} label={gettext("Description")}>
+ {custom_field.description}
+
+
+ <:col
+ :let={{_id, custom_field}}
+ label={gettext("Required")}
+ class="max-w-[9.375rem] text-center"
>
- <:col :let={{_id, custom_field}} label={gettext("Name")}>{custom_field.name}
+
+ {gettext("Required")}
+
+
+ {gettext("Optional")}
+
+
- <:col :let={{_id, custom_field}} label={gettext("Value Type")}>
- {@field_type_label.(custom_field.value_type)}
-
+ <:col
+ :let={{_id, custom_field}}
+ label={gettext("Show in overview")}
+ class="max-w-[9.375rem] text-center"
+ >
+
+ {gettext("Yes")}
+
+
+ {gettext("No")}
+
+
- <:col :let={{_id, custom_field}} label={gettext("Description")}>
- {custom_field.description}
-
+ <:action :let={{_id, custom_field}}>
+ <.link phx-click={
+ JS.push("edit_custom_field", value: %{id: custom_field.id}, target: @myself)
+ }>
+ {gettext("Edit")}
+
+
- <:col
- :let={{_id, custom_field}}
- label={gettext("Required")}
- class="max-w-[9.375rem] text-center"
- >
-
- {gettext("Required")}
-
-
- {gettext("Optional")}
-
-
+ <:action :let={{_id, custom_field}}>
+ <.link phx-click={JS.push("prepare_delete", value: %{id: custom_field.id}, target: @myself)}>
+ {gettext("Delete")}
+
+
+
- <:col
- :let={{_id, custom_field}}
- label={gettext("Show in overview")}
- class="max-w-[9.375rem] text-center"
- >
-
- {gettext("Yes")}
-
-
- {gettext("No")}
-
-
-
- <:action :let={{_id, custom_field}}>
- <.link phx-click={
- JS.push("edit_custom_field", value: %{id: custom_field.id}, target: @myself)
- }>
- {gettext("Edit")}
-
-
-
- <:action :let={{_id, custom_field}}>
- <.link phx-click={
- JS.push("prepare_delete", value: %{id: custom_field.id}, target: @myself)
- }>
- {gettext("Delete")}
-
-
-
-
- <%!-- Delete Confirmation Modal --%>
-