From f54fac74c8c0b1977ca28a3fc3830f74593301c9 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 17 Feb 2022 20:27:22 -0600 Subject: [PATCH] Add image icon next to thumbnail size dropdown menu. --- app/components/application_component.rb | 2 +- .../comment_component.html.erb | 2 +- .../comment_component/comment_component.scss | 5 ----- .../forum_post_component.html.erb | 2 +- .../popup_menu_component.html.erb | 4 ++-- .../popup_menu_component.scss | 9 --------- .../preview_size_menu_component.html.erb | 2 +- app/helpers/icon_helper.rb | 4 ++++ .../src/styles/specific/user_tooltips.scss | 2 -- app/views/posts/index.html.erb | 18 ++++++++++-------- 10 files changed, 20 insertions(+), 30 deletions(-) diff --git a/app/components/application_component.rb b/app/components/application_component.rb index ddbb2d3dc..c061993e2 100644 --- a/app/components/application_component.rb +++ b/app/components/application_component.rb @@ -2,7 +2,7 @@ class ApplicationComponent < ViewComponent::Base delegate :link_to_user, :time_ago_in_words_tagged, :format_text, :external_link_to, :tag_class, :current_page_path, to: :helpers - delegate :edit_icon, :delete_icon, :undelete_icon, :flag_icon, :upvote_icon, :downvote_icon, :link_icon, :sticky_icon, :unsticky_icon, :hashtag_icon, :caret_down_icon, to: :helpers + delegate :edit_icon, :delete_icon, :undelete_icon, :flag_icon, :upvote_icon, :downvote_icon, :link_icon, :sticky_icon, :unsticky_icon, :hashtag_icon, :caret_down_icon, :image_icon, to: :helpers def policy(subject) Pundit.policy!(current_user, subject) diff --git a/app/components/comment_component/comment_component.html.erb b/app/components/comment_component/comment_component.html.erb index 50c92bd29..d914422d6 100644 --- a/app/components/comment_component/comment_component.html.erb +++ b/app/components/comment_component/comment_component.html.erb @@ -42,7 +42,7 @@ <%= render "application/update_notice", record: comment %> <% end %> - + <% if votable? %>
  • <% if current_user.is_anonymous? %> diff --git a/app/components/comment_component/comment_component.scss b/app/components/comment_component/comment_component.scss index 5307ce8bb..c4bab3c97 100644 --- a/app/components/comment_component/comment_component.scss +++ b/app/components/comment_component/comment_component.scss @@ -43,9 +43,4 @@ article.comment { width: 1.25em; } } - - .popup-menu { - width: 1.5em; - height: 1.5em; - } } diff --git a/app/components/forum_post_component/forum_post_component.html.erb b/app/components/forum_post_component/forum_post_component.html.erb index 0a8a251a9..4c8af350d 100644 --- a/app/components/forum_post_component/forum_post_component.html.erb +++ b/app/components/forum_post_component/forum_post_component.html.erb @@ -15,7 +15,7 @@ <%= render "application/update_notice", record: forum_post %> - + <% if policy(forum_post).reply? %> <% if current_user.is_anonymous? %>
  • <%= link_to "Reply", login_path(url: request.fullpath) %>
  • diff --git a/app/components/popup_menu_component/popup_menu_component.html.erb b/app/components/popup_menu_component/popup_menu_component.html.erb index c7abca8c3..73519a9df 100644 --- a/app/components/popup_menu_component/popup_menu_component.html.erb +++ b/app/components/popup_menu_component/popup_menu_component.html.erb @@ -1,5 +1,5 @@ -
  • - <%= render PreviewSizeMenuComponent.new(current_size: @preview_size) %> +
  • + <%= render PreviewSizeMenuComponent.new(current_size: @preview_size) %> - <%= render PopupMenuComponent.new(classes: "post-preview-options-menu") do |menu| %> - <% menu.item do %> - <% if @post_set.show_votes %> - <%= link_to "Hide scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: nil, size: params[:size]), class: "post-preview-hide-votes", rel: "nofollow" %> - <% else %> - <%= link_to "Show scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: true, size: params[:size]), class: "post-preview-show-votes", rel: "nofollow" %> + <%= render PopupMenuComponent.new(classes: "post-preview-options-menu") do |menu| %> + <% menu.item do %> + <% if @post_set.show_votes %> + <%= link_to "Hide scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: nil, size: params[:size]), class: "post-preview-hide-votes", rel: "nofollow" %> + <% else %> + <%= link_to "Show scores", posts_path(tags: params[:tags], page: params[:page], limit: params[:limit], show_votes: true, size: params[:size]), class: "post-preview-show-votes", rel: "nofollow" %> + <% end %> <% end %> <% end %> - <% end %> +