gdoteof / election

drupal election module
3 stars 1 forks source link

Use Tables for Ballot Item Results #5

Closed bradley-holt closed 12 years ago

bradley-holt commented 12 years ago

Description

Please use tables for ballot item results instead of unordered lists.

Steps to Reproduce

curl 'https://example.org/town-meeting-season-2011/town-meeting-day-2011/ward-1/ward-1-city-council' \
-H 'Accept: text/html'

Actual Results

  …
  <ul>
  <li class="result">
    <span class="option candidate">Sharon Bushor (I) </span>
    <span class="votes" title="416">416 (100.0%)</span>
  </li>
  …

Expected Results

  …
  <table>
    <thead>
      <tr class="result">
        <th class="option candidate">Candidate</th>
        <th class="votes">Votes</th>
        <th class="percent">Percent</th>
      </tr>
    </thead>
    <tbody>
      <tr class="result">
        <td class="option candidate">Sharon Bushor (I)</td>
        <td class="votes">416</td>
        <td class="percent">100.0</td>
      </tr>
    </tbody>
  </table>
  …

Additional Comments

Although the original API requirements used unordered lists for ballot item results, these results are really tabular data. Note that the <tr> row within the <thead> must match the exact structure as the <tr> rows within the <tbody> (swapping <td> elements for <th> elements) as this header row will be used as a template when updating results in JavaScript. There may be other changes to the exact HTML structure of the table in the future.

gdoteof commented 12 years ago

fixed in df92e6a

bradley-holt commented 12 years ago

Looks good to me, thanks!