Skip to content

Commit 2a5815a

Browse files
author
jin
committed
more texts
1 parent 46616bb commit 2a5815a

File tree

4 files changed

+104
-45
lines changed

4 files changed

+104
-45
lines changed

meetup/meetup.ts

+64-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
namespace $ {
22

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+
348
export class $piterjs_meetup extends $piterjs_model {
449

550
@ $mol_mem
@@ -214,57 +259,44 @@ namespace $ {
214259
const now = $mol_state_time.now( 60 * 1000 )
215260
return start < now && now < end
216261
}
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-
}
235262

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()
242267
}
243268

244-
@ $mol_mem
245-
init_text() {
269+
@ $mol_mem_key
270+
post_text( id: keyof typeof $piterjs_meetup_post_texts ) {
246271

247272
const title = this.title()
248273
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' ) ?? ''
250276
const place = this.place().title()
251277
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+
253282
const speeches = this.speeches().map(
254-
speech => this.init_speech_template()
283+
speech => this.post_template( 'init_speech' )
255284
.replaceAll( '{start}', speech.start().toString( 'hh:mm' ) )
256285
.replaceAll( '{speaker}', speech.speaker().title() )
257286
.replaceAll( '{title}', speech.title() )
258287
).join( '\n\n' ) || 'формируется'
259288

260-
return this.init_template()
289+
return this.post_template( id )
261290
.replaceAll( '{title}', title )
262291
.replaceAll( '{descr}', descr )
263-
.replaceAll( '{start}', start )
292+
.replaceAll( '{date}', date )
293+
.replaceAll( '{time}', time )
264294
.replaceAll( '{place}', place )
265295
.replaceAll( '{address}', address )
266296
.replaceAll( '{speeches}', speeches )
267-
.replaceAll( '{register}', register )
297+
.replaceAll( '{meetup}', meetup )
298+
.replaceAll( '{video}', video )
299+
.replaceAll( '{afterparty}', afterparty )
268300

269301
}
270302

meetup/templates/templates.view.tree

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
$piterjs_meetup_templates $mol_page
22
theme \$mol_theme_special
33
meetup $piterjs_meetup
4-
init_text => init_text
5-
init_template? => init_template?
6-
init_speech_template? => init_speech_template?
4+
post_template*? => post_template*?
75
title \Шаблоны текстов
86
tools /
97
<= Close $mol_link
@@ -13,10 +11,26 @@ $piterjs_meetup_templates $mol_page
1311
body /
1412
<= Content $mol_list rows /
1513
<= Init_template_labeler $mol_labeler
16-
title \Шаблон анонса мероприятия
14+
title \Анонса мероприятия
1715
Content <= Init_template $mol_textarea
18-
value? <=> init_template?
16+
value? <=> post_template*init?
1917
<= Init_speech_template_labeler $mol_labeler
20-
title \Шаблон доклада в анонсе
18+
title \Доклад в анонсе
2119
Content <= Init_speech_template $mol_textarea
22-
value? <=> init_speech_template?
20+
value? <=> post_template*init_speech?
21+
<= Place_template_labeler $mol_labeler
22+
title \Напоминание за день
23+
Content <= Place_template $mol_textarea
24+
value? <=> post_template*place?
25+
<= Air_template_labeler $mol_labeler
26+
title \Выход в эфир
27+
Content <= Air_template $mol_textarea
28+
value? <=> post_template*air?
29+
<= Afterparty_template_labeler $mol_labeler
30+
title \Афтепати
31+
Content <= Afterparty_template $mol_textarea
32+
value? <=> post_template*afterparty?
33+
<= Retro_template_labeler $mol_labeler
34+
title \Ретропост
35+
Content <= Retro_template $mol_textarea
36+
value? <=> post_template*retro?

meetup/texts/texts.view.css.ts

+3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ namespace $.$$ {
1010

1111
$mol_style_define( $piterjs_meetup_texts_card, {
1212

13+
1314
Text: {
15+
margin: $mol_gap.block,
16+
padding: $mol_gap.block,
1417
whiteSpace: 'pre',
1518
background: {
1619
color: $mol_theme.card,

meetup/texts/texts.view.tree

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
$piterjs_meetup_texts $mol_page
22
theme \$mol_theme_special
33
meetup $piterjs_meetup
4-
init_text => init_text
5-
init_template? => init_template?
6-
init_speech_template? => init_speech_template?
4+
post_text* => post_text*
75
title \Тексты постов
86
tools /
97
<= Templates $mol_link
@@ -18,10 +16,22 @@ $piterjs_meetup_texts $mol_page
1816
<= Content $mol_list rows /
1917
<= Init_text $piterjs_meetup_texts_card
2018
title \Анонс мероприятия
21-
text <= init_text
19+
text <= post_text*init
20+
<= Place_text $piterjs_meetup_texts_card
21+
title \Анонс мероприятия
22+
text <= post_text*place
23+
<= Air_text $piterjs_meetup_texts_card
24+
title \Выход в эфир
25+
text <= post_text*air
26+
<= Arterpaty_text $piterjs_meetup_texts_card
27+
title \Афтепати
28+
text <= post_text*afterparty
29+
<= Retro_text $piterjs_meetup_texts_card
30+
title \Ретропост
31+
text <= post_text*retro
2232

23-
$piterjs_meetup_texts_card $mol_section
24-
tools /
33+
$piterjs_meetup_texts_card $mol_expander
34+
Tools $mol_view sub /
2535
<= Copy $mol_button_copy
2636
text <= text \
2737
content / <= Text $mol_text

0 commit comments

Comments
 (0)