mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 15:07:35 +01:00
Add game jam ad
This commit is contained in:
parent
e5ae41901c
commit
20c93925a8
@ -6,6 +6,24 @@ from app.models import *
|
|||||||
import flask_menu as menu
|
import flask_menu as menu
|
||||||
from sqlalchemy.orm import joinedload
|
from sqlalchemy.orm import joinedload
|
||||||
from sqlalchemy.sql.expression import func
|
from sqlalchemy.sql.expression import func
|
||||||
|
from flask_login import current_user
|
||||||
|
|
||||||
|
|
||||||
|
class GameJam:
|
||||||
|
cover_image = type("", (), dict(url="/static/gamejam.png"))()
|
||||||
|
tags = []
|
||||||
|
|
||||||
|
def getURL(self, _name):
|
||||||
|
return "https://forum.minetest.net/viewtopic.php?t=27512"
|
||||||
|
|
||||||
|
title = "Minetest Game Jam 2021"
|
||||||
|
author = None
|
||||||
|
|
||||||
|
short_desc = "We're holding a 3-week Game Jam starting December 1st! Sharpen your gamedev skills with a chance for a cash prize."
|
||||||
|
type = type("", (), dict(value="Competition"))()
|
||||||
|
content_warnings = []
|
||||||
|
reviews = []
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
@menu.register_menu(bp, ".", "Home")
|
@menu.register_menu(bp, ".", "Home")
|
||||||
@ -19,6 +37,8 @@ def home():
|
|||||||
count = query.count()
|
count = query.count()
|
||||||
|
|
||||||
featured = query.filter(Package.tags.any(name="featured")).order_by(func.random()).limit(6).all()
|
featured = query.filter(Package.tags.any(name="featured")).order_by(func.random()).limit(6).all()
|
||||||
|
if current_user.is_authenticated:
|
||||||
|
featured.insert(0, GameJam())
|
||||||
|
|
||||||
new = join(query.order_by(db.desc(Package.approved_at))).limit(4).all()
|
new = join(query.order_by(db.desc(Package.approved_at))).limit(4).all()
|
||||||
pop_mod = join(query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score))).limit(8).all()
|
pop_mod = join(query.filter_by(type=PackageType.MOD).order_by(db.desc(Package.score))).limit(8).all()
|
||||||
|
@ -39,11 +39,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="carousel-caption text-shadow">
|
<div class="carousel-caption text-shadow">
|
||||||
<h3 class="mt-0 mb-3">
|
<h3 class="mt-0 mb-3">
|
||||||
|
{% if package.author %}
|
||||||
{{ _('<strong>%(title)s</strong> by %(author)s', title=package.title, author=package.author.display_name) }}
|
{{ _('<strong>%(title)s</strong> by %(author)s', title=package.title, author=package.author.display_name) }}
|
||||||
|
{% else %}
|
||||||
|
<strong>{{ package.title }}</strong>
|
||||||
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
<p>
|
<p>
|
||||||
{{ package.short_desc }}
|
{{ package.short_desc }}
|
||||||
</p>
|
</p>
|
||||||
|
{% if package.author %}
|
||||||
<div class="d-none d-md-block">
|
<div class="d-none d-md-block">
|
||||||
<span class="mr-2">
|
<span class="mr-2">
|
||||||
{{ package.type.value }}
|
{{ package.type.value }}
|
||||||
@ -70,6 +75,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user