8000 minor #1420 Update the design of the source code modal (javiereguiluz) · symfony/demo@0b3e330 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b3e330

Browse files
committed
minor #1420 Update the design of the source code modal (javiereguiluz)
This PR was squashed before being merged into the main branch. Discussion ---------- Update the design of the source code modal The modal window that displays the source code of controller/template is nice. But the current design is troublesome. It displays the controller code on top of the template code. It doesn't look good many times because controller/templates are too long: ![source-code-modal-before](https://user-images.githubusercontent.com/73419/236446446-8981f360-ee43-4230-ad99-13cc068a623b.png) This PR proposes to use tabs to display controller and template side-by-side: ![source-code-modal-after](https://user-images.githubusercontent.com/73419/236446491-313ab2e9-0fed-4632-9419-afe87959f80f.png) Commits ------- 37d7a1c Update the design of the source code modal
2 parents 4768343 + 37d7a1c commit 0b3e330

13 files changed

+77
-43
lines changed

assets/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import './styles/app.scss';
44
import 'bootstrap/js/dist/alert';
55
import 'bootstrap/js/dist/collapse';
66
import 'bootstrap/js/dist/dropdown';
7+
import 'bootstrap/js/dist/tab';
78
import 'bootstrap/js/dist/modal';
89
import 'jquery'
910

assets/styles/app.scss

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@import "~bootstrap/scss/button-group";
1919
@import "~bootstrap/scss/input-group";
2020
// @import "~bootstrap/scss/custom-forms";
21-
// @import "~bootstrap/scss/nav";
21+
@import "~bootstrap/scss/nav";
2222
@import "~bootstrap/scss/navbar";
2323
// @import "~bootstrap/scss/card";
2424
@import "~bootstrap/scss/breadcrumb";
@@ -289,25 +289,38 @@ footer #footer-resources i {
289289
margin-left: 0.5em
290290
}
291291

292-
#sourceCodeModal h3 {
293-
font-size: $font-default;
294-
margin-top: 0
295-
}
292+
#sourceCodeModal {
293+
.modal-header {
294+
border-bottom: 0;
295+
padding: 1rem 1rem 0;
296296

297-
#sourceCodeModal h3 small {
298-
color: $gray-700;
299-
font-size: 80%
300-
}
297+
h3 { font-size: 18px; margin-top: 0; }
298+
}
301299

302-
#sourceCodeModal pre {
303-
margin-bottom: 2em;
304-
padding: 0;
305-
display: block;
306-
word-break: break-all;
307-
word-wrap: break-word;
300+
.nav-tabs {
301+
border-bottom-color: #95a5a6;
302+
margin-bottom: 15px;
303+
304+
.nav-link { font-size: 16px; }
305+
.nav-link.active { border-color: #95a5a6 #95a5a6 #fff; }
306+
.nav-link:not(.active):hover { border-color: transparent; text-decoration: underline; }
307+
}
308+
309+
.tab-content {
310+
.file-link { font-size: 16px; margin: 0 0 10px 5px; }
311+
}
312+
313+
pre {
314+
margin-bottom: 0;
315+
padding: 0;
316+
display: block;
317+
word-break: break-all;
318+
word-wrap: break-word;
308319

309-
code {
310-
white-space: pre-wrap;
320+
code {
321+
border-radius: 6px;
322+
white-space: pre-wrap;
323+
}
311324
}
312325
}
313326

public/build/42.5aced7b3.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/build/928.0e3059b2.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/42.5aced7b3.js.LICENSE.txt renamed to public/build/928.0e3059b2.js.LICENSE.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2323
*/
2424

25+
/*!
26+
* Bootstrap tab.js v4.6.2 (https://getbootstrap.com/)
27+
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
28+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
29+
*/
30+
2531
/*!
2632
* Bootstrap util.js v4.6.2 (https://getbootstrap.com/)
2733
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
File renamed without changes.

public/build/app.09886d85.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/app.3a149582.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/app.8d5ecae9.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/build/app.e7ad18f4.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)
0