diff --git a/Gemfile.lock b/Gemfile.lock index 314b90e..1af1d27 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -154,8 +154,8 @@ GEM mini_magick (4.13.2) mini_mime (1.1.5) minitest (5.25.1) - msgpack (1.7.3) - net-imap (0.5.0) + msgpack (1.7.4) + net-imap (0.5.1) date net-protocol net-protocol (0.2.2) @@ -242,7 +242,7 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.34.1) + rubocop-ast (1.35.0) parser (>= 3.3.1.0) rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) @@ -260,7 +260,7 @@ GEM ffi (~> 1.12) logger rubyzip (2.3.2) - securerandom (0.3.1) + securerandom (0.3.2) selenium-webdriver (4.26.0) base64 (~> 0.2) logger (~> 1.4) diff --git a/app/assets/stylesheets/tags.css b/app/assets/stylesheets/tags.css index bcf74cf..6d7e725 100644 --- a/app/assets/stylesheets/tags.css +++ b/app/assets/stylesheets/tags.css @@ -16,10 +16,19 @@ .tag-container { display: flex; align-items: flex-start; -} -.tag-container .name { - flex-grow: 1; + .name { + flex-grow: 1; + } + + .name a { + text-decoration: none; + color: var(--text) !important; + } + + .name a:hover { + text-decoration: underline; + } } .tag-container .action { diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index ee837ef..c5ca6a8 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class TagsController < ApplicationController - before_action :set_tag, only: %i[edit update destroy] + before_action :set_tag, only: %i[edit update destroy search] def index @tags = Tag.order(:name) @@ -57,10 +57,16 @@ def destroy redirect_to tags_url, notice: t('tags.destroy-success') end + def search + @search = Search.new(name: 'temporary', body: "tag:\"#{@tag.name}\"") + + render 'searches/show' + end + private def set_tag - @tag = Tag.find(params[:id]) + @tag = Tag.find(params[:id] || params[:tag_id]) end def tag_params diff --git a/app/views/searches/show.html.erb b/app/views/searches/show.html.erb index b7d3854..16e5996 100644 --- a/app/views/searches/show.html.erb +++ b/app/views/searches/show.html.erb @@ -1 +1 @@ -<%= render "search", items: @search.results %> +<%= render "searches/search", items: @search.results %> diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 0a82898..9fe2669 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -1,9 +1,9 @@