Require login for file upload
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
<script>
|
||||
import Menu from "../filesystem/Menu.svelte";
|
||||
import Footer from "../layout/Footer.svelte";
|
||||
import AddressReputation from "./AddressReputation.svelte";
|
||||
import FeatureTable from "./FeatureTable.svelte";
|
||||
import ForCreators from "./ForCreators.svelte";
|
||||
import PolicyChange from "./PolicyChange.svelte";
|
||||
import UploadWidget from "./UploadWidget.svelte";
|
||||
import UploadLoginWall from "./UploadLoginWall.svelte";
|
||||
</script>
|
||||
|
||||
<div class="page_content">
|
||||
<header>
|
||||
<header class="header" style="text-align: initial">
|
||||
<div class="menu_button_container">
|
||||
<Menu no_login_label="Not logged in" hide_name={false} hide_logo/>
|
||||
</div>
|
||||
<div class="header_image_container"></div>
|
||||
<PolicyChange/>
|
||||
</header>
|
||||
|
||||
<AddressReputation/>
|
||||
|
||||
<UploadWidget/>
|
||||
<UploadLoginWall/>
|
||||
</div>
|
||||
|
||||
<div class="page_content">
|
||||
@@ -99,18 +101,19 @@ header > h1 {
|
||||
}
|
||||
|
||||
.header_image_container {
|
||||
text-align: initial;
|
||||
margin: auto;
|
||||
height: 200px;
|
||||
width: 750px;
|
||||
height: 150px;
|
||||
width: 500px;
|
||||
max-width: 100%;
|
||||
background-image: url("/res/img/header_orbitron_wide.webp");
|
||||
background-image: url("/res/img/header_orbitron.webp");
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.header_image_container {
|
||||
background-image: url("/res/img/header_orbitron.webp");
|
||||
}
|
||||
.menu_button_container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
</style>
|
||||
|
||||
60
svelte/src/home_page/UploadLoginWall.svelte
Normal file
60
svelte/src/home_page/UploadLoginWall.svelte
Normal file
@@ -0,0 +1,60 @@
|
||||
<script>
|
||||
import Login from "../login/Login.svelte";
|
||||
import Register from "../login/Register.svelte";
|
||||
import UploadWidget from "./UploadWidget.svelte";
|
||||
|
||||
const finish_login = async e => {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
let page = "login"
|
||||
</script>
|
||||
|
||||
{#if window.user && window.user.username && window.user.username !== ""}
|
||||
<UploadWidget/>
|
||||
{:else}
|
||||
<section>
|
||||
<p>
|
||||
Pixeldrain requires an account to upload files to. If you already
|
||||
have an account use the login form below to log in to your account.
|
||||
If not, use the right tab button to register a new account.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<div class="tab_bar">
|
||||
<button on:click={() => page = "login"} class:button_highlight={page === "login"}>
|
||||
<i class="icon small">login</i>
|
||||
<span>Login</span>
|
||||
</button>
|
||||
|
||||
<button on:click={() => page = "register"} class:button_highlight={page === "register"}>
|
||||
<i class="icon small">how_to_reg</i>
|
||||
<span>Register</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if page === "login"}
|
||||
<section class="highlight_border">
|
||||
<Login on:login={finish_login}/>
|
||||
<p>
|
||||
If you have lost your password, you can <a
|
||||
href="password_reset">request a new password here</a>.
|
||||
</p>
|
||||
</section>
|
||||
{:else if page === "register"}
|
||||
<section class="highlight_border">
|
||||
<Register on:login={finish_login}/>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<br/>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.tab_bar > button {
|
||||
width: 40%;
|
||||
max-width: 10em;
|
||||
font-size: 1.3em;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user