Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd33c0ee

Browse files
committed
feature#20951 Redesigned the exception pages (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes#20951).Discussion----------Redesigned the exception pages| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20620| License | MIT| Doc PR | -Here are some before/after screenshots:| Before | After| --- | ---| ![exception-before-1](https://cloud.githubusercontent.com/assets/73419/21258148/f8fd6482-c37b-11e6-9efe-1bcf7b323c0f.png) | ![exception-after-1](https://cloud.githubusercontent.com/assets/73419/21258156/016059cc-c37c-11e6-8bab-80456189d614.png)| Before | After| --- | ---| ![exception-before-2](https://cloud.githubusercontent.com/assets/73419/21258171/11198a46-c37c-11e6-8a28-ae45e19e3eaf.png) | ![exception-after-2](https://cloud.githubusercontent.com/assets/73419/21258223/4cb9ac66-c37c-11e6-93db-0db2c204dc0b.png)| Before | After| --- | ---| ![exception-before-3](https://cloud.githubusercontent.com/assets/73419/21258239/5a0747ac-c37c-11e6-923e-564322e862a6.png) | ![exception-after-3](https://cloud.githubusercontent.com/assets/73419/21258246/62ad8b00-c37c-11e6-8838-3c1824c18287.png)---And here is the new design in action because everything is very dynamic and you can click anywhere to reveal/collapse things:![exception-in-action](https://cloud.githubusercontent.com/assets/73419/21258261/7445f140-c37c-11e6-9318-f3807fe38689.gif)Commits-------9d0c263 Redesigned the exception pages
2 parents12bb392 +9d0c263 commitd33c0ee

30 files changed

+363
-427
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{%include'@Twig/Exception/error.xml.twig' %}
1+
{{include('@Twig/Exception/error.xml.twig') }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{%include'@Twig/Exception/error.xml.twig' %}
1+
{{include('@Twig/Exception/error.xml.twig') }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{%include'@Twig/Exception/exception.xml.twig'with {'exception':exception } %}
1+
{{include('@Twig/Exception/exception.xml.twig', {exception:exception }) }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/*
2-
{%include'@Twig/Exception/exception.txt.twig'with {'exception':exception } %}
2+
{{include('@Twig/Exception/exception.txt.twig', {exception:exception }) }}
33
*/
Lines changed: 77 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,91 @@
1-
<divclass="block-exception">
2-
<divclass="block-exception-detected clear-fix">
3-
<divclass="support">
4-
<ahref="http://symfony.com/support">Need support?</a>
5-
</div>
6-
<divclass="illustration-exception">
7-
{{include('@Twig/Exception/exception.svg') }}
1+
<divclass="exception-summary">
2+
<divclass="exception-metadata">
3+
<divclass="container">
4+
<h2class="exception-hierarchy">
5+
{%forpreviousExceptioninexception.allPrevious|reverse %}
6+
{{previousException.class|abbr_class }}
7+
<spanclass="icon">{{include('@Twig/images/chevron-right.svg') }}</span>
8+
{%endfor %}
9+
{{exception.class|abbr_class }}
10+
</h2>
11+
<h2class="exception-http">
12+
HTTP {{status_code }} <small>{{status_text }}</small>
13+
</h2>
814
</div>
9-
<divclass="text-exception">
10-
<divclass="open-quote">“</div>
11-
12-
<h1>{{exception.message|nl2br|format_file_from_text }}</h1>
13-
14-
<div>
15-
<strong>{{status_code }}</strong> {{status_text }} - {{exception.class|abbr_class }}
15+
</div>
16+
<divclass="container">
17+
<divclass="exception-message-wrapper">
18+
<h1class="break-long-words exception-message {{exception.message|length>180?'long' }}">
19+
{{-exception.message|nl2br|format_file_from_text -}}
20+
</h1>
21+
22+
<divclass="exception-illustration hidden-xs-down">
23+
{{include('@Twig/images/symfony-ghost.svg') }}
1624
</div>
17-
18-
{%setprevious_count=exception.allPrevious|length %}
19-
{%ifprevious_count %}
20-
<divclass="linked"><span><strong>{{previous_count }}</strong> linked Exception{{previous_count>1?'s':'' }}:</span>
21-
<ul>
22-
{%fori,previousinexception.allPrevious %}
23-
<li>
24-
{{previous.class|abbr_class }} <ahref="#traces-link-{{i+1 }}"onclick="toggle('traces-{{i+1 }}', 'traces'); switchIcons('icon-traces-{{i+1 }}-open', 'icon-traces-{{i+1 }}-close');">&#187;</a>
25-
</li>
26-
{%endfor %}
27-
</ul>
28-
</div>
29-
{%endif %}
30-
31-
<divclass="close-quote">”</div>
3225
</div>
3326
</div>
3427
</div>
3528

36-
{%forposition,einexception.toarray %}
37-
{%include'@Twig/Exception/traces.html.twig'with {'exception':e,'position':position,'count':previous_count }only %}
38-
{%endfor %}
39-
40-
{%iflogger %}
41-
<divclass="block">
42-
<divclass="logs clear-fix">
43-
{%spaceless %}
44-
<h2>
45-
Logs&nbsp;
46-
<ahref="#"onclick="toggle('logs'); switchIcons('icon-logs-open', 'icon-logs-close'); return false;">
47-
<imgclass="toggle"id="icon-logs-open"alt="+"src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7"style="display: none" />
48-
<imgclass="toggle"id="icon-logs-close"alt="-"src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs="style="display: inline" />
49-
</a>
50-
</h2>
51-
{%endspaceless %}
29+
<divclass="container">
30+
<divclass="sf-tabs">
31+
<divclass="tab">
32+
{%setexception_as_array=exception.toarray %}
33+
<h3class="tab-title">
34+
{%ifexception_as_array|length>1 %}
35+
Exceptions <spanclass="badge">{{exception_as_array|length }}</span>
36+
{%else %}
37+
Exception
38+
{%endif %}
39+
</h3>
40+
41+
<divclass="tab-content">
42+
{%foreinexception_as_array %}
43+
{{include('@Twig/Exception/traces.html.twig', {exception:e,index:loop.index },with_context =false) }}
44+
{%endfor %}
45+
</div>
46+
</div>
5247

53-
{%iflogger.counterrors %}
54-
<divclass="error-count">
55-
<span>
56-
{{logger.counterrors }} error{{logger.counterrors>1?'s':''}}
57-
</span>
58-
</div>
59-
{%endif %}
48+
<divclass="tab {{loggerisempty?'disabled' }}">
49+
<h3class="tab-title">
50+
Logs
51+
{%iflogger.counterrors ??false %}<spanclass="badge status-error">{{logger.counterrors }}</span>{%endif %}
52+
</h3>
53+
54+
<divclass="tab-content">
55+
{%iflogger %}
56+
{{include('@Twig/Exception/logs.html.twig', {logs:logger.logs },with_context =false) }}
57+
{%else %}
58+
<divclass="empty">
59+
<p>No log messages</p>
60+
</div>
61+
{%endif %}
62+
</div>
6063
</div>
6164

62-
<divid="logs">
63-
{%include'@Twig/Exception/logs.html.twig'with {'logs':logger.logs }only %}
65+
<divclass="tab">
66+
<h3class="tab-title">
67+
{%ifexception_as_array|length>1 %}
68+
Stack Traces <spanclass="badge">{{exception_as_array|length }}</span>
69+
{%else %}
70+
Stack Trace
71+
{%endif %}
72+
</h3>
73+
74+
<divclass="tab-content">
75+
{%foreinexception_as_array %}
76+
{{include('@Twig/Exception/traces_text.html.twig', {exception:e,index:loop.index,num_exceptions:loop.length },with_context =false) }}
77+
{%endfor %}
78+
</div>
6479
</div>
65-
</div>
66-
{%endif %}
6780

68-
{%ifcurrentContent %}
69-
<divclass="block">
70-
{%spaceless %}
71-
<h2>
72-
Content of the Output&nbsp;
73-
<ahref="#"onclick="toggle('output-content'); switchIcons('icon-content-open', 'icon-content-close'); return false;">
74-
<imgclass="toggle"id="icon-content-close"alt="-"src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs="style="display: none" />
75-
<imgclass="toggle"id="icon-content-open"alt="+"src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7"style="display: inline" />
76-
</a>
77-
</h2>
78-
{%endspaceless %}
81+
{%ifcurrentContentis notempty %}
82+
<divclass="tab">
83+
<h3class="tab-title">Output content</h3>
7984

80-
<divid="output-content"style="display: none">
81-
{{currentContent }}
85+
<divclass="tab-content">
86+
{{currentContent }}
87+
</div>
8288
</div>
83-
84-
<divstyle="clear: both"></div>
89+
{%endif %}
8590
</div>
86-
{%endif %}
87-
88-
{%include'@Twig/Exception/traces_text.html.twig'with {'exception':exception }only %}
89-
90-
<scripttype="text/javascript">//<![CDATA[
91-
functiontoggle(id,clazz) {
92-
var el=document.getElementById(id),
93-
current=el.style.display,
94-
i;
95-
96-
if (clazz) {
97-
var tags=document.getElementsByTagName('*');
98-
for (i=tags.length-1; i>=0; i--) {
99-
if (tags[i].className=== clazz) {
100-
tags[i].style.display='none';
101-
}
102-
}
103-
}
104-
105-
el.style.display= current==='none'?'block':'none';
106-
}
107-
108-
functionswitchIcons(id1,id2) {
109-
var icon1, icon2, display1, display2;
110-
111-
icon1=document.getElementById(id1);
112-
icon2=document.getElementById(id2);
113-
114-
display1=icon1.style.display;
115-
display2=icon2.style.display;
116-
117-
icon1.style.display= display2;
118-
icon2.style.display= display1;
119-
}
120-
//]]></script>
91+
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/*
2-
{%include'@Twig/Exception/exception.txt.twig'with {'exception':exception } %}
2+
{{include('@Twig/Exception/exception.txt.twig', {exception:exception }) }}
33
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{%include'@Twig/Exception/exception.xml.twig'with {'exception':exception } %}
1+
{{include('@Twig/Exception/exception.xml.twig', {exception:exception }) }}

‎src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.svg‎

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

‎src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.txt.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
[message] {{exception.message }}
33
{%fori,einexception.toarray %}
44
[{{i+1 }}] {{e.class }}: {{e.message }}
5-
{%include'@Twig/Exception/traces.txt.twig'with {'exception':e }only %}
5+
{{include('@Twig/Exception/traces.txt.twig', {exception:e },with_context =false) }}
66

77
{%endfor %}

‎src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.xml.twig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<errorcode="{{status_code }}"message="{{status_text }}">
44
{%foreinexception.toarray %}
55
<exceptionclass="{{e.class }}"message="{{e.message }}">
6-
{%include'@Twig/Exception/traces.xml.twig'with {'exception':e }only %}
6+
{{include('@Twig/Exception/traces.xml.twig', {exception:e },with_context =false) }}
77
</exception>
88
{%endfor %}
99
</error>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp