diff --git a/app/scss/packagegrid.scss b/app/scss/packagegrid.scss index cc0b0de..28d6e8c 100644 --- a/app/scss/packagegrid.scss +++ b/app/scss/packagegrid.scss @@ -1,24 +1,17 @@ -.packagegrid { - display: flex; - flex-wrap: wrap; - flex-direction: row; - flex-grow: 1; - flex-shrink: 1; +.packagetile { + list-style: none; padding: 0; - margin: 0 -7px; + margin: 0 7px 7px 0; + min-width: 250px; } -.packagegrid li { - flex: 1; - display: block; - min-width: 300px; - min-height: 200px; - max-width: 332px; +li.d-flex { + list-style: none; padding: 0; - margin: 7px; + margin: 0; } -.packagegrid a { +.packagetile a { display: block; padding-bottom: 66.66%; border-radius: 7px; @@ -29,10 +22,6 @@ background-position: center; } -.packagegrid a:hover { - // box-shadow: 0px 0px 16px 6px rgba(0,0,0,0.4); -} - .packagegridscrub { position: absolute; top: 50%; @@ -63,15 +52,15 @@ font-weight: normal; } -.packagegrid a:hover .packagegridinfo { +.packagetile a:hover .packagegridinfo { top: 0; } -.packagegrid a:hover p { +.packagetile a:hover p { display: block; } -.packagegrid a:hover .packagegridscrub { +.packagetile a:hover .packagegridscrub { top: 0; background: rgba(0,0,0,0.8); } diff --git a/app/templates/macros/packagegridtile.html b/app/templates/macros/packagegridtile.html index 5eb680a..6c79ee6 100644 --- a/app/templates/macros/packagegridtile.html +++ b/app/templates/macros/packagegridtile.html @@ -1,5 +1,5 @@ {% macro render_pkgtile(package, show_author) -%} -
  • @@ -34,11 +34,18 @@ {% endmacro %} {% macro render_pkggrid(packages, show_author=True) -%} -
      +
        {% for p in packages %} {{ render_pkgtile(p, show_author) }} {% else %}
      • No packages available
      {% endfor %} + {% set amt=packages|length %} + {% if amt > 4 %} + {% set amt=4 %} + {% endif %} + {% for i in range(amt) %} +
    • + {% endfor %}
    {% endmacro %} diff --git a/app/views/__init__.py b/app/views/__init__.py index 412c236..6c19b0c 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -48,8 +48,8 @@ def send_upload(path): def home_page(): query = Package.query.filter_by(approved=True, soft_deleted=False) count = query.count() - new = query.order_by(db.desc(Package.created_at)).limit(15).all() - popular = query.order_by(db.desc(Package.score)).limit(6).all() + new = query.order_by(db.desc(Package.created_at)).limit(12).all() + popular = query.order_by(db.desc(Package.score)).limit(8).all() return render_template("index.html", new=new, popular=popular, count=count) from . import users, githublogin, packages, meta, threads, api diff --git a/app/views/packages/__init__.py b/app/views/packages/__init__.py index a3a4198..ff670ce 100644 --- a/app/views/packages/__init__.py +++ b/app/views/packages/__init__.py @@ -114,7 +114,7 @@ def packages_page(): return redirect("https://forum.minetest.net/viewtopic.php?t=" + str(topic.topic_id)) page = int(request.args.get("page") or 1) - num = min(42, int(request.args.get("n") or 100)) + num = min(40, int(request.args.get("n") or 100)) query = query.paginate(page, num, True) search = request.args.get("q")