From a2fe816cc82751133eb209816c5585ec53d64572 Mon Sep 17 00:00:00 2001 From: Torsten Date: Sun, 22 Jan 2023 11:36:35 +0200 Subject: [PATCH] show profiles good --- Gemfile.lock | 21 ++++++++++--------- app/views/layouts/_mobile_menu.haml | 6 ++++-- app/views/members/_artist_profile.haml | 8 +++++++ app/views/members/_member_profile.haml | 19 ++--------------- app/views/members/_profile_card.haml | 15 +++++++++++++ app/views/members/_teacher_profile.haml | 28 +++++++++++++++++-------- app/views/members/show.html.haml | 11 +++++----- app/views/profiles/edit.html.haml | 2 +- 8 files changed, 66 insertions(+), 44 deletions(-) create mode 100644 app/views/members/_profile_card.haml diff --git a/Gemfile.lock b/Gemfile.lock index 0e99cc6..7439b63 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,14 +1,6 @@ GIT - remote: https://github.com/ruby2js/ruby2js/ - revision: f204f4e8f14cde6e4d4c6aafc55251a8d488a78d - branch: haml_fix - specs: - ruby2js (5.0.1) - parser - regexp_parser (~> 2.1.1) - -PATH - remote: ../merged + remote: https://github.com/HubFeenixMakers/merged + revision: accb6682675f92eed6e1c306995017b1c8da1289 specs: merged (0.1.0) active_hash @@ -19,6 +11,15 @@ PATH redcarpet ruby2js (~> 5.0, >= 5.0.1) +GIT + remote: https://github.com/ruby2js/ruby2js/ + revision: f204f4e8f14cde6e4d4c6aafc55251a8d488a78d + branch: haml_fix + specs: + ruby2js (5.0.1) + parser + regexp_parser (~> 2.1.1) + GEM remote: https://rubygems.org/ specs: diff --git a/app/views/layouts/_mobile_menu.haml b/app/views/layouts/_mobile_menu.haml index 0824cca..836f220 100644 --- a/app/views/layouts/_mobile_menu.haml +++ b/app/views/layouts/_mobile_menu.haml @@ -13,12 +13,14 @@ %ul.space-y-6.px-20 - main_menu.each do |link , text| %li - %a.font-medium.tracking-wide.text-xl{ :href => "/#{link}" , :title => text }= text + %a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text} + = text %li %hr - mobile_menu.each do |link , text| %li - %a.font-medium.tracking-wide.text-xl{ :href => "/#{link}" , :title => text }= text + %a.w-full.h-full.block.tracking-wide.text-xl.p-2.rounded-lg.hover:bg-cyan-200{ :href => link , :title => text} + = text :javascript var drop_hidden = true; function menu_on() { diff --git a/app/views/members/_artist_profile.haml b/app/views/members/_artist_profile.haml index e69de29..d281e5e 100644 --- a/app/views/members/_artist_profile.haml +++ b/app/views/members/_artist_profile.haml @@ -0,0 +1,8 @@ += render "profile_card" , profile: profile +.flex.justify-between.mt-4 + = link_to edit_profile_path(profile) do + %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + Edit + = form_tag( profile_path(profile.id) , {method: :delete } ) do + %button.bg-red-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit} + Delete Profile diff --git a/app/views/members/_member_profile.haml b/app/views/members/_member_profile.haml index 42bd21d..86095bd 100644 --- a/app/views/members/_member_profile.haml +++ b/app/views/members/_member_profile.haml @@ -1,21 +1,6 @@ -.flex.flex-col.justify-center - =link_to profile_path(profile) do - .px-4.py-4.text-center.bg-gray-200 - %h1.text-2xl.font-bold.tracking-tight.sm:text-4xl - Member Profile - .flex.mt-6.py-4.flex-col.max-w-screen-lg.overflow-hidden.bg-white.border.rounded.shadow-sm - .relative - -if profile.picture_url - = image_tag profile.picture_url, class: "object-cover w-full h-60" - -else - No picture - %h5.m-4.text-3xl.font-bold.text-center - = profile.name - .mb-8.text-gray-800.text-center - .prose= markdown(profile.bio) += render "profile_card" , profile: profile - -.flex.justify-between +.flex.justify-between.mt-4 = link_to edit_profile_path(profile) do %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 Edit diff --git a/app/views/members/_profile_card.haml b/app/views/members/_profile_card.haml new file mode 100644 index 0000000..6b8fd99 --- /dev/null +++ b/app/views/members/_profile_card.haml @@ -0,0 +1,15 @@ +.flex.flex-col.justify-center + =link_to profile_path(profile) do + .px-4.py-4.text-center.bg-gray-200 + %h1.text-2xl.font-bold.tracking-tight.sm:text-4xl + #{profile.Kind} Profile + .flex.mt-6.py-4.flex-col.max-w-screen-lg.overflow-hidden.bg-white.border.rounded.shadow-sm + .relative + -if profile.picture_url + = image_tag profile.picture_url, class: "object-cover w-full h-60" + -else + No picture + %h5.m-4.text-3xl.font-bold.text-center + = profile.name + .mb-8.text-gray-800.text-center + .prose= markdown(profile.bio) diff --git a/app/views/members/_teacher_profile.haml b/app/views/members/_teacher_profile.haml index 7dca767..05fd03d 100644 --- a/app/views/members/_teacher_profile.haml +++ b/app/views/members/_teacher_profile.haml @@ -1,10 +1,20 @@ - -if event = profile.events.length >0 - %div - =link_to profile.events.first.name , event_path(profile.events.first) , class: "underline" - = link_to edit_event_path(profile.events.first) do - %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 - Edit - -else - = link_to new_event_path(profile: profile.kind) do += render "profile_card" , profile: profile + +.flex.justify-between.mt-4 + = link_to edit_profile_path(profile) do + %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + Edit + = form_tag( profile_path(profile.id) , {method: :delete } ) do + %button.bg-red-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400{type: :submit} + Delete Profile + +-if event = profile.events.length >0 + %div + =link_to profile.events.first.name , event_path(profile.events.first) , class: "underline" + = link_to edit_event_path(profile.events.first) do %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 - New #{profile.Kind} Event + Edit +-else + = link_to new_event_path(profile: profile.kind) do + %button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400 + New #{profile.Kind} Event diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 981204d..bf90432 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -24,11 +24,12 @@ %div= entity.name %div= entity.value %div - If you are an artist click - =link_to "here" , new_profile_path(kind: :artist) , class: "underline" - %br - Or a teacher, click - =link_to "here" , new_profile_path(kind: :teacher) , class: "underline" + - unless @member.artist_profile + If you are an artist at Hub Feenix, click + =link_to "here" , new_profile_path(kind: :artist) , class: "underline" + - unless @member.teacher_profile + If you teach at Hub Feenix, click + =link_to "here" , new_profile_path(kind: :teacher) , class: "underline" - unless @member.member_profile %div diff --git a/app/views/profiles/edit.html.haml b/app/views/profiles/edit.html.haml index 7ca7c87..c395027 100644 --- a/app/views/profiles/edit.html.haml +++ b/app/views/profiles/edit.html.haml @@ -1,5 +1,5 @@ .flex.justify-center - .column.max-w-lg + .column{class: "w-10/12 md:w-8/12 lg:w-5/12 xl:w-4/12"} .text-xl.m-4 Edit your =@profile.Kind