summaryrefslogtreecommitdiffstats
path: root/client/components/cards/checklists.jade
blob: 635b4092d6f8d5e8e50684cf55fa37af9f71d157 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
template(name="checklists")
  h3 {{_ 'checklists'}}
  if toggleDeleteDialog.get
    .board-overlay#card-details-overlay
    +checklistDeleteDialog(checklist = checklistToDelete)


  .card-checklist-items
    each checklist in currentCard.checklists
      +checklistDetail(checklist = checklist)

  if canModifyCard
    +inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
      +addChecklistItemForm
    else
      a.js-open-inlined-form
        i.fa.fa-plus
        | {{_ 'add-checklist'}}...

template(name="checklistDetail")
  .js-checklist.checklist
    +inlinedForm(classNames="js-edit-checklist-title" checklist = checklist)
      +editChecklistItemForm(checklist = checklist)
    else
      .checklist-title
        span
        if canModifyCard
          a.js-delete-checklist.toggle-delete-checklist-dialog {{_ "delete"}}...

        if canModifyCard
          h2.title.js-open-inlined-form.is-editable
            +viewer
              = checklist.title
          if isMiniScreen
            a.checklist-handle.handle.fa.fa-arrows.js-checklist-handle
          unless isMiniScreen
            if showDesktopDragHandles
              a.checklist-handle.handle.fa.fa-arrows.js-checklist-handle
        else
          h2.title
            +viewer
                = checklist.title
            if isMiniScreen
              a.checklist-handle.handle.fa.fa-arrows.js-checklist-handle
            unless isMiniScreen
              if showDesktopDragHandles
                a.checklist-handle.handle.fa.fa-arrows.js-checklist-handle
    +checklistItems(checklist = checklist)

template(name="checklistDeleteDialog")
  .js-confirm-checklist-delete
    p
      i(class="fa fa-exclamation-triangle" aria-hidden="true")
    p
      | {{_ 'confirm-checklist-delete-dialog'}}
      span {{checklist.title}}
      | ?
    .js-checklist-delete-buttons
      button.confirm-checklist-delete(type="button") {{_ 'delete'}}
      button.toggle-delete-checklist-dialog(type="button") {{_ 'cancel'}}

template(name="addChecklistItemForm")
  textarea.js-add-checklist-item(rows='1' autofocus)
  .edit-controls.clearfix
    button.primary.confirm.js-submit-add-checklist-item-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form

template(name="editChecklistItemForm")
  textarea.js-edit-checklist-item(rows='1' autofocus dir="auto")
    if $eq type 'item'
      = item.title
    else
      = checklist.title
  .edit-controls.clearfix
    button.primary.confirm.js-submit-edit-checklist-item-form(type="submit") {{_ 'save'}}
    a.fa.fa-times-thin.js-close-inlined-form
    span(title=createdAt) {{ moment createdAt }}
    if canModifyCard
      a.js-delete-checklist-item {{_ "delete"}}...

template(name="checklistItems")
  .checklist-items.js-checklist-items
    each item in checklist.items
      +inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
        +editChecklistItemForm(type = 'item' item = item checklist = checklist)
      else
        +checklistItemDetail(item = item checklist = checklist)
        if isMiniScreen
          a.checklist-item-handle.handle.fa.fa-arrows.js-checklist-item-handle
        unless isMiniScreen
          if showDesktopDragHandles
            a.checklist-item-handle.handle.fa.fa-arrows.js-checklist-item-handle
    if canModifyCard
      +inlinedForm(autoclose=false classNames="js-add-checklist-item" checklist = checklist)
        +addChecklistItemForm
      else
        a.add-checklist-item.js-open-inlined-form
          i.fa.fa-plus
          | {{_ 'add-checklist-item'}}...

template(name='checklistItemDetail')
  .js-checklist-item.checklist-item
    if canModifyCard
      .check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
      .item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}")
        +viewer
          = item.title
    else
      .materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
      .item-title(class="{{#if item.isFinished }}is-checked{{/if}}")
        +viewer
          = item.title