From d607a8790b76c26aa35a6df4018d5c917a2d8861 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 7 May 2020 15:01:35 +0200 Subject: [PATCH] Fix styling of new inbox entries --- app/assets/stylesheets/application.scss | 1 + .../stylesheets/components/_inbox-entry.scss | 14 ++++++++++++++ app/views/inbox/_entry.html.haml | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/components/_inbox-entry.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 4df19f85..f53ee7ed 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -82,6 +82,7 @@ "components/comments", "components/container", "components/entry", +"components/inbox-entry", "components/jumbotron", "components/locales", "components/notifications", diff --git a/app/assets/stylesheets/components/_inbox-entry.scss b/app/assets/stylesheets/components/_inbox-entry.scss new file mode 100644 index 00000000..3f549443 --- /dev/null +++ b/app/assets/stylesheets/components/_inbox-entry.scss @@ -0,0 +1,14 @@ +.inbox-entry { + &--new { + box-shadow: 0 0.125rem 0.25rem var(--primary); + + .card-header { + background-color: var(--primary); + color: RGB(var(--primary-text)); + + .text-muted { + color: RGBA(var(--primary-text), 0.8) !important; + } + } + } +} \ No newline at end of file diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index a93b6338..06320b01 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -1,11 +1,11 @@ -.card.inbox-box{class: "bg-#{i.new? ? 'primary' : 'default'}", data: { id: i.id }} +.card.inbox-box{class: i.new? ? 'inbox-entry--new' : '', data: { id: i.id }} .card-header .media - unless i.question.author_is_anonymous %a.pull-left{href: show_user_profile_path(i.question.user.screen_name)} %img.avatar-sm{src: i.question.user.profile_picture.url(:medium)} .media-body - %h6.text-muted.media-heading.answerbox--question-user + %h6.text-muted.media-heading.answerbox__question-user = raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question)) - unless i.question.author_is_anonymous - if i.question.answer_count > 0