Skip to content

Commit 0ffd450

Browse files
committed
announces2
1 parent 1c35338 commit 0ffd450

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

meetup/texts/texts.view.css.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace $.$$ {
2+
3+
$mol_style_define( $piterjs_meetup_texts, {
4+
5+
flex: {
6+
basis: `30rem`,
7+
},
8+
9+
} )
10+
11+
}

meetup/texts/texts.view.tree

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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}

meetup/texts/texts.view.ts

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

0 commit comments

Comments
 (0)