[% # INCLUDE dumper.tt dump = c.stash %] [% # INCLUDE dumper.tt dump = c.authen.last_access %] [% # INCLUDE dumper.tt dump = c.user_profile.session_idle_timeout %] [% # c.debug("==== rendering ${component.name} ====") %] [% IF c.authen.username; # skip if logged / timed out args = []; args.push('service=' _ c.cfg('settings').item('_centre') ); args.push('username=' _ c.authen.username); args.push('app_url=' _ app_url); args.push('tt=' _ template.name); cgi_url = c.cfg('settings').base_href _ '/script/cgi/new_messages.cgi?' _ args.join(';'); last_access_ms = c.authen.last_access * 1000; idle_time_ms = c.user_profile.session_idle_timeout * 1000; interval_ms = ( 60 * 1000 ) * 1; # mins (in millisecs) %] [% polling_window = idle_time_ms - interval_ms; # 1 interval short of idle-timeout %]
[% END %] [% IF c.stash.status_msg %]

[% c.stash.status_msg %]

[% END %] [% IF c.stash.error_msg; error = c.stash.error_msg; IF is_code_ref(error); # split into list form: %]
ERROR:
[% FOREACH e IN error %]
* [% e %]
[% END %] [% ELSE %]

ERROR: [% error %]

[% END %] [% END %] [% IF using_cap_flash; # using MessageStack instead & disabled to prevent c.flash producing undef msgs # PROCESS dumper.tt dump = c.flash.dump; # FOREACH type IN [ 'info', 'warning', 'error' ]; # IF c.flash.has_key(type); # FOREACH message IN c.flash.get(type) -%]

[% type | upper %]: [% message %]

[% # END %] [% # END %] [% # END %] [% END %] [% INCLUDE site/snippets/message_stack.tt %]