diff --git a/app/blueprints/collections/__init__.py b/app/blueprints/collections/__init__.py index d3f12a5f..8397d610 100644 --- a/app/blueprints/collections/__init__.py +++ b/app/blueprints/collections/__init__.py @@ -30,6 +30,9 @@ from app.utils import is_package_page, nonempty_or_none, add_audit_log bp = Blueprint("collections", __name__) +regex_invalid_chars = re.compile("[^a-z0-9_]") + + @bp.route("/collections/") @bp.route("/collections//") def list_all(author=None): @@ -120,9 +123,6 @@ def create_edit(author=None, name=None): collection=collection, form=form) -regex_invalid_chars = re.compile("[^a-z_]") - - def handle_create_edit(collection: Collection, form: CollectionForm, initial_package: typing.Optional[Package], author: User): diff --git a/app/templates/base.html b/app/templates/base.html index 0e2c9b8f..34e08d17 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -266,6 +266,7 @@ {% endif %}
  • {{ _("User List") }}
  • {{ _("Threads") }}
  • +
  • {{ _("Collections") }}
  • {{ _("Support Packages") }}
  • {{ _("Source Code") }}
  • diff --git a/app/templates/collections/create_edit.html b/app/templates/collections/create_edit.html index e003097d..a0eac13e 100644 --- a/app/templates/collections/create_edit.html +++ b/app/templates/collections/create_edit.html @@ -33,7 +33,10 @@ {{ _("%(title)s by %(author)s", title=package.title, author=package.author.display_name) }} - {{ render_field(form.descriptions[loop.index - 1]) }} +

    + {{ package.short_desc }} +

    + {{ render_field(form.descriptions[loop.index - 1], hint=_("You can replace the description with your own")) }} {{ form.package_ids[loop.index - 1]() }} diff --git a/app/templates/collections/view.html b/app/templates/collections/view.html index 61282142..162e9ce1 100644 --- a/app/templates/collections/view.html +++ b/app/templates/collections/view.html @@ -8,6 +8,13 @@ {{ collection.short_description }} {%- endblock %} +{% block headextra %} + {% set thumb_url = collection.packages and collection.packages[0].get_thumb_url(3, True) %} + {% if thumb_url -%} + + {%- endif %} +{% endblock %} + {% block author_link -%} {{ collection.author.display_name }} @@ -59,6 +66,11 @@ {% endif %}
    {% for item in collection.items %} + {% set package_link %} + + {{ item.package.title }} + + {% endset %}
    @@ -66,9 +78,7 @@
    - - {{ item.package.title }} - + {{ _("%(title)s by %(author)s", title=package_link, author=item.package.author.display_name) }}

    {% if item.description %} diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html index f6112db4..fdb6d310 100644 --- a/app/templates/packages/view.html +++ b/app/templates/packages/view.html @@ -349,7 +349,7 @@

    {% if current_user.is_authenticated %} -
    +