extends ../layout/default.jade

block content
    - var canEdit = req.user.hasPermission('system.widgets.toggle');
    .panel.panel-primary
        .panel-heading
            | Visible Widgets
        table.table
            thead
                th Controller
                th Action
                if canEdit
                    th Actions
            tbody
                each widget in visible
                    tr
                        td= widget.controller
                        td.col-md-4= widget.action
                        if canEdit
                            td.col-md-1
                                form(method='POST',action='/widget/' + widget.id.replace('#', '_') + '/hide')
                                    button.btn.btn-primary(type='submit')
                                        span.fa.fa-eye-slash

    .panel.panel-info
        .panel-heading
            | Hidden Widgets
        table.table
            thead
                th Controller
                th Action
                if canEdit
                    th Actions
            tbody
                each widget in hidden
                    tr
                        td= widget.controller
                        td.col-md-4= widget.action
                        if canEdit
                            td.col-md-1
                                form(method='POST',action='/widget/' + widget.id.replace('#', '_') + '/show')
                                    button.btn.btn-primary(type='submit')
                                        span.fa.fa-eye

extends ../layout/default.jade

block content
    - var canEdit = req.user.hasPermission('system.widgets.toggle');
    .panel.panel-primary
        .panel-heading
            | Visible Widgets
        table.table
            thead
                th Controller
                th Action
                if canEdit
                    th Actions
            tbody
                each widget in visible
                    tr
                        td= widget.controller
                        td.col-md-4= widget.action
                        if canEdit
                            td.col-md-1
                                form(method='POST',action='/widget/' + widget.id.replace('#', '_') + '/hide')
                                    button.btn.btn-primary(type='submit')
                                        span.fa.fa-eye-slash

    .panel.panel-info
        .panel-heading
            | Hidden Widgets
        table.table
            thead
                th Controller
                th Action
                if canEdit
                    th Actions
            tbody
                each widget in hidden
                    - var canShow = req.user.hasPermission(widget.permission);
                    tr
                        td= widget.controller
                        td.col-md-4= widget.action
                        if canEdit
                            td.col-md-1
                                form(method='POST',action='/widget/' + widget.id.replace('#', '_') + '/show')
                                    button.btn.btn-primary(type='submit', disabled=!canShow)
                                        span.fa.fa-eye

Disable button if cannot view widget anyway.
Disable button if cannot view widget anyway.
