mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +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,37 +39,43 @@
|
|||||||
</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">
|
||||||
{{ _('<strong>%(title)s</strong> by %(author)s', title=package.title, author=package.author.display_name) }}
|
{% if package.author %}
|
||||||
|
{{ _('<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>
|
||||||
<div class="d-none d-md-block">
|
{% if package.author %}
|
||||||
<span class="mr-2">
|
<div class="d-none d-md-block">
|
||||||
{{ package.type.value }}
|
<span class="mr-2">
|
||||||
</span>
|
{{ package.type.value }}
|
||||||
{% for warning in package.content_warnings %}
|
|
||||||
<span class="badge badge-warning" title="{{ warning.description }}">
|
|
||||||
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
|
||||||
{{ warning.title }}
|
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% for warning in package.content_warnings %}
|
||||||
{% for t in tags[:3] %}
|
<span class="badge badge-warning" title="{{ warning.description }}">
|
||||||
{% if t.name != "featured" %}
|
<i class="fas fa-exclamation-circle" style="margin-right: 0.3em;"></i>
|
||||||
<span class="badge badge-primary" title="{{ t.description or '' }}">
|
{{ warning.title }}
|
||||||
{{ t.title }}
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
{% for t in tags[:3] %}
|
||||||
|
{% if t.name != "featured" %}
|
||||||
|
<span class="badge badge-primary" title="{{ t.description or '' }}">
|
||||||
|
{{ t.title }}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<span class="btn" title="{{ _("Reviews") }}">
|
||||||
|
<i class="fas fa-star-half-alt"></i>
|
||||||
|
<span class="count">
|
||||||
|
+{{ package.reviews | selectattr("recommends") | list | length }}
|
||||||
|
/
|
||||||
|
-{{ package.reviews | rejectattr("recommends") | list | length }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
<span class="btn" title="{{ _("Reviews") }}">
|
|
||||||
<i class="fas fa-star-half-alt"></i>
|
|
||||||
<span class="count">
|
|
||||||
+{{ package.reviews | selectattr("recommends") | list | length }}
|
|
||||||
/
|
|
||||||
-{{ package.reviews | rejectattr("recommends") | list | length }}
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user