Browse Source

merged branch Tobion/patch-1 (PR #2856)

Commits
-------

6548354 fixed data-url

Discussion
----------

[WebProfilerBundle] fixed and adjusted HTML5 markup

I corrected some markup errors that I found when validating the pages of the WebProfilerBundle.
Along the way I also improved the semantic structure of HTML5 like table header and body, lang attribute.
Removed type="text/css" that is the default with rel="stylesheet". Also no need for media="screen"!? Otherwise style does not apply when debugging with handheld device or when printing.

---------------------------------------------------------------------------

by fabpot at 2011/12/12 23:37:15 -0800

@Tobion: Can you squash your commit before I merge your PR? Thanks.

---------------------------------------------------------------------------

by Tobion at 2011/12/13 03:14:51 -0800

@fabpot I would appreciate if you could do this.

I see two problems with pull requests on @github that occur again and again. It's pretty annoying compared to the otherwise very user-friendly Github.

1. Squashing commits of a pull request: If you've already pushed commits to GitHub, and then squash them locally, you will not be able to push that same branch to GitHub again. So you need to create a new branch and a new pull request.
So there should be a button on Github that simply squashes all commits and allows you to enter a new commit message.

2. Opening a pull request based on the master branch instead of the 2.0 branch where bug fixes should be made. So people must rebase their stuff and open a new pull request again. All this back and forth is taking time unnecessarily (both for admins and contributors) and cluttering Githubs news feed.
There should be the possibility to allow switching the pull request base branch. Or at least give the users a configurable hint about the best practice of contributing to a specific repo when they open a pull request.

---------------------------------------------------------------------------

by henrikbjorn at 2011/12/13 03:16:10 -0800

@Tobion

1. Solved by doing a git push -f remote_name branch_name
2. Yes here you need to open a new PR

---------------------------------------------------------------------------

by fabpot at 2011/12/13 03:21:47 -0800

@Tobion: I'm more than aware of these issues but unfortunately, there is nothing I can do if we want to continue using the Github PRs (and automatic closing).

---------------------------------------------------------------------------

by Tobion at 2011/12/13 03:51:47 -0800

That's why I hope that @github will provide a convenient solution to these issues.

---------------------------------------------------------------------------

by stof at 2011/12/13 04:08:07 -0800

@Tobion send a feature request to github. Commenting here will not make them implement it

---------------------------------------------------------------------------

by Tobion at 2011/12/13 04:18:31 -0800

@fabpot I squashed commits.
@stof I will do it. But there is no public issue tracker for the Github software, is there? So need to use the contact form I suppose.
Fabien Potencier 13 years ago
parent
commit
f06105ce01

File diff suppressed because it is too large
+ 1 - 2
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig


+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/exception.html.twig

@@ -1,7 +1,7 @@
 {% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}
 
 {% block head %}
-    <link href="{{ asset('bundles/framework/css/exception.css') }}" rel="stylesheet" type="text/css" media="screen" />
+    <link rel="stylesheet" href="{{ asset('bundles/framework/css/exception.css') }}" />
     {{ parent() }}
 {% endblock %}
 

+ 20 - 18
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig

@@ -77,15 +77,13 @@
 
     <h2>Request Content</h2>
 
-    <p>
-        {% if collector.content == false %}
-            <em>Request content not available (it was retrieved as a resource).</em>
-        {% elseif collector.content %}
-            <pre>{{ collector.content }}</pre>
-        {% else %}
-            <em>No content</em>
-        {% endif %}
-    </p>
+    {% if collector.content == false %}
+        <p><em>Request content not available (it was retrieved as a resource).</em></p>
+    {% elseif collector.content %}
+        <pre>{{ collector.content }}</pre>
+    {% else %}
+        <p><em>No content</em></p>
+    {% endif %}
 
     <h2>Request Server Parameters</h2>
 
@@ -99,17 +97,21 @@
 
     {% if collector.sessionattributes|length %}
         <table>
-            <tr>
-                <th>Key</th>
-                <th>Value</th>
-            </tr>
-            {% set attributes = collector.sessionattributes %}
-            {% for key in attributes|keys|sort %}
+            <thead>
                 <tr>
-                    <th>{{ key }}</th>
-                    <td>{{ attributes[key]|yaml_dump }}</td>
+                    <th scope="col">Key</th>
+                    <th scope="col">Value</th>
                 </tr>
-            {% endfor %}
+            </thead>
+            <tbody>
+                {% set attributes = collector.sessionattributes %}
+                {% for key in attributes|keys|sort %}
+                    <tr>
+                        <th>{{ key }}</th>
+                        <td>{{ attributes[key]|yaml_dump }}</td>
+                    </tr>
+                {% endfor %}
+            </tbody>
         </table>
     {% else %}
         <p>

+ 6 - 2
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/bag.html.twig

@@ -1,12 +1,16 @@
 <table>
+<thead>
     <tr>
-        <th>Key</th>
-        <th>Value</th>
+        <th scope="col">Key</th>
+        <th scope="col">Value</th>
     </tr>
+</thead>
+<tbody>
     {% for key in bag.keys|sort %}
         <tr>
             <th>{{ key }}</th>
             <td>{{ bag.get(key)|yaml_dump }}</td>
         </tr>
     {% endfor %}
+</tbody>
 </table>

+ 5 - 5
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base.html.twig

@@ -1,13 +1,13 @@
 <!DOCTYPE html>
-<html>
+<html lang="en">
     <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta charset="UTF-8" />
         <meta name="robots" content="noindex,nofollow" />
         <title>{% block title 'Profiler' %}</title>
-        <link rel="shortcut icon" type="image/x-icon" href="{{ asset('bundles/webprofiler/favicon.ico') }}" />
+        <link rel="icon" type="image/x-icon" sizes="16x16" href="{{ asset('bundles/webprofiler/favicon.ico') }}" />
         {% block head %}
-            <link href="{{ asset('bundles/webprofiler/css/toolbar.css') }}" rel="stylesheet" type="text/css" media="screen" />
-            <link href="{{ asset('bundles/webprofiler/css/profiler.css') }}" rel="stylesheet" type="text/css" media="screen" />
+            <link rel="stylesheet" href="{{ asset('bundles/webprofiler/css/toolbar.css') }}"  />
+            <link rel="stylesheet" href="{{ asset('bundles/webprofiler/css/profiler.css') }}" />
         {% endblock %}
     </head>
     <body>

+ 16 - 12
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig

@@ -5,20 +5,24 @@
 
     {% if tokens %}
         <table>
-            <tr>
-                <th>Token</th>
-                <th>IP</th>
-                <th>URL</th>
-                <th>Time</th>
-            </tr>
-            {% for elements in tokens %}
+            <thead>
                 <tr>
-                    <td><a href="{{ path('_profiler', { 'token': elements.token }) }}">{{ elements.token }}</a></td>
-                    <td>{{ elements.ip }}</td>
-                    <td>{{ elements.url }}</td>
-                    <td>{{ elements.time|date('r') }}</td>
+                    <th scope="col">Token</th>
+                    <th scope="col">IP</th>
+                    <th scope="col">URL</th>
+                    <th scope="col">Time</th>
                 </tr>
-            {% endfor %}
+            </thead>
+            <tbody>
+                {% for elements in tokens %}
+                    <tr>
+                        <td><a href="{{ path('_profiler', { 'token': elements.token }) }}">{{ elements.token }}</a></td>
+                        <td>{{ elements.ip }}</td>
+                        <td>{{ elements.url }}</td>
+                        <td>{{ elements.time|date('r') }}</td>
+                    </tr>
+                {% endfor %}
+            </tbody>
         </table>
     {% else %}
         <p>