Skip to content
Snippets Groups Projects
Verified Commit dd36c22e authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Funkcni prototyp

parent 951665f8
No related branches found
No related tags found
No related merge requests found
Pipeline #10495 passed
0.1.0
0.2.0
......@@ -23,7 +23,7 @@ sub callback ($c) {
})->first;
if ( $user ) {
$user->updata(\%user);
$user->update(\%user);
}
else {
$user = $c->schema->resultset('User')->create(\%user);
......
......@@ -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;
......@@ -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',
......
......@@ -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>
......@@ -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>
......
......@@ -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>
......
% 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>
......@@ -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()
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment