File tree 3 files changed +77
-0
lines changed
3 files changed +77
-0
lines changed Original file line number Diff line number Diff line change
1
+ namespace $ . $$ {
2
+
3
+ $mol_style_define ( $piterjs_meetup_texts , {
4
+
5
+ flex : {
6
+ basis : `30rem` ,
7
+ } ,
8
+
9
+ } )
10
+
11
+ }
Original file line number Diff line number Diff line change
1
+ $piterjs_meetup_texts $mol_page
2
+ theme \$mol_theme_special
3
+ meetup $piterjs_meetup
4
+ title \Тексты анонсов
5
+ tools /
6
+ <= Close $mol_link
7
+ arg * texts null
8
+ sub /
9
+ <= Close_icon $mol_icon_close
10
+ speech_text* \
11
+ \🎤 {start} {speaker} **{title}**
12
+ body /
13
+ <= Content $mol_list rows /
14
+ <= Init_labeler $mol_section
15
+ title \Анонс мероприятия
16
+ tools /
17
+ <= init_copy $mol_button_copy
18
+ text <= init_text
19
+ Content <= Init_field $mol_textarea
20
+ value? <=> init_text? \
21
+ \Ура! Скоро {title}
22
+ \
23
+ \⏰ Когда: {start}
24
+ \📍 Где: {place} ({address})
25
+ \
26
+ \📰 Программа
27
+ \
28
+ \{program}
29
+ \
30
+ \🎫 Регистрация: {register}
Original file line number Diff line number Diff line change
1
+ namespace $ . $$ {
2
+ export class $piterjs_meetup_texts extends $ . $piterjs_meetup_texts {
3
+
4
+ @ $mol_mem_key
5
+ speech_text ( speech : $piterjs_speech ) {
6
+ return super . speech_text ( speech )
7
+ . replaceAll ( '{start}' , speech . start ( ) . toString ( 'hh:mm' ) )
8
+ . replaceAll ( '{speaker}' , speech . speaker ( ) . title ( ) )
9
+ . replaceAll ( '{title}' , speech . title ( ) )
10
+ }
11
+
12
+ @ $mol_mem
13
+ init_text ( next ?: string ) {
14
+ if ( next ) return next
15
+
16
+ const meetup = this . meetup ( )
17
+ const title = meetup . title ( )
18
+ const start = meetup . start ( ) ?. toString ( 'DD Month hh:mm' ) ?? 'скоро'
19
+ const place = meetup . place ( ) . title ( )
20
+ const address = meetup . place ( ) . address ( )
21
+ const register = this . $ . $mol_state_arg . make_link ( { meetup : meetup . id ( ) } )
22
+
23
+ const program = meetup . speeches ( ) . map ( speech => this . speech_text ( speech ) ) . join ( '\n' ) || 'формируется'
24
+
25
+ return super . init_text ( )
26
+ . replaceAll ( '{title}' , title )
27
+ . replaceAll ( '{start}' , start )
28
+ . replaceAll ( '{place}' , place )
29
+ . replaceAll ( '{address}' , address )
30
+ . replaceAll ( '{program}' , program )
31
+ . replaceAll ( '{register}' , register )
32
+
33
+ }
34
+
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments