summaryrefslogtreecommitdiff
path: root/addons/base_import/static/src/scss/base_import.scss
blob: 7e737a71112ce0a4498f6c7caf5f987a0e47e153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.oe_import {
    @include o-webclient-padding($top: 8px);
    overflow: auto;
    position: absolute; // Needed for chrome
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    @include media-breakpoint-down(sm) {
        position: static;
    }

    > p {
        text-align: justify
    }
    h2 {
        margin-top: 0.5em;
        font-size: large; // override h2 font-size which is too large
    }
    .oe_padding {
        padding: 13px 0;
    }

    .oe_import_box {
        padding: 8px;
        background: #F0EEEE;
        border-radius: $border-radius;
        border: solid 1px #dddddd;
        label {
            font-weight: normal;
        }
        .oe_import_file {
            display: inline-block;
        }
    }

    a.oe_import_toggle {
        display: block;
        &:before {
            content: '+'
        }
    }
    .oe_import_options {
        margin-top: 8px;
        p {
            margin: 0;
        }
        label {
            width: 48%;
            line-height: 32px;
            text-align: right;
        }
    }
    /* ----------- INITIAL SETUP ------------ */
    dd,
    .oe_import_toggled,
    .oe_import_grid,
    .oe_import_error_report,
    .oe_import_noheaders,
    .oe_import_report_more {
        display: none;
    }

    .oe_import_with_file label {
        font-weight: normal;
    }
    .oe_import_debug_options {
        max-width: 800px;
        columns: 1;
        @include media-breakpoint-up(md) {
            columns: 2;
        }
        // try to keep the batch fields together, doesn't work on firefox &
        // not sure how to do that (except by adding intermediate dom
        // elements)
        .oe_import_batch_limit {
            break-before: column;
        }
    }

    &.oe_import_preview .oe_import_grid {
        display: table;
    }
    &.oe_import_error .oe_import_error_report,
    &.oe_import_noheaders .oe_import_noheaders{
        display: block;
    }
    .oe_import_report_showmore .oe_import_report_more {
        display: list-item;
    }

    /* ------------- ERRORS AND WARNINGS REPORT ------------ */
    .oe_import_error_report > ul {
        padding: 0;
    }
    .oe_import_report {
        list-style: none;
    }
    .alert {
        padding: 0.50rem 1.25rem;
        margin: 0.25rem 0;

        a {
            @extend .alert-link;
            &:hover {opacity: 0.8;}
        }

        // alias -error to -danger
        &.alert-error {
            @extend .alert-danger;
        }
        &.text-error {
            @extend .text-danger;
        }
    }

    /* ------------- THE CSV TABLE ------------ */

    $cell-max-width: 350px;
    $cell-padding: 4px;
    .oe_import_grid {
        tr {
            &.oe_import_grid-header:first-child {
                line-height: 24px;
                font-weight: normal;
            }
            .oe_import_grid-cell {
                max-width: $cell-max-width;
                padding: $cell-padding;
                vertical-align: top;
                .o_multi_line_text {
                    word-break: break-word;
                }
                .o_single_line_text {
                    @include o-text-overflow($display: table-cell, $max-width: $cell-max-width - $cell-padding);
                }
            }
        }
    }

    /* Default Color for placeholder on import fields*/
    .select2-default{
        color: #F00 !important;
    }
}
/* ------------- PARTIAL MODE buttons ------------ */
// hide import in partial mode, resume otherwise
.o_import_import_full.o_import_partial_mode,
.o_import_import_partial:not(.o_import_partial_mode) {
    display: none;
}

/* Field dropdown */
.oe_import_selector {
    font-size: $font-size-sm;
    ul, li {
        margin: 0; padding: 0;
    }
    width: 250px !important;
}

.o-list-buttons.o-editing .o_button_import {
    display: none; // hidden for list view editable
}