@@ -216,8 +216,56 @@ namespace $ {
216
216
}
217
217
218
218
@ $mol_mem
219
- init_text ( next ?: string ) {
220
- return this . sub ( 'init_text' , $hyoo_crowd_reg ) . str ( next )
219
+ init_template ( next ?: string ) {
220
+ return this . sub ( 'init_template' , $hyoo_crowd_text ) . text ( next ) || `
221
+ Ура! Скоро **PiterJS {title}**
222
+
223
+ {descr}
224
+
225
+ ⏰ Когда: **{start}**
226
+ 📍 Где: {place} (**{address}**)
227
+
228
+ 📰 Программа
229
+
230
+ {speeches}
231
+
232
+ 🎫 Регистрация: {register}
233
+ ` . replace ( / \t / g, '' ) . trim ( )
234
+ }
235
+
236
+ @ $mol_mem
237
+ init_speech_template ( next ?: string ) {
238
+ return this . sub ( 'init_speech_template' , $hyoo_crowd_text ) . text ( next ) || `
239
+ 🗣️ {start} {speaker}
240
+ 🎤 **{title}**
241
+ ` . replace ( / \t / g, '' ) . trim ( )
242
+ }
243
+
244
+ @ $mol_mem
245
+ init_text ( ) {
246
+
247
+ const title = this . title ( )
248
+ const descr = this . description ( )
249
+ const start = this . start ( ) ?. toString ( 'DD Month hh:mm' ) ?? 'скоро'
250
+ const place = this . place ( ) . title ( )
251
+ const address = this . place ( ) . address ( )
252
+ const register = this . $ . $mol_state_arg . make_link ( { meetup : this . id ( ) } )
253
+ const speeches = this . speeches ( ) . map (
254
+ speech => this . init_speech_template ( )
255
+ . replaceAll ( '{start}' , speech . start ( ) . toString ( 'hh:mm' ) )
256
+ . replaceAll ( '{speaker}' , speech . speaker ( ) . title ( ) )
257
+ . replaceAll ( '{title}' , speech . title ( ) )
258
+ ) . join ( '\n\n' ) || 'формируется'
259
+
260
+ return this . init_template ( )
261
+ . replaceAll ( '{title}' , title )
262
+ . replaceAll ( '{descr}' , descr )
263
+ . replaceAll ( '{start}' , start )
264
+ . replaceAll ( '{place}' , place )
265
+ . replaceAll ( '{address}' , address )
266
+ . replaceAll ( '{speeches}' , speeches )
267
+ . replaceAll ( '{register}' , register )
268
+
221
269
}
222
270
223
271
}
0 commit comments