Polling/Rating latest...

Posted by Steve Longdo Thu, 02 Feb 2006 03:24:00 GMT

Work has been slow going on my polling plugin. My day job has been sapping my energy for working on Rails projects when I get home.

That said I have been able to solve some of the issues I posted about earlier and some progress has been made. I have given the code for the Horizontal CSS bar graph to topfunky to include in his CSSGraphs plugin. I finally was able to get poll results to show up in the Typo sidebar. My local verison of Typo is severly hacked to accomplish this. Unfortunately this makes the polling code difficult to distribute. I have decided to rethink my entire approach to the project.

I am going to rewrite polling as a Rails engine to better facilitate code sharing and obviate the need for a hacked verison of Typo. I will make some sort of Typo integration with the polling engine available. Perhaps even making the polling information available through a web service. Before I do any of that though, I want to add a stripped down version of polling as a rating plugin for Rails. Rating will be implemented in the style of the acts_as_* ActiveRecord mixins. A model would have acts_as_rateable and the table would need a rating_id column. I have detailed this a bit better on my projects page. I may have to pursue rating as an engine since there would need to be some sort of rating input widget. The experiment continues...

Polling plugin for Typo III... 2

Posted by Steve Longdo Tue, 24 Jan 2006 05:36:00 GMT

Well I promised an update, and here it is. Not much progress to report. I am stalled on the sidebar issue, trying to have AJAX links in the sidebar panel to vote with and then updating the sidebar DIV with the results. Typo sidebars load fine from the SidebarController, but trying to hit them directly fails with uninitialized constant Plugin at the bottom of the error trace it mentions the controller file and the plugin.rb file.

Apparently plugin.rb is not loaded when you go to the controller directly. I wish sidebars worked more like the TextFilters. I tried to hack it up, but didn't have much success. I do notice that while the TextFilters are technically plugins, the controller for them lives inside the main Typo application, whereas the sidebar controller lives in the components directory... Long story short I've asked for help on the typo mailing list.

In the meantime I've been researching ways to display polling results. OpenLaszlo looked like a great candidate for this, especially for fitting into the small amount of real estate a sidebar allows. I had high hopes for its PieChart control, but it is still beta quality. I messed around with it a bit, but I wasn't satisfied with how it looks and also mouse events aren't supported yet. I spent quite a bit of time getting the demo up and running mostly because when you check it out from source some of the files have moved and thus the demos don't work. I will be keeping an eye on this project though especially now that there is a Ruby on Rails integration gem available from Oliver Steele.

Better news for Horizontal CSS graphing though. I was able to implement a helper based on Geoff Grosenbach's Vertical Bar CSS graphing code. At this point I will just be excited to see something show up in the sidebar for results... (grumble)

Polling Plugin for Typo II... 2

Posted by Steve Longdo Fri, 20 Jan 2006 06:05:00 GMT

I am continuing to work on the polling stuff for Typo. I've ended up expanding my approach to include a full Admin panel for the Polls. Mostly to allow selection of the "active" sidebar poll and to be able to view historical poll results.
I've run into an issue with the sidebar poll content.rhtml though. I was wanting to have AJAX voting via remote_link_to's, but no public routing is defined for sidebar plugins.
I've looked into how TextFilters are implemented in Typo to better understand how they work despite not having public routing. The TextFilterController defines a public_action method that allows child filters to include symbols for :plugin_public_action which in turn exposes the referenced methods.
Despite being named plugin_public_action it is in fact only implemeted for Filters and not for Sidebar components. I am debating adding this functionality and submitting a patch, however, I wonder if I am the only person that needs this functionality? I would update the routes.rb file to include a route for my poll controller, but that doesn't work because the sidebar controller handles loading all of the dependencies for "child" plugins.


Update: I just re-read this post and it comes off a bit badly. Mostly because I wrote it at the end of a very long day. I apologize to the reader for the stream of consciousness quality of the posting.
Read more...

Older posts: 1 2 3