Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
/**
2
* Reportbuilder styles.
3
*/
4
 
5
//
6
// General styles
7
//
8
 
9
// Button styles when a toggle button is active.
10
.reportbuilder-wrapper {
1441 ariadna 11
    .btn-outline-secondary[data-bs-toggle="collapse"]:not(.collapsed),
12
    .dropdown.show .btn-outline-secondary[data-bs-toggle="dropdown"] {
13
        color: color-contrast($gray-600);
1 efrain 14
        background-color: $gray-600;
15
        border-color: $gray-600;
16
    }
17
}
18
 
19
//
20
// Table
21
//
22
 
23
.reportbuilder-table {
24
    td {
25
        @extend .align-middle;
26
    }
27
    .action-menu .menubar {
28
        justify-content: end;
29
    }
30
}
31
 
32
//
33
// Filters
34
//
35
 
36
$rb-filters-dropdown-width: 27rem !default;
37
$rb-filters-dropdown-height: 30rem !default;
38
$rb-filters-footer-height: 4rem;
39
 
40
.reportbuilder-wrapper .filters-dropdown {
41
    width: $rb-filters-dropdown-width;
42
    padding: 0 0 $rb-filters-footer-height 0;
43
    z-index: $zindex-modal;
44
    overflow: hidden;
1441 ariadna 45
    @include media-breakpoint-down(md) {
1 efrain 46
        width: 100%;
47
    }
48
}
49
.reportbuilder-filters-sidebar {
50
    max-height: $rb-filters-dropdown-height;
51
    overflow-y: auto;
52
    border-bottom: 1px solid $dropdown-border-color;
53
    @include thin-scrolls($white);
54
    @include scroll-shadow();
55
 
56
    .filter {
57
        &:not(:nth-last-child(2)) {
58
            border-bottom: 1px solid $dropdown-border-color;
59
        }
60
        .filter-name:hover {
61
            white-space: normal;
62
            text-overflow: clip;
63
            word-break: break-all;
64
        }
65
    }
66
    .fitem[data-groupname="buttonar"] {
67
        position: absolute;
68
        bottom: 0;
69
        height: $rb-filters-footer-height;
70
        align-items: center;
71
        .col-form-label {
72
            display: none !important; /* stylelint-disable-line declaration-no-important */
73
        }
74
    }
75
}
76
 
77
//
78
// Inline forms
79
//
80
 
81
.reportbuilder-filters-wrapper,
82
.reportbuilder-conditions-list {
83
    .mform.full-width-labels {
84
        .fdate_selector {
85
            flex-wrap: wrap;
86
        }
87
        .fitem {
88
            margin-bottom: 0 !important; /* stylelint-disable-line declaration-no-important */
89
            max-width: 100%;
90
        }
91
        .fitem:not(.row):last-child {
92
            flex: 1;
93
            min-width: 0;
94
            span,
1441 ariadna 95
            .form-select {
1 efrain 96
                width: 100%;
97
            }
98
        }
99
    }
100
}
101
 
102
//
103
// Custom Reports
104
//
105
 
106
$rb-left-sidebar-width: 250px !default;
107
$rb-right-sidebar-width: 350px !default;
108
 
109
// Reportbuilder full page layout
110
 
111
@include media-breakpoint-up(lg) {
112
    $tabs-height: 83px;
113
    $sidebar-margin-top: $navbar-height + $tabs-height + 20px;
114
    .path-admin-reportbuilder.pagelayout-popup {
115
        // Fix for behat-site defined in theme/boost/scss/moodle/debug.scss:7 is not needed. Override it.
116
        &.behat-site .fixed-top {
117
            position: fixed;
118
        }
119
        #region-main {
120
            border: none;
121
            padding: 0;
122
        }
123
        #maincontent {
124
            visibility: hidden;
125
        }
126
        .dynamictabs .nav-tabs {
127
            position: fixed;
128
            z-index: $zindex-fixed;
129
            width: calc(100% - 35px);
130
            padding-top: 1.25rem;
131
            background-color: $white;
132
            // Small hack to simulate padding bottom after nav-tabs border.
133
            box-shadow: 0 1.25rem 0 $white;
134
        }
135
        .dynamictabs .tab-content {
136
            padding-top: $tabs-height;
137
        }
138
        .reportbuilder-sidebar-menu {
139
            position: fixed;
140
            .reportbuilder-sidebar-menu-cards {
141
                max-height: calc(100vh - #{$sidebar-margin-top} - 52px); // 52px corresponds to "search" input size.
142
            }
143
        }
144
        .reportbuilder-sidebar-settings {
145
            position: fixed;
146
            right: 30px;
147
            max-height: calc(100vh - #{$sidebar-margin-top});
148
        }
149
        .reportbuilder-report[data-editing] .reportbuilder-report-container {
150
            max-height: calc(100vh - #{$sidebar-margin-top});
151
            overflow-y: auto;
152
            @include thin-scrolls($gray-100);
153
            margin-left: calc(#{$rb-left-sidebar-width} + 1rem);
154
            margin-right: calc(#{$rb-right-sidebar-width} + 1rem);
155
        }
156
        .reportbuilder-audiences-container {
157
            margin-left: calc(#{$rb-left-sidebar-width} + 1rem);
158
        }
159
    }
160
}
161
// Fix popper.js behaviour in fullpage report (using 'popup' page layout).
162
#page-admin-reportbuilder-edit #page {
163
    overflow-y: auto;
164
}
165
 
166
// Main content in "Editor" tab (report table)
167
 
168
.reportbuilder-report-container {
169
    @extend .flex-fill;
170
    min-width: 0;
171
    button[data-action="toggle-edit-preview"] .loading-icon {
172
        margin-left: .5rem;
173
    }
174
}
175
// Allow horizontal scroll in editor table.
176
.reportbuilder-editor-table-container {
177
    overflow-x: auto;
1441 ariadna 178
    padding: 1px;
1 efrain 179
}
180
// Custom table headers.
181
.reportbuilder-table th {
182
    button[data-action="report-remove-column"],
183
    span[data-drag-type="move"] {
184
        .icon {
185
            width: 12px;
186
            height: 12px;
187
            font-size: 12px;
188
            vertical-align: text-top;
189
            color: $body-color;
190
        }
191
    }
192
    button[data-action="report-remove-column"] .icon {
193
        margin-right: 0;
194
    }
195
}
196
 
197
// Left sidebar menu in "Editor" tab (columns)
198
 
199
.reportbuilder-sidebar-menu {
200
    @include media-breakpoint-up(lg) {
201
        width: $rb-left-sidebar-width;
202
        flex-shrink: 0;
203
    }
204
    .card-body .list-group-item {
205
        padding: .75rem;
206
        .icon {
207
            width: 12px;
208
            height: 12px;
209
            font-size: 12px;
210
        }
211
    }
212
}
213
.reportbuilder-sidebar-menu-cards {
214
    overflow-y: auto;
215
    @include thin-scrolls($gray-100);
216
}
217
 
218
// Right sidebar menu in "Editor" tab  (settings)
219
 
220
.reportbuilder-sidebar-settings {
221
    overflow-y: auto;
222
    @include thin-scrolls($gray-100);
223
    @include media-breakpoint-up(lg) {
224
        width: $rb-right-sidebar-width;
225
        flex-shrink: 0;
226
    }
227
 
228
    // Improve autocomplete styles.
229
    div[data-region="settings-conditions"] .reportbuilder-conditions-select,
230
    div[data-region="settings-filters"] .reportbuilder-filters-select {
231
        .form-autocomplete-selection {
232
            display: none;
233
        }
234
        .form-autocomplete-input {
235
            width: 100%;
236
        }
237
        .form-autocomplete-suggestions {
238
            width: calc(100% - 2 * #{map-get($spacers, 2)});
239
        }
240
    }
241
 
242
    .list-group-item {
243
        padding: .75rem;
244
        .icon {
245
            width: 12px;
246
            height: 12px;
247
            font-size: 12px;
248
            color: $body-color;
249
        }
250
        button[data-action="report-remove-filter"],
251
        button[data-action="report-remove-condition"] {
252
            .icon {
253
                margin-right: 0;
254
                vertical-align: text-top;
255
            }
256
        }
257
        span[data-drag-type="move"] .icon {
258
            vertical-align: text-top;
259
        }
260
    }
261
    div[data-region="settings-sorting"] .list-group-item span[data-drag-type="move"] .icon {
262
        vertical-align: middle;
263
    }
264
    div[data-region="settings-cardview"] form {
265
        .col-md-3,
266
        .col-md-9 {
267
            flex: 1 1;
268
            max-width: initial;
269
        }
270
        div[data-fieldtype="submit"] {
271
            flex-basis: auto;
272
        }
273
    }
274
    .inplaceeditable.inplaceeditingon input {
275
        width: 100%;
276
    }
277
}
278
 
279
// Drag&drop styles
280
 
281
$rb-sortable-list-drag-color: lighten($primary, 40%);
282
 
283
@keyframes sortable-list-drag-color-reset {
284
    from {
285
        background-color: $rb-sortable-list-drag-color;
286
    }
287
    to {
288
        background-color: inherit;
289
    }
290
}
291
 
292
.reportbuilder-sortable-list li,
293
.reportbuilder-table th,
294
.reportbuilder-conditions-list .condition {
295
    &.sortable-list-current-position {
296
        background-color: $rb-sortable-list-drag-color;
297
    }
298
    &.sortable-list-is-dragged {
299
        background-color: $white;
300
        opacity: 0.85;
301
    }
302
    &.sortable-list-is-dropped {
303
        animation: sortable-list-drag-color-reset 1s ease;
304
    }
305
}
306
 
307
// Toggle cards
308
 
309
.reportbuilder-toggle-card {
310
    .card-header {
311
        border-bottom: none;
312
    }
313
    .card-body {
314
        border-top: $card-border-width solid $card-border-color;
315
    }
316
    .toggle-card-button {
317
        i.toggle-card-icon {
318
            color: $gray-600;
319
            font-weight: 700;
320
        }
321
        // Toggle icons using standard bootstrap collapse.
322
        .collapsed-icon-container {
323
            display: none;
324
        }
325
        .expanded-icon-container {
326
            display: inline-block;
327
        }
328
        &.collapsed {
329
            .collapsed-icon-container {
330
                display: inline-block;
331
            }
332
            .expanded-icon-container {
333
                display: none;
334
            }
335
        }
336
    }
337
}
338
 
339
// Audiences tab
340
 
341
.reportbuilder-audiences-container {
342
    // 'OR' separator.
343
    .audience-separator {
344
        text-transform: uppercase;
345
        &::before,
346
        &::after {
347
            content: '';
348
            flex: 1;
349
            border-bottom: 1px solid $report-audience-border-color;
350
        }
351
        &:not(:empty)::before {
352
            margin-right: 1rem;
353
        }
354
        &:not(:empty)::after {
355
            margin-left: 1rem;
356
        }
357
    }
358
    // Card action icons.
359
    .instance-card {
360
        .card-header {
361
            i.icon {
362
                margin-right: 0;
363
            }
364
        }
365
    }
366
}
367
 
368
//
369
// Card view.
370
//
371
 
372
// Mixin to covert a report table in a card
373
 
374
@mixin table-cards {
375
    table.reportbuilder-table {
1441 ariadna 376
        --#{$prefix}table-striped-bg: #{$card-bg};
377
        --#{$prefix}table-hover-bg: #{$card-bg};
1 efrain 378
        thead {
379
            display: none;
380
        }
381
        tr {
382
            display: flex;
383
            flex-direction: column;
384
            margin: .5rem 0;
385
            padding: .25rem .5rem 0 .5rem;
386
            word-wrap: break-word;
387
            background-clip: border-box;
388
            border: $card-border-width solid $card-border-color;
389
            @include border-radius($card-border-radius);
390
            &.emptyrow {
391
                display: none;
392
            }
393
            &:not(.show) {
394
                td[data-cardviewhidden] {
395
                    display: none;
396
                }
397
            }
398
            td {
399
                display: block;
400
                min-height: 3.6rem;
401
                padding: .5rem .25rem;
402
                border: none;
403
                &::before {
404
                    content: attr(data-cardtitle);
405
                    display: block;
406
                    text-transform: uppercase;
407
                    font-size: 70%;
408
                    color: $gray-800;
409
                }
410
                &:not([data-cardtitle]) {
411
                    min-height: 3rem;
412
                }
413
                &:not(:first-child):not(.card-toggle) {
414
                    border-top: $card-border-width solid $card-border-color;
415
                }
416
                &:first-child {
417
                    padding-right: 2rem;
418
                }
419
            }
420
            td.card-toggle {
421
                display: block !important; /* stylelint-disable-line declaration-no-important */
422
                position: absolute;
423
                right: 10px;
424
                button {
425
                    padding: 0 .5rem;
426
                    color: $gray-600;
427
                    i {
428
                        font-size: 1.5em;
429
                        font-weight: bold;
430
                    }
431
                }
432
            }
433
        }
434
    }
435
}
436
 
437
// Logic to apply card-view mixin when necessary
1441 ariadna 438
.reportbuilder-report {
439
    container-type: inline-size; /* stylelint-disable-line */
440
}
1 efrain 441
 
442
.reportbuilder-report[data-report-type="0"]:not([data-editing]) {
1441 ariadna 443
    // Report card view for small containers (if not forcing table).
444
    @container (width < #{map-get($grid-breakpoints, sm)}) { /* stylelint-disable-line */
1 efrain 445
        &:not([data-force-table]) {
446
            @include table-cards;
447
        }
448
    }
449
    // Report card view for bigger screens (if forcing card).
1441 ariadna 450
    &[data-force-card] {
451
        @include table-cards;
1 efrain 452
    }
453
}