Jobs - ryanpitts/source GitHub Wiki
The Jobs page displays a curated list of openings at organizations that are part of the Source database. At present, these are added to the database manually. New job records may be created by Source admins or by users who have admin privileges for their Organization.
The Jobs page pulls records from the Source CMS and displays them in reverse chronological order, based on when the job was posted. New postings also are automatically tweeted by a Source Jobs account: (currently @SourceJobsTest).
Page URL
https://source.opennews.org/jobs
In the admin
Creating a new Job record requires the following input:
- Job name
- Organization choose from dropdown, linking to Organization record
- Listing start date defaults to
today
- Listing end date defaults to
today + 30 days
Optionally, an admin can set:
- Display on site if unchecked, this will remain in the database but not be displayed to readers
- URL an address where readers can find more details about this job listing
- Contact name
- Contact email if left blank, this will fall back to the organization's email address
- Job location
- Description a one-sentence description of this job
The database model also automatically stores:
- Creation timestamp
- Modification timestamp
- Slug a concatenated version of the record's database ID and name values
- Tweeted At a timestamp set when this record is posted to the Twitter account
When a record is saved:
- The Slug is automatically updated
- Caches are cleared for:
- The jobs page
- The detail page for the associated organization
On the site
For a record to display on the website, the following must be true:
- Display on site is checked
- Listing start date is
today
or earlier - Listing end date is
today
or later
The jobs page displays all live records in reverse chronological order, according to Listing start date. Each listing shows:
- A title: Job name at Organization
- The Description if available
- A contact row: Organization | Job location | Contact name and/or Contact email
- A timestamp based on Listing start date
Job records also are displayed on the associated Organization detail page, under a "Job openings" header just below the standard set of contact information.
Automatic tasks
A management command called tweet_new_jobs
can be used manually, but is designed to run on a cron. The task will look for the first three Job records where the Tweeted At timestamp is blank, in order from oldest Listing start date to newest. It uses the Twitter API to automatically post an alert for each of these records to the @SourceJobsTest account. Only three records are retrieved at a time to avoid overwhelming readers' timelines with an annoyingly massive series of posts. Ideally, we will run the tweet_new_jobs
task hourly, from about noon to 8 p.m. Eastern.
Each tweet is created by randomly selecting a Madlibs-style template, which adds the Job name and Organization name to the appropriate places. A URL is appended to the end of the tweet, using the URL value if it exists, otherwise falling back to a link to the Source jobs page. These Madlibs-style templates are intended to provide some variety to the listings on Twitter, but we can easily switch to a standardized tweet template if that seems like a better idea.