From 940bcbfb2fb940ce507a458e0f508c60d6d395ec Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Tue, 7 Nov 2023 03:58:09 +0000 Subject: [PATCH] Style profile index --- app/assets/stylesheets/application.css.sass | 1 + app/assets/stylesheets/profiles.sass | 11 ++++++++++ app/assets/stylesheets/profiles.scss | 3 --- app/views/profiles/index.html.haml | 23 ++++++++++++++------- 4 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 app/assets/stylesheets/profiles.sass delete mode 100644 app/assets/stylesheets/profiles.scss diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index 98dbf196..2c3e294a 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -213,3 +213,4 @@ textarea padding: 1em @import doodads +@import profiles diff --git a/app/assets/stylesheets/profiles.sass b/app/assets/stylesheets/profiles.sass new file mode 100644 index 00000000..89b4ec4d --- /dev/null +++ b/app/assets/stylesheets/profiles.sass @@ -0,0 +1,11 @@ +.profile + text-align: center + background: #ffffff33 + border-radius: 1rem + padding: 1rem + margin: 1rem + border: .1rem solid #333333 + +a .profile + span, p + color: black diff --git a/app/assets/stylesheets/profiles.scss b/app/assets/stylesheets/profiles.scss deleted file mode 100644 index 4d63f1a3..00000000 --- a/app/assets/stylesheets/profiles.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Profiles controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: https://sass-lang.com/ diff --git a/app/views/profiles/index.html.haml b/app/views/profiles/index.html.haml index 800edd66..6c8f0407 100644 --- a/app/views/profiles/index.html.haml +++ b/app/views/profiles/index.html.haml @@ -7,18 +7,18 @@ = link_to 'Sign In', new_user_session_path to create a new Profile -%table - %thead - %tr +-# %table + -# %thead + -# %tr -# %th User - %th Name - %th Summary - %th About + -# %th Name + -# %th Summary + -# %th About -# - if policy(Profile).destroy? -# %th -# %th - %tbody + -# %tbody - @profiles.each do |profile| %tr -# %td= profile.user @@ -29,3 +29,12 @@ -# %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 + %p= profile.about + - if policy(profile).destroy? + = link_to 'Edit', edit_profile_path(profile) + = link_to 'Delete', profile, method: :delete, data: { confirm: 'Are you sure?' }