Make parameters table template WAI 2.0 compliant #101

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
@alademann
Contributor

alademann commented Jul 12, 2014

These changes make the parameters table in the swig templates accessible according to WAI 2.0 Table Guidelines

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jul 15, 2014

Member

Manually done. Will be released in 1.0.0-rc.17.

Member

HugoGiraudel commented Jul 15, 2014

Manually done. Will be released in 1.0.0-rc.17.

@alademann

This comment has been minimized.

Show comment
Hide comment
@alademann

alademann Jul 15, 2014

Contributor

@HugoGiraudel I'm not sure I understand what you mean by "manually done" - the parameters table changes have not been merged in?

Contributor

alademann commented Jul 15, 2014

@HugoGiraudel I'm not sure I understand what you mean by "manually done" - the parameters table changes have not been merged in?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jul 15, 2014

Member

Aye. I manually made the change to achieve the same result. Merged on master, will be shipped with rc.17.

Member

HugoGiraudel commented Jul 15, 2014

Aye. I manually made the change to achieve the same result. Merged on master, will be shipped with rc.17.

@alademann

This comment has been minimized.

Show comment
Hide comment
@alademann

alademann Jul 15, 2014

Contributor

@HugoGiraudel don't mean to be a pest - but how does your change make it accessible? In master - the table markup is still the same as it was before your commit:

It's missing the scope information on the headers, and the first column in the <tbody> rows is still a <td> instead of a <th scope="row">. These are requirements for WAI/WCAG compliant markup.

  <table class="item__parameters">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Type</th>
        <th>Default value</th>
      </tr>
    </thead>
    <tbody>
      {% for parameter in item.parameters %}
        <tr class="item__parameter">
          <td data-label="name"><code>${{ parameter.name }}</code></td>
          <td data-label="desc">{{ parameter.description | markdown | default('&mdash;') | safe }}</td>
          <td data-label="type">
          {% if parameter.type == '*' %}
            Any
          {% else %}
            {{ parameter.type | split('|') | trim | capitalize | join(', ')}}
          {% endif %}
          </td>
          <td data-label="default">
          {% if not parameter.default %}
            &mdash;
          {% else %}
            <code>{{ parameter.default }}</code>
          {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
Contributor

alademann commented Jul 15, 2014

@HugoGiraudel don't mean to be a pest - but how does your change make it accessible? In master - the table markup is still the same as it was before your commit:

It's missing the scope information on the headers, and the first column in the <tbody> rows is still a <td> instead of a <th scope="row">. These are requirements for WAI/WCAG compliant markup.

  <table class="item__parameters">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Type</th>
        <th>Default value</th>
      </tr>
    </thead>
    <tbody>
      {% for parameter in item.parameters %}
        <tr class="item__parameter">
          <td data-label="name"><code>${{ parameter.name }}</code></td>
          <td data-label="desc">{{ parameter.description | markdown | default('&mdash;') | safe }}</td>
          <td data-label="type">
          {% if parameter.type == '*' %}
            Any
          {% else %}
            {{ parameter.type | split('|') | trim | capitalize | join(', ')}}
          {% endif %}
          </td>
          <td data-label="default">
          {% if not parameter.default %}
            &mdash;
          {% else %}
            <code>{{ parameter.default }}</code>
          {% endif %}
          </td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Jul 15, 2014

Member

I missed that. I thought it was only about the display: none on the thead. I'll have a fix.

Member

HugoGiraudel commented Jul 15, 2014

I missed that. I thought it was only about the display: none on the thead. I'll have a fix.

HugoGiraudel added a commit that referenced this pull request Jul 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment