Revamped the home page a bit

This commit is contained in:
2022-12-11 21:29:18 -05:00
parent f3e970ab1b
commit 4c9d46f875
5 changed files with 101 additions and 16 deletions

View File

@ -1,11 +1,57 @@
<p>This is a test.</p>
<div class="row">
<div class="twelve columns">
<h1 id="site-header">Welcome to Raven</h1>
</div>
</div>
<% if items.length > 0 %>
<ul>
<% items.each do |item| %>
<li><%= item.name %></li>
<% end %>
</ul>
<% else %>
<p>There are no items to display.</p>
<% end %>
<hr>
<div class="row">
<div class="six columns">
<h3>Recent inventory updates</h3>
<% if items.length > 0 %>
<table class="u-full-width">
<thead>
<tr>
<th>Item name</th>
<th>Updated at</th>
</tr>
</thead>
<tbody>
<% items.each do |item| %>
<tr>
<td><%= item.name %></td>
<td><%= date_format(item.updated_at) %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>There are no items to display.</p>
<% end %>
</div>
<div class="six columns">
<h3>Recent license updates</h3>
<% if licenses.length > 0 %>
<table class="u-full-width">
<thead>
<tr>
<th>License name</th>
<th>Updated at</th>
</tr>
</thead>
<tbody>
<% licenses.each do |license| %>
<tr>
<td><%= license.name %></td>
<td><%= date_format(license.updated_at) %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>There are no licenses to display.</p>
<% end %>
</div>
</div>

View File

@ -13,7 +13,10 @@
<!-- Main navigation -->
<%= erb :'layout/navbar' %>
<div id="main-wrapper" class="container">
<!-- Inventory search/actions bar -->
<%= erb :'layout/actions' %>
<div id="main-wrapper" class="container fluid card">
<%= yield %>
</div>
</body>

9
views/layout/actions.erb Normal file
View File

@ -0,0 +1,9 @@
<div id="main-actions" class="container fluid card">
<div class="row">
<div class="six columns">
<form action="/search" class="u-full-width">
<input id="search-field" class="u-full-width" type="text" placeholder="Search your inventory..." name="Search field">
</form>
</div>
</div>
</div>