residency/app/views/members/edit.html.haml

42 lines
1.6 KiB
Plaintext
Raw Normal View History

= javascript_include_tag "merged/vue.min.js"
= javascript_include_tag "marked.min.js"
2022-12-24 14:07:25 +01:00
.flex.justify-center.m-20
2022-12-22 15:27:05 +01:00
.flex.flex-col
%h1 Editing member
2022-12-20 16:05:26 +01:00
2022-12-25 22:32:34 +01:00
= simple_form_for @member , builder: SimpleForm::Tailwind::FormBuilder do |f|
= f.error_notification
2022-12-20 16:05:26 +01:00
2022-12-25 16:37:22 +01:00
.grid.grid-cols-3.gap-10.mx-20
2022-12-25 22:32:34 +01:00
= f.input :name
2022-12-31 15:46:48 +01:00
= f.input :public , label: "Public: (Click box below)"
2022-12-25 22:32:34 +01:00
= f.input :picture , as: :file
2022-12-25 16:37:22 +01:00
.preview.prose
%b.text-2xl Preview
%div{"v-html" => "compiledMarkdown"}
.field.flex.flex-col
2022-12-25 22:32:34 +01:00
= f.text_area :bio ,rows: 15 , "v-model" => "markdown" , class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"
2022-12-25 16:37:22 +01:00
%div
-if @member.picture_url
%div.overflow-hidden
.my-5 Currently
= image_tag @member.picture_url, class: "object-contain h-40"
-else
No Picture
.flex.justify-center.actions.m-10
2022-12-31 15:46:48 +01:00
= f.button :button, "Update", class: "flex justify-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
= link_to member_path(@member) do
%button.ml-20.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit}
Back
:ruby2js
class Mark < Vue
options el: '.grid'
def initialize
@markdown = "#{@member.bio.to_s.html_safe}"
end
def compiledMarkdown
marked.parse(@markdown)
end
end