Skip to content

Commit 033f975

Browse files
committed
Move all <style> blocks in the main.css file
Signed-off-by: tdruez <[email protected]>
1 parent cbb8679 commit 033f975

File tree

4 files changed

+152
-149
lines changed

4 files changed

+152
-149
lines changed

scancodeio/static/main.css

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,128 @@ textarea.is-dynamic {
406406
#codebase-relation-list th#column-map_type {
407407
width: 145px;
408408
}
409+
#resource-viewer #editor {
410+
min-height:730px;
411+
border: var(--bulma-grey) 1px solid;
412+
}
413+
#resource-viewer .tag {
414+
height: 1.5em;
415+
padding-left: 0.5em;
416+
padding-right: 0.5em;
417+
}
418+
#resource-viewer .nav-button .button {
419+
height: auto;
420+
padding: 0 .25rem 0 .25rem;
421+
}
422+
#resource-viewer #detected-data-buttons {
423+
background-color: var(--bulma-pre-background);
424+
border-left: var(--bulma-grey) 1px solid;
425+
border-right: var(--bulma-grey) 1px solid;
426+
}
427+
#resource-viewer #detected-data-buttons p.control {
428+
border-right: var(--bulma-grey) 1px solid;
429+
}
430+
#resource-viewer .ace_tooltip .ace_icon {
431+
display: none;
432+
}
433+
434+
/* Full screen for #resource-viewer
435+
Inspired by ace/demo/scrollable-page.html */
436+
body.full-screen {
437+
overflow: hidden;
438+
/* transform breaks position fixed */
439+
transform: none !important;
440+
}
441+
body.full-screen #resource-viewer {
442+
height: auto;
443+
width: auto;
444+
border: 0;
445+
margin: 0;
446+
position: fixed !important;
447+
top: 0;
448+
bottom: 0;
449+
left: 0;
450+
right: 0;
451+
z-index: 100;
452+
}
453+
body.full-screen #resource-viewer .message-header {
454+
border-radius: 0 !important;
455+
}
456+
457+
#resource-tree-container .resizable-container {
458+
height: calc(100vh - 140px);
459+
}
460+
#resource-tree-container .chevron {
461+
transition: transform 0.2s ease;
462+
display: inline-block;
463+
}
464+
#resource-tree-container .chevron.rotated {
465+
transform: rotate(90deg);
466+
}
467+
#resource-tree-container .left-pane {
468+
min-width: 0;
469+
max-width: 100%;
470+
border-right: 1px solid #ccc;
471+
overflow-y: auto;
472+
overflow-x: hidden;
473+
flex-basis: 25%;
474+
transition: opacity 0.2s ease;
475+
text-overflow: ellipsis;
476+
white-space: nowrap;
477+
}
478+
#resource-tree-container .left-pane.collapsed {
479+
opacity: 0;
480+
pointer-events: none;
481+
}
482+
#resource-tree-container .resizer {
483+
width: 3px;
484+
background: var(--bulma-border);
485+
cursor: col-resize;
486+
position: relative;
487+
flex-shrink: 0;
488+
}
489+
#resource-tree-container .resizer:hover {
490+
background: var(--bulma-border-hover);
491+
}
492+
#resource-tree-container .resizer::before {
493+
content: '';
494+
position: absolute;
495+
top: 50%;
496+
left: 0px;
497+
transform: translateY(-50%);
498+
width: 2px;
499+
height: 30px;
500+
background: #999;
501+
border-radius: 2px;
502+
}
503+
#resource-tree-container .right-pane {
504+
flex: 1;
505+
min-width: 0;
506+
transition: opacity 0.2s ease;
507+
display: flex;
508+
flex-direction: column;
509+
height: 100%;
510+
}
511+
#resource-tree-container .right-pane .table-scroll-area {
512+
flex: 1;
513+
overflow-y: auto;
514+
overflow-x: hidden;
515+
}
516+
#resource-tree-container .right-pane.collapsed {
517+
opacity: 0;
518+
pointer-events: none;
519+
}
520+
#resource-tree-container .right-pane a:hover {
521+
text-decoration: underline;
522+
}
523+
#resource-tree-container .is-current, .is-current:hover {
524+
background-color: var(--bulma-background-hover) !important;
525+
border-radius: var(--bulma-radius);
526+
}
527+
#resource-tree-container .tree-node, .tree-node-file {
528+
padding: .25rem 0 .25rem 0;
529+
}
530+
#resource-tree-container .tree-node:hover, .tree-node-file:hover {
531+
background-color: var(--bulma-background);
532+
border-radius: var(--bulma-radius);
533+
}

scanpipe/templates/scanpipe/panels/resource_table_panel.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
{% for subpath, segment in path_segments %}
88
{% if not forloop.first %}<span class="mx-1">/</span>{% endif %}
99
{% if not forloop.last %}
10-
<a href="{% url 'codebase_resource_tree' project.slug %}?path={{ subpath }}" class="expand-in-tree has-text-link" data-path="{{ subpath }}" hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ subpath }}" hx-target="#right-pane" hx-push-url="{% url 'codebase_resource_tree' project.slug %}?path={{ subpath }}">{{ segment }}</a>
10+
<a href="{% url 'codebase_resource_tree' project.slug %}?path={{ subpath }}"
11+
class="expand-in-tree"
12+
data-path="{{ subpath }}"
13+
hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ subpath }}"
14+
hx-target="#right-pane"
15+
hx-push-url="{% url 'codebase_resource_tree' project.slug %}?path={{ subpath }}"
16+
>
17+
{{ segment }}
18+
</a>
1119
{% else %}
1220
<span>{{ segment }}</span>
1321
{% endif %}

scanpipe/templates/scanpipe/resource_detail.html

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,6 @@
33

44
{% block title %}ScanCode.io: {{ project.name }} - {{ object.name }}{% endblock %}
55

6-
{% block extrahead %}
7-
<style>
8-
#resource-viewer #editor {
9-
min-height:730px;
10-
border: var(--bulma-grey) 1px solid;
11-
}
12-
#resource-viewer .tag {
13-
height: 1.5em;
14-
padding-left: 0.5em;
15-
padding-right: 0.5em;
16-
}
17-
#resource-viewer .nav-button .button {
18-
height: auto;
19-
padding: 0 .25rem 0 .25rem;
20-
}
21-
#resource-viewer #detected-data-buttons {
22-
background-color: var(--bulma-pre-background);
23-
border-left: var(--bulma-grey) 1px solid;
24-
border-right: var(--bulma-grey) 1px solid;
25-
}
26-
#resource-viewer #detected-data-buttons p.control {
27-
border-right: var(--bulma-grey) 1px solid;
28-
}
29-
.ace_tooltip .ace_icon {display: none;}
30-
{# Full screen inspired by ace/demo/scrollable-page.html #}
31-
body.full-screen #resource-viewer {
32-
height: auto;
33-
width: auto;
34-
border: 0;
35-
margin: 0;
36-
position: fixed !important;
37-
top: 0;
38-
bottom: 0;
39-
left: 0;
40-
right: 0;
41-
z-index: 100;
42-
43-
}
44-
body.full-screen #resource-viewer .message-header {
45-
border-radius: 0!important;
46-
}
47-
body.full-screen {
48-
overflow: hidden;
49-
/*transform breaks position fixed*/
50-
transform: none!important;
51-
}
52-
body {
53-
transform: translateZ(0);
54-
}
55-
</style>
56-
{% endblock %}
57-
586
{% block content %}
597
<div class="container is-max-widescreen">
608
{% include 'scanpipe/includes/navbar_header.html' %}

scanpipe/templates/scanpipe/resource_tree.html

Lines changed: 18 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,90 +2,6 @@
22
{% load static humanize %}
33
{% block title %}ScanCode.io: {{ project.name }} - Resources tree{% endblock %}
44

5-
{% block extrahead %}
6-
<style>
7-
.chevron {
8-
transition: transform 0.2s ease;
9-
display: inline-block;
10-
}
11-
.chevron.rotated {
12-
transform: rotate(90deg);
13-
}
14-
.resizable-container {
15-
display: flex;
16-
height: calc(100vh - 140px);
17-
margin: 0;
18-
}
19-
.left-pane {
20-
min-width: 0;
21-
max-width: 100%;
22-
border-right: 1px solid #ccc;
23-
overflow-y: auto;
24-
overflow-x: hidden;
25-
flex-basis: 25%;
26-
transition: opacity 0.2s ease;
27-
text-overflow: ellipsis;
28-
white-space: nowrap;
29-
}
30-
.left-pane.collapsed {
31-
opacity: 0;
32-
pointer-events: none;
33-
}
34-
.resizer {
35-
width: 3px;
36-
background: #ddd;
37-
cursor: col-resize;
38-
position: relative;
39-
flex-shrink: 0;
40-
}
41-
.resizer:hover {
42-
background: #bbb;
43-
}
44-
.resizer::before {
45-
content: '';
46-
position: absolute;
47-
top: 50%;
48-
left: 0px;
49-
transform: translateY(-50%);
50-
width: 2px;
51-
height: 30px;
52-
background: #999;
53-
border-radius: 2px;
54-
}
55-
.right-pane {
56-
flex: 1;
57-
min-width: 0;
58-
transition: opacity 0.2s ease;
59-
display: flex;
60-
flex-direction: column;
61-
height: 100%;
62-
}
63-
.right-pane .table-scroll-area {
64-
flex: 1;
65-
overflow-y: auto;
66-
overflow-x: hidden;
67-
}
68-
.right-pane.collapsed {
69-
opacity: 0;
70-
pointer-events: none;
71-
}
72-
.right-pane a:hover {
73-
text-decoration: underline;
74-
}
75-
.is-current, .is-current:hover {
76-
background-color: var(--bulma-background-hover) !important;
77-
border-radius: var(--bulma-radius);
78-
}
79-
.tree-node, .tree-node-file {
80-
padding: .25rem 0 .25rem 0;
81-
}
82-
.tree-node:hover, .tree-node-file:hover {
83-
background-color: var(--bulma-background);
84-
border-radius: var(--bulma-radius);
85-
}
86-
</style>
87-
{% endblock %}
88-
895
{% block content %}
906
<div id="content-header" class="container is-max-widescreen mb-3">
917
{% include 'scanpipe/includes/navbar_header.html' %}
@@ -96,19 +12,25 @@
9612
</section>
9713
</div>
9814

99-
<div class="resizable-container">
100-
<div id="left-pane" class="left-pane px-2">
101-
<div id="resource-tree">
102-
{% include "scanpipe/panels/codebase_tree_panel.html" with children=children path=path %}
15+
<div id="resource-tree-container" class="container is-fluid p-0">
16+
<div class="resizable-container is-flex">
17+
<div id="left-pane" class="left-pane px-2">
18+
<div id="resource-tree">
19+
{% include "scanpipe/panels/codebase_tree_panel.html" with children=children path=path %}
20+
</div>
21+
</div>
22+
<div id="resizer" class="resizer"></div>
23+
<div id="right-pane" class="right-pane px-2">
24+
{% if path %}
25+
<div hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ path }}"
26+
hx-trigger="load"
27+
hx-target="this"
28+
>
29+
</div>
30+
{% else %}
31+
{% include "scanpipe/panels/resource_table_panel.html" %}
32+
{% endif %}
10333
</div>
104-
</div>
105-
<div id="resizer" class="resizer"></div>
106-
<div id="right-pane" class="right-pane px-2">
107-
{% if path %}
108-
<div hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ path }}" hx-trigger="load" hx-target="this"></div>
109-
{% else %}
110-
{% include "scanpipe/panels/resource_table_panel.html" %}
111-
{% endif %}
11234
</div>
11335
</div>
11436
{% endblock %}

0 commit comments

Comments
 (0)