Newer
Older
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
import("./utils.js").then((utils) => {
import(utils.coreVersion()).then((core) => {
core.Sib.register({
name: "tzcld-point-follow-form",
use: [core.StoreMixin],
empty() {
//console.debug();
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
community: await this.resource,
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `
<solid-form solid-resource bind-resources fields="answer" partial
widget-answer="solid-form-textarea-label"
></solid-form>`;
this.element.innerHTML = render;
}
});
core.Sib.register({
name: "follow-answer-question",
use: [core.StoreMixin],
empty() {
//console.debug();
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
answer: await this.resource,
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `
<div class="\${value != "" ? \`not-null\` : \`null\`}">
<solid-form-textarea name="comment" class="segment auto" value=\${value}">
<textarea data-holder="" name="comment"><!---->\${value}<!----></textarea>
</solid-form-textarea>
<div class="segment full display-comment">
<div class="segment auto">\${value}</div>
<div class="search-button segment auto text-xsmall children-link-button children-link-text-bold children-link-text-uppercase children-link-reversed color-secondary bordered children-button-icon children-icon-arrow-right-circle children-icon-small children-icon-margin-right-xsmall text-right padding-right-xsmall padding-left-xsmall block">
<button><!---->Modifier<!----></button>
</div>
</div>
</div>`;
this.element.innerHTML = render;
}
});
core.Sib.register({
name: "tzcld-follow-points",
use: [core.StoreMixin],
empty() {
//console.debug();
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
points: await this.resource["ldp:contains"]
};
let communityId = false ;
let pointsAnswers = false ;
let PartsPoints = false ;
let parentContext = utils.findAncestor(this.element, 'tzcld-follow') ;
if (parentContext) {
communityId = parentContext.getAttribute('data-src') ;
pointsAnswers = parentContext.getAttribute('point-answers') ;
PartsPoints = parentContext.getAttribute('parts-points') ;
}
let render = ``;
let i = 0 ;
for(let point of tzcldprofile.points) {
let widget_id = 'follow-answer-form' ;
render += ` <div class="full">
<solid-form-search id="filter-anwer-${utils.getIntId(point['@id'])}" class="hidden"
fields="community, followed_point"
value-community="${communityId}"
value-followed_point="${point['@id']}"
></solid-form-search>
<solid-display
solid-resource
bind-resources
fields="@id"
filtered-by="filter-anwer-${utils.getIntId(point['@id'])}"
data-src="${pointsAnswers}"
widget-id="${widget_id}"
></solid-display>
</div>`;
i++ ;
}
this.element.innerHTML = render;
}
});
core.Sib.register({
name: "tzcld-follow",
use: [core.StoreMixin],
empty() {
//console.debug();
this.element.innerHTML = "";
},
async populate() {
this.element.innerHTML = `
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
</div>`;
let tzcldprofile = {
community: await this.resource,
name: await this.resource.name,
parts: await this.element.getAttribute('parts'),
};
if("label" in this.element.attributes) {
for(let ignore of this.element.attributes['label'].value.split(',')) {
tzcldprofile[ignore.trim()] = null;
}
}
let render = `
<solid-widget name="follow-answer-form">
<template>
<div class="segment full auto-eval-answer">
<div class="segment half padding-small whitespace-normal">
<div class="segment full padding-small text-top whitespace-normal">
<solid-display data-src="\${value}"
solid-resource
bind-resources
fields="followed_point.name"
widget-followed_point.name="h4"
></solid-display>
</div>
<div class="segment full padding-small text-top">
<solid-form solid-resource bind-resources fields="answer" class="form" data-src="\${value}"
widget-answer="solid-form-textarea-label"
label-answer=" "
class-answer="segment margin-bottom-medium full sm-full padding-right-small sm-padding-none text-small text-semibold text-color-heading whitespace-normal text-xlarge"
class-submit-button="hidden"
autosave
></solid-form>
</div>
</div>
<div class="segment half padding-small text-top">
<solid-display
data-src="\${value}"
fields="title, followed_point.helpComment"
value-title="Question à poser"
widget-title="h5"
></solid-display>
</div>
</div>
</template>
</solid-widget>
<!--<div>${await tzcldprofile.name}</div>-->
<solid-display solid-resource bind-resources data-src="${this.element.getAttribute('parts')}" parts-points="${this.element.getAttribute('parts-points')}" fields="title, followed_part_points" class="segment full"
multiple-followed_part_points="tzcld-follow-points"
widget-name="div"
widget-title="h2"
class-title="margin-large margin-left-small text-xlarge text-xbold text-color-heading"
class-followed_part_points="full"
></solid-display>`;
this.element.innerHTML = render;
}
});
});
});