import router from 'girder/router';
import events from 'girder/events';

import JobModel from './models/JobModel';
import JobDetailsWidget from './views/JobDetailsWidget';
router.route('job/:id', 'jobView', function (id) {
    var job = new JobModel({_id: id}).once('g:fetched', function () {
        events.trigger('g:navigateTo', JobDetailsWidget, {
            job: job,
            renderImmediate: true
        });
    }, this).once('g:error', function () {
        router.navigate('collections', {trigger: true});
    }, this).fetch();
});

import JobListWidget from './views/JobListWidget';
router.route('jobs/user/:id', 'jobList', function (id) {
    events.trigger('g:navigateTo', JobListWidget, {
        filter: {userId: id}
    });
});

import router from 'girder/router';
import events from 'girder/events';

import JobModel from './models/JobModel';
import JobDetailsWidget from './views/JobDetailsWidget';
import JobListWidget from './views/JobListWidget';

router.route('job/:id', 'jobView', function (id) {
    var job = new JobModel({_id: id}).once('g:fetched', function () {
        events.trigger('g:navigateTo', JobDetailsWidget, {
            job: job,
            renderImmediate: true
        });
    }, this).once('g:error', function () {
        router.navigate('collections', {trigger: true});
    }, this);
    job.fetch();
});

router.route('jobs/user/:id', 'jobList', function (id) {
    events.trigger('g:navigateTo', JobListWidget, {
        filter: {userId: id}
    });
});

Fix a breakage of the job details page.
Fix a breakage of the job details page.

This was an uncaught casualty of #1504.
