/[Arh]/lib/Arh/View.pm
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 /lib/Arh/View.pm

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

revision 15 by dpavlin, Fri Nov 30 16:46:39 2007 UTC revision 23 by dpavlin, Fri Nov 30 23:23:14 2007 UTC
# Line 14  template '/pictures' => page { Line 14  template '/pictures' => page {
14          form {          form {
15                  if ( $fc->count ) {                  if ( $fc->count ) {
16                          h1 { _("Pictures available in system") };                          h1 { _("Pictures available in system") };
17                    } else {
18                            span { outs _("No pubicly available pictures at this time...") }
19                  }                  }
20                  table {                  table {
21                          while ( my $f = $fc->next ) {                          while ( my $f = $fc->next ) {
# Line 88  Jifty::View::Declare::CRUD->mount_view(' Line 90  Jifty::View::Declare::CRUD->mount_view('
90  template '/units' => page {  template '/units' => page {
91          h1 { _("Units available in system") };          h1 { _("Units available in system") };
92    
93            show( 'toggle_edit' );
94    
95          my $search = Arh::Model::UnitCollection->new;          my $search = Arh::Model::UnitCollection->new;
96          $search->unlimit;          $search->unlimit;
97    
# Line 102  template '/units' => page { Line 106  template '/units' => page {
106    
107  };  };
108    
109    private template '/toggle_edit' => sub {
110            my $self = shift;
111    
112            # no fun for anonymous users
113            return unless $self->current_user->id;
114    
115            render_region(
116                    name => 'toggle-edit',
117                    path => '/toggle_edit_region',
118            );
119    
120    };
121    
122    template 'toggle_edit_region' => sub {
123            my $self = shift;
124    
125            my $toggleedit = new_action( class => 'ToggleEdit' );
126    
127            my $label = $self->current_user->editing ? _("Disable editing") : _("Enable editing");
128    
129            warn "## $label\n";
130    
131            form {
132                    hyperlink(
133                            label => $label,
134                            onclick => {
135                                    submit => $toggleedit,
136                                    refresh_self => 1,
137                            },
138                    )
139            }
140    
141    };
142    
143  1;  1;

Legend:
Removed from v.15  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26