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

Lehky redesign, korektni prace neprihlasenych

parent 8360cdbe
No related branches found
No related tags found
No related merge requests found
Pipeline #19215 passed
...@@ -134,7 +134,11 @@ sub startup( $self ) { ...@@ -134,7 +134,11 @@ sub startup( $self ) {
$r->get('/')->to(cb => sub { shift->render('index'); }); $r->get('/')->to(cb => sub { shift->render('index'); });
$r->get('/meets/:id')->requires(authenticated => 1)->to('Meets#meet'); $r->get('/meets/:id')->requires(authenticated => 1)->to('Meets#meet');
$r->get('/meets/:id')->to(cb => sub { shift->render('unauthorized'); }); $r->get('/meets/:id')->to(cb => sub {
my $c = shift;
$c->session->{id} = $c->stash->{id};
$c->render('index');
});
$r->get('/guest/:token')->to('Invites#meet'); $r->get('/guest/:token')->to('Invites#meet');
$r->websocket('/ws')->to('Websockets#main'); $r->websocket('/ws')->to('Websockets#main');
......
...@@ -64,7 +64,14 @@ sub callback ($c) { ...@@ -64,7 +64,14 @@ sub callback ($c) {
}; };
$c->authenticate(); $c->authenticate();
$c->redirect_to('/'); if ($c->session->{id}) {
my $id = $c->session->{id};
delete $c->session->{id};
$c->redirect_to("/meets/$id");
}
else {
$c->redirect_to('/');
}
} }
sub do_logout($c) { # nesmi se jmenovat logout - rekurze sub do_logout($c) { # nesmi se jmenovat logout - rekurze
......
...@@ -237,12 +237,20 @@ sub meet($c) { #NENI API! ...@@ -237,12 +237,20 @@ sub meet($c) { #NENI API!
id => $c->current_user->{id} id => $c->current_user->{id}
}); });
return $c->error(404, 'NOT_FOUND') if ! $meet; if (! $meet) {
$c->render('unauthorized');
return;
}
# return $c->error(404, 'NOT_FOUND') if ! $meet;
my $roles = $meet->user_roles($user, $c->current_user->{groups}); my $roles = $meet->user_roles($user, $c->current_user->{groups});
$c->trace($roles); $c->trace($roles);
return $c->error(404, 'NOT_FOUND') if ! $roles->{any}; # return $c->error(404, 'NOT_FOUND') if ! $roles->{any};
if (! $roles->{any}) {
$c->render('unauthorized');
return;
}
$c->stash->{meet} = $meet; $c->stash->{meet} = $meet;
$c->stash->{roles} = $roles; $c->stash->{roles} = $roles;
......
public/img/bg.jpg

1.85 MiB

public/img/motivator/1.jpg

36 KiB

public/img/motivator/2.jpg

56.7 KiB

public/img/motivator/3.jpg

75.4 KiB

public/img/motivator/4.jpg

57.1 KiB

public/img/motivator/5.jpg

66.4 KiB

public/img/og1.jpg

88.3 KiB

public/img/og1.png

1.03 MiB

<head>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" href="<%= config->{styleguide} %>images/favicons/favicon-196x196.png">
<link rel="icon" type="image/png" href="<%= config->{styleguide} %>images/favicons/favicon-196x196.png" sizes="196x196">
<meta name="application-name" content="<%= config->{name} %>">
<meta name="msapplication-TileColor" content="#000000">
<meta name="msapplication-TileImage" content="<%= config->{styleguide} %>images/favicons/mstile-144x144.png">
<meta name="msapplication-square70x70logo" content="<%= config->{styleguide} %>images/favicons/mstile-70x70.png">
<meta name="msapplication-square150x150logo" content="<%= config->{styleguide} %>images/favicons/mstile-150x150.png">
<meta name="msapplication-wide310x150logo" content="<%= config->{styleguide} %>images/favicons/mstile-310x150.png">
<meta name="msapplication-square310x310logo" content="<%= config->{styleguide} %>images/favicons/mstile-310x310.png">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<meta name="theme-color" content="#000000"/>
<meta property="og:url" content="<%= config->{base_url} %>"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="<%= config->{name} %>"/>
<meta property="og:image" content="<%= config->{base_url} %>/img/og1.png"/>
<meta property="og:description" content="<%= config->{description} %>"/>
<meta name="description" content="<%= config->{description} %>"/>
<title><%= config->{name} %></title>
<link rel="manifest" href="/manifest.json"/>
<link rel="stylesheet" href="<%= config->{styleguide} %>css/styles.css"/>
<link rel="stylesheet" href="/custom.css"/>
% if ( $c->stash->{meet} ) {
<script src='https://jitsi.pirati.cz/external_api.js'></script>
% }
<script src="https://cdn-unpkg.pirati.cz/vue@2.7.8/dist/vue.min.js"></script>
<script src="<%= config->{styleguide} %>js/main.bundle.js"></script>
<script src="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/index.min.js"></script>
<script src="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/locale/cs.js"></script>
<link href="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/index.css" rel="stylesheet">
<style>
.mx-input { height: 48px; border-color: #adadad; border-radius: 0; }
</style>
</head>
% layout 'default'; % layout 'unauthorized';
<h1 class="head-alt-lg text-center my-12">Bezpečný jitsi jenom pro ověřené účastníky</h1>
<div class="flex flex-row justify-items-center">
<div class="w-80 mr-10">
<figure class="figure">
<img src="/img/motivator/<%= int(rand(5))+1 %>.jpg" alt="" />
</figure>
</div>
<div>
<h1 class="head-alt-lg">Bezpečný jitsi<br/>jenom pro ověřené účastníky</h1>
<h1 class="head-alt-lg text-red-600 pt-10">Testovací provoz</h1>
</div>
</div>
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"/> %= include 'includes/head'
<link rel="apple-touch-icon" href="<%= config->{styleguide} %>images/favicons/favicon-196x196.png">
<link rel="icon" type="image/png" href="<%= config->{styleguide} %>images/favicons/favicon-196x196.png" sizes="196x196">
<meta name="application-name" content="<%= config->{name} %>">
<meta name="msapplication-TileColor" content="#000000">
<meta name="msapplication-TileImage" content="<%= config->{styleguide} %>images/favicons/mstile-144x144.png">
<meta name="msapplication-square70x70logo" content="<%= config->{styleguide} %>images/favicons/mstile-70x70.png">
<meta name="msapplication-square150x150logo" content="<%= config->{styleguide} %>images/favicons/mstile-150x150.png">
<meta name="msapplication-wide310x150logo" content="<%= config->{styleguide} %>images/favicons/mstile-310x150.png">
<meta name="msapplication-square310x310logo" content="<%= config->{styleguide} %>images/favicons/mstile-310x310.png">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<meta name="theme-color" content="#000000"/>
<meta property="og:url" content="<%= config->{base_url} %>"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="<%= config->{name} %>"/>
<meta property="og:image" content="<%= config->{base_url} %>/img/og1.jpg"/>
<meta property="og:description" content="<%= config->{description} %>"/>
<meta name="description" content="<%= config->{description} %>"/>
<title><%= config->{name} %></title>
<link rel="manifest" href="/manifest.json"/>
<link rel="stylesheet" href="<%= config->{styleguide} %>css/styles.css"/>
<link rel="stylesheet" href="/custom.css"/>
% if ( $c->stash->{meet} ) {
<script src='https://jitsi.pirati.cz/external_api.js'></script>
% }
<script src="https://cdn-unpkg.pirati.cz/vue@2.7.8/dist/vue.min.js"></script>
<script src="<%= config->{styleguide} %>js/main.bundle.js"></script>
<script src="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/index.min.js"></script>
<script src="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/locale/cs.js"></script>
<link href="https://cdn-unpkg.pirati.cz/vue2-datepicker@3.11.1/index.css" rel="stylesheet">
<style>
.mx-input { height: 48px; border-color: #adadad; border-radius: 0; }
</style>
</head> </head>
<body> <body>
<nav class="navbar navbar--simple __js-root"> <nav class="navbar navbar--simple __js-root">
<ui-app inline-template> <ui-app inline-template>
<ui-navbar inline-template> <ui-navbar inline-template>
...@@ -59,7 +25,6 @@ ...@@ -59,7 +25,6 @@
</div> </div>
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
% if ( is_user_authenticated ) {
<div class="flex items-center space-x-4"> <div class="flex items-center space-x-4">
<span class="head-heavy-2xs"><%= current_user->{displayname} %></span> <span class="head-heavy-2xs"><%= current_user->{displayname} %></span>
<div class="avatar avatar--2xs"> <div class="avatar avatar--2xs">
...@@ -67,18 +32,6 @@ ...@@ -67,18 +32,6 @@
</div> </div>
<a href="/logout"><button class="text-grey-200 hover:text-white"><i class="ico--log-out"></i></button></a> <a href="/logout"><button class="text-grey-200 hover:text-white"><i class="ico--log-out"></i></button></a>
</div> </div>
% } else {
<a href="<%= oidc->authorize %>">
<button class="btn btn--icon btn--grey-125 btn--hoveractive">
<div class="btn__body-wrap">
<div class="btn__body">Přihlásit se</div>
<div class="btn__icon">
<i class="ico--pirati"></i>
</div>
</div>
</button>
</a>
% }
</div> </div>
</div> </div>
</div> </div>
...@@ -94,6 +47,5 @@ ...@@ -94,6 +47,5 @@
</main> </main>
</section> </section>
</div> </div>
</body> </body>
</html> </html>
<!doctype html>
<html lang="en">
<body>
<head>
%= include 'includes/head'
<style>
#all {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
background: url( '/img/bg.jpg') no-repeat center center;
background-size: cover;
}
</style>
</head>
<div id="all">
<div class="container container--default py-8">
<section>
<main>
<div class="card elevation-9" style="background-color: #fff; opacity: .7" >
<div class="card__body">
<%= content %>
<a href="<%= oidc->authorize %>">
<button class="btn btn--icon text-lg btn--fullwidth btn--violet-500 btn--hoveractive">
<div class="btn__body-wrap">
<div class="btn__body">Přihlásit se</div>
<div class="btn__icon">
<i class="ico--pirati"></i>
</div>
</div>
</button>
</a>
</div>
</div>
</main>
</section>
</div>
</div>
</body>
</html>
% if ( is_user_authenticated ) {
% layout 'default'; % layout 'default';
% } else {
<h1 class="head-alt-lg">Nemáte oprávnění pro přístup do této místnosti</h1> % layout 'unauthorized';
% }
<a href="<%= oidc->authorize %>"> <h1 class="head-alt-lg text-center my-12">Nemáte oprávnění pro přístup do této místnosti</h1>
<button class="btn btn--icon btn--grey-125 btn--hoveractive">
<div class="btn__body-wrap">
<div class="btn__body">Přihlásit se</div>
<div class="btn__icon">
<i class="ico--pirati"></i>
</div>
</div>
</button>
</a>
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