ActionBar: Verwendung bei »Verlauf der Hintergrund-Jobs«
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 14:39:23 +0000 (15:39 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 14:39:23 +0000 (15:39 +0100)
SL/Controller/BackgroundJobHistory.pm
templates/webpages/background_job_history/list.html
templates/webpages/background_job_history/show.html

index fae8706..4fbd7ec 100644 (file)
@@ -29,6 +29,7 @@ sub action_list {
 
   $self->make_filter_summary;
 
+  $self->setup_list_action_bar;
   $self->render('background_job_history/list',
                 title   => $::locale->text('Background job history'),
                 ENTRIES => $self->models->get,
@@ -41,6 +42,7 @@ sub action_show {
   my $back_to = $::form->{back_to} || $self->url_for(action => 'list');
 
   $self->history(SL::DB::BackgroundJobHistory->new(id => $::form->{id})->load);
+  $self->setup_show_action_bar;
   $self->render('background_job_history/show',
                 title   => $::locale->text('View background job execution result'),
                 back_to => $back_to);
@@ -111,4 +113,34 @@ sub init_models {
   );
 }
 
+sub setup_list_action_bar {
+  my ($self) = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      link => [
+        t8('Server control'),
+        link => $self->url_for(controller => 'TaskServer', action => 'show'),
+      ],
+      link => [
+        t8('List of jobs'),
+        link => $self->url_for(controller => 'BackgroundJob', action => 'list'),
+      ],
+    );
+  }
+}
+
+sub setup_show_action_bar {
+  my ($self) = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      link => [
+        t8('Back'),
+        link => $self->url_for(action => 'list'),
+      ],
+    );
+  }
+}
+
 1;
index 0296274..d83bb28 100644 (file)
 [%- END %]
 
 [% L.paginate_controls %]
-
-<hr size="3" noshade>
-
-<p>
- <a href="[% SELF.url_for(controller => 'BackgroundJob', action => 'list') %]">[%- LxERP.t8('View background jobs') %]</a>
- |
- <a href="[% SELF.url_for(controller => 'TaskServer', action => 'show') %]">[%- LxERP.t8('Task server control') %]</a>
-</p>
index 5e42d08..a2f3ab6 100644 (file)
@@ -45,7 +45,3 @@
    </tr>
   </tbody>
  </table>
-
- <p>
-  <a href="[% back_to %]">[%- LxERP.t8('Back') %]</a>
- </p>