Source

evolve-proj / composeapp / lists.yml

tabular.coffee: |
  (head, req) ->
    {_} = require 'underscore'
    {TableWriter} = require 'lib/tabular'
    start headers: {'Content-Type': 'text/html'}

    send '<h1>tabular</h1>'
    send '<style> .correct {background-color: green;} .incorrect {background-color: red;}</style>'
    info = _.clone req.query
    delete info.group
    baseinfo = getRow().value
    hw_array = baseinfo.axis["height-weight"]
    hw = hw_array[0]
    tw = new TableWriter send, hw_array, (row) -> row.value.spec['height-weight']

    tw.make_header (send, val) ->
      send '<h2>heights weight' + val + '</h2>'
      send '<table>\n'
      send '  <tr>\n    <th>*\n'
      for p in baseinfo.axis.population
        send '    <th>' + p + '\n'
    last = {}
    tw.make_rows getRow, (send, row, last) ->
      val = row.value
      if last.generations != val.spec.generations
        send '  <tr><th>' + val.spec.generations + '\n'
      if val.correct
        send '    <td class=correct>'
      else
        send '    <td class=incorrect>'
      send '&nbsp\n'
      return val.spec

    tw.finalize()
    return
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.