Skip to content

Commit

Permalink
Update insider trading tool links and routes for top owners, biggest …
Browse files Browse the repository at this point in the history
…trades, and top officers
  • Loading branch information
Shpigford committed Nov 21, 2024
1 parent c49fd2a commit 7298e29
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@
<h2 class="text-2xl font-medium">Insider Trading Activity</h2>
</div>
<div class="flex items-center gap-2">
<%= link_to top_owners_tool_path(slug: "inside-trading-tracker"),
<%= link_to "/tools/inside-trading-tracker/top-owners",
class: "px-3 py-2 text-xs rounded-lg border border-gray-200 hover:bg-gray-50 flex items-center gap-1.5 #{params[:filter] == 'top-owners' ? 'bg-blue-50 border-blue-200 text-blue-600' : 'text-gray-600'}",
data: { turbo_frame: "_top" } do %>
<%= lucide_icon "users", class: "w-4 h-4" %>
Large 10% Owner Trades
<% end %>

<%= link_to biggest_trades_tool_path(slug: "inside-trading-tracker"),
<%= link_to "/tools/inside-trading-tracker/biggest-trades",
class: "px-3 py-2 text-xs rounded-lg border border-gray-200 hover:bg-gray-50 flex items-center gap-1.5 #{params[:filter] == 'biggest-trades' ? 'bg-blue-50 border-blue-200 text-blue-600' : 'text-gray-600'}",
data: { turbo_frame: "_top" } do %>
<%= lucide_icon "trending-up", class: "w-4 h-4" %>
Biggest Insider Trades
<% end %>

<%= link_to top_officers_tool_path(slug: "inside-trading-tracker"),
<%= link_to "/tools/inside-trading-tracker/top-officers",
class: "px-3 py-2 text-xs rounded-lg border border-gray-200 hover:bg-gray-50 flex items-center gap-1.5 #{params[:filter] == 'top-officers' ? 'bg-blue-50 border-blue-200 text-blue-600' : 'text-gray-600'}",
data: { turbo_frame: "_top" } do %>
<%= lucide_icon "briefcase", class: "w-4 h-4" %>
Expand Down
28 changes: 18 additions & 10 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,26 @@
resources :terms, only: [ :index, :show ], path: "financial-terms"
resources :tools, only: [ :index, :show ], param: :slug do
member do
get "top-owners", to: "tools#show", defaults: { filter: "top-owners" }
get "biggest-trades", to: "tools#show", defaults: { filter: "biggest-trades" }
get "top-officers", to: "tools#show", defaults: { filter: "top-officers" }
# Exchange rate calculator routes
get ":from_currency/:to_currency(/:amount)",
constraints: {
from_currency: /[A-Z]{3}/,
to_currency: /[A-Z]{3}/,
amount: /\d+(\.\d+)?/
},
action: :show

# Insider trading views
get ":filter",
action: :show,
constraints: {
filter: /top-owners|biggest-trades|top-officers/,
slug: "inside-trading-tracker"
}

# Stock symbol route
get ":symbol", action: :show, constraints: { symbol: /[A-Z]+/ }
end
get ":from_currency/:to_currency(/:amount)", on: :member,
constraints: {
from_currency: /[A-Z]{3}/,
to_currency: /[A-Z]{3}/,
amount: /\d+(\.\d+)?/
},
action: :show
end

get "stocks/exchanges/:id", to: "stocks#exchanges", as: :stock_exchange
Expand Down

0 comments on commit 7298e29

Please sign in to comment.