diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 96dd3e30..ca626077 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -288,4 +288,19 @@ sub dashboard :Chained('user') :Args(0) { } +sub my_jobs_tab :Chained('user') :PathPart('my-jobs-tab') :Args(0) { + my ($self, $c) = @_; + $c->stash->{template} = 'dashboard-my-jobs-tab.tt'; + + die unless $c->stash->{user}->emailaddress; + + # Get all current builds of which this user is a maintainer. + $c->stash->{builds} = [$c->model('DB::Builds')->search( + { iscurrent => 1 + , maintainers => { ilike => "%" . $c->stash->{user}->emailaddress . "%" } + }, + { order_by => ["project", "jobset", "job"] })]; +} + + 1; diff --git a/src/root/dashboard.tt b/src/root/dashboard.tt index d33eb887..2e30ea4b 100644 --- a/src/root/dashboard.tt +++ b/src/root/dashboard.tt @@ -3,6 +3,7 @@
@@ -31,12 +32,16 @@ [% ELSE %] -
You have no starred jobs. You can add them by visiting a job page and clicking on the ☆ icon.
+
You have no starred jobs. You + can add them by visiting a job page and clicking on the ☆ + icon.
[% END %]
+ [% INCLUDE makeLazyTab tabName="tabs-my-jobs" uri=c.uri_for(c.controller('User').action_for('my_jobs_tab'), [user.username]) %] + [% END %]