Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Commits on Sep 16, 2009
Commits on Sep 15, 2009
  1. Removed offset from documentation for events:each tag

    authored
    Still not sure why offset refuses to work. Don't need it for the LHL
    site, so I'm not going to worry about it right now. Best not to give the
    impression that it should work, though, so out of the docs it comes.
  2. <r:date /> implemented, passes specs for default case

    authored
    On both EventPage and Page.
  3. <r:events:each (from|to)='nonsense'> implemented, passes spec

    authored
    As it turns out, Time.parse alone isn't enough to verify that something
    is a proper date and time; it returns the current date and time if you
    feed it 'wibble'. Time.parse relies on Date._parse (note underscore),
    which has a really primitive and permissive parser; it returns an empty
    hash {} for Date.parse('wibble') instead of throwing an exception.
    
    Fixed the problem in event tags handling by making a call to Date.parse
    (no underscore) before the Time.parse call. Date.parse is much stricter
    than Date._parse (which is also, amusingly enough, undocumentd), and
    when combined with Time.parse, should throw an ArgumentError if the
    date string isn't really a date. I hope.
  4. <r:events:each by='field'> implemented, passes spec

    authored
    Marked <r:events:each offset='n'> as pending for now. It's not working,
    and I'm not certain why not.
Commits on Sep 14, 2009
  1. <r:events:each order='asc'> passing spec

    authored
    Of course, order='asc' isn't implemented at all, and it's the default,
    but no need to get ahead of ourselves. It passes, moving on to the next
    spec.
  2. Basic <r:events:each> tag is working.

    authored
    And passing spec! The default case, which returns all the event children
    of the current page that aren't in the past, ordered by start date, is
    working. Now to add in handling for a buttload of options.
  3. Mysteriously, the specs are running. Finally.

    authored
    The ludicrous 'Object is not missing constant EventfulTags' exception
    no longer occurs, though I haven't a clue what was causing it in the
    first place, and I'm pretty sure my code's identical now to the code
    that wasn't working. Go figure.
    
    One failing tag spec, so we're ready to start implementing something.
    Go test-driven development!
    
    Also cleaned up line endings; for whatever reason, a couple of the files
    had crlf pairs in them. Ick.
Commits on Sep 11, 2009
  1. Started spec for Eventful tags

    authored
    Also cleaned up the event_pages dataset so it's a neatly ordered set of
    typical event pages.
  2. Event date interface full of ajaxy goodness

    authored
    Eureka! Found a third option without the negatives of the two options
    mentioned in the previous checkin:
    
    * Put remote_function into the onclick handlers of the all_day_event and
      no_end_time check boxes. Pro: Avoids unnecessary round-trips to the
      server; only clicks on the check boxes will fire an action. Con: Took
      some figuring out to get the form data to submit.
    
    The solution to getting the form's data out was to add :submit =>
    'edit_page' (edit_page being the id of the Page form), which correctly
    submits all the field data from the form, with authenticity token.
    
    Possible future enhancement: hook the ajax callbacks to display and hide
    a throbber. It still takes a moment to ping the server and get it to
    render partials, and the feedback would be nice. In practice, on a
    production server, this probably won't be much of an issue, unless
    you're logged in from Liberia over a 14.4 modem.
  3. Ajaxy event check boxes working, after a fashion

    authored
    Current implementation uses observe_form, because it appears that
    observe_field doesn't work for check boxes. Checking and unchecking the
    all_day_event and no_end_time check boxes works, but everything goes
    quite pear-shaped if you start typing text into the content fields. The
    javascript observer dutifully sends *all* the text, as it's entered, in
    0.3-second intervals, except that the server round-trip means that each
    0.3-second span takes more like 2-3 seconds, for events that don't
    generate any kind of updates to the page. Ugh.
    
    Possible solutions:
    
    * Code ajaxy bits entirely in javascript using Prototype, possibly with
      help from LowPro. Pro: Everything happens client-side, so there's no
      wait for a server round-trip. Might be able to isolate to check box
      changes only. Con: Not entirely sure how to get all the data shoved
      around without server round trip. It's awfully nice just asking Rails
      to render partials, and I've have to do the equivalent by hand in
      javascript.
    
    * Wrap check boxes in their own form, which is what observe_form
      watches. Pro: Only the changes we care about cause a hit on the
      server. Con: Not sure how to get the data from the check boxes to save
      in the Page model, because the check boxes would now be in a separate
      form. Also, not sure what happens if I try to embed a form within
      another form; might be an HTML no-no.
  4. Event date partial rendering implemented sans javascript

    authored
    Manually feeding the update_event_ui action, with appropriate params,
    returns the correct partial rendering. Next step is adding javascript to
    make the update_event_ui action call when check boxes are switched on
    and off.
Commits on Sep 10, 2009
  1. Separate partials for event date rows

    authored
      * event_start_date_only
      * event_start_datetime
      * event_end_datetime
    
    Now I just need some script to hide and show them dynamically.
Commits on Sep 9, 2009
  1. Added display of event-related boolean values

    authored
    all_day_event and no_end_time are now check boxes on an event page, and
    also columns in the pages table.
    
    No logic yet to change behavior of the EventPage model or the Page view
    according to these boolean values, but that's coming next. In the model:
    
      * all_day_event prevents display of times for the event, and all-day
        events get sorted before events with start times.
      * no_end_time prevents display of event_end time for the event, and it
        makes the event sort after all-day events, but before events with
        both start and end times.
    
    And in the view:
    
      * all_day_event toggles display of event_start_row and event_end_row
        tr elements, as well as no_end_time check box.
      * no_end_time toggles display of event_end_row tr element.
  2. Took another stab at making some view specs

    authored
    Not working yet. Attempting to use datasets to define an assortment of
    valid event pages, but not having much luck getting the view spec to
    pull them in. I'm not sure this is a good way to isolate the view code,
    anyhow, but it's all a learning experience.
    
    At the very least, the datasets would make sense for more extensive
    model testing. Maybe.
Commits on Sep 8, 2009
  1. Event pages display working event_start and event_end selectors

    authored
    Had to hack around Radiant a bit; its _meta_row.html.haml partial does
    not work with the instructions given in the Creating a Custom Page Type
    article (http://wiki.github.com/radiant/radiant/creating-a-custom-page-type)
    on the Radiant wiki. The instructions create form inputs that aren't
    tied to the Page model; instead of names like page[my_field], you get
    names like my_field, which won't save any data during the update action.
    
    The hack replaces the meta_row partial with a slightly modified version,
    event_meta_row. The new partial passes correct values to the form
    element-building method in its f.send call. I'm not entirely sure how
    Radiant uses the default meta_row partial, because it seems to be able
    to generate correct input names with it; the details are lost somewhere
    in the maze of Radiant's complicated PagesController ->
    ResourceController -> Radiant::ResourceResponses logic chain.
    
    Now that interface appears and data saves, it's time to throw in a bit
    of javascript to show and hide the new interface, allowing the user to
    choose no particular start and end times for events.
Commits on Sep 5, 2009
  1. Added Page view partial to display event start and stop selectors

    authored
    Selectors appear and are formatted reasonably now. Their contents still
    aren't saved with the rest of the page, however; need to figure out
    where the disconnect is.
    
    The view spec for admin/pages/edit.html.haml breaks. I have yet to
    figure out how to isolate the views in Radiant's twisty maze of crazy
    layered classes and methods. Perhaps figuring out how to wire the view
    specs will grant me insight into why Radiant refuses to save the event
    dates.
Commits on Sep 4, 2009
  1. Rebuilt tests using RSpec

    authored
    As it turns out, RSpec does support nested describe blocks, but I was
    attempting to put code directly into them, which is a no-no. Setting up
    objects for testing must be done within an it block; instance variables
    (@foo) set up in before blocks are out of scope inside describe until an
    it block is encountered.
    
    I like the output from RSpec better, and it's got a lot more support via
    tools (TextMate, rcov) and documentation (The RSpec Book). I'll be
    sticking with it for now, but I'm leaving the Shoulda tests in place;
    they certainly aren't hurting anything.
  2. Added validations for start and end dates

    authored
    Also replaced RSpec with Shoulda tests. You can't nest describe blocks?
    What the hell is that about?
Commits on Aug 17, 2009
  1. Initial commit

    authored
Something went wrong with that request. Please try again.