Skip to content

Commit ff7fbaa

Browse files
anshulxyzseanmarcia
authored andcommitted
Fix table columns alignment for numerals and dates (#1263)
* Fix table columns alignment for numerals and dates Closes #1220 I have added the css for sligning table columns with numeral to the right and table columns with date to the center * Update fix table columns assignment Add updated CSS for numerals and dates in the tables across the views Resolves #1220 * Fix the leftout views' table for proper indent * Fix typo in donations index and fix order in purchases row
1 parent 2f45c52 commit ff7fbaa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+128
-119
lines changed

app/assets/stylesheets/application.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@
4242
}
4343
thead {background: $light-grey}
4444
}
45+
46+
table .numeric {
47+
text-align: right;
48+
}
49+
50+
table .date {
51+
text-align: center;
52+
}

app/views/adjustments/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<table class="table table-hover striped">
5454
<thead>
5555
<tr>
56-
<th>Created</th>
56+
<th class="date">Created</th>
5757
<th>Organization</th>
5858
<th>Storage location</th>
5959
<th>Comment</th>
@@ -64,7 +64,7 @@
6464
<tbody>
6565
<% @paginated_adjustments.each do |adjustment| %>
6666
<tr>
67-
<td><time datetime="<%= adjustment.created_at %>"><%= adjustment.created_at.strftime("%B %e, %Y") %></time></td>
67+
<td class="date"><time datetime="<%= adjustment.created_at %>"><%= adjustment.created_at.strftime("%B %e, %Y") %></time></td>
6868
<td><%= adjustment.organization.name %></td>
6969
<td><%= adjustment.storage_location.name %></td>
7070
<td><%= adjustment.comment %></td>

app/views/adjustments/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
<tr>
4141
<th>&nbsp;</th>
4242
<th>Item</th>
43-
<th>Quantity</th>
43+
<th class="numeric">Quantity</th>
4444
</tr>
4545
<% @adjustment.line_items.each do |line_item| %>
4646
<tr class="<%= line_item.quantity > 0 ? "positive" : "negative" %>">
4747
<td><%= (line_item.quantity > 0) ? "Added " : "Removed " %></td>
4848
<td><%= line_item.item.name %></td>
49-
<td><%= line_item.quantity.abs %></td>
49+
<td class="numeric"><%= line_item.quantity.abs %></td>
5050
</tr>
5151
<% end %>
5252
</table>

app/views/admin/barcode_items/_barcode_item_row.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr>
22
<td><%= barcode_item_row.barcodeable.name %></td>
3-
<td><%= barcode_item_row.quantity %></td>
4-
<td><%= barcode_item_row.value %></td>
3+
<td class="numeric"><%= barcode_item_row.quantity %></td>
4+
<td class="numeric"><%= barcode_item_row.value %></td>
55
<td class="text-right">
66
<%= link_to "View", admin_barcode_item_path(barcode_item_row), class: "btn btn-primary btn-xs" %>
77
<%= link_to edit_admin_barcode_item_path(barcode_item_row), class: "btn btn-info btn-xs" do %>

app/views/admin/barcode_items/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
<thead>
4949
<tr>
5050
<th>Item Type</th>
51-
<th>Quantity in the Box</th>
52-
<th>Barcode</th>
51+
<th class="numeric">Quantity in the Box</th>
52+
<th class="numeric">Barcode</th>
5353
<th class="pull-right">Actions</th>
5454
</tr>
5555
</thead>

app/views/admin/organizations/_organization_row.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr class="<%= organization_row.short_name %>">
22
<td><%= organization_row.name %></td>
33
<td><%= link_to organization_row.email, "mailto:#{organization_row.email}" %></td>
4-
<td><%= organization_row.created_at.strftime("%F") %></td>
4+
<td class="date"><%= organization_row.created_at.strftime("%F") %></td>
55
<td class="text-right">
66
<%= view_button_to admin_organization_path(organization_row.id) %>
77
<%= edit_button_to edit_admin_organization_path(organization_row.id) %>

app/views/admin/organizations/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<tr>
3232
<th>Organization</th>
3333
<th>Contact E-mail</th>
34-
<th>Added On</th>
34+
<th class="date">Added On</th>
3535
<th class="text-right">Actions</th>
3636
</tr>
3737
</thead>

app/views/audits/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<table class="table table-hover striped">
4848
<thead>
4949
<tr>
50-
<th>Created</th>
50+
<th class="date">Created</th>
5151
<th>Organization</th>
5252
<th>Storage location</th>
5353
<th>Summary</th>
@@ -58,7 +58,7 @@
5858
<tbody>
5959
<% @audits.each do |audit| %>
6060
<tr class="<%= (audit.finalized?) ? 'positive' : (audit.in_progress?) ? 'negative' : 'highlight' %>">
61-
<td><time datetime="<%= audit.created_at %>"><%= audit.created_at.strftime("%B %e, %Y") %></time></td>
61+
<td class="date"><time datetime="<%= audit.created_at %>"><%= audit.created_at.strftime("%B %e, %Y") %></time></td>
6262
<td><%= audit.organization.name %></td>
6363
<td><%= audit.storage_location.name %></td>
6464
<td><%= pluralize(audit.line_items.count, 'item') %></td>

app/views/barcode_items/_barcode_item_row.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr>
22
<td><%= barcode_item_row.barcodeable.name %></td>
3-
<td><%= barcode_item_row.quantity %></td>
4-
<td><%= barcode_item_row.value %></td>
3+
<td class=numeric><%= barcode_item_row.quantity %></td>
4+
<td class=numeric><%= barcode_item_row.value %></td>
55
<td class="text-right">
66
<%= view_button_to barcode_item_path(barcode_item_row) %>
77
<%= edit_button_to edit_barcode_item_path(barcode_item_row) %>

app/views/barcode_items/index.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
<thead>
6464
<tr>
6565
<th>Item Type</th>
66-
<th>Quantity in the Box</th>
67-
<th>Barcode</th>
66+
<th class="numeric">Quantity in the Box</th>
67+
<th class="numeric">Barcode</th>
6868
<th class="pull-right">Actions</th>
6969
</tr>
7070
</thead>

0 commit comments

Comments
 (0)