basic integration of entities to profile

This commit is contained in:
2023-01-13 22:23:23 +02:00
parent 38f51a5de6
commit d869eab476
6 changed files with 24 additions and 17 deletions

View File

@ -10,8 +10,6 @@
= f.input :name
.field
= f.input :ha_id , collection: Entity.ha_entities
.field
= f.input :ha_type , collection: ["text" , "bool"]
.field
= f.input :member_id , collection: Member.all.collect{|m| [m.name , m.id ]}
.actions{class: button_classes}

View File

@ -16,8 +16,8 @@
%tr
%td= entity.name
%td= entity.ha_id
%td= entity.ha_type
%td= entity.member
%td= entity.type
%td= entity.member.name
%td= link_to 'Show', entity
%td= link_to 'Edit', edit_entity_path(entity)
%td= link_to 'Destroy', entity, method: :delete, data: { confirm: 'Are you sure?' }

View File

@ -9,9 +9,9 @@
= @entity.ha_id
%p
%b Type:
= @entity.ha_type
= @entity.type
%p
%b Type:
%b Value:
= @entity.value
%p
%b Member:

View File

@ -17,11 +17,17 @@
%svg.inline-block.w-3.ml-2{:fill => "currentColor", :viewbox => "0 0 12 12"}
%path{:d => "M9.707,5.293l-5-5A1,1,0,0,0,3.293,1.707L7.586,6,3.293,10.293a1,1,0,1,0,1.414,1.414l5-5A1,1,0,0,0,9.707,5.293Z"}
.flex.justify-around
= link_to edit_member_path(@member) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit
-if @member == current_member or current_member.admin?
= form_tag( destroy_member_session_path , {method: :delete } ) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit}
Sign out
.flex.justify-around
= link_to edit_member_path(@member) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit
.grid.grid-cols-3.gap-4
-@member.entities.each do |entity|
%div= entity.type
%div= entity.name
%div= entity.value
= form_tag( destroy_member_session_path , {method: :delete } ) do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit}
Sign out