summaryrefslogtreecommitdiffstats
path: root/client/components/activities/templates.html
blob: 8d3ff763951a1230090fd54acba1ece1515130e3 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template name="boardActivities">
    {{# each currentBoard.activities }}
        <div class="phenom phenom-action clearfix phenom-other">
            {{> userAvatar user=user size="extra-small" class="creator js-show-mem-menu" }}
            <div class="phenom-desc">
                {{ > memberName user=user }}

                {{# if $eq activityType 'createBoard' }}
                    {{_ 'activity-created' boardLabel}}.
                {{ /if }}

                {{# if $eq activityType 'createList' }}
                    {{_ 'activity-added' list.title boardLabel}}.
                {{ /if }}

                {{# if $eq activityType 'archivedList' }}
                    {{_ 'activity-archived' list.title}}.
                {{ /if }}

                {{# if $eq activityType 'createCard' }}
                    {{{_ 'activity-added' cardLink boardLabel}}}.
                {{ /if }}

                {{# if $eq activityType 'archivedCard' }}
                    {{{_ 'activity-archived' cardLink}}}.
                {{ /if }}

                {{# if $eq activityType 'restoredCard' }}
                    {{{_ 'activity-sent' cardLink boardLabel}}}.
                {{ /if }}

                {{# if $eq activityType 'moveCard' }}
                    {{{_ 'activity-moved' cardLink oldList.title list.title}}}.
                {{ /if }}

                {{# if $eq activityType 'addBoardMember' }}
                    {{{_ 'activity-added' memberLink boardLabel}}}.
                {{ /if }}

                {{# if $eq activityType 'removeBoardMember' }}
                    {{{_ 'activity-excluded' memberLink boardLabel}}}.
                {{ /if }}

                {{# if $eq activityType 'joinMember' }}
                    {{# if $eq currentUser._id member._id }}
                        {{{_ 'activity-joined' cardLink}}}.
                    {{ else }}
                        {{{_ 'activity-added' memberLink cardLink}}}.
                    {{/if}}
                {{ /if }}

                {{# if $eq activityType 'unjoinMember' }}
                    {{# if $eq currentUser._id member._id }}
                        {{{_ 'activity-unjoined' cardLink}}}.
                    {{ else }}
                        {{{_ 'activity-removed' memberLink cardLink}}}.
                    {{/if}}
                {{ /if }}

                {{# if $eq activityType 'addComment' }}
                    <div class="phenom-desc">
                    {{{_ 'activity-on' cardLink}}}
                        <div class="action-comment markeddown">
                            <a href="{{ card.absoluteUrl }}" class="current-comment show tdn">
                                <p>{{#viewer}}{{ comment.text }}{{/viewer}}</p>
                            </a>
                        </div>
                    </div>
                {{ /if }}

                {{# if $eq activityType 'addAttachment' }}
                    <div class="phenom-desc">
                        {{{_ 'activity-attached' attachmentLink cardLink}}}.
                    </div>
                {{ /if }}
            </div>
            <p class="phenom-meta quiet">
                <span class="date js-hide-on-sending">
                    {{ moment createdAt }}
                </span>
            </p>
        </div>
    {{ /each }}
</template>

<template name="cardActivities">
    {{# each currentCard.comments }}
        <div class="phenom phenom-action clearfix phenom-comment">
            {{> userAvatar user=user size="small" class="creator js-show-mem-menu" }}
            <form>
                <div class="phenom-desc">
                    {{ > memberName user=user }}
                    <div class="action-comment markeddown">
                        <div class="current-comment">
                          {{#viewer}}{{ text }}{{/viewer}}
                        </div>
                        <textarea class="js-text" tabindex="1">{{ text }}</textarea>
                    </div>
                </div>
                <div class="edit-controls clearfix">
                    <input type="submit" class="primary confirm js-save-edit" value="{{_ 'save'}}" tabindex="2">
                </div>
            </form>
            <p class="phenom-meta quiet">
                <span class="date js-hide-on-sending">{{ moment createdAt }}</span>
                {{# if currentUser }}
                    <span class="js-hide-on-sending">
                        - <a href="#" class="js-edit-action">{{_ "edit"}}</a>
                        - <a href="#" class="js-confirm-delete-action">{{_ "delete"}}</a>
                    </span>
                {{/ if }}
            </p>
        </div>
    {{/each}}

    {{# each currentCard.activities }}
        <div class="phenom phenom-action clearfix phenom-other">
            {{> userAvatar user=user size="extra-small" class="creator js-show-mem-menu" }}
            {{ > memberName user=user }}
            {{# if $eq activityType 'createCard' }}
                {{_ 'activity-added' cardLabel list.title}}.
            {{ /if }}
            {{# if $eq activityType 'joinMember' }}
                {{# if $eq currentUser._id member._id }}
                    {{_ 'activity-joined' cardLabel}}.
                {{ else }}
                    {{{_ 'activity-added' cardLabel memberLink}}}.
                {{/if}}
            {{/if}}
            {{# if $eq activityType 'unjoinMember' }}
                {{# if $eq currentUser._id member._id }}
                    {{_ 'activity-unjoined' cardLabel}}.
                {{ else }}
                    {{{_ 'activity-removed' cardLabel memberLink}}}.
                {{/if}}
            {{ /if }}
            {{# if $eq activityType 'archivedCard' }}
                {{_ 'activity-archived' cardLabel}}.
            {{ /if }}
            {{# if $eq activityType 'restoredCard' }}
                {{_ 'activity-sent' cardLabel boardLabel}}.
            {{/ if }}
            {{# if $eq activityType 'moveCard' }}
                {{_ 'activity-moved' cardLabel oldList.title list.title}}.
            {{/ if }}
            {{# if $eq activityType 'addAttachment' }}
                {{{_ 'activity-attached' attachmentLink cardLabel}}}.
                {{# if attachment.isImage }}
                    <img src="{{ attachment.url }}" class="attachment-image-preview">
                {{/if}}
            {{/ if}}
        </div>
    {{/each}}
</template>