2022-12-25 13:13:11 +01:00
|
|
|
= 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
|
2023-01-10 21:23:56 +01:00
|
|
|
%h1.text-4xl Editing profile
|
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
|
|
|
|
2023-01-10 21:23:56 +01:00
|
|
|
.grid.grid-cols-4.mx-20
|
|
|
|
.info.mr-8
|
|
|
|
= f.input :name
|
|
|
|
= f.input :public , label: "Public: (Click box below)"
|
|
|
|
= f.input :picture , as: :file
|
|
|
|
.flex.justify-center.actions.m-10
|
|
|
|
= f.button :button, "Update", class: button_classes + " bg-cyan-200"
|
|
|
|
= link_to member_path(@member) do
|
|
|
|
%button.ml-10{type: :submit, class: button_classes}
|
|
|
|
Back
|
|
|
|
.field.flex.flex-col.pr-2.border-r-8.border-slate-600
|
|
|
|
= f.text_area :bio ,rows: 18 , "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"
|
|
|
|
%div.h-90
|
2022-12-25 16:37:22 +01:00
|
|
|
-if @member.picture_url
|
2023-01-10 21:23:56 +01:00
|
|
|
%div.overflow-hidden.ml-2.mr-8
|
|
|
|
= image_tag @member.picture_url, class: "object-contain w-full"
|
2022-12-25 16:37:22 +01:00
|
|
|
-else
|
|
|
|
No Picture
|
2023-01-10 21:23:56 +01:00
|
|
|
.preview.prose
|
|
|
|
%b.text-2xl Preview
|
|
|
|
%div{"v-html" => "compiledMarkdown"}
|
2022-12-25 13:13:11 +01:00
|
|
|
:ruby2js
|
|
|
|
class Mark < Vue
|
|
|
|
options el: '.grid'
|
|
|
|
def initialize
|
|
|
|
@markdown = "#{@member.bio.to_s.html_safe}"
|
|
|
|
end
|
|
|
|
def compiledMarkdown
|
|
|
|
marked.parse(@markdown)
|
|
|
|
end
|
|
|
|
end
|