From crschmidt@crschmidt.net Sun Nov 20 00:04:42 2005 From: crschmidt@crschmidt.net To: openguides-dev@lists.openguides.org Subject: [OGDev] [OpenGuides] #11: Edit page category/locale selection Date: Sat, 19 Nov 2005 19:04:23 -0500 Message-ID: <20051120000422.GY13875@crschmidt.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9194570693170030405==" --===============9194570693170030405== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Now that trac is up and running, I went through all the open tickets and added my two cents to a fair number of them. One of them was ticket 11, regarding adding a javascript mechanism for selecting categories/locales. You can see the result of my work at http://boston.openguides.org/?id=Home;action=edit , under the Locales and Category sections. My comment below provides a brief summary of the way that I did it. #11: Edit page category/locale selection Comment: Okay, so I've tossed something for this together on the Boston OpenGuides site. * Created CGI::Wiki::Plugin:: Summariser, for generating metadata summary lists, http://crschmidt.net/projects/Summariser.pm * Added some code to wiki.cgi in edit_node(): {{{ my $summariser = CGI::Wiki::Plugin::Summariser->new; $wiki->register_plugin( plugin => $summariser ); my @categories = $summariser->metadata_list( type => 'Category' ); my @locales = $summariser->metadata_list( type => 'Locale' ); my %tt_vars = ( global_categories => \@categories, global_locales => \@locales, ... }}} * Added some code to edit_form.tt: {{{ [% FOREACH category = global_categories %] [% category %] * [% END %] }}} and the same for locales. It's not a *clean* solution by any means, but it works, and should get anyone else who's interested in attacking the problem a running start. -- Ticket URL: OpenGuides The OpenGuides city guides project --===============9194570693170030405== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi41IChHTlUv TGludXgpCgppRDhEQlFGRGY3MkdxakNwbUtIaWExZ1JBaWlYQUtDM3lYekJWTDMzWVRZbWJVQ0x4 U0xPdlh0Y0FRQ2czWUJzCjZNWTY5aGgvcjdZbWdVcldJRnplL3EwPQo9SUlPVQotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0K --===============9194570693170030405==--