|
18 | 18 | <a href="/admin/shop" style="padding: 8px 16px; border-bottom: 2px solid #f25f2c; color: #f25f2c; text-decoration: none; font-weight: 600;">Shop</a> |
19 | 19 | </div> |
20 | 20 |
|
21 | | - <h1 class="page-title">Shop Items</h1> |
| 21 | + <h1 class="page-title">Shop</h1> |
22 | 22 |
|
23 | 23 | <div class="card" style="padding: 2rem; margin-bottom: 2rem; max-width: 600px;"> |
24 | 24 | <h2 style="margin-top: 0; margin-bottom: 1.5rem;">Add New Item</h2> |
|
83 | 83 | </div> |
84 | 84 | </div> |
85 | 85 | <% end %> |
86 | | - </div> |
87 | | -</main> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + |
| 89 | + <h2 style="margin: 3rem 0 1rem;">Recent Orders (<%= @shop_orders.count %>)</h2> |
| 90 | + |
| 91 | + <div class="card" style="overflow: hidden;"> |
| 92 | + <table style="width: 100%; border-collapse: collapse;"> |
| 93 | + <thead> |
| 94 | + <tr style="background: #f5f5f5; border-bottom: 1px solid #e0e0e0;"> |
| 95 | + <th style="padding: 1rem; text-align: left; font-weight: 600; font-size: 0.9rem;">User</th> |
| 96 | + <th style="padding: 1rem; text-align: left; font-weight: 600; font-size: 0.9rem;">Order Name</th> |
| 97 | + <th style="padding: 1rem; text-align: left; font-weight: 600; font-size: 0.9rem;">Status</th> |
| 98 | + <th style="padding: 1rem; text-align: left; font-weight: 600; font-size: 0.9rem;">Date</th> |
| 99 | + </tr> |
| 100 | + </thead> |
| 101 | + <tbody> |
| 102 | + <% if @shop_orders.empty? %> |
| 103 | + <tr> |
| 104 | + <td colspan="4" style="padding: 2rem; text-align: center; color: #999;">No orders yet</td> |
| 105 | + </tr> |
| 106 | + <% else %> |
| 107 | + <% @shop_orders.each do |order| %> |
| 108 | + <tr style="border-bottom: 1px solid #e0e0e0;"> |
| 109 | + <td style="padding: 1rem;"> |
| 110 | + <span style="font-weight: 600;"><%= order.user.first_name %> <%= order.user.last_name %></span> |
| 111 | + <br> |
| 112 | + <span class="muted" style="font-size: 0.9rem;"><%= order.user.email %></span> |
| 113 | + </td> |
| 114 | + <td style="padding: 1rem;"> |
| 115 | + <%= order.name %> |
| 116 | + </td> |
| 117 | + <td style="padding: 1rem;"> |
| 118 | + <% status_color = case order.status |
| 119 | + when 'pending' then '#fff3cd' |
| 120 | + when 'completed' then '#d4edda' |
| 121 | + when 'cancelled' then '#f8d7da' |
| 122 | + else '#e2e3e5' |
| 123 | + end %> |
| 124 | + <span style="background: <%= status_color %>; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; text-transform: capitalize;"><%= order.status %></span> |
| 125 | + </td> |
| 126 | + <td style="padding: 1rem; color: #999; font-size: 0.9rem;"> |
| 127 | + <%= order.created_at.strftime('%b %d, %Y') %> |
| 128 | + </td> |
| 129 | + </tr> |
| 130 | + <% end %> |
| 131 | + <% end %> |
| 132 | + </tbody> |
| 133 | + </table> |
| 134 | + </div> |
| 135 | + </main> |
88 | 136 |
|
89 | | -<script> |
| 137 | + <script> |
90 | 138 | const addItemForm = document.getElementById('add-item-form'); |
91 | 139 | const addItemBtn = document.getElementById('add-item-btn'); |
92 | 140 |
|
|
0 commit comments