From befaa23347225dd187042bb686608353d5f50e05 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 16:28:35 +0000 Subject: [PATCH 01/27] registration on-site --- app/app.view.tree | 4 ++ app/app.view.ts | 3 + domain/domain.ts | 5 ++ meetup/guests/guests.view.css.ts | 17 ++++++ meetup/guests/guests.view.tree | 18 ++++++ meetup/guests/guests.view.ts | 16 ++++++ meetup/meetup.ts | 21 +++++++ meetup/page/page.view.css | 29 ++++++++-- meetup/page/page.view.tree | 88 ++++++++++++++++++++---------- meetup/page/page.view.ts | 51 ++++++++++++++++- person/edit/edit.view.tree | 13 +++++ person/person.ts | 17 ++++++ person/snippet/snippet.view.css.ts | 9 +++ person/snippet/snippet.view.tree | 2 + person/snippet/snippet.view.ts | 11 ++++ place/place.ts | 5 ++ 16 files changed, 273 insertions(+), 36 deletions(-) create mode 100644 meetup/guests/guests.view.css.ts create mode 100644 meetup/guests/guests.view.tree create mode 100644 meetup/guests/guests.view.ts create mode 100644 person/edit/edit.view.tree create mode 100644 person/person.ts create mode 100644 person/snippet/snippet.view.css.ts create mode 100644 person/snippet/snippet.view.tree create mode 100644 person/snippet/snippet.view.ts diff --git a/app/app.view.tree b/app/app.view.tree index 45315db..d63ceec 100644 --- a/app/app.view.tree +++ b/app/app.view.tree @@ -3,6 +3,7 @@ $piterjs_app $mol_view meetups => meetups meetup* => meetup* meetup_public*? => meetup_public*? + person => person plugins / <= Theme $mol_theme_auto sub / @@ -56,8 +57,11 @@ $piterjs_app $mol_view title \Другие события Meetup* $piterjs_meetup_page meetup <= meetup* + person <= person editing <= editing? false meetup_public? <=> meetup_public*? + Meetup_guests* $piterjs_meetup_guests + meetup <= meetup* Speech!id $piterjs_speech_page speech <= speech!id $piterjs_speech editing <= editing? false diff --git a/app/app.view.ts b/app/app.view.ts index 3ab546b..bf95b42 100644 --- a/app/app.view.ts +++ b/app/app.view.ts @@ -31,6 +31,8 @@ namespace $.$$ { wiki() { return this.$.$mol_state_arg.value( 'wiki' ) !== null } + guests() { return this.$.$mol_state_arg.value( 'guests' ) !== null } + @ $mol_mem meetup_id( next? : string | null ) { @@ -62,6 +64,7 @@ namespace $.$$ { const pages = [ this.Menu() , ... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] , + ... this.guests() ? [ this.Meetup_guests( this.meetup_id() ) ] : [] , ... this.speech_id() ? [ this.Speech( this.speech_id() ) ] : [] , ... this.place_show() ? [ this.Place() ] : [] , ... this.video() ? [ this.Video() ] : [] , diff --git a/domain/domain.ts b/domain/domain.ts index e5235dd..b47f884 100644 --- a/domain/domain.ts +++ b/domain/domain.ts @@ -37,6 +37,11 @@ namespace $ { return this.world()!.Fund( $piterjs_meetup ).make()! } + @ $mol_mem + person() { + return this.world()!.Fund( $piterjs_person ).Item( this.land!.peer_id() ) + } + } } diff --git a/meetup/guests/guests.view.css.ts b/meetup/guests/guests.view.css.ts new file mode 100644 index 0000000..f668e32 --- /dev/null +++ b/meetup/guests/guests.view.css.ts @@ -0,0 +1,17 @@ +namespace $.$$ { + + $mol_style_define( $piterjs_meetup_guests, { + + flex: { + basis: `20rem`, + }, + + Filter: { + align: { + self: `stretch`, + } + }, + + } ) + +} diff --git a/meetup/guests/guests.view.tree b/meetup/guests/guests.view.tree new file mode 100644 index 0000000..c51dede --- /dev/null +++ b/meetup/guests/guests.view.tree @@ -0,0 +1,18 @@ +$piterjs_meetup_guests $mol_page + meetup $piterjs_meetup + title \Список гостей + tools / + <= Close $mol_link + arg * guests null + sub / + <= Close_icon $mol_icon_cross + body / + <= Content $mol_list rows / + <= Filter $mol_search + hint \Поиск... + query? <=> filter? \ + <= Person_list $mol_list + rows <= person_list / + <= Person*0_0 $piterjs_person_snippet + person <= person* $piterjs_person + needle <= filter diff --git a/meetup/guests/guests.view.ts b/meetup/guests/guests.view.ts new file mode 100644 index 0000000..62dc107 --- /dev/null +++ b/meetup/guests/guests.view.ts @@ -0,0 +1,16 @@ +namespace $.$$ { + export class $piterjs_meetup_guests extends $.$piterjs_meetup_guests { + + @ $mol_mem + person_list() { + return this.meetup().joined_list() + .filter( $mol_match_text( this.filter(), person => [ person.name_first(), person.name_last(), person.id() ] ) ) + .map( person => this.Person( person ) ) + } + + person( person: $piterjs_person ) { + return person + } + + } +} diff --git a/meetup/meetup.ts b/meetup/meetup.ts index d8b57ae..3dabab4 100644 --- a/meetup/meetup.ts +++ b/meetup/meetup.ts @@ -53,6 +53,27 @@ namespace $ { return this.sub( 'afterparty', $hyoo_crowd_reg ).str( next ) } + @ $mol_mem + joined_node() { + return this.sub( 'joined', $hyoo_crowd_counter ) + } + + @ $mol_mem + joined( next?: boolean ) { + return this.joined_node().counted( next ) ?? false + } + + @ $mol_mem + joined_list() { + const Person = this.world()!.Fund( $piterjs_person ) + return this.joined_node().list().map( id => Person.Item( id ) ) + } + + @ $mol_mem + joined_count() { + return this.joined_node().total() + } + } } diff --git a/meetup/page/page.view.css b/meetup/page/page.view.css index c7a665f..75eaa2a 100644 --- a/meetup/page/page.view.css +++ b/meetup/page/page.view.css @@ -2,10 +2,6 @@ flex: 0 0 28rem; } -[piterjs_meetup_page_head] { - flex-wrap: nowrap; -} - [piterjs_meetup_page_body] { padding: .75rem; } @@ -28,12 +24,35 @@ font-family: sans-serif; } +[piterjs_meetup_page_hidden_fields] { + padding: var(--mol_gap_block); +} + [piterjs_meetup_page_afterparty] { box-shadow: none; flex-grow: 0; font-family: sans-serif; } +[piterjs_meetup_page_join] { + padding: var(--mol_gap_block); + background-color: var(--mol_theme_card); +} + +[piterjs_meetup_page_joined_confirm] { + padding: var(--mol_gap_text); +} + +[piterjs_meetup_page_joined_bid] { + padding: var(--mol_gap_text); + color: var(--mol_theme_focus); +} + +[piterjs_meetup_page_free_space] { + padding: var(--mol_gap_text); + color: var(--mol_theme_shade); +} + [piterjs_meetup_page_title] { - flex: 1000 1000 auto; + flex: 1000 1000 3rem; } diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index b3b8193..2d93a1c 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -4,6 +4,8 @@ $piterjs_meetup_page $mol_page description? => description? afterparty? => afterparty? start? => start? + joined_count => joined_count + joined? => joined? Title $mol_string_button value? <=> title? enabled <= editing false @@ -12,6 +14,11 @@ $piterjs_meetup_page $mol_page <= Public $mol_check_icon checked? <=> meetup_public? false Icon <= Public_icon $mol_icon_eye + <= Guests_link $mol_link + arg * guests \ + hint \Список гостей + sub / + <= Guests_link_icon $mol_icon_account_group_outline <= Start $mol_date value_moment? <=> start? enabled <= editing false @@ -25,35 +32,58 @@ $piterjs_meetup_page $mol_page sub / <= Close_icon $mol_icon_cross body / - <= Description $mol_textarea - hint \Резюме - value? <=> description? - enabled <= editing false - <= Links $mol_view sub <= links / - <= Video $mol_link - arg * - video \ - place null - speech null - title \Трансляция - <= Place $mol_link - arg * - video null - place \ - speech null - title \Площадка - <= Speeches $mol_list rows <= speeches / - <= Speech_add $mol_button_minor - click? <=> speech_add? null - sub / - <= Speech_add_icon $mol_icon_plus - \Добавить доклад - <= Afterparty_field $mol_form_field - name \Афтерпати - Content <= Afterparty $mol_textarea - hint \Адрес, ориентиры, чат - value? <=> afterparty? + <= Content $mol_list rows <= content / + <= Description $mol_textarea + hint \Резюме + value? <=> description? enabled <= editing false + <= Links $mol_view sub <= links / + <= Video $mol_link + arg * + video \ + place null + speech null + title \Трансляция + <= Place $mol_link + arg * + video null + place \ + speech null + title \Площадка + <= Speeches $mol_list rows <= speeches / + <= Speech_add $mol_button_minor + click? <=> speech_add? null + sub / + <= Speech_add_icon $mol_icon_plus + \Добавить доклад + <= Hidden_fields $mol_list rows / + <= Afterparty_field $mol_form_field + name \Афтерпати + Content <= Afterparty $mol_textarea + hint \Адрес, ориентиры, чат + value? <=> afterparty? + enabled <= editing false + <= Capacity_field $mol_form_field + name \Максимальная вместимость + Content <= Capacity $mol_number + hint \100 + value? <=> capacity? 0 + enabled <= editing false + <= Join $mol_section + title \Регистрация + level 5 + tools / + <= Free_space $mol_paragraph title <= free_space \нет мест + content <= join_content / + <= Profile $piterjs_person_edit + person <= person $piterjs_person + - enabled <= profile_editable true + <= Joined_form $mol_view sub <= joined_form / + <= Joined $mol_check_box + checked? <=> joined? + enabled <= join_enabled false + title \Я приду + <= Joined_confirm $mol_paragraph title \🔥 Ждём тебя! + <= Joined_bid $mol_paragraph title \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. Speech!index $piterjs_speech_snippet speech <= speech!index $piterjs_speech - diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 8fbefe1..19c06b8 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -13,15 +13,21 @@ namespace $.$$ { coords() { return this.meetup().place().coords() } + + @ $mol_mem + join_allowed() { + return this.meetup().start().valueOf() > $mol_state_time.now( 60 * 60 ) + } @ $mol_mem - body() { + content() { return [ ... ( this.editing() || this.description() ) ? [ this.Description() ] : [] , this.Links() , this.Speeches() , ... this.editing() ? [ this.Speech_add() ] : [] , - ... this.editing() ? [ this.Afterparty_field() ] : [] , + ... this.editing() ? [ this.Hidden_fields() ] : [] , + ... this.join_allowed() ? [ this.Join() ] : [] , ] } @@ -54,6 +60,47 @@ namespace $.$$ { return super.Public() } + Guests_link() { + if( !this.editing() ) return null! + return super.Guests_link() + } + + capacity( next?: number ) { + return this.meetup().place().capacity_max( next ) + } + + profile_editable() { + return !this.joined() + } + + join_enabled() { + if( this.person().name_first().length < 2 ) return false + if( this.person().name_last().length < 2 ) return false + return true + } + + @ $mol_mem + join_content() { + return [ + this.Profile(), + this.Joined_form(), + ... this.meetup().joined() ? [ this.Joined_bid() ] : [], + ] + } + + @ $mol_mem + joined_form() { + return [ + this.Joined(), + ... this.meetup().joined() ? [ this.Joined_confirm() ] : [], + ] + } + + free_space() { + const space = this.meetup().place().capacity_max() - this.joined_count() + return `Свободно мест: ${space}` + } + } } diff --git a/person/edit/edit.view.tree b/person/edit/edit.view.tree new file mode 100644 index 0000000..2aca5d3 --- /dev/null +++ b/person/edit/edit.view.tree @@ -0,0 +1,13 @@ +$piterjs_person_edit $mol_view + person $piterjs_person + name_first? => name_first? + name_last? => name_last? + sub / + <= Name_first $mol_string + hint \Имя + value? <=> name_first? + enabled <= enabled true + <= Name_last $mol_string + hint \Фамилия + value? <=> name_last? + enabled <= enabled true diff --git a/person/person.ts b/person/person.ts new file mode 100644 index 0000000..4206164 --- /dev/null +++ b/person/person.ts @@ -0,0 +1,17 @@ +namespace $ { + + export class $piterjs_person extends $piterjs_model { + + @ $mol_mem + name_first( next?: string ) { + return this.sub( 'name_first', $hyoo_crowd_reg ).str( next ) + } + + @ $mol_mem + name_last( next?: string ) { + return this.sub( 'name_last', $hyoo_crowd_reg ).str( next ) + } + + } + +} diff --git a/person/snippet/snippet.view.css.ts b/person/snippet/snippet.view.css.ts new file mode 100644 index 0000000..e1cc0d6 --- /dev/null +++ b/person/snippet/snippet.view.css.ts @@ -0,0 +1,9 @@ +namespace $.$$ { + + $mol_style_define( $piterjs_person_snippet, { + + padding: $mol_gap.text, + + } ) + +} diff --git a/person/snippet/snippet.view.tree b/person/snippet/snippet.view.tree new file mode 100644 index 0000000..f44ba40 --- /dev/null +++ b/person/snippet/snippet.view.tree @@ -0,0 +1,2 @@ +$piterjs_person_snippet $mol_dimmer + person $piterjs_person diff --git a/person/snippet/snippet.view.ts b/person/snippet/snippet.view.ts new file mode 100644 index 0000000..f2f5a45 --- /dev/null +++ b/person/snippet/snippet.view.ts @@ -0,0 +1,11 @@ +namespace $.$$ { + export class $piterjs_person_snippet extends $.$piterjs_person_snippet { + + @ $mol_mem + haystack() { + const person = this.person() + return person.name_first() + ' ' + person.name_last() + } + + } +} diff --git a/place/place.ts b/place/place.ts index bf63e7f..a492864 100644 --- a/place/place.ts +++ b/place/place.ts @@ -12,6 +12,11 @@ namespace $ { // return $mol_data_wrapper( $mol_data_string , URL )( this.data().site ) // } + @ $mol_mem + capacity_max( next?: number ) { + return this.sub( 'capacity_max', $hyoo_crowd_reg ).numb( next ) + } + @ $mol_mem address( next?: string ) { return this.sub( 'address', $hyoo_crowd_reg ).str( next ) From 2a6ac027192c19f84ec1e234b573654ce3a5ff1b Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 16:31:01 +0000 Subject: [PATCH 02/27] reduce readme --- README.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/README.md b/README.md index 3e9c380..b13aae6 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,10 @@ # PiterJS -# Внесение данных - -Всё данные находятся в data.[tree](https://github.com/nin-jin/tree.d) конфигах. Для отступов используются табы, юниксовые переводы строк. После обновления данных нужно открыть [piterjs.org](https://piterjs.org/). Если будут какие-либо ошибки или данные не появятся, то в консоли разработчика (Ctrl+Shit+I) будет написано в чём проблема. - -Проще всего вносить данные через свой форк прямо на гитхабе. - -## Добавление докладчика - -1. Открываем [speaker/speaker.data.tree](speaker/speaker.data.tree) -2. Поиском проверяем, что этого докладчика ещё нет. -3. Если есть - обновляем его данные, если надо. -4. Если нет - придумываем ему красивый идентификатор. Например - первые слога фамилии и имени транслитом. Или широко известный никнейм докладчика. Проверяем, что этот идентификатор ещё никем не занят. -5. Добавляем данные о нём по аналогии с остальными. - -## Добавление выступления - -1. Открываем [speech/speech.data.tree](speech/speech.data.tree) -2. Придумываем выступлению красивый идентификатор. Желательно не слишком длинный. Проверяем, что других докладов с этим идентификатором ещё нет. -3. Добавляем данные о нём по аналогии с остальными. -4. В поле `speaker` указываем идентификаторы докладчиков. В поле `duration` (продолжительность доклада) используется [ISO8601](https://en.wikipedia.org/wiki/ISO_8601#Durations). - -## Добавление митапа - -1. Открываем [meetup/meetup.data.tree](meetup/meetup.data.tree) -2. Добавляем данные о нём по аналогии с остальными. -3. В поле `speeches` указываем идентификаторы выступлений. В поле `place` указываем идентификатор площадки. В поле `start` (время начала митапа) используется [ISO8601](https://en.wikipedia.org/wiki/ISO_8601). - -## Добавление площадки - -1. Открываем [place/place.data.tree](place/place.data.tree) -2. Добавляем данные о ней по аналогии с остальными. - ## Изменение презентации 1. Открываем [intro/intro.view.tree](intro/intro.view.tree) 2. Изменяем по аналогии с остальным. В `text` можно использовать markdown. Можно добавлять свои страницы или скрывать существующие, поставив `- ` (дефис+пробел) перед веткой описания слайда. У каждого слайда первым словом задаётся уникальный идентификатор, который будет фигурировать в ссылке. -# Запуск девсервера - -``` -git clone https://github.com/eigenmethod/mam.git ./mam && cd mam -npm install -npm start -``` - -Application will be accessible at `http://localhost:9080/piterjs/app/-/index.html` - -You can change source files (`./piterjs/**`) and reload page to view result. - # BrowserStack We use it for crossbrowser testing. From e45822c9451aaa44644c567f88d1a20dfbfd355e Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 16:34:07 +0000 Subject: [PATCH 03/27] fixed input size --- meetup/page/page.view.css | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meetup/page/page.view.css b/meetup/page/page.view.css index 75eaa2a..fc51311 100644 --- a/meetup/page/page.view.css +++ b/meetup/page/page.view.css @@ -2,6 +2,14 @@ flex: 0 0 28rem; } +[piterjs_meetup_page_title] { + flex: 1000 1000 3rem; +} + +[piterjs_meetup_page_tools] { + flex-grow: 1; +} + [piterjs_meetup_page_body] { padding: .75rem; } @@ -52,7 +60,3 @@ padding: var(--mol_gap_text); color: var(--mol_theme_shade); } - -[piterjs_meetup_page_title] { - flex: 1000 1000 3rem; -} From 7067cde2b4a7745dbb7243429cc5766b054f5a7b Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 16:36:26 +0000 Subject: [PATCH 04/27] fixed error --- meetup/page/page.view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 19c06b8..1839906 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -16,7 +16,7 @@ namespace $.$$ { @ $mol_mem join_allowed() { - return this.meetup().start().valueOf() > $mol_state_time.now( 60 * 60 ) + return ( this.meetup().start()?.valueOf() ?? 0 ) > $mol_state_time.now( 60 * 60 ) } @ $mol_mem From 3c68b6376cab98b78b10d28e13d340667872ec57 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 16:59:52 +0000 Subject: [PATCH 05/27] keys export/import --- app/app.view.tree | 10 ++++++++++ app/app.view.ts | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/app/app.view.tree b/app/app.view.tree index d63ceec..619b2a1 100644 --- a/app/app.view.tree +++ b/app/app.view.tree @@ -26,6 +26,10 @@ $piterjs_app $mol_view <= Rights_toggle $mol_check_icon checked? <=> rights? false Icon <= Rights_toggle_icon $mol_icon_shield_account + <= Safe_link $mol_link + arg * safe \ + sub / + <= Safe_icon $mol_icon_key_variant foot <= foot / <= Online $hyoo_sync_online yard <= Yard $hyoo_sync_client @@ -85,3 +89,9 @@ $piterjs_app $mol_view Wiki $hyoo_page side_main_id \zi5t5h_8aygdf yard <= Yard + Safe $hyoo_meta_safe + tools / + <= Safe_close $mol_link + arg * safe null + sub / + <= Safe_close_icon $mol_icon_cross diff --git a/app/app.view.ts b/app/app.view.ts index bf95b42..1358a2c 100644 --- a/app/app.view.ts +++ b/app/app.view.ts @@ -32,6 +32,8 @@ namespace $.$$ { wiki() { return this.$.$mol_state_arg.value( 'wiki' ) !== null } guests() { return this.$.$mol_state_arg.value( 'guests' ) !== null } + + safe() { return this.$.$mol_state_arg.value( 'safe' ) !== null } @ $mol_mem meetup_id( next? : string | null ) { @@ -63,6 +65,7 @@ namespace $.$$ { if( this.intro() != null ) return [ this.Intro() ] const pages = [ this.Menu() , + ... this.safe() ? [ this.Safe() ] : [], ... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] , ... this.guests() ? [ this.Meetup_guests( this.meetup_id() ) ] : [] , ... this.speech_id() ? [ this.Speech( this.speech_id() ) ] : [] , @@ -134,6 +137,7 @@ namespace $.$$ { return [ ... this.editing() ? [ this.Meetup_add() ] : [], ... this.editing() ? [ this.Rights_toggle() ] : [], + this.Safe_link(), ] } From 91745e71b668f3c357260f4114a57ae806d7101e Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 17:41:27 +0000 Subject: [PATCH 06/27] better hints --- meetup/page/page.view.css | 5 ----- meetup/page/page.view.tree | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/meetup/page/page.view.css b/meetup/page/page.view.css index fc51311..af6b50f 100644 --- a/meetup/page/page.view.css +++ b/meetup/page/page.view.css @@ -51,11 +51,6 @@ padding: var(--mol_gap_text); } -[piterjs_meetup_page_joined_bid] { - padding: var(--mol_gap_text); - color: var(--mol_theme_focus); -} - [piterjs_meetup_page_free_space] { padding: var(--mol_gap_text); color: var(--mol_theme_shade); diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index 2d93a1c..eb2c806 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -84,6 +84,9 @@ $piterjs_meetup_page $mol_page enabled <= join_enabled false title \Я приду <= Joined_confirm $mol_paragraph title \🔥 Ждём тебя! - <= Joined_bid $mol_paragraph title \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. + <= Joined_bid $mol_text text \ + \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. + \Сделать это можно с того же девайса+браузера. Но \\тут\#!safe\\ можешь перенести свою авторизацию на любой другой. + \Да, мы упарываемся по твоей приватности 💟 Speech!index $piterjs_speech_snippet speech <= speech!index $piterjs_speech From 66f61386757ee6414d6a3f9f9977902847da05fe Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 17:43:26 +0000 Subject: [PATCH 07/27] reorder --- app/app.view.ts | 2 +- meetup/page/page.view.tree | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.view.ts b/app/app.view.ts index 1358a2c..4841df6 100644 --- a/app/app.view.ts +++ b/app/app.view.ts @@ -65,8 +65,8 @@ namespace $.$$ { if( this.intro() != null ) return [ this.Intro() ] const pages = [ this.Menu() , - ... this.safe() ? [ this.Safe() ] : [], ... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] , + ... this.safe() ? [ this.Safe() ] : [], ... this.guests() ? [ this.Meetup_guests( this.meetup_id() ) ] : [] , ... this.speech_id() ? [ this.Speech( this.speech_id() ) ] : [] , ... this.place_show() ? [ this.Place() ] : [] , diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index eb2c806..55bf0fe 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -86,7 +86,7 @@ $piterjs_meetup_page $mol_page <= Joined_confirm $mol_paragraph title \🔥 Ждём тебя! <= Joined_bid $mol_text text \ \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. - \Сделать это можно с того же девайса+браузера. Но \\тут\#!safe\\ можешь перенести свою авторизацию на любой другой. + \Сделать это можно лишь с того же девайса. Но \\тут\#!safe\\ можешь перенести свою авторизацию на любой другой. \Да, мы упарываемся по твоей приватности 💟 Speech!index $piterjs_speech_snippet speech <= speech!index $piterjs_speech From a647831cd934db936a0cdf77fc2bf3869e2d7a37 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 18:41:56 +0000 Subject: [PATCH 08/27] + stats --- app/app.view.tree | 2 ++ app/app.view.ts | 2 ++ meetup/meetup.ts | 9 +++++++++ meetup/page/page.view.tree | 5 +++++ meetup/stats/stats.view.css.ts | 21 +++++++++++++++++++++ meetup/stats/stats.view.tree | 21 +++++++++++++++++++++ meetup/stats/stats.view.ts | 20 ++++++++++++++++++++ 7 files changed, 80 insertions(+) create mode 100644 meetup/stats/stats.view.css.ts create mode 100644 meetup/stats/stats.view.tree create mode 100644 meetup/stats/stats.view.ts diff --git a/app/app.view.tree b/app/app.view.tree index 619b2a1..e23a10c 100644 --- a/app/app.view.tree +++ b/app/app.view.tree @@ -66,6 +66,8 @@ $piterjs_app $mol_view meetup_public? <=> meetup_public*? Meetup_guests* $piterjs_meetup_guests meetup <= meetup* + Meetup_stats* $piterjs_meetup_stats + meetup <= meetup* Speech!id $piterjs_speech_page speech <= speech!id $piterjs_speech editing <= editing? false diff --git a/app/app.view.ts b/app/app.view.ts index 4841df6..8c2927d 100644 --- a/app/app.view.ts +++ b/app/app.view.ts @@ -32,6 +32,7 @@ namespace $.$$ { wiki() { return this.$.$mol_state_arg.value( 'wiki' ) !== null } guests() { return this.$.$mol_state_arg.value( 'guests' ) !== null } + stats() { return this.$.$mol_state_arg.value( 'stats' ) !== null } safe() { return this.$.$mol_state_arg.value( 'safe' ) !== null } @@ -68,6 +69,7 @@ namespace $.$$ { ... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] , ... this.safe() ? [ this.Safe() ] : [], ... this.guests() ? [ this.Meetup_guests( this.meetup_id() ) ] : [] , + ... this.stats() ? [ this.Meetup_stats( this.meetup_id() ) ] : [] , ... this.speech_id() ? [ this.Speech( this.speech_id() ) ] : [] , ... this.place_show() ? [ this.Place() ] : [] , ... this.video() ? [ this.Video() ] : [] , diff --git a/meetup/meetup.ts b/meetup/meetup.ts index 3dabab4..c4ca564 100644 --- a/meetup/meetup.ts +++ b/meetup/meetup.ts @@ -69,6 +69,15 @@ namespace $ { return this.joined_node().list().map( id => Person.Item( id ) ) } + @ $mol_mem + joined_moments() { + const land = this.joined_node().yoke([]) + land?.pub.promote() + return [ ... land?._unit_all.values() ?? [] ] + .filter( unit => unit.data && unit.kind() === $hyoo_crowd_unit_kind.join ) + .map( unit => new $mol_time_moment( $hyoo_crowd_time_stamp( unit.time ) ) ) + } + @ $mol_mem joined_count() { return this.joined_node().total() diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index 55bf0fe..adaf906 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -19,6 +19,11 @@ $piterjs_meetup_page $mol_page hint \Список гостей sub / <= Guests_link_icon $mol_icon_account_group_outline + <= Stats_link $mol_link + arg * stats \ + hint \Статистика + sub / + <= Stats_link_icon $mol_icon_chart_bar_stacked <= Start $mol_date value_moment? <=> start? enabled <= editing false diff --git a/meetup/stats/stats.view.css.ts b/meetup/stats/stats.view.css.ts new file mode 100644 index 0000000..0e27386 --- /dev/null +++ b/meetup/stats/stats.view.css.ts @@ -0,0 +1,21 @@ +namespace $.$$ { + + $mol_style_define( $piterjs_meetup_stats, { + + flex: { + basis: `30rem`, + }, + + Chart: { + flex: { + basis: `20rem`, + grow: 0, + }, + background: { + color: $mol_theme.card, + }, + }, + + } ) + +} diff --git a/meetup/stats/stats.view.tree b/meetup/stats/stats.view.tree new file mode 100644 index 0000000..6e810a4 --- /dev/null +++ b/meetup/stats/stats.view.tree @@ -0,0 +1,21 @@ +$piterjs_meetup_stats $mol_page + meetup $piterjs_meetup + joined_moments => joined_moments + title \Статистика + tools / + <= Close $mol_link + arg * stats null + sub / + <= Close_icon $mol_icon_cross + body / + <= Chart $mol_chart + graphs / + <= Days $mol_plot_mark_hor + title \Дни + labels <= days / + <= Counts $mol_plot_ruler_vert + title \Число + series_y <= joins_per_days / + <= Joins $mol_plot_bar + title \Регистрации + series_y <= joins_per_days / diff --git a/meetup/stats/stats.view.ts b/meetup/stats/stats.view.ts new file mode 100644 index 0000000..a9a0655 --- /dev/null +++ b/meetup/stats/stats.view.ts @@ -0,0 +1,20 @@ +namespace $.$$ { + export class $piterjs_meetup_stats extends $.$piterjs_meetup_stats { + + @ $mol_mem + joins_stat() { + return $mol_array_groups( this.joined_moments(), moment => moment.toString( 'YYYY-MM-DD' ) ) + } + + @ $mol_mem + days() { + return Object.keys( this.joins_stat() ) + } + + @ $mol_mem + joins_per_days() { + return Object.values( this.joins_stat() ).map( moments => moments!.length ) + } + + } +} From fcd61b85da3e6088cbdc31b4d4baf074c3e0f69c Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 18:49:30 +0000 Subject: [PATCH 09/27] fixes --- app/app.view.css | 2 +- meetup/page/page.view.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/app.view.css b/app/app.view.css index f57bc5a..e6ff4bc 100644 --- a/app/app.view.css +++ b/app/app.view.css @@ -38,7 +38,7 @@ } [piterjs_app_menu] { - flex: 0 0 14rem; + flex: 0 0 15rem; } [piterjs_app_menu_content] { diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 1839906..0a8528b 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -65,6 +65,11 @@ namespace $.$$ { return super.Guests_link() } + Stats_link() { + if( !this.editing() ) return null! + return super.Stats_link() + } + capacity( next?: number ) { return this.meetup().place().capacity_max( next ) } From c149b6f5aace8cadd02cb132e5d496b187191603 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Wed, 4 Oct 2023 19:21:06 +0000 Subject: [PATCH 10/27] close reg support --- meetup/page/page.view.css | 8 ++++++++ meetup/page/page.view.tree | 18 ++++++++++++------ meetup/page/page.view.ts | 5 +++++ meetup/stats/stats.view.css.ts | 3 --- meetup/stats/stats.view.tree | 4 ++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/meetup/page/page.view.css b/meetup/page/page.view.css index af6b50f..264216f 100644 --- a/meetup/page/page.view.css +++ b/meetup/page/page.view.css @@ -55,3 +55,11 @@ padding: var(--mol_gap_text); color: var(--mol_theme_shade); } + +[piterjs_meetup_page_capacity_field] { + flex: 1 +} + +[piterjs_meetup_page_capacity_cut] { + align-self: flex-end; +} diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index adaf906..e71fbe4 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -68,12 +68,18 @@ $piterjs_meetup_page $mol_page hint \Адрес, ориентиры, чат value? <=> afterparty? enabled <= editing false - <= Capacity_field $mol_form_field - name \Максимальная вместимость - Content <= Capacity $mol_number - hint \100 - value? <=> capacity? 0 - enabled <= editing false + <= Capacity_block $mol_view sub / + <= Capacity_field $mol_form_field + name \Максимальная вместимость + Content <= Capacity $mol_number + hint \100 + value? <=> capacity? 0 + enabled <= editing false + <= Capacity_cut $mol_button_minor + title \закрыть регистрацию + click? <=> capacity_cut? null + sub / + <= Capacity_cut_icon $mol_icon_heart_box_outline <= Join $mol_section title \Регистрация level 5 diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 0a8528b..791f6f4 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -74,6 +74,10 @@ namespace $.$$ { return this.meetup().place().capacity_max( next ) } + capacity_cut() { + this.meetup().place().capacity_max( this.joined_count() ) + } + profile_editable() { return !this.joined() } @@ -81,6 +85,7 @@ namespace $.$$ { join_enabled() { if( this.person().name_first().length < 2 ) return false if( this.person().name_last().length < 2 ) return false + if( !this.joined() && this.meetup().place().capacity_max() <= this.joined_count() ) return false return true } diff --git a/meetup/stats/stats.view.css.ts b/meetup/stats/stats.view.css.ts index 0e27386..084e7fb 100644 --- a/meetup/stats/stats.view.css.ts +++ b/meetup/stats/stats.view.css.ts @@ -11,9 +11,6 @@ namespace $.$$ { basis: `20rem`, grow: 0, }, - background: { - color: $mol_theme.card, - }, }, } ) diff --git a/meetup/stats/stats.view.tree b/meetup/stats/stats.view.tree index 6e810a4..3878cdf 100644 --- a/meetup/stats/stats.view.tree +++ b/meetup/stats/stats.view.tree @@ -19,3 +19,7 @@ $piterjs_meetup_stats $mol_page <= Joins $mol_plot_bar title \Регистрации series_y <= joins_per_days / + <= Details $mol_plot_mark_cross + labels <= days / + graphs / + <= Joins From 2c3d3c2730f76cc02a4c762fe71c8991ab099d51 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 04:20:14 +0000 Subject: [PATCH 11/27] better form --- meetup/page/page.view.css | 1 + meetup/page/page.view.tree | 10 +++++----- meetup/page/page.view.ts | 14 +++++++++----- person/edit/edit.view.tree | 18 ++++++------------ person/person.ts | 5 +++++ person/snippet/snippet.view.ts | 2 +- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/meetup/page/page.view.css b/meetup/page/page.view.css index 264216f..46987fc 100644 --- a/meetup/page/page.view.css +++ b/meetup/page/page.view.css @@ -49,6 +49,7 @@ [piterjs_meetup_page_joined_confirm] { padding: var(--mol_gap_text); + color: var(--mol_theme_focus); } [piterjs_meetup_page_free_space] { diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index e71fbe4..1631bd2 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -88,16 +88,16 @@ $piterjs_meetup_page $mol_page content <= join_content / <= Profile $piterjs_person_edit person <= person $piterjs_person - - enabled <= profile_editable true + enabled <= profile_editable true <= Joined_form $mol_view sub <= joined_form / <= Joined $mol_check_box checked? <=> joined? enabled <= join_enabled false title \Я приду <= Joined_confirm $mol_paragraph title \🔥 Ждём тебя! - <= Joined_bid $mol_text text \ - \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. - \Сделать это можно лишь с того же девайса. Но \\тут\#!safe\\ можешь перенести свою авторизацию на любой другой. - \Да, мы упарываемся по твоей приватности 💟 + <= Joined_bid $mol_text text \ + \Если не сможешь прийти - не забудь отменить регистрацию, чтобы освободить место другим. + \Сделать это можно лишь с того же девайса. Но \\тут\#!safe\\ можешь перенести свою авторизацию на любой другой. + \Да, мы упарываемся по твоей приватности 💟 Speech!index $piterjs_speech_snippet speech <= speech!index $piterjs_speech diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 791f6f4..3db5c80 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -28,6 +28,7 @@ namespace $.$$ { ... this.editing() ? [ this.Speech_add() ] : [] , ... this.editing() ? [ this.Hidden_fields() ] : [] , ... this.join_allowed() ? [ this.Join() ] : [] , + ... this.meetup().joined() ? [ this.Joined_bid() ] : [], ] } @@ -79,12 +80,16 @@ namespace $.$$ { } profile_editable() { - return !this.joined() + if( this.joined() ) return false + return true } - + + person_name() { + return this.person().name_real().trim().replace( /\s+/, ' ' ) + } + join_enabled() { - if( this.person().name_first().length < 2 ) return false - if( this.person().name_last().length < 2 ) return false + if( !/\S{2,}\s\S{2,}/.test( this.person_name() ) ) return false if( !this.joined() && this.meetup().place().capacity_max() <= this.joined_count() ) return false return true } @@ -94,7 +99,6 @@ namespace $.$$ { return [ this.Profile(), this.Joined_form(), - ... this.meetup().joined() ? [ this.Joined_bid() ] : [], ] } diff --git a/person/edit/edit.view.tree b/person/edit/edit.view.tree index 2aca5d3..d84b2fd 100644 --- a/person/edit/edit.view.tree +++ b/person/edit/edit.view.tree @@ -1,13 +1,7 @@ -$piterjs_person_edit $mol_view +$piterjs_person_edit $mol_form_field person $piterjs_person - name_first? => name_first? - name_last? => name_last? - sub / - <= Name_first $mol_string - hint \Имя - value? <=> name_first? - enabled <= enabled true - <= Name_last $mol_string - hint \Фамилия - value? <=> name_last? - enabled <= enabled true + name_real? => name_real? + name \Имя Фамилия + Content <= Name_real $mol_string + value? <=> name_real? + enabled <= enabled true diff --git a/person/person.ts b/person/person.ts index 4206164..ac00c7e 100644 --- a/person/person.ts +++ b/person/person.ts @@ -2,6 +2,11 @@ namespace $ { export class $piterjs_person extends $piterjs_model { + @ $mol_mem + name_real( next?: string ) { + return this.sub( 'name_real', $hyoo_crowd_reg ).str( next ) + } + @ $mol_mem name_first( next?: string ) { return this.sub( 'name_first', $hyoo_crowd_reg ).str( next ) diff --git a/person/snippet/snippet.view.ts b/person/snippet/snippet.view.ts index f2f5a45..dd99154 100644 --- a/person/snippet/snippet.view.ts +++ b/person/snippet/snippet.view.ts @@ -4,7 +4,7 @@ namespace $.$$ { @ $mol_mem haystack() { const person = this.person() - return person.name_first() + ' ' + person.name_last() + return person.name_real() || person.name_first() + ' ' + person.name_last() } } From 891903ef25771f0c3d72a45cf0fa8be6a31356d3 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 04:27:55 +0000 Subject: [PATCH 12/27] +section --- meetup/page/page.view.tree | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index 1631bd2..7c24061 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -55,7 +55,10 @@ $piterjs_meetup_page $mol_page place \ speech null title \Площадка - <= Speeches $mol_list rows <= speeches / + <= Speeches $mol_section + title \Программа + level 5 + content <= speeches / <= Speech_add $mol_button_minor click? <=> speech_add? null sub / From 8f5a9a9b5c7cd875b217b2d2393150f2f8fa16b4 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 04:40:58 +0000 Subject: [PATCH 13/27] use better counter api --- meetup/meetup.ts | 9 ++++----- meetup/stats/stats.view.ts | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/meetup/meetup.ts b/meetup/meetup.ts index c4ca564..bc8b878 100644 --- a/meetup/meetup.ts +++ b/meetup/meetup.ts @@ -71,11 +71,10 @@ namespace $ { @ $mol_mem joined_moments() { - const land = this.joined_node().yoke([]) - land?.pub.promote() - return [ ... land?._unit_all.values() ?? [] ] - .filter( unit => unit.data && unit.kind() === $hyoo_crowd_unit_kind.join ) - .map( unit => new $mol_time_moment( $hyoo_crowd_time_stamp( unit.time ) ) ) + return Object.fromEntries( + Object.entries( this.joined_node().times() ) + .map( ([ peer, stamp ]) => [ peer, new $mol_time_moment( stamp ) ] ) + ) } @ $mol_mem diff --git a/meetup/stats/stats.view.ts b/meetup/stats/stats.view.ts index a9a0655..c998d16 100644 --- a/meetup/stats/stats.view.ts +++ b/meetup/stats/stats.view.ts @@ -3,7 +3,10 @@ namespace $.$$ { @ $mol_mem joins_stat() { - return $mol_array_groups( this.joined_moments(), moment => moment.toString( 'YYYY-MM-DD' ) ) + return $mol_array_groups( + Object.values( this.joined_moments() ), + moment => moment.toString( 'YYYY-MM-DD' ), + ) } @ $mol_mem From a0a8eb5fc1a0a5a4beda2318465f6a747426e310 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 04:42:28 +0000 Subject: [PATCH 14/27] fixd logic --- meetup/page/page.view.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 3db5c80..10aa3c6 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -89,8 +89,9 @@ namespace $.$$ { } join_enabled() { + if( this.joined() ) return true if( !/\S{2,}\s\S{2,}/.test( this.person_name() ) ) return false - if( !this.joined() && this.meetup().place().capacity_max() <= this.joined_count() ) return false + if( this.meetup().place().capacity_max() <= this.joined_count() ) return false return true } From 1d68da68441a5e4d1ae9f091647264588112137f Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 04:48:21 +0000 Subject: [PATCH 15/27] short date --- meetup/stats/stats.view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meetup/stats/stats.view.ts b/meetup/stats/stats.view.ts index c998d16..317cbf4 100644 --- a/meetup/stats/stats.view.ts +++ b/meetup/stats/stats.view.ts @@ -5,7 +5,7 @@ namespace $.$$ { joins_stat() { return $mol_array_groups( Object.values( this.joined_moments() ), - moment => moment.toString( 'YYYY-MM-DD' ), + moment => moment.toString( 'MM-DD' ), ) } From 8fb3cfa7ac8c2e59a5a4c4ba52ddda2ab3a69acc Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 19:45:53 +0000 Subject: [PATCH 16/27] better adaptive --- intro/intro.view.css | 3 ++- schedule/schedule.view.css.ts | 15 +++++++++------ screen/lines/intro.view.css | 2 +- screen/screen.view.css | 19 ------------------- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/intro/intro.view.css b/intro/intro.view.css index e53a16e..3ecc989 100644 --- a/intro/intro.view.css +++ b/intro/intro.view.css @@ -1,7 +1,8 @@ [piterjs_intro] { flex: auto; display: flex; - font-size: 5vmin; + font-size: 4vmin; + line-height: 6vmin; } @keyframes piterjs_intro_screen_show { diff --git a/schedule/schedule.view.css.ts b/schedule/schedule.view.css.ts index 2a5d0e5..b9570fc 100644 --- a/schedule/schedule.view.css.ts +++ b/schedule/schedule.view.css.ts @@ -8,8 +8,8 @@ namespace $.$$ { flexWrap: 'wrap', display: 'flex', justifyContent: 'space-between', - fontSize: '3vmin', - lineHeight: '3vmin', + // fontSize: '3vmin', + // lineHeight: '3vmin', Speeches: { margin: 'auto', @@ -26,17 +26,20 @@ namespace $.$$ { Speech_start: { fontWeight: 'bolder', - padding: `.5em`, + padding: [ `.5em`, `.75em` ], }, Speech_title: { - padding: `.5em`, + padding: [ `.5em`, `.75em` ], + flex: { + shrink: 1, + }, }, Speech_speaker: { - padding: `.5em`, + padding: [ `.5em`, `.75em` ], margin : { - left: vmin(9.5), + left: `4.75em`, }, color: $mol_theme.shade, }, diff --git a/screen/lines/intro.view.css b/screen/lines/intro.view.css index 5eb907a..26c9a76 100644 --- a/screen/lines/intro.view.css +++ b/screen/lines/intro.view.css @@ -1,5 +1,5 @@ [piterjs_screen_lines] { - width: 25%; + width: 20vmin; pointer-events: none; position: absolute; z-index: -1; diff --git a/screen/screen.view.css b/screen/screen.view.css index 77f8fd9..8e388fd 100644 --- a/screen/screen.view.css +++ b/screen/screen.view.css @@ -1,22 +1,3 @@ -/* cyrillic */ -@font-face { - font-family: 'Fira Sans'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: local('Fira Sans Regular'), local('FiraSans-Regular'), url(https://fonts.gstatic.com/s/firasans/v10/va9E4kDNxMZdWfMOD5Vvk4jLeTY.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* latin */ -@font-face { - font-family: 'Fira Sans'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: local('Fira Sans Regular'), local('FiraSans-Regular'), url(https://fonts.gstatic.com/s/firasans/v10/va9E4kDNxMZdWfMOD5Vvl4jL.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} - [piterjs_screen] { font-family: "Fira Sans", "Verdana", sans-serif; background: var(--mol_theme_back); From b297b7b5b9dac5162e5a5a0cd6807e77b5bd89ff Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 22:25:46 +0000 Subject: [PATCH 17/27] + speech poster capture --- speech/page/page.view.css.ts | 8 ++++ speech/page/page.view.tree | 11 ++++++ speech/page/page.view.ts | 7 ++++ speech/poster/poster.view.css.ts | 65 ++++++++++++++++++++++++++++++++ speech/poster/poster.view.tree | 14 +++++++ speech/poster/poster.view.ts | 14 +++++++ 6 files changed, 119 insertions(+) create mode 100644 speech/poster/poster.view.css.ts create mode 100644 speech/poster/poster.view.tree create mode 100644 speech/poster/poster.view.ts diff --git a/speech/page/page.view.css.ts b/speech/page/page.view.css.ts index 826e87d..ca5f95c 100644 --- a/speech/page/page.view.css.ts +++ b/speech/page/page.view.css.ts @@ -47,6 +47,14 @@ namespace $.$$ { } }, + + Poster_zone: { + position: `absolute`, + width: 0, + height: 0, + overflow: `hidden`, + zIndex: 1, + }, } ) diff --git a/speech/page/page.view.tree b/speech/page/page.view.tree index 281b495..041964b 100644 --- a/speech/page/page.view.tree +++ b/speech/page/page.view.tree @@ -10,6 +10,11 @@ $piterjs_speech_page $mol_page enabled <= editing false hint \Название tools / + <= Poster_copy $mol_button_copy + hint \Скопировать постер + blobs /$mol_blob + <= poster_blob? $mol_blob + Icon <= Poster_copy_icon $mol_icon_camera <= Public $mol_check_icon checked? <=> speech_public? false Icon <= Public_icon $mol_icon_eye @@ -21,6 +26,12 @@ $piterjs_speech_page $mol_page sub / <= Close_icon $mol_icon_cross body / + <= Poster_zone $mol_view + minimal_width 0 + minimal_height 0 + sub / + <= Poster $piterjs_speech_poster + speech <= speech <= Description $mol_textarea hint \О чём value? <=> description? diff --git a/speech/page/page.view.ts b/speech/page/page.view.ts index 5b2b5ec..4490e10 100644 --- a/speech/page/page.view.ts +++ b/speech/page/page.view.ts @@ -19,6 +19,13 @@ namespace $.$$ { return super.Public() } + override poster_blob() { + const canvas = $mol_wire_sync( this.$ ).$mol_dom_capture_canvas( this.Poster().dom_tree() ) + const picture = $mol_picture.fit( canvas ) + const blob = picture.format( `image/png` )! + return blob + } + } } diff --git a/speech/poster/poster.view.css.ts b/speech/poster/poster.view.css.ts new file mode 100644 index 0000000..66b9258 --- /dev/null +++ b/speech/poster/poster.view.css.ts @@ -0,0 +1,65 @@ +namespace $.$$ { + + $mol_style_define( $piterjs_speech_poster, { + + padding: 0, + + flex: { + shrink: 0, + }, + + align: { + items: 'center', + }, + + justify: { + content: 'center', + }, + + font: { + size: `3rem`, + weight: `bolder`, + }, + + lineHeight: `4rem`, + + width: `1000px`, + height: `1000px`, + aspectRatio: 1, + + $piterjs_screen_lines: { + width: `10rem`, + }, + + Main: { + flex: { + shrink: 1, + wrap: `nowrap`, + direction: `column`, + }, + padding: `3rem`, + }, + + Photo: { + margin: `auto`, + width: `25rem`, + aspectRatio: 1, + }, + + Title: { + margin: `auto`, + padding: `3rem`, + flex: { + shrink: 1, + }, + textAlign: `center`, + }, + + Name: { + margin: `auto`, + color: $mol_theme.shade, + }, + + } ) + +} diff --git a/speech/poster/poster.view.tree b/speech/poster/poster.view.tree new file mode 100644 index 0000000..731e951 --- /dev/null +++ b/speech/poster/poster.view.tree @@ -0,0 +1,14 @@ +$piterjs_speech_poster $piterjs_screen + speech $piterjs_speech + title => title + start => start + speaker => speaker + theme \$mol_theme_light + content / + <= Main $mol_view sub / + <= Title $mol_paragraph + title <= title + <= Photo $piterjs_image + link <= photo_uri \ + <= Name $mol_paragraph + title <= speaker_name \ diff --git a/speech/poster/poster.view.ts b/speech/poster/poster.view.ts new file mode 100644 index 0000000..18933a5 --- /dev/null +++ b/speech/poster/poster.view.ts @@ -0,0 +1,14 @@ +namespace $.$$ { + export class $piterjs_speech_poster extends $.$piterjs_speech_poster { + + @ $mol_mem + override photo_uri() { + return $mol_wire_sync( this.$ ).$mol_blob_uri( this.speaker().photo_blob() ) + } + + override speaker_name() { + return this.speaker().title() + } + + } +} From 5b762ebd47992febb96c65c39844c00db4d71571 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 22:37:39 +0000 Subject: [PATCH 18/27] share instead of copy --- speech/page/page.view.tree | 7 ++++--- speech/page/page.view.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/speech/page/page.view.tree b/speech/page/page.view.tree index 041964b..9eb14b4 100644 --- a/speech/page/page.view.tree +++ b/speech/page/page.view.tree @@ -10,11 +10,12 @@ $piterjs_speech_page $mol_page enabled <= editing false hint \Название tools / - <= Poster_copy $mol_button_copy + <= Poster_copy $mol_button_share hint \Скопировать постер - blobs /$mol_blob + capture <= Poster + - blobs /$mol_blob <= poster_blob? $mol_blob - Icon <= Poster_copy_icon $mol_icon_camera + - Icon <= Poster_copy_icon $mol_icon_camera <= Public $mol_check_icon checked? <=> speech_public? false Icon <= Public_icon $mol_icon_eye diff --git a/speech/page/page.view.ts b/speech/page/page.view.ts index 4490e10..cf853f6 100644 --- a/speech/page/page.view.ts +++ b/speech/page/page.view.ts @@ -19,12 +19,12 @@ namespace $.$$ { return super.Public() } - override poster_blob() { - const canvas = $mol_wire_sync( this.$ ).$mol_dom_capture_canvas( this.Poster().dom_tree() ) - const picture = $mol_picture.fit( canvas ) - const blob = picture.format( `image/png` )! - return blob - } + // override poster_blob() { + // const canvas = $mol_wire_sync( this.$ ).$mol_dom_capture_canvas( this.Poster().dom_tree() ) + // const picture = $mol_picture.fit( canvas ) + // const blob = picture.format( `image/png` )! + // return blob + // } } From a7629980ab450a7c3c65d5716a0140ac15d18f79 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Thu, 5 Oct 2023 22:50:13 +0000 Subject: [PATCH 19/27] download instead of share --- speech/page/page.view.tree | 11 +++++------ speech/page/page.view.ts | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/speech/page/page.view.tree b/speech/page/page.view.tree index 9eb14b4..1743b8d 100644 --- a/speech/page/page.view.tree +++ b/speech/page/page.view.tree @@ -10,12 +10,11 @@ $piterjs_speech_page $mol_page enabled <= editing false hint \Название tools / - <= Poster_copy $mol_button_share - hint \Скопировать постер - capture <= Poster - - blobs /$mol_blob - <= poster_blob? $mol_blob - - Icon <= Poster_copy_icon $mol_icon_camera + <= Poster_copy $mol_button_download + hint \Скачать постер + blob <= poster_blob? $mol_blob + file_name <= poster_name \poster.png + Icon <= Poster_copy_icon $mol_icon_camera <= Public $mol_check_icon checked? <=> speech_public? false Icon <= Public_icon $mol_icon_eye diff --git a/speech/page/page.view.ts b/speech/page/page.view.ts index cf853f6..e5b2e95 100644 --- a/speech/page/page.view.ts +++ b/speech/page/page.view.ts @@ -7,24 +7,28 @@ namespace $.$$ { } @ $mol_mem - links() { + override links() { return [ ... ( this.editing() || this.slides() ) ? [ this.Slides() ] : [] , ... ( this.editing() || this.video() ) ? [ this.Video() ] : [] , ] } - Public() { + override Public() { if( !this.editing() ) return null! return super.Public() } - // override poster_blob() { - // const canvas = $mol_wire_sync( this.$ ).$mol_dom_capture_canvas( this.Poster().dom_tree() ) - // const picture = $mol_picture.fit( canvas ) - // const blob = picture.format( `image/png` )! - // return blob - // } + override poster_name() { + return `${ this.speaker().title() } - ${ this.title() }.png` + } + + override poster_blob() { + const canvas = $mol_wire_sync( this.$ ).$mol_dom_capture_canvas( this.Poster().dom_tree() ) + const picture = $mol_picture.fit( canvas ) + const blob = picture.format( `image/png` )! + return blob + } } From 71206b615930f8df5dbda13323acec99eb9b5ff0 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Fri, 6 Oct 2023 00:04:54 +0000 Subject: [PATCH 20/27] nae center --- speech/poster/poster.view.css.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/speech/poster/poster.view.css.ts b/speech/poster/poster.view.css.ts index 66b9258..a1f3a77 100644 --- a/speech/poster/poster.view.css.ts +++ b/speech/poster/poster.view.css.ts @@ -58,6 +58,7 @@ namespace $.$$ { Name: { margin: `auto`, color: $mol_theme.shade, + textAlign: `center`, }, } ) From b519cd96f3c64ee79a2241e1e7c6384522b4ab07 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 10:56:44 +0000 Subject: [PATCH 21/27] secure names --- domain/domain.ts | 15 +++++++++++ meetup/guests/guests.view.ts | 2 +- person/person.ts | 46 ++++++++++++++++++++++++++-------- person/snippet/snippet.view.ts | 3 +-- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/domain/domain.ts b/domain/domain.ts index b47f884..4d7b3e9 100644 --- a/domain/domain.ts +++ b/domain/domain.ts @@ -42,6 +42,21 @@ namespace $ { return this.world()!.Fund( $piterjs_person ).Item( this.land!.peer_id() ) } + @ $mol_mem + static secure_public() { + return '2SZr8D4nwg_SQrt1PSB3NTRqz_Qzx5eo04gC2lsJTRwCcLC-8vFfvBFHY8f05nrm_vRS5Rx_qTMRRw06wdrwWk' + } + + @ $mol_mem + static secure_private() { + + const sec = this.$.$mol_state_arg.value( 'secure' ) + if( !sec ) return null + + return this.secure_public() + sec + + } + } } diff --git a/meetup/guests/guests.view.ts b/meetup/guests/guests.view.ts index 62dc107..ccf5ad1 100644 --- a/meetup/guests/guests.view.ts +++ b/meetup/guests/guests.view.ts @@ -4,7 +4,7 @@ namespace $.$$ { @ $mol_mem person_list() { return this.meetup().joined_list() - .filter( $mol_match_text( this.filter(), person => [ person.name_first(), person.name_last(), person.id() ] ) ) + .filter( $mol_match_text( this.filter(), person => [ person.name_real(), person.id() ] ) ) .map( person => this.Person( person ) ) } diff --git a/person/person.ts b/person/person.ts index ac00c7e..f914922 100644 --- a/person/person.ts +++ b/person/person.ts @@ -3,20 +3,46 @@ namespace $ { export class $piterjs_person extends $piterjs_model { @ $mol_mem - name_real( next?: string ) { - return this.sub( 'name_real', $hyoo_crowd_reg ).str( next ) - } - - @ $mol_mem - name_first( next?: string ) { - return this.sub( 'name_first', $hyoo_crowd_reg ).str( next ) + secret() { + + const priv = $piterjs_domain.secure_private() + if( priv ) { + + const pub = this.land.unit( this.id(), this.id() )!.data as string + return $mol_wire_sync( $mol_crypto_secret ).derive( priv, pub ) + + } else { + + const priv = this.land.peer().key_private_serial + const pub = $piterjs_domain.secure_public() + return $mol_wire_sync( $mol_crypto_secret ).derive( priv, pub ) + + } + } @ $mol_mem - name_last( next?: string ) { - return this.sub( 'name_last', $hyoo_crowd_reg ).str( next ) - } + name_real( next?: string ) { + + const secret = $mol_wire_sync( this.secret() ) + const reg = this.sub( 'name_real', $hyoo_crowd_reg ) + const salt = $mol_charset_encode( this.id() ) + + if( next !== undefined ) { + + const closed = secret.encrypt( $mol_charset_encode( next ), salt ) + reg.value( new Uint8Array( closed ) ) + return next + + } + const closed = reg.value() as Uint8Array | null + if( !closed ) return '' + + return $mol_charset_decode( secret.decrypt( closed, salt ) ) + + } + } } diff --git a/person/snippet/snippet.view.ts b/person/snippet/snippet.view.ts index dd99154..07e1996 100644 --- a/person/snippet/snippet.view.ts +++ b/person/snippet/snippet.view.ts @@ -3,8 +3,7 @@ namespace $.$$ { @ $mol_mem haystack() { - const person = this.person() - return person.name_real() || person.name_first() + ' ' + person.name_last() + return this.person().name_real() } } From 4220de2e4686531a6853bbca9536d5945b2d019e Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 11:08:00 +0000 Subject: [PATCH 22/27] +1 --- person/person.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/person/person.ts b/person/person.ts index f914922..a3b1b11 100644 --- a/person/person.ts +++ b/person/person.ts @@ -25,7 +25,7 @@ namespace $ { name_real( next?: string ) { const secret = $mol_wire_sync( this.secret() ) - const reg = this.sub( 'name_real', $hyoo_crowd_reg ) + const reg = this.sub( 'name', $hyoo_crowd_reg ) const salt = $mol_charset_encode( this.id() ) if( next !== undefined ) { From c730d03dfe3b15619e263940ba88cf03e5eda0e8 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 11:13:39 +0000 Subject: [PATCH 23/27] +2 --- person/person.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/person/person.ts b/person/person.ts index a3b1b11..1e43203 100644 --- a/person/person.ts +++ b/person/person.ts @@ -36,8 +36,9 @@ namespace $ { } - const closed = reg.value() as Uint8Array | null + const closed = reg.value() as Uint8Array | string | null if( !closed ) return '' + if( typeof closed === 'string' ) return closed return $mol_charset_decode( secret.decrypt( closed, salt ) ) From 01db5a2fc77e52850c4ca9ef7b17491f1c30e311 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 11:18:12 +0000 Subject: [PATCH 24/27] +3 --- person/person.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/person/person.ts b/person/person.ts index 1e43203..79e497f 100644 --- a/person/person.ts +++ b/person/person.ts @@ -25,7 +25,7 @@ namespace $ { name_real( next?: string ) { const secret = $mol_wire_sync( this.secret() ) - const reg = this.sub( 'name', $hyoo_crowd_reg ) + const reg = this.sub( 'name_real', $hyoo_crowd_reg ) const salt = $mol_charset_encode( this.id() ) if( next !== undefined ) { From a7b2c2f8bb638cc41d1510c24189e0a9d11be5a9 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 11:47:02 +0000 Subject: [PATCH 25/27] name bids --- meetup/page/page.view.tree | 1 + meetup/page/page.view.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/meetup/page/page.view.tree b/meetup/page/page.view.tree index 7c24061..f5e8df9 100644 --- a/meetup/page/page.view.tree +++ b/meetup/page/page.view.tree @@ -92,6 +92,7 @@ $piterjs_meetup_page $mol_page <= Profile $piterjs_person_edit person <= person $piterjs_person enabled <= profile_editable true + bid <= profile_bid \ <= Joined_form $mol_view sub <= joined_form / <= Joined $mol_check_box checked? <=> joined? diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 10aa3c6..44d8796 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -87,10 +87,17 @@ namespace $.$$ { person_name() { return this.person().name_real().trim().replace( /\s+/, ' ' ) } + + profile_bid() { + const name = this.person_name() + if( !name ) return 'Обязательно' + if( !/\S{2,}\s\S{2,}/.test( this.person_name() ) ) return 'От двух слов' + return '' + } join_enabled() { if( this.joined() ) return true - if( !/\S{2,}\s\S{2,}/.test( this.person_name() ) ) return false + if( this.profile_bid() ) return false if( this.meetup().place().capacity_max() <= this.joined_count() ) return false return true } From 8fb91059ef3b6a8b7a51750c8746f097db4a1524 Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 11:53:17 +0000 Subject: [PATCH 26/27] reorder --- meetup/page/page.view.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meetup/page/page.view.ts b/meetup/page/page.view.ts index 44d8796..9e31ab5 100644 --- a/meetup/page/page.view.ts +++ b/meetup/page/page.view.ts @@ -24,11 +24,11 @@ namespace $.$$ { return [ ... ( this.editing() || this.description() ) ? [ this.Description() ] : [] , this.Links() , + ... this.join_allowed() ? [ this.Join() ] : [] , + ... this.meetup().joined() ? [ this.Joined_bid() ] : [], this.Speeches() , ... this.editing() ? [ this.Speech_add() ] : [] , ... this.editing() ? [ this.Hidden_fields() ] : [] , - ... this.join_allowed() ? [ this.Join() ] : [] , - ... this.meetup().joined() ? [ this.Joined_bid() ] : [], ] } From d205f9928d4e8a9cf8bc7424910d9f748565bc0b Mon Sep 17 00:00:00 2001 From: nin-jin Date: Tue, 10 Oct 2023 12:43:25 +0000 Subject: [PATCH 27/27] fixed input --- person/person.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/person/person.ts b/person/person.ts index 79e497f..1c3f2a7 100644 --- a/person/person.ts +++ b/person/person.ts @@ -22,16 +22,20 @@ namespace $ { } @ $mol_mem - name_real( next?: string ) { + name_real( next?: string, cache?: 'cache' ) { + if( cache ) return next! - const secret = $mol_wire_sync( this.secret() ) + const secret = this.secret() const reg = this.sub( 'name_real', $hyoo_crowd_reg ) const salt = $mol_charset_encode( this.id() ) if( next !== undefined ) { - const closed = secret.encrypt( $mol_charset_encode( next ), salt ) - reg.value( new Uint8Array( closed ) ) + secret.encrypt( $mol_charset_encode( next ), salt ) + .then( closed => { + reg.value( new Uint8Array( closed ) ) + this.name_real( $mol_mem_cached( ()=> this.name_real() ), 'cache' ) + } ) return next } @@ -40,7 +44,7 @@ namespace $ { if( !closed ) return '' if( typeof closed === 'string' ) return closed - return $mol_charset_decode( secret.decrypt( closed, salt ) ) + return $mol_charset_decode( $mol_wire_sync( secret ).decrypt( closed, salt ) ) }