
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.

/* Based on backgrid.css from Backgrid, but with most stuff removed since we 
 * are using Bootstrap's table styles instead and we aren't using any of the 
 * editor functionality. */

.backgrid {
    th {
        white-space: nowrap;
    }

    th.sortable a {
        cursor: pointer;
    }

    th.sortable:after {
        margin-left: 0.3em;
        text-decoration: none;
        .fa-icon();
        content: @fa-var-sort;
        color: @grayLighter;
    }
    th.sortable.ascending:after {
        .fa-icon();
        content: @fa-var-sort-asc;
        color: @textColor;
    }
    th.sortable.descending:after {
        .fa-icon();
        content: @fa-var-sort-desc;
        color: @textColor;
    }

    .number-cell, .integer-cell {
        text-align: right;
    }
    .boolean-cell, .select-cell {
        text-align: center;
    }
    // Usernames are usually short except lab controller user accounts are 
    // typically very long, which can blow out the table width. So we constraint 
    // them a bit with an ellipsis for overflow.
    .user-cell {
        max-width: 6em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    // Truncated Markdown cells are similarly constrained with an ellipsis.
    .truncated-markdown-cell {
        max-width: 30em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    // Loading overlay showing a spinner
    .loading-overlay {
        position: absolute;
        background-color: rgba(255, 255, 255, 0.7);
        z-index: 100;
        display: table;
        p {
            text-align: center;
            vertical-align: middle;
            display: table-cell;
        }
    }
}

.backgrid-initial-loading-indicator {
    text-align: center;
}

.grid-filter {
    float: left;
    input.search-query {
        width: 20em;
        padding-left: 2*@baseFontSize;
    }
    &:before {
        content: @fa-var-search;
        .fa-icon();
        line-height: inherit !important;
        opacity: 0.6;
        z-index: 200; // input-append uses z-index hackery
        position: absolute;
        height: @baseLineHeight;
        padding: 4px 10px; // matches default for <input/>
    }
}

.grid-add {
    float: left;
}
