From 3e35edc37944f633695fe463912868b810cca593 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Wed, 8 Nov 2023 17:38:38 +0000 Subject: [PATCH] Improve profile style --- app/assets/stylesheets/application.css.sass | 13 +++----- app/assets/stylesheets/profiles.sass | 2 +- app/views/profiles/index.html.haml | 34 +++++++-------------- app/views/profiles/show.html.haml | 3 -- app/views/social_links/new.html.haml | 2 -- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index a6ed7a88..a4495936 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -24,7 +24,8 @@ a h1 font-size: 7vmin - margin: 0 0 5vmin 0 + width: 100% + text-align: center header font-size: 3vmin @@ -55,6 +56,9 @@ header background: #00ff0060 border-radius: 0 18em 0 0 font-size: 2em + > h1 + padding-top: .6em + text-indent: -7.5em #home-headline, .home-headline @@ -73,13 +77,6 @@ header background-color: #33cc3399 #main-menu - // transition: all 12s ease-out - // padding: 40px - // bottom: 0 - // position: relative - // display: inline-block - // margin-top: 15em - // top: 97px flex: 1 1 auto font-size: 5vmin display: flex diff --git a/app/assets/stylesheets/profiles.sass b/app/assets/stylesheets/profiles.sass index 157642af..6c8c6ada 100644 --- a/app/assets/stylesheets/profiles.sass +++ b/app/assets/stylesheets/profiles.sass @@ -15,7 +15,7 @@ a .profile text-align: center position: relative background: #40a10b - background: linear-gradient(90deg, #e1b02777 0%, rgba(0,0,0,0) 88%) + background: linear-gradient(90deg, rgba(0,0,0,0) 0%, #e1b02777 47%, rgba(0, 0, 0, 0) 95%) > a padding: 0 1em .dscvr-logo, .x-logo diff --git a/app/views/profiles/index.html.haml b/app/views/profiles/index.html.haml index 6c8f0407..1116e654 100644 --- a/app/views/profiles/index.html.haml +++ b/app/views/profiles/index.html.haml @@ -1,39 +1,27 @@ %h1 Listing profiles -%p +%div{style: "align-self: start; padding-left: .8em;"} - if policy(Profile).new? = link_to '+ New Profile', new_profile_path - else = link_to 'Sign In', new_user_session_path to create a new Profile --# %table - -# %thead - -# %tr - -# %th User - -# %th Name - -# %th Summary - -# %th About - -# - if policy(Profile).destroy? - -# %th - -# %th - - -# %tbody - - @profiles.each do |profile| - %tr - -# %td= profile.user - %td= link_to profile.name, profile - %td= profile.summary - %td= profile.about - -# - if policy(profile).destroy? - -# %td= link_to 'Edit', edit_profile_path(profile) - -# %td= link_to 'Destroy', profile, method: :delete, data: { confirm: 'Are you sure?' } - - @profiles.each do |profile| = link_to profile do .profile %h1= profile.name %span= profile.summary + -# = link_to "", "#" + .social-links + - profile.social_links.each do |social_link| + - if policy(social_link).destroy? + %span.controls + = link_to '📝', edit_social_link_path(social_link) + = link_to '❌', social_link, method: :delete, data: { confirm: 'Are you sure?' } + = social_link.to_icon.html_safe + - if policy(profile).edit? + %br= link_to '+ Add Social Link', new_social_link_path(profile_id: profile.id) %p= profile.about - if policy(profile).destroy? = link_to 'Edit', edit_profile_path(profile) diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index b788bcc8..0cf8bae3 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -1,6 +1,3 @@ -:css - #content { padding-top: 3em; } - - if policy(@profile).edit? .contain = link_to 'Edit', edit_profile_path(@profile) diff --git a/app/views/social_links/new.html.haml b/app/views/social_links/new.html.haml index ac0a1aea..57febfce 100644 --- a/app/views/social_links/new.html.haml +++ b/app/views/social_links/new.html.haml @@ -1,5 +1,3 @@ %h1 New social_link = render 'form' - -= link_to 'Back', social_links_path