The Third Bear

Just Right.

Posts

Development workflow for ActionKit templatesets — by egj in actionkit , actionkit templates

I've been trying to find a good development workflow for editing ActionKit templatesets for a very long time now.

For a while, I got used to just coding my changes directly in ActionKit's web interface.  Obviously this is not an ideal editing environment, but the ease of previewing draft changes live…

Skipping host confirmation or event approval during uploads — by egj in actionkit , actionkit events

When bulk uploading ActionKit events in a campaign that normally requires approval and/or confirmation, you may want to automatically approve all the events you just uploaded, or even skip the step where hosts need to confirm via email.

You can do this with some undocumented extra columns in your upl…

Customizing ActionKit events: adding "duration" and end times — by egj in actionkit , events , actionkit data manager

By default, ActionKit events have a start time that's specified by their hosts, but they don't have any concept of an end time or a duration.  Knowing how long an event will last can be important for both organizing reasons -- staff want to know how big a commitment the hosts are making; potential a…

Actionkit forms with file upload fields — by egj in actionkit

You may sometimes need to associate uploaded files with Actionkit form submissions.  Broadly speaking, this can be done in two ways:

  1. Let users submit an Actionkit form, then land on a custom page hosted outside of Actionkit where they can upload a file to a server endpoint you've set up.  Capture the…

Complex template logic with {% record %} and {% with %} — by egj in actionkit

ActionKit's {% record %} tag can be used to build pretty complex logic directly in your page & email code.

Here's a basic example of the pattern:

Conditional "followup" questions in ActionKit surveys — by egj in actionkit

In an ActionKit survey, you may want to create "followup" questions that only appear if the previous question was answered a certain way.  For example, a "What is your favorite color?" question with radio choices for "red", "blue", "green", and "other": if a user chooses "other", then a text field s…

Custom public API endpoints for ActionKit data — by egj in actionkit

(12/20/2018) UPDATE: ActionKit now lets you enable CORS for specific hostnames.  This can be used to eliminate the JSONP wrapper described below, if you know in advance what websites should be allowed to access your API.

You can use heavily customized ActionKit templatesets to define your own JSON+JS…

Passing lists into ActionKit query reports — by egj in actionkit , actionkit reports

Suppose you want to build an ActionKit report where the end user inputs a list.  In some of these cases ActionKit is magical enough to know what you want to do and make it work without any effort, e.g. when you're querying for user_ids or mailing_ids.  But suppose we want a simple report to pull dat…

A/B testing ActionKit survey questions — by egj in actionkit

ActionKit's built-in A/B testing platform for pages is great, but it doesn't yet support variations in survey question labels or survey questions themselves.  Fortunately there's a pretty easy way to do it yourself, while still running through the A/B platform to stop and start variations, view test…

Aggregating values server-side in ActionKit templates — by egj in actionkit

I recently needed to add up some values in an ActionKit template, in order to display a tally of the fifty latest on a page, e.g.: "Members have pledged $5,678 recently -- can you pledge $10?"  There were a few constraints that made this nontrivial:

  • These were pledges, not donations, and hence were s…

Reusable code snippets in ActionKit templates — by egj in actionkit

(5/12/2016) UPDATE: We Also Walk Dogs just released a built-in "Make Your Own Templates" feature which makes this a lot cleaner.  Instead of overriding `wrapper.html` with a giant switch-case, you can now just create a new template for each custom snippet and include that template directly.

It's stil…

Hosting quizzes in ActionKit — by egj in actionkit

It's possible to use ActionKit survey pages to host quizzes, "what type of [X] are you" games, and even web polls that display the current winning responses.

Stateful (on/off) hallo.js plugins for Wagtail — by egj in wagtail

Jeffrey Hearn and Joss Ingram have published examples of using Wagtail’s hooks system to register custom hallo.js plugins for additional WYSIWYG features.  Using their examples I was able to quickly wire up some plugins that I needed for a Wagtail project, including:

  • Indent and outdent buttons, for n…

Managing Wagtail redirects as pages — by egj in wagtail

(9/26/2014) UPDATE: Alejandro Varas has published an extended version of this, which is able to redirect to an external URL or a hosted Document in addition to internal pages.  He also added the panel definition that my code was missing.

Letting editors choose a template for a Wagtail page — by egj in wagtail

Each wagtail Page class has a “template” attribute which tells the system what template (as a string identifier) should be loaded when rendering instances of that Page.  As Serafeim Papastefanos writes in his Wagtail tutorial:

Trac MultiRepoSearch plugin v0.6 released — by egj in trac , opensource

Version 0.6 of MultiRepoSearchPlugin for Trac has been released.  The plugin is now faster and more robust than ever before!  An sdist can be downloaded from PyPI or with `pip install`/`easy_install trac-MultiRepoSearchPlugin`.

MultiRepoSearchPlugin allows you to perform full-text searches on your re…

Integrating Trac and Gitolite: Using Postgres — by egj in trac , gitolite , sysadmin

Now that the basics are set up and confirmed working, let's create a new Trac environment using postgres instead of sqlite.

You should already have the necessary system packages (python-dev, postgres and libpq-dev) installed.

Getting Permissions Right, Part 2: The Postgres Database

We need to create a …

Integrating Trac and Gitolite: Round One — by egj in trac , gitolite , sysadmin

We're now going to set up the core integration between Trac and Gitolite, including:

  • Gitolite post-receive hooks to notify Trac of new commits
  • Trac components to update or close tickets when commit messages like "Fixes #1" are pushed to the git server
  • Trac Repository Browser for git repositories
Getting…

Trac and Gitolite: System Setup — by egj in trac , gitolite , sysadmin

First we install some packages:

Installing and Integrating Trac and Gitolite — by egj in trac , gitolite , sysadmin

In a series of posts I'll detail how I install Trac and Gitolite using:

  • Trac 1.0
  • Gitolite v3
  • Ubuntu 12.04 LTS
  • Python 2.7.3
  • Postgres 9.1 for Trac's database
  • Apache 2.2.22 (Ubuntu) with mod_wsgi 3.3

The resulting system will have Trac running at `http://hostname.com` and Git repositories available to clone f…

Triggering Trac emails based on workflow actions — by egj in trac , opensource

I've released a new (BSD licensed) plugin on Trac Hacks.  WorkflowNotificationPlugin enables configurable email notifications tied to ticket workflow events.  For example, you could set up one email notification to be sent out when the "resolve" action is taken, and a different email notification to…

Managing Gitolite through Trac's web admin — by egj in trac , opensource , gitolite

I've released a new BSD-licensed Trac plugin, GitolitePlugin.  This plugin provides two-way integration between Trac and Gitolite.  A permission policy causes Trac's Repository Browser to respect repository "read" permissions as specified in your Gitolite configuration, and three new admin panels al…

Adding avatars for your Trac users — by egj in trac , opensource

I've released a new BSD-licensed Trac plugin, UserPicturesPlugin.   It displays user-specific icons wherever users are referenced in a typical Trac installation: the timeline, ticket reporters and owners, comments, reports and queries, search results, wiki history, source/browser/changeset views, an…

Writing Genshi macros in Trac wiki pages — by egj in trac , opensource

(5/6/2012) UPDATE: Remy Blank has provided some security advice about GenshiMacro.  "Genshi templates allow executing arbitrary Python code. So you basically give users who can insert the macro anywhere (wiki page, ticket comment, etc) permission to act as the user running Trac, including running ru…

Trac plugins for cloning tickets and searching repositories — by egj in trac , opensource

I've released two new Trac plugins to Trac Hacks, PyPI and Github.

MultiRepoSearch allows you to perform full-text searches on your repositories' source code from within Trac.  It is based heavily on RepoSearchPlugin by Alec Thomas and Ryan Ollos but with enough significant differences that a new plu…

WANDisco's Apache Bloodhound is a bad idea — by egj in trac

I posted the following to the Apache Incubator mailing list yesterday, to explain my objections to WANDisco's Bloodhound project being incubated by Apache.  I would love to see a new Trac distribution sponsored by a company with direct financial stakes in its success, with goals like updating Trac's…

Web Tech for Small-Scale Organizing — by egj in coactivate

I’ve been describing CoActivate.org lately as “online collaboration and knowledge-management tools for small- to medium-scale organizing.”

The other day someone asked me, why small- to medium-scale?  Would it scale to large-scale organizing?  Why not?  And why focus on small-scale?

I like that questio…