File: pulldown

package info (click to toggle)
libtemplate-perl 2.14-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 5,496 kB
  • ctags: 667
  • sloc: perl: 15,349; makefile: 62; xml: 7; sh: 5
file content (35 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[% # splash/pull: menu as a vertical sequence of buttons
   # ARGS:
   #	buttons = [
   #	    { link => 'page1.html', text => 'First Page' },
   #	    { link => 'page2.html', text => 'Second Page' },
   #	      ...
   #	],
   #	select	    # item to select in range 1..n (0: none)

    SET
        default = splash.style.default
    ;
    DEFAULT 
        style = default
        space = style.space or default.space
        pad   = style.pad   or default.pad
    ;
-%]
<!-- tt2.splash.pulldown -->
[%  WRAPPER html/table col=0;
	FOREACH button = buttons;
	    WRAPPER html/row + html/cell width = width ? '100%' : 0, col=0;
		style = (select == loop.count or select == button.text) 
			         ? splash.style.select : splash.style.default;
		WRAPPER splash/button
		        width = width ? '100%' : 0;
			INCLUDE splash/text 
				content = button.text
				link    = button.link;
		END;
	    END;
	END;
    END
%]
<!-- /tt2.splash.pulldown -->