summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar/sidebarCustomFields.jade
blob: e17bb75d57de380f92b3f6796f0e320288fd0b72 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
template(name="customFieldsSidebar")
    ul.sidebar-list
        each customFields
            li
                div.minicard-wrapper.js-minicard
                    div.minicard
                        a.fa.fa-pencil.js-edit-custom-field.minicard-edit-button
                        div.minicard-title
                            | {{ name }} ({{ type }})

    if currentUser.isBoardMember
        hr
        a.sidebar-btn.js-open-create-custom-field
            i.fa.fa-plus
            span {{_ 'createCustomField'}}

template(name="createCustomFieldPopup")
    form
        label
            | {{_ 'name'}}
            unless _id
                input.js-field-name(type="text" name="field-name" autofocus)
            else
                input.js-field-name(type="text" name="field-name" value=name)

        label
            | {{_ 'type'}}
            select.js-field-type(name="field-type" disabled="{{#if _id}}disabled{{/if}}")
                each types
                    if selected
                        option(value=type selected="selected") {{name}}
                    else
                        option(value=type) {{name}}
        a.flex.js-field-show-on-card
            .materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}")

            span {{_ 'show-field-on-card'}}
        button.primary.wide.left(type="submit")
            | {{_ 'save'}}
        if _id
            button.negate.wide.right.js-delete-custom-field
                | {{_ 'delete'}}

template(name="editCustomFieldPopup")
    | {{> createCustomFieldPopup}}

template(name="deleteCustomFieldPopup")
    p {{_ "custom-field-delete-pop"}}
    button.js-confirm.negate.full(type="submit") {{_ 'delete'}}