/[transports]/trunk/web/templates/transports/table
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/web/templates/transports/table

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 45 by dpavlin, Tue May 30 14:34:58 2006 UTC revision 59 by dpavlin, Thu Jun 8 08:24:51 2006 UTC
# Line 5  $page => 1 Line 5  $page => 1
5  my $transports = Transports::Model::TransportCollection->new();  my $transports = Transports::Model::TransportCollection->new();
6  if (Jifty->web->current_user->admin) {  if (Jifty->web->current_user->admin) {
7          $transports->unlimit();          $transports->unlimit();
8    } elsif (Jifty->web->current_user->can_import) {
9            $transports->limit(
10                    column => 'return_code',
11                    operator => 'is',
12                    value => 'null',
13            );
14  } else {  } else {
15          $transports->limit(          $transports->limit(
16                  column => 'created_by',                  column => 'created_by',
17                  value => Jifty->web->current_user->id,                  value => Jifty->web->current_user->id,
18          )          );
19  }  }
20  $transports->order_by({ column => 'date' });  $transports->order_by({ column => 'date' });
21  $transports->set_page_info(  $transports->set_page_info(
22          current_page => $page,          current_page => $page,
23          per_page => 5,          per_page => 5,
24  );  );
25  $m->out("No transports found.") if ($transports->pager->total_entries == 0);  if (my $nr = $transports->pager->total_entries) {
26            $m->out("Showing $nr transports.")
27    } elsif ( Jifty->web->current_user->can_import ) {
28            $m->out("No transports waiting for import.");
29    } else {
30            $m->out("No transports found.")
31    }
32  </%init>  </%init>
33    
34  <table>  <table>
# Line 28  $m->out("No transports found.") if ($tra Line 40  $m->out("No transports found.") if ($tra
40  <th>dep</th>  <th>dep</th>
41  <th>created by</th>  <th>created by</th>
42  <th>description</th>  <th>description</th>
43    <th>import</th>
44  % if (Jifty->web->current_user->admin) {  % if (Jifty->web->current_user->admin) {
45  <th>&nbsp;</th>  <th>&nbsp;</th>
46  % }  % }
# Line 44  $m->out("No transports found.") if ($tra Line 57  $m->out("No transports found.") if ($tra
57  <td>  <td>
58  <% $t->client_dependent ? 'client' : 'none' %>  <% $t->client_dependent ? 'client' : 'none' %>
59  </td>  </td>
60    <td><em><% $t->created_by->name %></em></td>
61    <td><% $t->description %></td>
62  <td>  <td>
63  %  if ($t->created_by) {  %  if ($t->return_code) {
64      <em><% $t->created_by->name %></em>  <% $t->return_code->name %>
65    %  } elsif (Jifty->web->current_user->can_import) {
66    <% Jifty->web->link( label => 'import', url => '/import/' . $t->id ) %>
67    %  } else {
68    pending
69  %  }  %  }
70  </td>  </td>
 <td><% $t->description %></td>  
71  %  if (Jifty->web->current_user->admin) {  %  if (Jifty->web->current_user->admin) {
72  <td><% Jifty->web->link( label => 'edit', url => '/edit/' . $t->id ) %></td>  <td><% Jifty->web->link( label => 'edit', url => '/edit/' . $t->id ) %></td>
73  %  }  %  }

Legend:
Removed from v.45  
changed lines
  Added in v.59

  ViewVC Help
Powered by ViewVC 1.1.26