Skip to content

Commit

Permalink
Improve Cost Card style
Browse files Browse the repository at this point in the history
- Move cost to right
- Space as separator
- Add lines between rows and columns
  • Loading branch information
kula1922 committed Mar 30, 2015
1 parent 11bcaf9 commit bd34f69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/ralph_scrooge/media/scrooge/css/scrooge.css
Expand Up @@ -418,9 +418,6 @@ div.blocked {
.red {
color: red;
}
.table>tbody>tr>td {
border: 0px;
}
.table tbody tr td.tab-error {
background-color: #ffcccc;
border-radius: 4px;
Expand Down
15 changes: 13 additions & 2 deletions src/ralph_scrooge/media/scrooge/partials/costcard.html
Expand Up @@ -3,13 +3,24 @@
<thead>
<tr>
<th data-field="name" data-sortable="true">Usage name</th>
<th data-field="cost" data-sortable="true" data-formatter="costFormatter">Cost</th>
<th data-field="cost" data-halign="center" data-align="right" data-sortable="true" data-formatter="costFormatter">Cost</th>
</tr>
</thead>
</table>
<script>
function costFormatter(value, row) {
return value + ' PLN';
value_list = String(value).split('.');
new_value = '';
for(var i = value_list[0].length; i > 0; i--) {
if (i % 3 === 0) {
new_value += ' ';
}
new_value += value_list[0][value_list[0].length - i];
}
if (value_list.length === 2) {
new_value += '.' + value_list[1];
}
return new_value + ' PLN';
}
function rowStyle(row, index) {
if (row.name == 'Total') {
Expand Down

0 comments on commit bd34f69

Please sign in to comment.