Commit 0676d954 authored by Lukas Böhm's avatar Lukas Böhm 🎱
Browse files

landing page

parent c0be5c6b
......@@ -2,6 +2,6 @@ from flask import Flask
app = Flask(__name__)
app.config['API_URL'] = 'http://localhost:6969'
app.config['SECRET_KEY'] = 'AYYY'
app.config['SECRET_KEY'] = '0345896u409568540968630498649058609'
import routes
......@@ -4,7 +4,7 @@ from werkzeug.exceptions import HTTPException
import requests as api
from chiefsend import app
from util import AuthForm, get_password, set_password
from util import AuthForm, get_password, set_password, SearchForm
......@@ -17,9 +17,14 @@ def about():
return render_template('About.html')
def index():
return render_template('Landing.html')
@app.route('/', methods=['GET', 'POST'])
def landing():
form = SearchForm()
if form.validate_on_submit():
share_id ="/")[-1]
return redirect(url_for('download', share_id=share_id))
return render_template('Landing.html', form=form)
{% extends 'Base.html' %}
{% extends "Base.html" %}
{% block page %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/cover.css') }}">
<div class="cover bg-dark">
<div class="cover-container d-flex h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">Cover</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="#">Home</a>
<a class="nav-link" href="#">Features</a>
<a class="nav-link" href="#">Contact</a>
<main role="main" class="inner cover">
<h1 class="cover-heading">Cover your page.</h1>
<p class="lead">Cover is a one-page template for building simple and beautiful home pages. Download, edit the text, and add your own fullscreen background photo to make it your own.</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-secondary">Learn more</a>
<!-- Navbar -->
<div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white border-bottom shadow-sm">
<h5 class="my-0 mr-md-auto font-weight-normal">ChiefSend</h5>
<nav class="my-2 my-md-0 mr-md-3">
<a class="p-2 text-dark" href="{{ url_for('public') }}">Öffentlich</a>
<a class="p-2 text-dark" href="{{ url_for('privacy') }}">Privacy</a>
<a class="p-2 text-dark" href="{{ url_for('about') }}">About</a>
<footer class="mastfoot mt-auto">
<div class="inner">
<p>Cover template for <a href="">Bootstrap</a>, by <a href="">@mdo</a>.</p>
<main class="container-fluid">
<div class="row align-items-center justify-content-center text-center">
<div class="col-lg-6">
<p class="mb-5">Haben Sie schon einen Share link, oder wollen sie einen erstellen?</p>
<form class="form-group d-flex" method="post">
{{ form.hidden_tag() }}
{{ form.query(class="form-control", placeholder="Share ID oder Link") }}
{{ form.submit(class="btn btn-primary text-white px-4") }}
<a class="form-group btn btn-block btn-outline-success" href="{{ url_for('upload') }}">
Share erstellen
{% endblock %}
\ No newline at end of file
{% endblock page %}
from flask import session
from flask_wtf import FlaskForm
from wtforms import SubmitField, PasswordField
from wtforms.validators import DataRequired
from wtforms import SubmitField, PasswordField, StringField
from wtforms.validators import DataRequired, InputRequired
class AuthForm(FlaskForm):
......@@ -9,6 +9,11 @@ class AuthForm(FlaskForm):
submit = SubmitField('Zugriff!')
class SearchForm(FlaskForm):
query = StringField('Suchbegriff', validators=[InputRequired()])
submit = SubmitField('Finden')
def get_password(share_id):
if share_id not in session:
return None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment