Files
project-work/worker-toolkit-stocks-in-the-future/repo/app/views/stocks/index.html.erb
Eric Bell 2854619bc9 chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
2026-08-11 14:44:09 -04:00

36 lines
1.7 KiB
Plaintext

<div class="w-full px-6">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<% if current_user.student? && !current_user.classroom&.trading_enabled? %>
<div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-lg mb-5">
<div class="flex items-start">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-yellow-400" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
</svg>
</div>
<div class="ml-3">
<p class="text-sm font-medium text-yellow-800">Trading is currently disabled for your classroom.</p>
<p class="mt-1 text-sm text-yellow-700">You cannot place buy or sell orders at this time. Please contact your teacher for more information.</p>
</div>
</div>
</div>
<% end %>
<div class="flex flex-col lg:flex-row justify-between items-start lg:items-center pb-2 pt-4 gap-4">
<h1 class="font-bold text-4xl">Trading Floor</h1>
<% if policy(Stock).show_holdings? || (current_user.present? && current_user.student?) %>
<div class="mt-4">
<%= render 'shared/earnings_to_invest_card' %>
</div>
<% end %>
</div>
<main class="flex-1 py-6">
<%= render "stocks/stocks_table", title: "Active Stocks", stocks: @stocks.active %>
<%= render "stocks/stocks_table", title: "Archived Stocks", stocks: @stocks.archived %>
</main>
</div>