mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-05-14 14:22:16 +00:00
start working on adding more game info
This commit is contained in:
parent
e6794d42af
commit
9676819871
4 changed files with 32 additions and 18 deletions
|
@ -1,10 +1,9 @@
|
||||||
from flask import Blueprint, render_template, redirect, flash, abort
|
from flask import Blueprint, render_template, redirect, flash, abort
|
||||||
from flask_login import login_user, logout_user, login_required, current_user
|
from flask_login import login_user, logout_user, login_required
|
||||||
from flask_wtf import FlaskForm
|
from flask_wtf import FlaskForm
|
||||||
from wtforms import StringField
|
from wtforms import StringField
|
||||||
from wtforms.validators import DataRequired
|
from wtforms.validators import DataRequired
|
||||||
from website.models import Users, Games
|
from website.models import Users, Games, Images, Authors, Tags
|
||||||
from website.extensions import db
|
|
||||||
|
|
||||||
|
|
||||||
blueprint = Blueprint("website", __name__)
|
blueprint = Blueprint("website", __name__)
|
||||||
|
@ -36,6 +35,11 @@ def g(game_id):
|
||||||
if not game:
|
if not game:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
# TODO: Add images, authors, and tags to the game page
|
||||||
|
# images = Images.query.filter_by(game_id=game_id).all()
|
||||||
|
# authors = Authors.query.filter_id(game_id=game_id).all()
|
||||||
|
# tags = Tags.query.filter_by(game_id=game_id).all()
|
||||||
|
|
||||||
return render_template("game.html", game=game)
|
return render_template("game.html", game=game)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
nav
|
nav
|
||||||
padding: 0 0.5rem
|
padding: 0 0.5rem
|
||||||
width: 100%
|
|
||||||
height: 3rem
|
height: 3rem
|
||||||
|
|
||||||
display: flex
|
display: flex
|
||||||
|
@ -54,7 +53,7 @@ nav
|
||||||
&:hover
|
&:hover
|
||||||
color: RGB($accent)
|
color: RGB($accent)
|
||||||
|
|
||||||
> .title
|
.title
|
||||||
height: 3rem
|
height: 3rem
|
||||||
display: flex
|
display: flex
|
||||||
flex-direction: row
|
flex-direction: row
|
||||||
|
@ -73,7 +72,7 @@ nav
|
||||||
color: RGB($accent)
|
color: RGB($accent)
|
||||||
|
|
||||||
&.scrolled
|
&.scrolled
|
||||||
> .title
|
.title
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
&::before
|
&::before
|
||||||
|
@ -84,12 +83,10 @@ nav
|
||||||
height: 6rem
|
height: 6rem
|
||||||
top: -3rem
|
top: -3rem
|
||||||
display: flex
|
display: flex
|
||||||
flex-direction: column
|
|
||||||
justify-content: center
|
justify-content: center
|
||||||
|
|
||||||
transition: top 0.2s ease-in-out
|
transition: top 0.2s ease-in-out
|
||||||
|
|
||||||
> .title > p
|
.title > p
|
||||||
font-size: 1.3rem
|
font-size: 1.3rem
|
||||||
|
|
||||||
&.scrolled
|
&.scrolled
|
||||||
|
|
|
@ -107,6 +107,7 @@ div.login
|
||||||
flex-direction: column
|
flex-direction: column
|
||||||
|
|
||||||
font-family: $main-font
|
font-family: $main-font
|
||||||
|
font-size: 1rem
|
||||||
|
|
||||||
background-color: RGB($primary)
|
background-color: RGB($primary)
|
||||||
color: RGB($secondary)
|
color: RGB($secondary)
|
||||||
|
@ -118,11 +119,9 @@ div.login
|
||||||
|
|
||||||
> img
|
> img
|
||||||
margin: 0 0 0.5rem
|
margin: 0 0 0.5rem
|
||||||
width: auto
|
width: 100%
|
||||||
height: 10rem
|
|
||||||
object-fit: cover
|
|
||||||
display: block
|
display: block
|
||||||
border-radius: calc(#{$radius} - 0.5rem) calc(#{$radius} - 0.5rem) calc(calc(#{$radius} - 0.5rem) / 2) calc(calc(#{$radius} - 0.5rem) / 2)
|
// border-radius: calc(#{$radius} - 0.5rem) calc(#{$radius} - 0.5rem) calc(calc(#{$radius} - 0.5rem) / 2) calc(calc(#{$radius} - 0.5rem) / 2)
|
||||||
|
|
||||||
> h2
|
> h2
|
||||||
margin: 0 0 0.5rem
|
margin: 0 0 0.5rem
|
||||||
|
@ -132,7 +131,6 @@ div.login
|
||||||
> p
|
> p
|
||||||
height: 100%
|
height: 100%
|
||||||
margin: 0 0 1rem
|
margin: 0 0 1rem
|
||||||
font-size: 1rem
|
|
||||||
|
|
||||||
> .options
|
> .options
|
||||||
display: flex
|
display: flex
|
||||||
|
@ -150,7 +148,6 @@ div.login
|
||||||
justify-content: center
|
justify-content: center
|
||||||
align-items: center
|
align-items: center
|
||||||
|
|
||||||
font-size: 1rem
|
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
|
|
||||||
background-color: RGB($primary-button)
|
background-color: RGB($primary-button)
|
||||||
|
|
|
@ -9,10 +9,26 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<header style="height: 40vh">
|
<header style="height: 40vh">
|
||||||
<h1>{{ game.name }}</h1>
|
<h1>{{ game.name }}</h1>
|
||||||
|
<p>{{ game.developer }}</p>
|
||||||
|
<p>{% for person in game.autors %}{{ person }}{% if not loop.last %},{% endif %}{% endfor %}</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section class="fill">
|
<section class="fill" id="Description">
|
||||||
<h2>Games</h2>
|
<h2>Description</h2>
|
||||||
<p>Here are some games AAAA</p>
|
<p>{{ game.description }}</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id="Tags">
|
||||||
|
<ul>
|
||||||
|
{% for tag in game.tags %}
|
||||||
|
<li>{{ tag }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id="Images">
|
||||||
|
{% for image in game.images %}
|
||||||
|
<img src="{{ url_for('static', filename='images/' + image) }}" alt="{{ image.alt }}">
|
||||||
|
{% endfor %}
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Add table
Reference in a new issue