<vc>
    <servicebar id="servicebar" />

    <body>
        <pad>
            <tabs id="config">
                <tab title="ACL">
                    <bind:collection bind="acl" id="acl">
                        <dt bind="__items" addrow="{Add}" />

                        <bind:template>
                            <collapserow>
                                <box>
                                    <right>
                                        <hc>
                                            <button bind="__delete" icon="remove" style="icon" warning="{Confirm deletion}" />
                                        </hc>
                                    </right>
                                    <hc>
                                        <icon icon="lock" />
                                        <label bind="name" />
                                        <label bind="describe" bindtransform="lambda x: x()" />
                                    </hc>
                                </box>
                                <pad>
                                    <hc>
                                        <formline text="{Name}">
                                            <textbox bind="name" />
                                        </formline>
                                        <formline text="{Options}">
                                            <include layout="squid:options-editor" />
                                        </formline>
                                    </hc>
                                </pad>
                            </collapserow>
                        </bind:template>
                    </bind:collection>
                </tab>

                <tab title="{HTTP Access}">
                    <bind:collection bind="http_access" id="http_access">
                        <dt bind="__items" addrow="{Add}" />

                        <bind:template>
                            <collapserow>
                                <box>
                                    <right>
                                        <hc>
                                            <button bind="__delete" icon="remove" style="icon" warning="{Confirm deletion}" />
                                        </hc>
                                    </right>
                                    <hc>
                                        <icon icon="lock" />
                                        <box width="100">
                                            <label bind="mode" />
                                        </box>
                                        <label bind="options" bindtransform="lambda x: ' '.join(_.value for _ in x)" />
                                    </hc>
                                </box>
                                <pad>
                                    <hc>
                                        <formline text="{Mode}">
                                            <dropdown bind="mode" values="['allow', 'deny']" labels="[_('Allow'), _('Deny')]"/>
                                        </formline>
                                        <formline text="{Options}">
                                            <include layout="squid:options-editor" />
                                        </formline>
                                    </hc>
                                </pad>
                            </collapserow>
                        </bind:template>
                    </bind:collection>
                </tab>

                <tab title="{Ports}">
                    <label style="bold" text="HTTP" />
                    <bind:collection bind="http_port" id="http_port">
                        <dt bind="__items" addrow="{Add}" />
                        <include layout="squid:port-template" />
                    </bind:collection>

                    <label style="bold" text="HTTPS" />
                    <bind:collection bind="https_port" id="https_port">
                        <dt bind="__items" addrow="{Add}" />
                        <include layout="squid:port-template" />
                    </bind:collection>
                </tab>
            </tabs>
        </pad>
    </body>

    <button id="save" icon="ok" text="{Save}" />
</vc>