basic temapltes rendered

This commit is contained in:
2020-11-27 05:49:29 +01:00
parent 0b86db6413
commit e25c28b04c
20 changed files with 108 additions and 101 deletions

View File

@@ -6,12 +6,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://bootswatch.com/4/darkly/bootstrap.min.css">
<title>My Store Web App</title>
<title>UnstableVortex CAFF Store</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-3">
<div class="container">
<a class="navbar-brand" href="{{ url_for('index') }}">UnstableVortex CAFF Store</a>
<a class="navbar-brand" href="{{ url_for('IndexView:index') }}">UnstableVortex CAFF Store</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@@ -19,16 +19,16 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{{ url_for('index') }}">Home</a>
<a class="nav-link" href="{{ url_for('IndexView:index') }}">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{{ url_for('profile') }}">Profile</a>
<a class="nav-link" href="{{ url_for('ProfileView:index') }}">Profile</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{{ url_for('login') }}">Login</a>
<a class="nav-link" href="{{ url_for_security('login') }}">Login</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{{ url_for('register') }}">Register</a>
<a class="nav-link" href="{{ url_for_security('login') }}">Register</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">

View File

@@ -5,13 +5,13 @@
{% for image in images %}
<div class="col-12 col-sm-6 col-md-4 px-2 mb-3">
<div class="card">
<a href="{{ url_for('item', id=image.id) }}">
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.caption}}">
<a href="{{ url_for('ItemView:index', id=image.id) }}">
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.name}}">
</a>
<div class="card-body">
<h5 class="card-title">{{image.creator}}</h5>
<p class="card-text">
{{image.caption}}
{{image.name}}
</p>
<a href="{{ url_for('download', id=image.id) }}" class="btn btn-primary" target="_blank">Download Now</a>
</div>

View File

@@ -6,9 +6,9 @@
<!-- <h5 class="card-title">Special title treatment</h5>-->
<!-- <h6 class="card-subtitle text-muted">Support card subtitle</h6>-->
<!-- </div>-->
<img src="{{image.preview}}" class="card-img" style="padding: 30px" alt="{{image.caption}}">
<img src="{{image.preview}}" class="card-img" style="padding: 30px" alt="{{image.name}}">
<div class="card-body">
<p class="card-text">{{ image.caption }}</p>
<p class="card-text">{{ image.name }}</p>
</div>
<div class="card-body">
<table class="table table-responsive">
@@ -17,10 +17,6 @@
<th scope="row">Creator</th>
<td>{{ image.creator }}</td>
</tr>
<tr class="table-active">
<th scope="row">Number of images</th>
<td>{{ image.num_anim }}</td>
</tr>
<tr class="table-active">
<th scope="row">Creation date</th>
<td>{{ image.creation_date }}</td>

View File

@@ -1,17 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<div class="jumbotron">
<h1 class="display-3">Please sign in</h1>
<br>
<form action="" method="post">
<input size="50" type="text" class="form-control" placeholder="Username" name="username" value="{{request.form.username}}"></br></br>
<input type="password" class="form-control" placeholder="Password" name="password" value="{{request.form.password}}"></br></br>
<input class="btn btn-primary" type="submit" value="Sign In"></br></br>
</form>
<p>Dont't have an account? <a class="bottom" href="{{ url_for('register') }}"> Sign Up here</a></p>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}
{% endif %}
</div>
{% endblock %}

View File

@@ -4,7 +4,7 @@
{% if current_user.is_authenticated %}
<div>
<h1>Welcome {{ user.username }}</h1>
<a href="upload.html" class="btn btn-primary">Upload</a>
<a href="{{ url_for('UploadView:index') }}" class="btn btn-primary">Upload</a>
</div>
<br>
{% if images %}
@@ -12,16 +12,16 @@
{% for image in images %}
<div class="col-12 col-sm-6 col-md-4 px-2 mb-3">
<div class="card">
<a href="{{ url_for('item', id=image.id) }}">
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.caption}}">
<a href="{{ url_for('ItemView:index', id=image.id) }}">
<img src="{{image.preview}}" class="img-fluid" style="padding: 30px" alt="{{image.name}}">
</a>
<div class="card-body">
<h5 class="card-title">{{image.creator}}</h5>
<p class="card-text">
{{image.caption}}
</p>
<a href="{{ url_for('download', id=image.id) }}" class="btn btn-primary" target="_blank">Download</a>
<a href="{{ url_for('delete', id=image.id) }}" class="btn btn-primary" target="_blank">Delete</a>
<a href="{{ url_for('ItemView:download', id=image.id) }}" class="btn btn-primary" target="_blank">Download</a>
<a href="{{ url_for('ItemView:delete', id=image.id) }}" class="btn btn-primary" target="_blank">Delete</a>
</div>
</div>
</div>
@@ -32,6 +32,6 @@
<p>No images available.</p>
{% endif %}
{% else %}
<p><a href="{{ url_for('login') }}">Log in</a> to view your profile.</p>
<p><a href="{{ url_for_security('login') }}">Log in</a> to view your profile.</p>
{% endif %}
{% endblock %}

View File

@@ -1,18 +0,0 @@
{% extends 'base.html' %}
{% block content %}
<div class="jumbotron">
<h1 class="display-3">Please sign up</h1>
<br>
<form action="" method="post">
<input type="text" class="form-control" placeholder="Username" name="username" value="{{request.form.username}}"></br></br>
<input type="password" class="form-control" placeholder="Password" name="password" value="{{request.form.password}}"></br></br>
<input type="email" class="form-control" placeholder="Email" name="email" value="{{request.form.email}}"></br></br>
<input class="btn btn-primary" type="submit" value="Sign Up"></br></br>
</form>
<p class="bottom">Already have an account? <a class="bottom" href="{{ url_for('login') }}"> Sign In here</a></p>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
<div class="jumbotron">
<h1 class="display-3">Please sign in</h1>
<br>
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
{{ login_user_form.hidden_tag() }}
{{ render_field_with_errors(login_user_form.email) }}
{{ render_field_with_errors(login_user_form.password) }}
{{ render_field_with_errors(login_user_form.remember) }}
{{ render_field(login_user_form.submit) }}
</form>
<p>Dont't have an account? <a class="bottom" href="/register"> Sign Up here</a></p>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
<div class="jumbotron">
<h1 class="display-3">Please sign up</h1>
<br>
<form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
{{ register_user_form.hidden_tag() }}
{{ render_field_with_errors(register_user_form.email) }}
{{ render_field_with_errors(register_user_form.password) }}
{% if register_user_form.password_confirm %}
{{ render_field_with_errors(register_user_form.password_confirm) }}
{% endif %}
{{ render_field(register_user_form.submit) }}
</form>
<p class="bottom">Already have an account? <a class="bottom" href="/login"> Sign In here</a></p>
{% if error %}
<p class="error"><strong>Error:</strong> {{ error }}
{% endif %}
</div>
{% endblock %}

View File

@@ -11,6 +11,6 @@
</form>
</div>
{% else %}
<p><a href="{{ url_for('login') }}">Log in</a> to upload an animation.</p>
<p><a href="{{ url_for_security('login') }}">Log in</a> to upload an animation.</p>
{% endif %}
{% endblock %}