Skip to content

Commit

Permalink
Different rights per meetup
Browse files Browse the repository at this point in the history
  • Loading branch information
nin-jin committed Nov 9, 2023
1 parent 0c33abc commit 809d337
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 36 deletions.
18 changes: 16 additions & 2 deletions app/app.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $piterjs_app $mol_view
meetup* => meetup*
meetup_public*? => meetup_public*?
person => person
editable => editable
plugins /
<= Theme $mol_theme_auto
sub /
Expand Down Expand Up @@ -62,15 +63,16 @@ $piterjs_app $mol_view
Meetup* $piterjs_meetup_page
meetup <= meetup*
person <= person
editing <= editing? false
editing? <=> editing? false
meetup_public? <=> meetup_public*?
rights? <=> rights_meetup? false
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
editing? <=> editing? false
speech_public? <=> speech_public*? false
Menu_meetup* $piterjs_meetup_snippet
meetup <= meetup*
Expand All @@ -88,6 +90,18 @@ $piterjs_app $mol_view
Others $piterjs_others
Rights $hyoo_meta_rights
meta <= Domain
tools /
<= Rights_close $mol_check
checked? <=> rights?
sub /
<= Rights_close_icon $mol_icon_cross
Rights_meetup $hyoo_meta_rights
meta <= meetup_current
tools /
<= Rights_meetup_close $mol_check
checked? <=> rights_meetup?
sub /
<= Rights_meetup_close_icon $mol_icon_cross
Wiki $hyoo_page
side_main_id \zi5t5h_8aygdf
yard <= Yard
Expand Down
19 changes: 16 additions & 3 deletions app/app.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ namespace $.$$ {
if( this.intro() != null ) return [ this.Intro() ]
const pages = [
this.Menu() ,
... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] ,
... this.rights() ? [ this.Rights() ] : [] ,
... this.safe() ? [ this.Safe() ] : [],
... this.meetup_id() ? [ this.Meetup( this.meetup_id() ) ] : [] ,
... this.rights_meetup() ? [ this.Rights_meetup() ] : [] ,
... 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() ] : [] ,
... this.others() ? [ this.Others() ] : [] ,
... this.rights() ? [ this.Rights() ] : [] ,
... this.wiki() ? this.Wiki().pages() : [],
]
if( pages.length === 1 ) pages.push( this.Now() )
Expand Down Expand Up @@ -147,11 +148,23 @@ namespace $.$$ {
return [
this.Online(),
... this.Domain().editable() ? [ this.Editing() ] : [ this.User() ],
... this.editing() ? [ this.Rights_toggle() ] : [],
... this.editable() ? [ this.Rights_toggle() ] : [],
this.Lights(),
]
}

editing( next?: boolean ) {
return this.$.$mol_state_session.value( `${this}.editing()`, next )
}

rights( next?: boolean ) {
return this.$.$mol_state_session.value( `${this}.rights()`, next )
}

rights_meetup( next?: boolean ) {
return this.$.$mol_state_session.value( `${this}.rights_meetup()`, next )
}

@ $mol_mem
user_id() {
return this.Yard().peer().id
Expand Down
17 changes: 12 additions & 5 deletions meetup/page/page.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ $piterjs_meetup_page $mol_page
start? => start?
joined_count => joined_count
joined? => joined?
editable => editable
Title $mol_string_button
value? <=> title?
enabled <= editing false
enabled <= editing
hint \Номер
tools /
<= Start $mol_date
value_moment? <=> start?
enabled <= editing false
enabled <= editing
align \bottom_left
<= Close $mol_link
arg *
Expand All @@ -28,7 +29,7 @@ $piterjs_meetup_page $mol_page
<= Description $mol_textarea
hint \Резюме
value? <=> description?
enabled <= editing false
enabled <= editing
<= Links $mol_view sub <= links /
<= Video $mol_link
arg *
Expand All @@ -54,14 +55,14 @@ $piterjs_meetup_page $mol_page
Content <= Afterparty $mol_textarea
hint \Адрес, ориентиры, чат
value? <=> afterparty?
enabled <= editing false
enabled <= editing
<= Capacity_block $mol_view sub /
<= Capacity_field $mol_form_field
name \Максимальная вместимость
Content <= Capacity $mol_number
hint \100
value? <=> capacity? 0
enabled <= editing false
enabled <= editing
<= Capacity_cut $mol_button_minor
title \закрыть регистрацию
click? <=> capacity_cut? null
Expand Down Expand Up @@ -94,6 +95,12 @@ $piterjs_meetup_page $mol_page
checked? <=> meetup_public? false
Icon <= Public_icon $mol_icon_eye
hint \Опубликовано
<= Editing $mol_check_icon
Icon <= Editing_icon $mol_icon_settings_outline
checked? <=> editing? false
<= Rights_toggle $mol_check_icon
checked? <=> rights? false
Icon <= Rights_toggle_icon $mol_icon_shield_account
<= Guests_link $mol_link
arg * guests \
hint \Список гостей
Expand Down
19 changes: 5 additions & 14 deletions meetup/page/page.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,13 @@ namespace $.$$ {
const speech = this.meetup().speech_make()
this.$.$mol_state_arg.value( 'speech', speech.id() )
}

Public() {
if( !this.editing() ) return null!
return super.Public()
}

Guests_link() {
if( !this.editing() ) return null!
return super.Guests_link()
}

Stats_link() {
if( !this.editing() ) return null!
return super.Stats_link()
@ $mol_mem
foot() {
if( !this.editable() ) return []
return super.foot()
}

capacity( next?: number ) {
return this.meetup().place().capacity_max( next )
}
Expand Down
12 changes: 8 additions & 4 deletions speech/page/page.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ $piterjs_speech_page $mol_page
start? => start?
slides? => slides?
video? => video?
editable => editable
Title $mol_string_button
value? <=> title?
enabled <= editing false
enabled <= editing
hint \Название
tools /
<= Start $mol_pick_time
value_moment? <=> start?
enabled <= editing false
enabled <= editing
<= Close $mol_link
arg * speech null
sub /
Expand All @@ -28,7 +29,7 @@ $piterjs_speech_page $mol_page
<= Description $mol_textarea
hint \О чём
value? <=> description?
enabled <= editing false
enabled <= editing
<= Links $mol_view sub <= links /
<= Slides $mol_string_link
value? <=> slides?
Expand All @@ -40,11 +41,14 @@ $piterjs_speech_page $mol_page
title \Видео
<= Speaker $piterjs_speaker_snippet
speaker <= speaker $piterjs_speaker
editing <= editing false
editing <= editing
foot /
<= Public $mol_check_icon
checked? <=> speech_public? false
Icon <= Public_icon $mol_icon_eye
<= Editing $mol_check_icon
Icon <= Editing_icon $mol_icon_settings_outline
checked? <=> editing? false
<= Poster_copy $mol_pick
hint \Скачать постер
trigger_content /
Expand Down
11 changes: 3 additions & 8 deletions speech/page/page.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ namespace $.$$ {
]
}

override Public() {
if( !this.editing() ) return null!
return super.Public()
}

override Poster_copy() {
if( !this.editing() ) return null!
return super.Poster_copy()
override foot() {
if( !this.editable() ) return []
return super.foot()
}

override poster_1_1_name() {
Expand Down

0 comments on commit 809d337

Please sign in to comment.