-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
_pagetree.scss
628 lines (556 loc) · 14.2 KB
/
_pagetree.scss
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
//##############################################################################
// PAGETREE
// INFO: please not that all related styles to the pagetree itselfs are
// handled through theming after the "PAGETREE THEME" section in this file.
// HEADER
.cms-pagetree-container-custom {
background: #f7f7f7;
}
.cms-pagetree-header {
clear: both;
overflow: hidden;
.cms-pagetree-title {
float: left;
}
.cms-pagetree-search {
float: right;
padding: 0;
margin: 0;
background: none;
box-shadow: none;
}
.cms-pagetree-buttons {
float: right;
}
}
.cms-pagetree-container {
// overflow: auto;
margin-bottom: $pagetree-bottom-offset;
}
.cms-pagetree-container,
.cms-pagetree {
// helper classes
.cms-hidden {
display: none !important;
}
}
.hidden {
display: none !important;
}
.cms-tree-col {
height: $pagetree-header-height;
}
.cms-tree-item {
display: inline-block;
}
.cms-tree-reload {
float: right;
}
// we need to add this to get drag & drop to work on internet explorer,
// more specifically on a microsoft surface
.jstree li {
-ms-touch-action: none;
touch-action: none;
}
//###########################################################
// TOOLTIP
// handles tooltip styling
.cms-tree-tooltip-container {
display: none;
position: absolute;
right: $pagetree-tooltip-offset;
top: -$pagetree-icon-offset;
z-index: 100;
text-align: left;
border-radius: $border-radius-base;
background: $white;
border: 1px solid $gray-lighter;
// icon on the right
&:before {
content: "";
position: absolute;
left: 100%;
top: $pagetree-icon-offset + 2;
z-index: 1;
width: $dropdown-arrow-side;
height: $dropdown-arrow-side;
margin-left: -($dropdown-arrow-side / 2);
transform: rotate(45deg);
box-shadow: $dropdown-shadow;
background-color: $submenu-dropdown-bgcolor;
}
h3 {
position: relative;
z-index: 10;
color: $gray-light;
font-size: $font-size-small;
font-weight: normal;
text-transform: uppercase;
padding: $pagetree-tooltip-header-padding;
margin: 0 !important;
border-bottom: 1px solid $gray-lighter;
background: $white;
}
a {
display: block;
padding: $pagetree-tooltip-anchor-padding;
min-width: $pagetree-tooltip-min-width;
text-transform: none;
border-bottom: 1px solid $gray-lighter;
&:hover,
&:link:hover {
color: darken($color-primary, 10%) !important;
}
&:last-child {
border: none;
}
}
.cms-icon {
position: relative;
top: 3px;
left: -1px;
}
// open state
&-open {
display: block;
}
}
.cms-tree-tooltip-wrapper {
padding: 10px;
}
//###########################################################
// ICONS
// used for the sitemap and apphook icons
.cms-tree-item-icons {
position: relative;
top: $pagetree-icon-offset;
padding: $pagetree-icon-padding;
span:before {
color: $gray-light;
}
&-dark span:before {
color: $gray-darker;
}
}
//###########################################################
// PREVIEW
// shows preview eye icon
.cms-tree-item-preview {
position: relative;
// need custom positioning here
top: 2px;
left: 3px;
a {
@extend %icon;
@include icon(eye);
font-size: $pagetree-icon-size;
&:before {
color: $gray-darker;
}
&:hover:before {
color: $black;
}
}
span {
display: inline-block;
@include hide-content();
}
// active state for current selected page
&-active a:before {
color: $black;
}
}
//###########################################################
// LANGUAGE
// shows language bubbles
.cms-tree-item-lang {
// required for tooltip
position: relative;
top: $pagetree-icon-offset;
.cms-tree-tooltip-container {
right: $pagetree-tooltip-offset - 3;
}
}
.cms-tree-lang-container span {
box-sizing: border-box;
display: inline-block;
width: $pagetree-lang-size;
height: $pagetree-lang-size;
border-radius: 100%;
// will change according to states
border: 1px solid $white;
background: $white;
&.empty {
border-color: $gray-light;
background-color: $white;
}
&.unpublished,
&.unpublishedparent {
border-color: $gray-light;
background-color: $gray-light;
}
&.published {
border-color: $color-success;
background-color: $color-success;
}
&.dirty {
animation: pulsate 2.5s ease-out infinite;
border-color: $color-primary;
background-color: $color-primary;
}
}
// animation for publishing
@keyframes pulsate {
0% {
opacity: 0.5;
}
50% {
opacity: 1;
}
100% {
opacity: 0.5;
}
}
//###########################################################
// LANGUAGE
// shows language bubbles
.cms-tree-item-menu {
position: relative;
top: $pagetree-icon-offset - 1;
.cms-icon:before {
font-size: $pagetree-icon-size - 4;
color: $gray-darker;
}
.cms-icon-check-square:before {
color: $color-success;
}
}
//###########################################################
// INFO
// icon used at the end to display additional help
.cms-tree-item-info {
position: relative;
top: $pagetree-icon-offset;
left: 1px;
.cms-icon:before {
font-size: $pagetree-icon-size;
}
p {
color: $gray-darkest;
padding: 0;
margin: 0;
}
strong {
color: $gray-light;
font-weight: normal;
}
}
//###########################################################
// SEARCH & FILTERING
// searchform or filtering
.cms-tree-search {
float: left;
margin-right: 5px;
label {
display: none !important;
}
select {
position: relative;
top: 2px;
width: $pagetree-search-width !important;
}
// need to overwrite djangocms-admin-theme
#toolbar form#changelist-search input[type="submit"] {
margin-left: 0 !important;
}
#toolbar form#changelist-search #searchbar {
width: $pagetree-search-width !important;
}
}
.cms-tree-filters {
float: right;
.js-cms-tree-filter-trigger {
position: absolute;
top: 0;
right: 0;
padding-right: 20px;
line-height: 30px;
width: 175px;
border-bottom: 1px solid $gray-lighter;
}
h2 {
display: none;
}
}
//###########################################################
// django default admin theme adaptions
.cms-tree-col {
line-height: 16px;
}
//##############################################################################
// PAGETREE THEME
// this level is required to make sure djangocms-admin-style or django-admin
// are not interfering (increasing specificity). This section only defines
// resets added through inline styles
.jstree-django-cms {
// parent and children ul
.jstree-container-ul,
.jstree-children,
// children and childrens children li
.jstree-leaf,
.jstree-node {
list-style-type: none;
padding: 0;
margin: 0;
}
// grid settings and resets added by `jstree.grid.js`
.jstree-grid-header,
.jstree-grid-separator {
padding: 0;
margin: 0;
// there are inline styles set to this part
margin-left: 0 !important;
border: none;
background: none;
}
&.jstree-grid-cell {
padding: 0;
}
// tooltips are hidden if overflow is prevented
.jstree-grid-column,
.jstree-grid-cell {
box-sizing: border-box;
overflow: visible;
}
// disable highlight on iOS devices
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
// wrapper added by jstree
.jstree-grid-wrapper {
box-sizing: border-box;
overflow: visible !important;
width: 100% !important;
}
//###########################################################
// DJANGO-CMS THEME
// general wrapper
.cms-pagetree-container {
border: 1px solid $gray-lighter;
}
.jstree-grid-wrapper {
padding-bottom: $pagetree-bottom-padding !important;
border-left: 1px solid $white;
border-bottom: 1px solid $white;
background: $gray-lightest;
}
// specificity required for admin styles and jstree resets
.jstree-django-cms {
.jstree {
padding-left: $pagetree-nesting-padding / 2;
}
// header column
.jstree-grid-header {
font-size: $font-size-small;
font-color: $gray;
text-align: center;
padding: $pagetree-header-padding;
border-bottom: 1px solid $gray-lighter;
background: $white;
}
// ensure first line is not centered
.jstree-grid-column-0 .jstree-grid-header {
text-align: left !important;
}
//###########################################################
// styles for nesting elements
.jstree-container-ul {
margin-left: $pagetree-nesting-padding;
}
.jstree-children {
margin-left: $pagetree-nesting-padding;
}
.jstree-ocl {
float: left;
position: relative;
left: -$pagetree-nesting-padding;
font-size: 12px;
color: $gray-light;
padding: 15px 10px 10px 0;
@extend %icon;
}
.jstree-open > .jstree-ocl,
.jstree-closed > .jstree-ocl {
cursor: pointer;
&:after {
content: "";
display: block;
position: absolute;
right: 2px;
top: 20px;
width: 8px;
height: 2px;
background: $gray-lighter;
}
}
.jstree-open > .jstree-ocl {
@include icon(minus-square-o);
}
.jstree-closed > .jstree-ocl {
@include icon(plus-square-o);
}
.jstree-loading > .jstree-ocl {
@include icon(loader);
&:before {
animation: cms-spin 2s infinite linear;
}
}
//###########################################################
// background color and paddings for nodes
// first row styling
.jstree-anchor {
box-sizing: border-box;
display: block;
cursor: move;
outline: none;
color: $gray;
// we need to add one pixel in to negate the negative margin
// value to get the borders to work visually
height: $pagetree-cell-height + 1;
padding: $pagetree-anchor-padding;
margin-top: -1px;
border: 1px solid $gray-lighter;
border-right: none;
background: $white url('../img/pagetree/tree-li-drag.gif') no-repeat -1px center;
&:hover {
color: $gray !important;
}
}
// style cells afterwards
.jstree-grid-cell {
height: $pagetree-cell-height;
border-bottom: 1px solid $gray-lighter;
background: $white;
// don't apply these styles for the first column
&.jstree-django-cms {
height: auto;
border: none;
background: none;
}
}
.jstree-grid-cell-regular {
text-align: center;
padding: $pagetree-cell-padding;
border-left: 1px solid $gray-lighter;
}
.jstree-grid-cell-regular-options {
border-left: none;
text-align: right;
}
// hover states
.jstree-hovered,
.jstree-clicked {
background-color: lighten($gray-lightest, 3%);
}
// special case for paste header
.jstree-grid-column-1 .jstree-grid-header {
text-align: right;
a {
font-size: $font-size-small;
top: 0;
}
span {
line-height: 1;
}
// special icon for pasting
.cms-icon {
font-size: $font-size-small;
padding-right: $pagetree-icon-offset;
margin-left: $pagetree-icon-offset;
}
}
}
//###########################################################
// initial loading display of the tree
.jstree.jstree-loading {
.jstree-container-ul {
margin: 0;
}
.jstree-anchor {
padding-top: 13px;
padding-left: 15px;
border: none;
background: none;
}
.jstree-loading > .jstree-ocl {
display: none;
}
}
//###########################################################
// success animation and paste functionality
// this should only be attached to the root
.cms-tree-node-success {
> .jstree-anchor .jstree-themeicon {
content: "";
position: relative;
top: 4px;
color: $color-success;
@extend %icon;
@include icon(check);
}
}
.cms-tree-item-helpers a {
position: relative;
top: 2px;
font-size: $font-size-normal;
.cms-icon {
position: relative;
top: 1px;
font-size: $font-size-small;
}
}
//###########################################################
// drag & drop item
#jstree-dnd {
box-sizing: border-box;
display: block;
min-width: 300px;
height: $pagetree-cell-height;
padding: $pagetree-anchor-padding !important;
margin-left: -$pagetree-marker-size + 1;
border: 1px solid $gray-lighter;
background: $white;
// copy icon triggered when pressing `CMD`
.jstree-copy {
color: $white;
padding: 0 5px 2px;
margin-left: 5px;
border-radius: $border-radius-base;
background: $gray-light;
}
// error color displayed if we can/cannot move it
.jstree-ok,
.jstree-er {
position: absolute;
top: 0;
left: -5px;
width: 5px;
height: 100%;
background: $gray-lighter;
}
.jstree-ok {
background-color: $color-success;
}
.jstree-er {
background-color: $color-danger;
}
}
#jstree-marker {
position: absolute;
margin: -$pagetree-marker-size 0 0 0;
border-right: 0;
border-top: $pagetree-marker-size solid transparent;
border-bottom: $pagetree-marker-size solid transparent;
border-left: $pagetree-marker-size solid $black;
width: 0;
height: 0;
}