def current_user
controller.current_user
end
+ def human_readable_bytes_html(n)
+ return h(n) unless n.is_a? Fixnum
+ raw = n.to_s
+ cooked = ''
+ while raw.length > 3
+ cooked = ',' + raw[-3..-1] + cooked
+ raw = raw[0..-4]
+ end
+ cooked = raw + cooked
+ if cooked.length >= 9
+ '<b>' + cooked[0..-9] + '</b>' + cooked[-8..-1]
+ else
+ cooked
+ end
+ end
end
<tr class="contain-align-left">
<th>
collection
- </th><th>
+ </th><th class="data-size">
data size
</th><th>
protected?
<tr class="collection">
<td>
<span class="btn"><tt class="deemphasize"><%= sourcedata[:uuid] %></tt></span>
- </td><td>
- <%= sourcedata[:collection].data_size if sourcedata[:collection] and sourcedata[:collection].data_size %>
+ </td><td class="data-size">
+ <%= raw(human_readable_bytes_html(18972784837 || sourcedata[:collection].data_size)) if sourcedata[:collection] and sourcedata[:collection].data_size %>
</td><td>
<% if sourcedata[:protected] %>
<span class="btn btn-success">yes</span>