/[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

trunk/web/templates/fragments/table revision 67 by dpavlin, Sun Jun 11 11:38:48 2006 UTC trunk/web/templates/transports/table revision 69 by dpavlin, Sun Jun 11 14:23:37 2006 UTC
# Line 1  Line 1 
1  <%args>  <%args>
2  $page => 1  $page => 1
3    $show_description => 0
4    $show_comment => 0
5  </%args>  </%args>
6  <%init>  <%init>
7  my $transports = Transports::Model::TransportCollection->new();  my $transports = Transports::Model::TransportCollection->new();
# Line 20  if (Jifty->web->current_user->admin) { Line 22  if (Jifty->web->current_user->admin) {
22  $transports->order_by({ column => 'date' });  $transports->order_by({ column => 'date' });
23  $transports->set_page_info(  $transports->set_page_info(
24          current_page => $page,          current_page => $page,
25          per_page => 5,          per_page => 10,
26  );  );
27  if (my $nr = $transports->pager->total_entries) {  if (my $nr = $transports->pager->total_entries) {
28          $m->out("Showing $nr transports.")          $m->out("Showing $nr transports.")
29    
30  } elsif ( Jifty->web->current_user->can_import ) {  } elsif ( Jifty->web->current_user->can_import ) {
31          $m->out("No transports waiting for import.");          $m->out("No transports waiting for import.");
32  } else {  } else {
# Line 31  if (my $nr = $transports->pager->total_e Line 34  if (my $nr = $transports->pager->total_e
34  }  }
35  </%init>  </%init>
36    
37    <% Jifty->web->link(
38            label => ( $show_description ? 'no ' : '' ) . ' description',
39            onclick => {
40                    replace_with => '/transports/table',
41                    args => { show_description => $show_description ? 0 : 1 },
42            }
43    ) %>
44    
45    <% Jifty->web->link(
46            label => ( $show_comment ? 'no ' : '' ) . ' import comment',
47            onclick => {
48                    replace_with => '/transports/table',
49                    args => { show_comment => $show_comment ? 0 : 1 },
50            }
51    ) %>
52    
53  <table>  <table>
54  <tr>  <tr>
55  <th>src</th>  <th>src</th>
# Line 39  if (my $nr = $transports->pager->total_e Line 58  if (my $nr = $transports->pager->total_e
58  <th>req.nr</th>  <th>req.nr</th>
59  <th>dep</th>  <th>dep</th>
60  <th>created by</th>  <th>created by</th>
61    % if ($show_description) {
62  <th>description</th>  <th>description</th>
63    % }
64  <th>import</th>  <th>import</th>
65    % if ($show_comment) {
66    <th>comment</th>
67    % }
68    </th>
69  % if (Jifty->web->current_user->admin) {  % if (Jifty->web->current_user->admin) {
70  <th>&nbsp;</th>  <th>&nbsp;</th>
71  % }  % }
 </th>  
72  </tr>  </tr>
73    
74  % my $i = 0;  % my $i = 0;
75  % while (my $t = $transports->next) {  % while (my $t = $transports->next) {
76    
77  <tr class="<% ++$i % 2 == 0 ? 'alt' : '' %>">  <tr class="<% ++$i % 2 == 0 ? 'alt' : '' %>">
78  <td><% $t->source->name %></td>  <td><% $t->source->name %></td>
79  <td><% $t->destination->name %></td>  <td><% $t->destination->name %></td>
# Line 58  if (my $nr = $transports->pager->total_e Line 83  if (my $nr = $transports->pager->total_e
83  <% $t->client_dependent ? 'client' : 'none' %>  <% $t->client_dependent ? 'client' : 'none' %>
84  </td>  </td>
85  <td><em><% $t->created_by->name %></em></td>  <td><em><% $t->created_by->name %></em></td>
86    % if ($show_description) {
87  <td><% $t->description %></td>  <td><% $t->description %></td>
88    % }
89  <td>  <td>
90  %  if ($t->return_code) {  %  if ($t->return_code && $t->return_code->name) {
91  <% $t->return_code->name %>  <% $t->return_code->name %>
92  %  } elsif (Jifty->web->current_user->can_import) {  %  } elsif (Jifty->web->current_user->can_import) {
93  <% Jifty->web->link( label => 'import', url => '/import/' . $t->id ) %>  <% Jifty->web->link( label => 'import', onclick => {
94            replace_with => '/transports/import',
95            args => { id => $t->id },
96    } ) %>
97  %  } else {  %  } else {
98  pending  pending
99  %  }  %  }
100  </td>  </td>
101    % if ($show_comment) {
102    <td><% $t->comment %></td>
103    % }
104  %  if (Jifty->web->current_user->admin) {  %  if (Jifty->web->current_user->admin) {
105  <td><% Jifty->web->link( label => 'edit', url => '/edit/' . $t->id ) %></td>  <td><% Jifty->web->link( label => 'edit', onclick => {
106            replace_with => '/transports/edit',
107            args => { id => $t->id },
108    } ) %></td>
109  %  }  %  }
110  </tr>  </tr>
111  % }  % }
# Line 77  pending Line 113  pending
113    
114  % if ($transports->pager->previous_page) {  % if ($transports->pager->previous_page) {
115   <% Jifty->web->link(   <% Jifty->web->link(
116          label => "Previous page",          label => "Previous",
117          onclick => { args => { page => $transports->pager->previous_page } }          onclick => { args => { page => $transports->pager->previous_page } }
118   ) %>   ) %>
119  % }  % }
# Line 88  page <% $page %> of <% $transports->page Line 124  page <% $page %> of <% $transports->page
124    
125  % if ($transports->pager->next_page) {  % if ($transports->pager->next_page) {
126   <% Jifty->web->link(   <% Jifty->web->link(
127          label => "Next page",          label => "Next",
128          onclick => { args => { page => $transports->pager->next_page } }          onclick => { args => { page => $transports->pager->next_page } }
129   ) %>   ) %>
130  % }  % }

Legend:
Removed from v.67  
changed lines
  Added in v.69

  ViewVC Help
Powered by ViewVC 1.1.26