From 3a50ae1b4fac6b9925ca7db24e449c34d83a2648 Mon Sep 17 00:00:00 2001 From: Lisa Sy Date: Fri, 30 Oct 2020 10:24:11 -0700 Subject: [PATCH] [Crayons] Update tag page header (#11130) [deploy] * Update tag page header * Update small fixes * Make small edits * Update header layout * Use "opacity-50" instead of part of a component * Bringing back `p` since we're stripping other tags anyway :) * Update to test to match new header * Update test Co-authored-by: ludwiczakpawel Co-authored-by: Zhao-Andy <17884966+Zhao-Andy@users.noreply.github.com> --- .../stylesheets/user-profile-header.scss | 17 ------- app/assets/stylesheets/views.scss | 1 + app/assets/stylesheets/views/tag.scss | 14 +++++ app/views/articles/tag_index.html.erb | 51 +++++++++++-------- app/views/articles/tags/_sidebar.html.erb | 10 ---- app/views/podcast_episodes/index.html.erb | 2 +- .../user_visits_articles_by_tag_spec.rb | 4 +- 7 files changed, 47 insertions(+), 52 deletions(-) create mode 100644 app/assets/stylesheets/views/tag.scss diff --git a/app/assets/stylesheets/user-profile-header.scss b/app/assets/stylesheets/user-profile-header.scss index 147313b35..426d2e2b6 100644 --- a/app/assets/stylesheets/user-profile-header.scss +++ b/app/assets/stylesheets/user-profile-header.scss @@ -17,23 +17,6 @@ @media screen and (min-width: 1100px) { padding: 25px 0px 11px; } - &.tag-header { - @media screen and (min-width: 1100px) { - padding: 0px 0px 1.2vw; - } - h1 { - font-size: calc(3vw + 23px); - margin-top: 1.2vw; - margin-bottom: 8px; - margin-left: 3%; - text-align: center; - width: 94%; - img { - max-height: calc(3vw + 33px); - max-width: calc(3vw + 33px); - } - } - } &.podcast-header { background: rgb(5, 22, 32); text-align: center; diff --git a/app/assets/stylesheets/views.scss b/app/assets/stylesheets/views.scss index ade82102f..614b6cebf 100644 --- a/app/assets/stylesheets/views.scss +++ b/app/assets/stylesheets/views.scss @@ -11,3 +11,4 @@ @import 'views/signin'; @import 'views/signup-modal'; @import 'views/sponsors'; +@import 'views/tag'; diff --git a/app/assets/stylesheets/views/tag.scss b/app/assets/stylesheets/views/tag.scss new file mode 100644 index 000000000..17b690142 --- /dev/null +++ b/app/assets/stylesheets/views/tag.scss @@ -0,0 +1,14 @@ +@import '../config/import'; + +.tag-header { + padding: var(--su-4); + border-radius: 0; + + @media (min-width: $breakpoint-m) { + border-radius: var(--radius); + } + + @media (min-width: $breakpoint-l) { + padding: var(--su-6); + } +} diff --git a/app/views/articles/tag_index.html.erb b/app/views/articles/tag_index.html.erb index 2d3b5f099..233c6da06 100644 --- a/app/views/articles/tag_index.html.erb +++ b/app/views/articles/tag_index.html.erb @@ -4,31 +4,38 @@ <% expiry_minutes = params[:timeframe].blank? || params[:timeframe] == "latest" ? 4 : 20 %> <% flag = true %> <% cache("tag-stories-index-#{params}-#{flag}-#{@tag_model.updated_at}-#{user_signed_in?}", expires_in: expiry_minutes.minutes) do %> - - + <% if @tag_model && @tag_model.short_summary.present? %> + <% end %> + +
" data-which="" data-tag="<%= @tag %>" diff --git a/app/views/articles/tags/_sidebar.html.erb b/app/views/articles/tags/_sidebar.html.erb index 9f6ace981..16f7ba193 100644 --- a/app/views/articles/tags/_sidebar.html.erb +++ b/app/views/articles/tags/_sidebar.html.erb @@ -2,16 +2,6 @@