|
1 | 1 | namespace $ {
|
2 | 2 |
|
| 3 | + export let $piterjs_meetup_post_texts = { |
| 4 | + init: ` |
| 5 | + Ура! Скоро **PiterJS {title}** |
| 6 | + |
| 7 | + {descr} |
| 8 | + |
| 9 | + ⏰ Когда: **{date} {time}** |
| 10 | + 📍 Где: {place} (**{address}**) |
| 11 | + |
| 12 | + 📰 Программа |
| 13 | + |
| 14 | + {speeches} |
| 15 | + |
| 16 | + 🎫 Регистрация: {meetup} |
| 17 | + `, |
| 18 | + init_speech: ` |
| 19 | + 🗣️ {start} {speaker} |
| 20 | + 🎤 **{title}** |
| 21 | + `, |
| 22 | + place: ` |
| 23 | + 🎉 PiterJS {title} уже завтра в {place}: **{address}** |
| 24 | + |
| 25 | + 🤗 Ждем тебя к {time}. |
| 26 | + 🙏 Если придёщь — отмени регистрацию: {meetup} |
| 27 | + 📽️ Но всё-равно смотри трансляцию! |
| 28 | + `, |
| 29 | + air: ` |
| 30 | + 🎬 PiterJS {title} начинается! |
| 31 | + 📽️ Занимайте места и смотрите трансляцию: **{video}** |
| 32 | + `, |
| 33 | + afterparty: ` |
| 34 | + ✨ Вот и подошёл к концу очередной PiterJS.. |
| 35 | + 📢 Оставляйте свои отзывы — они нам очень интересны: {meetup} |
| 36 | + 🎊 А кому не хватило, идём вместе на афтепати: **{afterparty}** |
| 37 | + `, |
| 38 | + retro: ` |
| 39 | + 👐 Спасибо всем, что были с нами! |
| 40 | + 📸 Ищите себя на фоточках. |
| 41 | + 🙌 Особенно докладчикам — без вас ничего бы не состоялось! |
| 42 | + 🫶 Отдельное спасибо тем, кто оставил отзыв — вы помогаете нам становиться лучше: {meetup} |
| 43 | + 🤝 И конечно же, огромное спасибо от всего сообщества площадке {place} за гостеприимство и партнёрам за подарки. |
| 44 | + 👋 Не скучайте, мы скоро снова всех вас соберём вместе! |
| 45 | + `, |
| 46 | + } |
| 47 | + |
3 | 48 | export class $piterjs_meetup extends $piterjs_model {
|
4 | 49 |
|
5 | 50 | @ $mol_mem
|
@@ -214,57 +259,44 @@ namespace $ {
|
214 | 259 | const now = $mol_state_time.now( 60 * 1000 )
|
215 | 260 | return start < now && now < end
|
216 | 261 | }
|
217 |
| - |
218 |
| - @ $mol_mem |
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 | 262 |
|
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() |
| 263 | + @ $mol_mem_key |
| 264 | + post_template( id: keyof typeof $piterjs_meetup_post_texts, next?: string ) { |
| 265 | + return this.sub( 'template', $hyoo_crowd_dict ).sub( id, $hyoo_crowd_text ).text( next ) |
| 266 | + || $piterjs_meetup_post_texts[ id ].replace( /\t/g, '' ).trim() |
242 | 267 | }
|
243 | 268 |
|
244 |
| - @ $mol_mem |
245 |
| - init_text() { |
| 269 | + @ $mol_mem_key |
| 270 | + post_text( id: keyof typeof $piterjs_meetup_post_texts ) { |
246 | 271 |
|
247 | 272 | const title = this.title()
|
248 | 273 | const descr = this.description()
|
249 |
| - const start = this.start()?.toString( 'DD Month hh:mm' ) ?? 'скоро' |
| 274 | + const date = this.start()?.toString( 'DD Month' ) ?? 'скоро' |
| 275 | + const time = this.start()?.toString( 'hh:mm' ) ?? '' |
250 | 276 | const place = this.place().title()
|
251 | 277 | const address = this.place().address()
|
252 |
| - const register = this.$.$mol_state_arg.make_link({ meetup: this.id() }) |
| 278 | + const afterparty = this.afterparty() |
| 279 | + const meetup = this.$.$mol_state_arg.make_link({ meetup: this.id() }) |
| 280 | + const video = this.video() |
| 281 | + |
253 | 282 | const speeches = this.speeches().map(
|
254 |
| - speech => this.init_speech_template() |
| 283 | + speech => this.post_template( 'init_speech' ) |
255 | 284 | .replaceAll( '{start}', speech.start().toString( 'hh:mm' ) )
|
256 | 285 | .replaceAll( '{speaker}', speech.speaker().title() )
|
257 | 286 | .replaceAll( '{title}', speech.title() )
|
258 | 287 | ).join( '\n\n' ) || 'формируется'
|
259 | 288 |
|
260 |
| - return this.init_template() |
| 289 | + return this.post_template( id ) |
261 | 290 | .replaceAll( '{title}', title )
|
262 | 291 | .replaceAll( '{descr}', descr )
|
263 |
| - .replaceAll( '{start}', start ) |
| 292 | + .replaceAll( '{date}', date ) |
| 293 | + .replaceAll( '{time}', time ) |
264 | 294 | .replaceAll( '{place}', place )
|
265 | 295 | .replaceAll( '{address}', address )
|
266 | 296 | .replaceAll( '{speeches}', speeches )
|
267 |
| - .replaceAll( '{register}', register ) |
| 297 | + .replaceAll( '{meetup}', meetup ) |
| 298 | + .replaceAll( '{video}', video ) |
| 299 | + .replaceAll( '{afterparty}', afterparty ) |
268 | 300 |
|
269 | 301 | }
|
270 | 302 |
|
|
0 commit comments