Bläddra i källkod

[FrameworkBundle] implemented new exception stack trace layout

hhamon 14 år sedan
förälder
incheckning
f75ec8d4ad
19 ändrade filer med 563 tillägg och 78 borttagningar
  1. 267 29
      src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css
  2. 162 0
      src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css
  3. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_less.gif
  4. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_more.gif
  5. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_l.png
  6. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_r.png
  7. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/btn_bg.png
  8. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/close_quote.gif
  9. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.gif
  10. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/grey_magnifier.png
  11. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/icon_log.png
  12. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/input_bg.gif
  13. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.gif
  14. BIN
      src/Symfony/Bundle/FrameworkBundle/Resources/public/images/open_quote.gif
  15. 54 28
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.html.twig
  16. 49 7
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/layout.html.twig
  17. 9 4
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/logs.html.twig
  18. 15 5
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/trace.html.twig
  19. 7 5
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.html.twig

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 267 - 29
src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception.css


+ 162 - 0
src/Symfony/Bundle/FrameworkBundle/Resources/public/css/exception_layout.css

@@ -0,0 +1,162 @@
+html
+{
+    background: #eee
+}
+
+body
+{
+    font: 11px Verdana, Arial, sans-serif; 
+    color: #333
+}
+
+.sf-exceptionreset, .sf-exceptionreset .block, .sf-exceptionreset #message
+{
+    margin: auto
+}
+
+img
+{
+    border: 0;
+}
+
+.clear
+{
+    clear:both;
+    height:0px;
+    font-size:0;
+    line-height:0;
+}
+
+.clear_fix:after
+{
+    content:"\0020";
+    display:block;
+    height:0;
+    clear:both;
+    visibility:hidden;
+}
+
+.clear_fix
+{
+    display:inline-block;
+}
+
+* html .clear_fix
+{
+    height:1%;
+}
+
+.clear_fix
+{
+    display:block;
+}
+
+.header
+{
+    padding:30px 30px 20px 30px;
+}
+
+.header_logo
+{
+    float:left;
+}
+
+.search
+{
+    float:right;
+}
+
+.search
+{
+    padding-top:20px;
+}
+
+.search button
+{
+    float:none;
+}
+
+.search label
+{
+    line-height:28px; 
+    vertical-align:middle;
+}
+
+.search input
+{
+    width:188px; 
+    margin-right:10px; 
+    font-size:12px; 
+    border:1px solid #dadada; 
+    background:#FFFFFF url(/bundles/framework/images/input_bg.gif) repeat-x left top; 
+    padding:5px 6px;
+    color:#565656;
+}
+
+button
+{
+    -webkit-appearance: button-bevel;
+    float: left;
+    text-align: left;
+    padding: 0;
+    margin: 0;
+    overflow: visible;
+    width: auto;
+    text-decoration: none;
+    cursor: pointer;
+    white-space: nowrap;
+    display: inline-block;
+    text-align: center;
+    vertical-align: middle;
+    border: 0;
+    background: none;
+}
+
+button:-moz-focus-inner
+{
+  padding: 0;
+  border: none;
+}
+
+button:hover
+{
+    text-decoration: none;
+}
+
+button span span,
+button span span span
+{
+  position: static;
+}
+
+button span
+{
+    position: relative;
+    text-decoration: none;
+    display: block;
+    height: 28px;
+    float: left;
+    padding: 0 0 0 8px;
+    background: transparent url(/bundles/framework/images/border_l.png) no-repeat top left;
+}
+
+button span span
+{
+    padding: 0 8px 0 0;
+    background: transparent url(/bundles/framework/images/border_r.png) right top no-repeat;
+}
+
+button span span span
+{
+    padding: 0px 7px;
+    font: bold 11px Arial, Helvetica, sans-serif;
+    color: #6b6b6b;
+    line-height: 28px;
+    background: transparent url(/bundles/framework/images/btn_bg.png) repeat-x top left;
+}
+
+#content
+{
+    width:970px;
+    margin:0 auto;
+}

BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_less.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/blue_picto_more.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_l.png


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/border_r.png


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/btn_bg.png


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/close_quote.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/exception_detected.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/grey_magnifier.png


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/icon_log.png


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/input_bg.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/logo_symfony.gif


BIN
src/Symfony/Bundle/FrameworkBundle/Resources/public/images/open_quote.gif


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 54 - 28
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.html.twig


+ 49 - 7
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/layout.html.twig

@@ -3,12 +3,10 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset={{ _charset }}"/>
         <title>{{ exception.message }} ({{ status_code }} {{ status_text }})</title>
-        <style type="text/css">
-            html { background: #eee }
-            body { font: 11px Verdana, Arial, sans-serif; color: #333 }
-            .sf-exceptionreset, .sf-exceptionreset .block, .sf-exceptionreset #message { margin: auto }
-        </style>
-        <link href="{{ asset('bundles/framework/css/exception.css') }}" rel="stylesheet" type="text/css" media="screen" />
+
+        <link href="{{ asset('/bundles/framework/css/exception_layout.css') }}" rel="stylesheet" type="text/css" media="all" />
+        <link href="{{ asset('/bundles/framework/css/exception.css') }}" rel="stylesheet" type="text/css" media="all" />
+
         <script type="text/javascript">
             //<![CDATA[
             function toggle(id, clazz) {
@@ -26,10 +24,54 @@
 
                 el.style.display = current == 'none' ? 'block' : 'none';
             }
+
+            function switchIcons(id1, id2) {
+                icon1 = document.getElementById(id1);
+                icon2 = document.getElementById(id2);
+
+                visibility1 = icon1.style.visibility;
+                visibility2 = icon2.style.visibility;
+
+                icon1.style.visibility = visibility2;
+                icon2.style.visibility = visibility1;
+            }
+
             //]]>
         </script>
     </head>
     <body>
-        {% block body '' %}
+        <div id="content">
+            <div class="header clear_fix">
+                <div class="header_logo">
+                  <a href="http://symfony.com/">
+                    <img src="{{ asset('bundles/framework/images/logo_symfony.gif') }}" alt="Symfony" />
+                  </a>
+                </div>
+
+                <div class="search">
+                  <form method="post" action="http://symfony.com/search">
+                    <div class="form_row">
+
+                      <label for="search_id">
+                          <img src="{{ asset('bundles/framework/images/grey_magnifier.png') }}" alt="Search on Symfony website" />
+                      </label>
+
+                      <input name="search_name" id="search_id" type="text" placeholder="Search on Symfony website" />
+
+                      <button type="submit">
+                        <span class="border_l">
+                          <span class="border_r">
+                            <span class="btn_bg">OK</span>
+                          </span>
+                        </span>
+                      </button>
+                    </div>
+                   </form>
+                </div>
+            </div>
+
+            {% block body '' %}
+
+        </div>
     </body>
 </html>

+ 9 - 4
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/logs.html.twig

@@ -1,8 +1,13 @@
-<ol>
+<ol class="traces">
     {% for log in logs %}
-        <li{% if 'ERR' == log.priorityName %} class="error"{% endif %}>
-            {{ log.priorityName }}
+        <li>
+            {% if 'ERR' == log.priorityName %}
+                <em>{{ log.priorityName }}</em>
+            {% else %}
+                {{ log.priorityName }}
+            {% endif %}
+
             {{ log.message }}
         </li>
     {% endfor %}
-</ol>
+</ol>

+ 15 - 5
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/trace.html.twig

@@ -1,10 +1,20 @@
 {% if trace.function %}
-    at <strong><abbr title="{{ trace.class }}">{{ trace.short_class }}</abbr>{{ trace.type ~ trace.function }}</strong>({{ trace.args|format_args }})<br />
+    at 
+    <strong>
+        <abbr title="{{ trace.class }}">{{ trace.short_class }}</abbr>
+        {{ trace.type ~ trace.function }}
+    </strong> 
+    ({{ trace.args|format_args }})
+    <br />
 {% endif %}
+
 {% if trace.file is defined and trace.line is defined %}
-    in <em>{{ trace.file|format_file(trace.line) }}</em>
-    <a href="#" onclick="toggle('trace_{{ prefix ~ '_' ~ i }}'); return false;">&raquo;</a><br />
-    <div id="trace_{{ prefix ~ '_' ~ i }}" class="trace" style="display: {{ 0 == i ? 'block' : 'none' }}">
+    in {{ trace.file|format_file(trace.line) }} 
+    <a href="#" onclick="toggle('trace_{{ prefix ~ '_' ~ i }}'); switchIcons('icon_{{ prefix ~ '_' ~ i }}_open', 'icon_{{ prefix ~ '_' ~ i }}_close'); return false;">
+        <img class="toggle" id="icon_{{ prefix ~ '_' ~ i }}_close" alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="visibility: {{ 0 == prefix ? 'hidden' : 'display' }}" />
+        <img class="toggle" id="icon_{{ prefix ~ '_' ~ i }}_open" alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="visibility: {{ 0 == prefix ? 'display' : 'hidden' }}; margin-left: -22px" />
+    </a>
+    <div id="trace_{{ prefix ~ '_' ~ i }}" style="display: {{ 0 == i ? 'block' : 'none' }}" class="trace">
         {{ trace.file|file_excerpt(trace.line) }}
     </div>
-{% endif %}
+{% endif %}

+ 7 - 5
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.html.twig

@@ -1,20 +1,22 @@
 <div class="block">
     {% if count > 0 %}
-        <h3>
+        <h2>
             <span>{{ count - position + 1 }}/{{ count + 1 }}</span>
             {{ exception.class|abbr_class }}: {{ exception.message|replace({ "\n": '<br />' }) }}
             <a href="#" onclick="toggle('traces_{{ position }}', 'traces'); return false;">&raquo;</a><br />
-        </h3>
+        </h2>
     {% else %}
-        <h3>Stack Trace</h3>
+        <h2>Stack Trace</h3>
     {% endif %}
 
     <a id="traces_link_{{ position }}"></a>
-    <ol class="traces" id="traces_{{ position }}" style="display: {{ 0 == position ? 'block' : 'none' }}">
+    <ol class="traces list_exception" id="traces_{{ position }}" style="display: {{ 0 == position ? 'block' : 'none' }}">
+    
         {% for i, trace in exception.trace %}
             <li>
                 {% include 'FrameworkBundle:Exception:trace.html.twig' with { 'prefix': position, 'i': i, 'trace': trace } only %}
             </li>
         {% endfor %}
+
     </ol>
-</div>
+</div>