badar_madeena/app/views/incomes/index.html.erb

103 lines
2.5 KiB
Plaintext

<p style="color: green"><%= notice %></p>
<% content_for :title, "Incomes" %>
<h1>Incomes</h1>
<div class="text-end mb-3">
<%= link_to "📊 Income Report", income_report_path, class: "btn btn-outline-primary" %>
</div>
<%= link_to "New income", new_income_path, class:"btn-income" %>
<div id="income">
<% @incomes.each do |income| %>
<div class="income-card-item">
<div class="amount"><%= number_to_currency(income.amount) %></div>
<div class="date"><%= income.created_at.strftime("%d %b %Y") %></div>
<%= link_to "Show this income", income, class: "show-link" %>
</div>
<% end %>
</div>
<style>
/* Container for all cards */
#income {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
margin-top: 20px;
}
/* Individual income card */
.income-card-item {
background: linear-gradient(135deg, #f0f8ff, #e6f7ff); /* soft gradient */
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
width: 250px;
padding: 20px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* Hover effect for card */
.income-card-item:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
/* Amount styling */
.income-card-item .amount {
font-size: 1.4rem;
font-weight: 600;
color: #007bff;
margin-bottom: 10px;
}
/* Date styling */
.income-card-item .date {
font-size: 0.9rem;
color: #555555;
margin-bottom: 15px;
}
/* Show link styling */
.income-card-item .show-link {
align-self: flex-start;
background-color: #28a745;
color: white;
padding: 6px 12px;
border-radius: 6px;
text-decoration: none;
font-size: 0.9rem;
font-weight: 500;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.income-card-item .show-link:hover {
background-color: #1e7e34;
transform: scale(1.05);
}
.btn-income {
display: inline-block;
background: linear-gradient(135deg, #6a11cb, #2575fc);
color: #fff;
padding: 10px 20px;
font-size: 1rem;
font-weight: 600;
border-radius: 8px;
text-decoration: none;
transition: transform 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.btn-income:hover {
transform: translateY(-3px);
box-shadow: 0 6px 12px rgba(0,0,0,0.15);
background: linear-gradient(135deg, #2575fc, #6a11cb);
}
</style>