diff --git a/VERSION b/VERSION index 6e8bf73aa550d4c57f6f35830f1bcdc7a4a62f38..0ea3a944b399d25f7e1b8fe684d754eb8da9fe7f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.2.0 diff --git a/lib/SeMeet/Controller/Auth.pm b/lib/SeMeet/Controller/Auth.pm index 05fd39f62f138f3e597f7b265f3805825a5c082c..5cc5ed3a222e49424c51dd8a7634832975eb203b 100644 --- a/lib/SeMeet/Controller/Auth.pm +++ b/lib/SeMeet/Controller/Auth.pm @@ -23,7 +23,7 @@ sub callback ($c) { })->first; if ( $user ) { - $user->updata(\%user); + $user->update(\%user); } else { $user = $c->schema->resultset('User')->create(\%user); diff --git a/lib/SeMeet/Controller/Meets.pm b/lib/SeMeet/Controller/Meets.pm index 65fa2448369a175d9b95b87a2e96f58ece155197..bae0a8633cf90419a5ed294f13337450dd75a19f 100644 --- a/lib/SeMeet/Controller/Meets.pm +++ b/lib/SeMeet/Controller/Meets.pm @@ -25,11 +25,6 @@ sub create($c) { name => $args->{name}, }); - $meet->add_to_meet_users({ - user_id => $c->current_user->{id}, - is_moderator => 't', - }); - $guard->commit; $c->trace(\'User %s create meet "%s" with id %d', @@ -217,29 +212,3 @@ sub meet($c) { 1; -__END__ - - my $avatar = join ('', - $c->config->{piratar}, - AVATAR_SIZE, '/', - $user->username, - '.jpg', - ); - $c->stash->{token} = Mojo::JWT->new( - secret => $c->config->{jitsi_secret}, - claims => { - aud => 'semeet', - iss => 'semeet', - sub => 'meet.pirati.cz', - room => $meet->uuid, -# moderator => $user{moderator} ? \1:\0, - exp => time + JITSI_TOKEN_LIFETIME, - context => { - user => { - avatar => $avatar, - name => $user->displayname, -# email => $user{mail}, - } - }, - } - )->encode; diff --git a/lib/SeMeet/I18N/cs.pm b/lib/SeMeet/I18N/cs.pm index ea6e5d546ab06193eff3f9513e2dfde8585ae87d..48fb158a4446a4d4002ef4e205a6e2aaa091dfe3 100644 --- a/lib/SeMeet/I18N/cs.pm +++ b/lib/SeMeet/I18N/cs.pm @@ -5,7 +5,6 @@ use utf8; our %Lexicon = ( MEET_EDIT => 'Editace mĂstnosti', - MEET_DELETE => 'Smazat mĂstnost', MEET_DELETE_CONFIRM => 'Opravdu chceš smazat mĂstnost', INPUT_MEET_NAME_PLACEHOLDER => 'Název novĂ© mĂstnosti', INPUT_MEET_NAME_LABEL => 'Název mĂstnosti', @@ -16,9 +15,6 @@ our %Lexicon = ( INPUT_MEET_ADD_USERS_PLACEHOLDER => 'ZaÄŤnÄ›te psát jmĂ©no osoby pro hledánĂ', INPUT_MEET_ADD_GROUPS_LABEL => 'PĹ™idat skupiny', INPUT_MEET_ADD_GROUPS_PLACEHOLDER => 'ZaÄŤnÄ›te psát název skupiny pro hledánĂ', - BUTTON_GROUPS_ADD => 'PĹ™idat skupiny', - BUTTON_MODERATORS_ADD => 'PĹ™idat moderatory', - BUTTON_SAVE => 'UloĹľit zmÄ›ny', ERROR_SERVERSIDE => 'Chyba na stranÄ› serveru', ERROR_MEET_NAME_REQURED => "Název novĂ© mĂstnosti je povinnĂ˝", ERROR_MEET_NAME_DUPLICITY => 'DuplicitnĂ název mistnosti', @@ -27,8 +23,12 @@ our %Lexicon = ( ENTER => 'Vstoupit', COPY_LINK => 'ZkopĂrovat odkaz', + 'Add groups' => 'PĹ™idat skupiny', + 'Add moderators' => 'PĹ™idat moderatory', 'Create meet' => 'VytvoĹ™it mĂstnost', - 'Base configuration' => 'ZákladnĂ nastavenĂ', + 'Delete meet' => 'Smazat mĂstnost', + 'Save changes' => 'UloĹľit zmÄ›ny', + 'Configuration' => 'Konfigurace', 'Authorized groups' => 'OpravnÄ›nĂ© skupiny', 'Moderators' => 'ModeratoĹ™i', 'Invites' => 'Pozvánky', diff --git a/templates/includes/meet_form.html.ep b/templates/includes/meet_form.html.ep index bc26275109dda27a7a64e05821a2ed145ea04c8b..d9c4d139c32858ce3572a7e4435d7bf5d873ea85 100644 --- a/templates/includes/meet_form.html.ep +++ b/templates/includes/meet_form.html.ep @@ -16,6 +16,39 @@ </div> <button class="btn btn--blue-300 btn--hoveractive"> - <div class="btn__body"><%=l 'BUTTON_SAVE' %></div> - </button> + <div class="btn__body"><%=l 'Save changes' %></div> +</button> +<button class="btn btn--red-600 btn--hoveractive" @click="delete_confirm_visible=true"> + <div class="btn__body"><%=l 'Delete meet' %></div> +</button> + <form> + +<div class="modal__overlay toggle-modal-sample-1" id="modal-sample-1" v-if="delete_confirm_visible"> + <div class="modal__content" role="dialog"> + <div class="modal__container w-full max-w-2xl" role="dialog"> + <div class="modal__container-body elevation-10"> + <button class="modal__close" title="ZavĹ™Ăt" @click.prevent="delete_confirm_visible = false"><i class="ico--cross"></i></button> + <div class="card "> + <div class="card__body "> + <h1 class="card-headline mb-2"><%=l 'MEET_DELETE' %></h1> + <p class="card-body-text my-8"> + <%=l 'MEET_DELETE_CONFIRM' %> + </p> + + <p class="card-body-text"> + <button class="btn btn--green-300 btn--hoveractive text-sm" @click.prevent="deleteMeet()"> + <div class="btn__body"><i class="btn__inline-icon ico--bin"></i><%=l 'ANO' %></div> + </button> + <button class="btn btn--orange-400 btn--hoveractive text-sm" @click.prevent="delete_confirm_visible = false"> + <div class="btn__body"><i class="btn__inline-icon ico--cross"></i><%=l 'NE' %></div> + </button> + </p> + + </div> + </div> + + </div> + </div> + </div> +</div> diff --git a/templates/includes/meet_groups.html.ep b/templates/includes/meet_groups.html.ep index ae20a0918b0601ed7c67c019a0b5311418581ecb..bd0c2b7f07de59ab92d86d430de55946b841831f 100644 --- a/templates/includes/meet_groups.html.ep +++ b/templates/includes/meet_groups.html.ep @@ -18,7 +18,7 @@ </div> <div class="form-field" v-if="selected_groups.length > 0"> <button class="btn btn--green-400 btn--hoveractive text-lg" @click="addGroups()"> - <div class="btn__body"><%=l 'BUTTON_GROUPS_ADD' %></div> + <div class="btn__body"><%=l 'Add groups' %></div> </button> </div> </div> diff --git a/templates/includes/meet_moderators.html.ep b/templates/includes/meet_moderators.html.ep index dfd527b7b15981d2d85b0d899a97ae85c4e84014..b1fd19651d850f12c4a3a90bfc76c024607b49d7 100644 --- a/templates/includes/meet_moderators.html.ep +++ b/templates/includes/meet_moderators.html.ep @@ -18,7 +18,7 @@ </div> <div class="form-field" v-if="selected_users.length > 0"> <button class="btn btn--red-600 btn--hoveractive text-lg" @click="addModerators()"> - <div class="btn__body"><%=l 'BUTTON_MODERATORS_ADD' %></div> + <div class="btn__body"><%=l 'Add moderators' %></div> </button> </div> </div> diff --git a/templates/index.html.ep b/templates/index.html.ep index 642a4b69bb67f12b6644b83f6245e3ce159da96d..6d6ffddf12463d7acab9cbe31d78285b19d921df 100644 --- a/templates/index.html.ep +++ b/templates/index.html.ep @@ -1,13 +1,15 @@ % layout 'default'; +<div class="flex flex-row"> + +<div class="w-80 mr-4"> <figure class="figure"> - <img src="/img/bg/2.jpg" alt="16x9 Image" /> -<!-- - <figcaption> -<h1 class="head-alt-xl">Opravdu bezpeÄŤnĂ˝ jitsi</h1> - </figcaption> ---> + <img src="/img/bg/2.jpg" alt="" /> </figure> +</div> - +<div> +<h1 class="head-alt-xl">Opravdu bezpeÄŤnĂ˝ jitsi</h1> +</div> +</div> diff --git a/templates/meet.html.ep b/templates/meet.html.ep index 00c04638e9f5c125ca0bd8b402421157ba0f01d7..ae503ba4af93196aa0c3753fc8ba34e10566d335 100644 --- a/templates/meet.html.ep +++ b/templates/meet.html.ep @@ -5,11 +5,10 @@ % if ( $is_editable ) { <div class="grid grid-cols-4 border border-b-0 divide-x text-center"> -%#<div @click="active_tab='meet'" class="p-4 bg-grey-125" :class="tabClass('meet')"><%=l 'Meet' %></div> -<div @click="active_tab='form'" class="p-4 bg-grey-125" :class="tabClass('form')"><%=l 'Base configuration' %></div> <div @click="active_tab='groups'" class="p-4 bg-grey-125" :class="tabClass('groups')"><%=l 'Authorized groups' %></div> <div @click="active_tab='moderators'" class="p-4 bg-grey-125" :class="tabClass('moderators')"><%=l 'Moderators' %></div> <div @click="active_tab='invites'" class="p-4 bg-grey-125" :class="tabClass('invites')"><%=l 'Invites' %></div> +<div @click="active_tab='form'" class="p-4 bg-grey-125" :class="tabClass('form')"><%=l 'Configuration' %></div> </div> <div class="border p-4" v-effect="getMeet()"> @@ -41,7 +40,8 @@ meet: {}, users: {}, - active_tab: 'form', + active_tab: 'groups', + delete_confirm_visible: false, search_groups: '', search_users: '', @@ -189,6 +189,24 @@ }) }, + deleteMeet() { + fetch(MEET_URL, { + method: "DELETE", + headers: { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Bearer <%= current_user->{token} %>", + }, + }) + .then( response => { + this.delete_confirm_visible = false; + window.location.replace("/"); +// redirect + }) + .catch(() => { + this.formError = "<%=l 'ERROR_SERVERSIDE' %>" + }); + } }).mount() diff --git a/templates/meets.html.ep b/templates/meets.html.ep index d514791d54ae7a44218308f139dcc2f3db78b90d..30c1e76b3ccc589d4ce5c8d308ebcdafc809796f 100644 --- a/templates/meets.html.ep +++ b/templates/meets.html.ep @@ -6,7 +6,7 @@ <div class="flex justify-between mb-3"> <h2 class="head-alt-xs"><a v-bind:href="'/meets/' + meet.id">{{meet.name}}</a></h2> <div> - <a class="hover:no-underline" v-bind:href="'/meets/' + meet.id" title="<%=l 'ENTER' %>"><i class="ico--phone"></i></a> +%# <a class="hover:no-underline" v-bind:href="'/meets/' + meet.id" title="<%=l 'ENTER' %>"><i class="ico--phone"></i></a> </div> </div> @@ -51,14 +51,10 @@ formData: { name: "" }, - formError: "", - deleteDialogVisible: false, - deleteMeetId: null, - deleteMeetName: "", - async copyLink(id) { - await navigator.clipboard.writeText('<%= config->{base_url} %>/meets/' + id); - }, +// async copyLink(id) { +// await navigator.clipboard.writeText('<%= config->{base_url} %>/meets/' + id); +// }, fetchData() { //TODO: async fetch(BASE_URL, { @@ -105,6 +101,7 @@ this.formError = "<%=l 'ERROR_SERVERSIDE' %>" }); }, + % } }).mount()