From 91a36e65a3564d9fe265aaea90a895143764f2ba Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 09:32:27 -0500 Subject: Tweak sorting settings on stale relations page * Don't allow sorting of packages columns, doesn't make much sense * Default to sorting by pkgbase on all tables * Ensure all JS is executed inside doc.ready function (wow, how has this been wrong for so long?) Signed-off-by: Dan McGee --- templates/packages/stale_relations.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index f1ad4373..2b5af236 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -117,13 +117,13 @@ {% endblock %} -- cgit v1.2.3-2-g168b From 2f19529c922172007ff3894ad0e0fca0b3e33f5b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 13:48:07 -0500 Subject: Convert details sub-tempates to Jinja2 This is a start at improving performance of rendering the package details page, our most-visited and slowest page on the production website. The Django template system is not very efficient due to our heavy use of broken out templates and pulling of various attributes and such on related packages. Signed-off-by: Dan McGee --- templates/packages/details.html | 10 +++++----- templates/packages/details_depend.html | 13 ------------- templates/packages/details_depend.html.jinja | 13 +++++++++++++ templates/packages/details_link.html.jinja | 1 + templates/packages/details_relatedto.html | 2 -- templates/packages/details_relatedto.html.jinja | 3 +++ templates/packages/details_requiredby.html | 8 -------- templates/packages/details_requiredby.html.jinja | 8 ++++++++ 8 files changed, 30 insertions(+), 28 deletions(-) delete mode 100644 templates/packages/details_depend.html create mode 100644 templates/packages/details_depend.html.jinja create mode 100644 templates/packages/details_link.html.jinja delete mode 100644 templates/packages/details_relatedto.html create mode 100644 templates/packages/details_relatedto.html.jinja delete mode 100644 templates/packages/details_requiredby.html create mode 100644 templates/packages/details_requiredby.html.jinja (limited to 'templates') diff --git a/templates/packages/details.html b/templates/packages/details.html index bfa2de16..c4c1f6b2 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -134,19 +134,19 @@ {% with pkg.provides.all as all_related %}{% if all_related %} Provides: - {% include "packages/details_relatedto.html" %} + {% include "packages/details_relatedto.html.jinja" %} {% endif %}{% endwith %} {% with pkg.replaces.all as all_related %}{% if all_related %} Replaces: - {% include "packages/details_relatedto.html" %} + {% include "packages/details_relatedto.html.jinja" %} {% endif %}{% endwith %} {% with pkg.conflicts.all as all_related %}{% if all_related %} Conflicts: - {% include "packages/details_relatedto.html" %} + {% include "packages/details_relatedto.html.jinja" %} {% endif %}{% endwith %} {% with pkg.reverse_conflicts as rev_conflicts %}{% if rev_conflicts %} @@ -205,7 +205,7 @@

Dependencies ({{deps|length}})

{% if deps %}
    - {% for depend in deps %}{% include "packages/details_depend.html" %}{% endfor %} + {% for depend in deps %}{% include "packages/details_depend.html.jinja" %}{% endfor %}
{% endif %} {% endwith %} @@ -214,7 +214,7 @@

Required By ({{rqdby|length}})

{% if rqdby %}
    - {% for req in rqdby %}{% include "packages/details_requiredby.html" %}{% endfor %} + {% for req in rqdby %}{% include "packages/details_requiredby.html.jinja" %}{% endfor %}
{% endif %} {% endwith %} diff --git a/templates/packages/details_depend.html b/templates/packages/details_depend.html deleted file mode 100644 index b89ffbfa..00000000 --- a/templates/packages/details_depend.html +++ /dev/null @@ -1,13 +0,0 @@ -{% load package_extras %}
  • {% ifequal depend.pkg None %} -{% if depend.providers %}{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} ({% multi_pkg_details depend.providers %}) -{% else %}{{ depend.dep.name }}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} (virtual) -{% endif %}{% else %} -{% pkg_details_link depend.pkg %}{{ depend.dep.comparison|default:"" }}{{ depend.dep.version|default:"" }} -{% if depend.pkg.repo.testing %} (testing) -{% endif %}{% if depend.pkg.repo.staging %} (staging) -{% endif %}{% endifequal %} -{% if depend.dep.deptype == 'O' %} (optional) -{% endif %}{% if depend.dep.deptype == 'M' %} (make) -{% endif %}{% if depend.dep.deptype == 'C' %} (check) -{% endif %}{% if depend.dep.description %} - {{ depend.dep.description }} -{% endif %}
  • diff --git a/templates/packages/details_depend.html.jinja b/templates/packages/details_depend.html.jinja new file mode 100644 index 00000000..404793b6 --- /dev/null +++ b/templates/packages/details_depend.html.jinja @@ -0,0 +1,13 @@ +{% import 'packages/details_link.html.jinja' as details %}
  • {% if depend.pkg == None %} +{% if depend.providers %}{{ depend.dep.name }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }} ({% for pkg in depend.providers %}{{ details.details_link(pkg) }}{% if not loop.last %}, {% endif %}{% endfor %}) +{% else %}{{ depend.dep.name }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }} (virtual) +{% endif %}{% else %} +{{ details.details_link(depend.pkg) }}{{ depend.dep.comparison|default("") }}{{ depend.dep.version|default("") }} +{% if depend.pkg.repo.testing %} (testing) +{% endif %}{% if depend.pkg.repo.staging %} (staging) +{% endif %}{% endif %} +{% if depend.dep.deptype == 'O' %} (optional) +{% endif %}{% if depend.dep.deptype == 'M' %} (make) +{% endif %}{% if depend.dep.deptype == 'C' %} (check) +{% endif %}{% if depend.dep.description %} - {{ depend.dep.description }} +{% endif %}
  • diff --git a/templates/packages/details_link.html.jinja b/templates/packages/details_link.html.jinja new file mode 100644 index 00000000..b7e75fe5 --- /dev/null +++ b/templates/packages/details_link.html.jinja @@ -0,0 +1 @@ +{% macro details_link(pkg) %}{{ pkg.pkgname }}{% endmacro %} diff --git a/templates/packages/details_relatedto.html b/templates/packages/details_relatedto.html deleted file mode 100644 index e14375d3..00000000 --- a/templates/packages/details_relatedto.html +++ /dev/null @@ -1,2 +0,0 @@ -{% load package_extras %}{% for related in all_related %}{% with related.get_best_satisfier as best_satisfier %}{% ifequal best_satisfier None %}{{ related.name }}{% else %}{% pkg_details_link best_satisfier %}{% endifequal %}{{ related.comparison|default:"" }}{{ related.version|default:"" }}{% if not forloop.last %}, {% endif %} -{% endwith %}{% endfor %} diff --git a/templates/packages/details_relatedto.html.jinja b/templates/packages/details_relatedto.html.jinja new file mode 100644 index 00000000..955fdd37 --- /dev/null +++ b/templates/packages/details_relatedto.html.jinja @@ -0,0 +1,3 @@ +{% import 'packages/details_link.html.jinja' as details %}{% for related in all_related %}{% with best_satisfier = related.get_best_satisfier() %} +{% if best_satisfier == None %}{{ related.name }}{% else %}{{ details.details_link(best_satisfier) }}{% endif %}{{ related.comparison|default("") }}{{ related.version|default("") }}{% if not loop.last %}, {% endif %} +{% endwith %}{% endfor %} diff --git a/templates/packages/details_requiredby.html b/templates/packages/details_requiredby.html deleted file mode 100644 index 504a322f..00000000 --- a/templates/packages/details_requiredby.html +++ /dev/null @@ -1,8 +0,0 @@ -{% load package_extras %}
  • {% pkg_details_link req.pkg %} -{% if req.name != pkg.pkgname %} (requires {{ req.name }}) -{% endif %}{% if req.pkg.repo.testing %} (testing) -{% endif %}{% if req.pkg.repo.staging %} (staging) -{% endif %}{% if req.deptype == 'O' %} (optional) -{% endif %}{% if req.deptype == 'M' %} (make) -{% endif %}{% if req.deptype == 'C' %} (check) -{% endif %}
  • diff --git a/templates/packages/details_requiredby.html.jinja b/templates/packages/details_requiredby.html.jinja new file mode 100644 index 00000000..b083a7fc --- /dev/null +++ b/templates/packages/details_requiredby.html.jinja @@ -0,0 +1,8 @@ +{% import 'packages/details_link.html.jinja' as details %}
  • {{ details.details_link(req.pkg) }} +{% if req.name != pkg.pkgname %} (requires {{ req.name }}) +{% endif %}{% if req.pkg.repo.testing %} (testing) +{% endif %}{% if req.pkg.repo.staging %} (staging) +{% endif %}{% if req.deptype == 'O' %} (optional) +{% endif %}{% if req.deptype == 'M' %} (make) +{% endif %}{% if req.deptype == 'C' %} (check) +{% endif %}
  • -- cgit v1.2.3-2-g168b From fff9cf9c5537d9f758a9e30fcb18df800c70f051 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 15:17:56 -0500 Subject: Convert bulk of package details page to Jinja2 We wrap the whole thing in a Django template so we don't have to convert our base template to Jinja2 (or have one for each templating engine). This also simplifies the static stuff so we can just keep using the Django tags. Signed-off-by: Dan McGee --- templates/packages/details.html | 225 +--------------------------------- templates/packages/details.html.jinja | 221 +++++++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+), 224 deletions(-) create mode 100644 templates/packages/details.html.jinja (limited to 'templates') diff --git a/templates/packages/details.html b/templates/packages/details.html index c4c1f6b2..7a0f8e88 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -1,234 +1,11 @@ {% extends "base.html" %} {% load static from staticfiles %} -{% load package_extras %} -{% load pgp %} {% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} ({{ pkg.arch.name }}){% endblock %} {% block navbarclass %}anb-packages{% endblock %} -{% load package_extras %} {% block content %} -
    - -

    {{ pkg.pkgname }} {{ pkg.full_version }}

    - - - -
    - - - - - - - -
    - -
    - - - - - - - - - {% ifequal pkg.pkgname pkg.pkgbase %} - {% with pkg.split_packages as splits %}{% if splits %} - - - - - {% endif %}{% endwith %} - {% else %} - - - {% with pkg.base_package as base %}{% if base %} - - {% else %} - - {% endif %}{% endwith %} - - {% endifequal %} - - - - - - - - - - - {% with pkg.groups.all as groups %}{% if groups %} - - - - - {% endif %}{% endwith %} - {% with pkg.provides.all as all_related %}{% if all_related %} - - - - - {% endif %}{% endwith %} - {% with pkg.replaces.all as all_related %}{% if all_related %} - - - - - {% endif %}{% endwith %} - {% with pkg.conflicts.all as all_related %}{% if all_related %} - - - - - {% endif %}{% endwith %} - {% with pkg.reverse_conflicts as rev_conflicts %}{% if rev_conflicts %} - - - - - {% endif %}{% endwith %} - - - {% with pkg.maintainers as maints %} - - {% endwith %} - - - - - - - - - - - - - {% if pkg.signature %} - - - - - - {% else %} - - - {% endif %} - - - - {% if user.is_authenticated %}{% with pkg.flag_request as flag_request %}{% if flag_request %} - - - {% endif %}{% endwith %}{% endif %} -
    Architecture:{{ pkg.arch.name }}
    Repository:{{ pkg.repo.name|capfirst }}
    Split Packages:{% for s in splits %}{% pkg_details_link s %}{% if not forloop.last %}, {% endif %}{% endfor %}
    Base Package:{% pkg_details_link base %}{{ pkg.pkgbase }}
    Description:{{ pkg.pkgdesc|default:"" }}
    Upstream URL:{% if pkg.url %}{% endif %}
    License(s):{{ pkg.licenses.all|join:", " }}
    Groups:{% for g in groups %} - {{ g.name }}{% if not forloop.last %}, {% endif %}{% endfor %} -
    Provides:{% include "packages/details_relatedto.html.jinja" %}
    Replaces:{% include "packages/details_relatedto.html.jinja" %}
    Conflicts:{% include "packages/details_relatedto.html.jinja" %}
    Reverse Conflicts:{% for conflict in rev_conflicts %} - {% pkg_details_link conflict %}{% if not forloop.last %}, {% endif %}{% endfor %}
    Maintainers:{% if maints %} - {% for m in maints %} - {% maintainer_link m %}
    - {% endfor %} - {% else %}Orphan{% endif %} -
    Package Size:{{ pkg.compressed_size|filesizeformat }}
    Installed Size:{{ pkg.installed_size|filesizeformat }}
    Last Packager:{% with pkg.packager as pkgr %}{% if pkgr %}{% packager_link pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}
    Build Date:{{ pkg.build_date|date:"DATETIME_FORMAT" }} UTC
    Signed By:{% with pkg.signer as signer %}{% if signer %}{% pgp_key_link pkg.signature.key_id signer.get_full_name %}{% else %}Unknown ({% pgp_key_link pkg.signature.key_id %}){% endif %}{% endwith %}
    Signature Date:{{ pkg.signature.creation_time|date:"DATETIME_FORMAT" }} UTC
    Signed By:Unsigned
    Last Updated:{{ pkg.last_update|date:"DATETIME_FORMAT" }} UTC
    Last Flag Request:From {{ flag_request.who }} on {{ flag_request.created|date }}:
    -
    {{ flag_request.message|linebreaksbr|default:"{no message}" }}
    -
    - -
    - {% with pkg.get_depends as deps %} -
    -

    - Dependencies ({{deps|length}})

    - {% if deps %}
      - {% for depend in deps %}{% include "packages/details_depend.html.jinja" %}{% endfor %} -
    {% endif %} -
    - {% endwith %} - {% with pkg.get_requiredby as rqdby %} -
    -

    - Required By ({{rqdby|length}})

    - {% if rqdby %}
      - {% for req in rqdby %}{% include "packages/details_requiredby.html.jinja" %}{% endfor %} -
    {% endif %} -
    - {% endwith %} -
    -

    - Package Contents

    - -
    -
    -
    +{% include "packages/details.html.jinja" %} {% endblock %} {% block script_block %} diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja new file mode 100644 index 00000000..7ca5629c --- /dev/null +++ b/templates/packages/details.html.jinja @@ -0,0 +1,221 @@ +{% import 'packages/details_link.html.jinja' as details %} +
    +

    {{ pkg.pkgname }} {{ pkg.full_version }}

    + + + +
    + + + + + + + +
    + +
    + + + + + + + + + {% if pkg.pkgname == pkg.pkgbase %} + {% with splits = pkg.split_packages() %}{% if splits %} + + + + + {% endif %}{% endwith %} + {% else %} + + + {% with base = pkg.base_package %}{% if base %} + + {% else %} + + {% endif %}{% endwith %} + + {% endif %} + + + + + + + + + + + {% with groups = pkg.groups.all() %}{% if groups %} + + + + + {% endif %}{% endwith %} + {% with all_related = pkg.provides.all() %}{% if all_related %} + + + + + {% endif %}{% endwith %} + {% with all_related = pkg.replaces.all() %}{% if all_related %} + + + + + {% endif %}{% endwith %} + {% with all_related = pkg.conflicts.all() %}{% if all_related %} + + + + + {% endif %}{% endwith %} + {% with rev_conflicts = pkg.reverse_conflicts() %}{% if rev_conflicts %} + + + + + {% endif %}{% endwith %} + + + {% with maints = pkg.maintainers %} + + {% endwith %} + + + + + + + + + + + + + {% if pkg.signature %} + + + + + + {% else %} + + + {% endif %} + + + + {% if user.is_authenticated %}{% with flag_request = pkg.flag_request() %}{% if flag_request %} + + + {% endif %}{% endwith %}{% endif %} +
    Architecture:{{ pkg.arch.name }}
    Repository:{{ pkg.repo.name|capfirst }}
    Split Packages:{% for s in splits %}{{ details.details_link(s) }}{% if not loop.last %}, {% endif %}{% endfor %}
    Base Package:{{ details.details_link(base) }}{{ pkg.pkgbase }}
    Description:{{ pkg.pkgdesc|default("") }}
    Upstream URL:{% if pkg.url %}{% endif %}
    License(s):{{ pkg.licenses.all()|join(", ") }}
    Groups:{% for g in groups %} + {{ g.name }}{% if not loop.last %}, {% endif %}{% endfor %} +
    Provides:{% include "packages/details_relatedto.html.jinja" %}
    Replaces:{% include "packages/details_relatedto.html.jinja" %}
    Conflicts:{% include "packages/details_relatedto.html.jinja" %}
    Reverse Conflicts:{% for conflict in rev_conflicts %} + {{ details.details_link(conflict) }}{% if not loop.last %}, {% endif %}{% endfor %}
    Maintainers:{% if maints %} + {% for m in maints %} + {{ maintainer_link(m)|safe }}
    + {% endfor %} + {% else %}Orphan{% endif %} +
    Package Size:{{ pkg.compressed_size|filesizeformat }}
    Installed Size:{{ pkg.installed_size|filesizeformat }}
    Last Packager:{% with pkgr = pkg.packager %}{% if pkgr %}{{ packager_link(pkgr)|safe }}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}
    Build Date:{{ pkg.build_date|date("DATETIME_FORMAT") }} UTC
    Signed By:{% with signer = pkg.signer %}{% if signer %}{{ pgp_key_link(pkg.signature.key_id, signer.get_full_name())|safe }}{% else %}Unknown ({{ pgp_key_link(pkg.signature.key_id)|safe }}){% endif %}{% endwith %}
    Signature Date:{{ pkg.signature.creation_time|date("DATETIME_FORMAT") }} UTC
    Signed By:Unsigned
    Last Updated:{{ pkg.last_update|date("DATETIME_FORMAT") }} UTC
    Last Flag Request:From {{ flag_request.who() }} on {{ flag_request.created|date }}:
    +
    {{ flag_request.message|linebreaksbr|default("{no message}") }}
    +
    + +
    + {% with deps = pkg.get_depends() %} +
    +

    + Dependencies ({{deps|length}})

    + {% if deps %}
      + {% for depend in deps %}{% include "packages/details_depend.html.jinja" %}{% endfor %} +
    {% endif %} +
    + {% endwith %} + {% with rqdby = pkg.get_requiredby() %} +
    +

    + Required By ({{rqdby|length}})

    + {% if rqdby %}
      + {% for req in rqdby %}{% include "packages/details_requiredby.html.jinja" %}{% endfor %} +
    {% endif %} +
    + {% endwith %} +
    +

    + Package Contents

    + +
    +
    +
    -- cgit v1.2.3-2-g168b From 122302e9e5fb9752a942abe5691ad3dd6d186196 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 15:36:56 -0500 Subject: Move maintainer/packager link code back into template Signed-off-by: Dan McGee --- templates/packages/details.html.jinja | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 7ca5629c..52d13f14 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -149,11 +149,10 @@ Maintainers: {% with maints = pkg.maintainers %} - {% if maints %} - {% for m in maints %} - {{ maintainer_link(m)|safe }}
    - {% endfor %} - {% else %}Orphan{% endif %} + {% if maints %}{% for m in maints %} + {{ m.get_full_name() }}
    + {% endfor %}{% else %}Orphan{% endif %} {% endwith %} @@ -164,7 +163,10 @@ {{ pkg.installed_size|filesizeformat }} Last Packager: - {% with pkgr = pkg.packager %}{% if pkgr %}{{ packager_link(pkgr)|safe }}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %} + {% with pkgr = pkg.packager %}{% if pkgr %} + {{ pkgr.get_full_name() }} + {% else %}{{ pkg.packager_str }}{% endif %}{% endwith %} Build Date: {{ pkg.build_date|date("DATETIME_FORMAT") }} UTC -- cgit v1.2.3-2-g168b From 4def86ec76d9975be8a357b6fc06104cc2b31fed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 18:03:42 -0500 Subject: Package search HTML cleanups Signed-off-by: Dan McGee --- templates/packages/search.html | 15 ++++----------- templates/packages/search_paginator.html | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index d312c374..db86fb67 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -2,7 +2,7 @@ {% load cycle from future %} {% load package_extras %} -{% block title %}Arch Linux - Package Database{% endblock %} +{% block title %}Arch Linux - Package Search{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block head %} @@ -12,10 +12,7 @@ {% block content %} - - + {% if package_list %}
    {% include "packages/search_paginator.html" %}
    {% csrf_token %} - @@ -96,10 +91,8 @@

    {% endif %} - - - + {% else %}

    We couldn't find any packages matching your query. Try searching again diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 3c368b82..4c2bef03 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -22,6 +22,6 @@

    {% else %} -

    {{ package_list.count }} packages found.

    +

    {{ package_list|length }} packages found.

    {% endif %} -- cgit v1.2.3-2-g168b From 061805aa73d3d5b418a61fa6d6591d1a7d03d9ed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 18:28:26 -0500 Subject: FS#30773: put exact matches at top There have been a few proposed solutions to this, but there really isn't anything without a drawback. Things break pagination, require loading the entire result set from the database, etc. Just plop a new table on the page if someone did a so-called "simple" search and we have a match. Only show on the first page of the search results. This results in a relatively fast experience for someone doing something like searching for the "perl" package. Signed-off-by: Dan McGee --- templates/packages/search.html | 36 ++++++++++++++++++++++++++++++++ templates/packages/search_paginator.html | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index db86fb67..ca95c3f0 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -40,6 +40,42 @@ +{% if not is_paginated or page_obj.number == 1 %}{% with search_form.exact_matches as exact_matches %}{% if exact_matches %} +
    +
    +

    {{ exact_matches|length }} exact match{{ exact_matches|pluralize:"es" }} found.

    +
    +
    + + + + + + + + + + + + + {% for pkg in exact_matches %} + + + + {% if pkg.flag_date %} + + {% else %} + + {% endif %} + + + + {% endfor %} + +
    ArchRepoNameVersionDescriptionLast UpdatedFlag Date
    {{ pkg.arch.name }}{{ pkg.repo.name|capfirst }}{% pkg_details_link pkg %}{{ pkg.full_version }}{{ pkg.full_version }}{{ pkg.pkgdesc }}{{ pkg.last_update|date }}{{ pkg.flag_date|date }}
    +
    +{% endif %}{% endwith %}{% endif %} + {% if package_list %}
    {% include "packages/search_paginator.html" %} diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 4c2bef03..a748d26b 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -1,6 +1,6 @@
    {% if is_paginated %} -

    {{ paginator.count }} packages found. +

    {{ paginator.count }} matching packages found. Page {{ page_obj.number }} of {{ paginator.num_pages }}.

    @@ -22,6 +22,6 @@
    {% else %} -

    {{ package_list|length }} packages found.

    +

    {{ package_list|length }} matching package{{ package_list|pluralize }} found.

    {% endif %}
    -- cgit v1.2.3-2-g168b From 15a27036a51d71f6f0bc4f15ae4e79b5b4de6637 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 18:43:24 -0500 Subject: Fix colspan values Signed-off-by: Dan McGee --- templates/packages/stale_relations.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index 2b5af236..2dafc2be 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -37,7 +37,7 @@ {{ relation.created }} {% empty %} - No inactive user relations. + No inactive user relations. {% endfor %} @@ -66,7 +66,7 @@ {{ relation.last_update.created }} {% empty %} - No non-existent pkgbase relations. + No non-existent pkgbase relations. {% endfor %} @@ -100,7 +100,7 @@ {{ relation.repositories|join:", " }} {% empty %} - No relations with wrong permissions. + No relations with wrong permissions. {% endfor %} -- cgit v1.2.3-2-g168b From 21b8ff5cf2b60f862e3fc3cfb43d8d8af0d6189f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 19:21:26 -0500 Subject: Tweak search results page a bit more Signed-off-by: Dan McGee --- templates/packages/search.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index ca95c3f0..d4a47b26 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -58,7 +58,8 @@ - {% for pkg in exact_matches %} + {% for pkg in exact_matches %} + {{ pkg.arch.name }} {{ pkg.repo.name|capfirst }} {% pkg_details_link pkg %} @@ -70,13 +71,13 @@ {{ pkg.pkgdesc }} {{ pkg.last_update|date }} {{ pkg.flag_date|date }} - {% endfor %} + + {% endfor %}
    {% endif %}{% endwith %}{% endif %} -{% if package_list %}
    {% include "packages/search_paginator.html" %}
    {% csrf_token %} @@ -101,7 +102,8 @@ - {% for pkg in package_list %} + {% for pkg in package_list %} + {% if perms.main.change_package %} {% endif %} @@ -116,7 +118,10 @@ {{ pkg.pkgdesc }} {{ pkg.last_update|date }} {{ pkg.flag_date|date }} - {% endfor %} + + {% empty %} + No matching packages found + {% endfor %} {% include "packages/search_paginator.html" %} @@ -129,21 +134,16 @@ {% endif %}
    -{% else %} -
    -

    We couldn't find any packages matching your query. Try searching again + +

    +

    Can't find what you are looking for? Try searching again using different criteria, or try {% if search_form.q.data %} searching the AUR {% else %}searching the AUR{% endif %} to see if the package can be found there.

    -
    -{% endif %} -

    You are browsing the Arch Linux package database. From here you can find - detailed information about packages located in the official supported repositories. - For unsupported packages, browse the Arch User Repository (AUR).

    + detailed information about packages located in the official supported repositories.

    {% endblock %} -- cgit v1.2.3-2-g168b From ff09c7877e58ddadaf677bf133cd110711bbc5a8 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Oct 2014 10:39:03 -0500 Subject: Fix function vs. property reference in Jinja template Signed-off-by: Dan McGee --- templates/packages/details.html.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 52d13f14..0b5d0ae8 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -93,7 +93,7 @@ {% else %} Base Package: - {% with base = pkg.base_package %}{% if base %} + {% with base = pkg.base_package() %}{% if base %} {{ details.details_link(base) }} {% else %} Date: Sun, 19 Oct 2014 11:00:20 -0500 Subject: Fix Jinja2 render in no-packager case Signed-off-by: Dan McGee --- templates/packages/details.html.jinja | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 0b5d0ae8..21be80f5 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -69,10 +69,10 @@ - -
    + + {% if pkg.packager %}
    -
    +
    {% endif %} -- cgit v1.2.3-2-g168b From 9589a7eadeb05e82c2d63f6fe128316fdb6dcc8a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Oct 2014 11:14:26 -0500 Subject: Convert package files view to Jinja2 This is another one we spend a lot of time rendering, and packges like sage-mathematics with 80,000+ files can really make the Django template engine grind. Signed-off-by: Dan McGee --- templates/packages/files.html | 2 +- templates/packages/files_list.html | 16 ---------------- templates/packages/files_list.html.jinja | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 templates/packages/files_list.html create mode 100644 templates/packages/files_list.html.jinja (limited to 'templates') diff --git a/templates/packages/files.html b/templates/packages/files.html index 3e718ed0..879fcbff 100644 --- a/templates/packages/files.html +++ b/templates/packages/files.html @@ -9,7 +9,7 @@

    Package has {{ files_count }} file{{ files_count|pluralize }} and {{ dir_count }} director{{ dir_count|pluralize:"y,ies" }}.

    Back to Package

    - {% include "packages/files_list.html" %} + {% include "packages/files_list.html.jinja" %}
    diff --git a/templates/packages/files_list.html b/templates/packages/files_list.html deleted file mode 100644 index 93a2c847..00000000 --- a/templates/packages/files_list.html +++ /dev/null @@ -1,16 +0,0 @@ -{% if pkg.last_update > pkg.files_last_update %} -

    Note: This file list was generated from a previous version -of the package; it may be out of date.

    -{% endif %} -{% if pkg.files_last_update %} -{% if files|length %} -
      -{% for file in files %} -
    • {{ file.directory }}{{ file.filename|default:'' }}
    • {% endfor %} -
    -{% else %} -

    Package has no files.

    -{% endif %} -{% else %} -

    No file list available.

    -{% endif %} diff --git a/templates/packages/files_list.html.jinja b/templates/packages/files_list.html.jinja new file mode 100644 index 00000000..c8fc3b1a --- /dev/null +++ b/templates/packages/files_list.html.jinja @@ -0,0 +1,16 @@ +{% if pkg.last_update > pkg.files_last_update %} +

    Note: This file list was generated from a previous version +of the package; it may be out of date.

    +{% endif %} +{% if pkg.files_last_update %} +{% if files|length %} +
      +{% for file in files %} +
    • {{ file.directory }}{{ file.filename|default('') }}
    • {% endfor %} +
    +{% else %} +

    Package has no files.

    +{% endif %} +{% else %} +

    No file list available.

    +{% endif %} -- cgit v1.2.3-2-g168b From f7d1940a731370ceee6e1c6eaae2cc2f5bab0432 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Oct 2014 18:30:32 -0500 Subject: Remove usage of templates for RSS feeds Signed-off-by: Dan McGee --- templates/feeds/news_description.html | 2 -- templates/feeds/packages_title.html | 1 - 2 files changed, 3 deletions(-) delete mode 100644 templates/feeds/news_description.html delete mode 100644 templates/feeds/packages_title.html (limited to 'templates') diff --git a/templates/feeds/news_description.html b/templates/feeds/news_description.html deleted file mode 100644 index 61ceedf3..00000000 --- a/templates/feeds/news_description.html +++ /dev/null @@ -1,2 +0,0 @@ -

    {{obj.author.get_full_name}} wrote:

    -{{ obj.html }} diff --git a/templates/feeds/packages_title.html b/templates/feeds/packages_title.html deleted file mode 100644 index f92ac684..00000000 --- a/templates/feeds/packages_title.html +++ /dev/null @@ -1 +0,0 @@ -{{ obj.pkgname }} {{ obj.full_version }} {{ obj.arch.name }} \ No newline at end of file -- cgit v1.2.3-2-g168b From f9f8683799ef96904a7165adcfdeb0d13cb7ff61 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 20 Oct 2014 07:55:24 -0500 Subject: Fix display of flag requests for non-logged-in users More Jinja2 conversion fallout, whoops. Signed-off-by: Dan McGee --- templates/packages/details.html.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 21be80f5..2215f8dc 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -183,7 +183,7 @@
    - {% if user.is_authenticated %}{% with flag_request = pkg.flag_request() %}{% if flag_request %} + {% if user.is_authenticated() %}{% with flag_request = pkg.flag_request() %}{% if flag_request %} -- cgit v1.2.3-2-g168b From abb3a507a1e8f218b5225d3e00187808e323e48a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Oct 2014 21:12:24 -0500 Subject: Move all homepage JavaScript into single file We had two small files plus a handful of inline stuff in the HTML; move as much of it as possible into a single static file. Signed-off-by: Dan McGee --- templates/public/index.html | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'templates') diff --git a/templates/public/index.html b/templates/public/index.html index 89486be8..d815363b 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -214,44 +214,8 @@ {% load cdn %}{% jquery %} {% endblock %} -- cgit v1.2.3-2-g168b From 651678be2b6208cbfb45e11f5f390d66cf3eb8a6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 24 Oct 2014 13:50:38 -0500 Subject: Reorganize sidebar links involving people Signed-off-by: Dan McGee --- templates/public/index.html | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'templates') diff --git a/templates/public/index.html b/templates/public/index.html index d815363b..3b17803c 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -108,7 +108,6 @@ {% cache 115 main-page-right secure %}
    -- cgit v1.2.3-2-g168b From 02ffa37f8607634e5e4eccba7ef25d4f48b29b3b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 13 Apr 2015 21:01:41 -0400 Subject: Catch an instance of "Arch Linux" in packages/details.html --- templates/packages/details.html.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 21be80f5..3632ecf0 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -69,7 +69,7 @@ - + {% if pkg.packager %}
    {% endif %} -- cgit v1.2.3-2-g168b From 65e3ef63f7475a217da5205a788f52f3888ebea7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 14 Apr 2015 02:17:54 -0400 Subject: Replace usage of parabolagnulinux.org with parabola.nu, also replace repo.parabola.nu/isos/ with /iso/, in settings.py --- templates/packages/search.html | 2 +- templates/public/art.html | 2 +- templates/public/https.html | 2 +- templates/public/index.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/packages/search.html b/templates/packages/search.html index 7509864e..41e36193 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -141,7 +141,7 @@

    You are browsing the {{ BRANDING_DISTRONAME }} package database. From here you can find detailed information about packages located in the official supported repositories. If you need the sourceball from where a package is built, you can look at our sources repo.

    {% endblock %} diff --git a/templates/public/art.html b/templates/public/art.html index 80c5ac95..32acc172 100644 --- a/templates/public/art.html +++ b/templates/public/art.html @@ -10,7 +10,7 @@

    You can help by creating artwork for {{ BRANDING_DISTRONAME }}.

    -

    Send your designs to dev@lists.parabolagnulinux.org and state they are CC-by-sa +

    Send your designs to dev@lists.parabola.nu and state they are CC-by-sa or another free culture friendly license.

    {% comment %} diff --git a/templates/public/https.html b/templates/public/https.html index df3e2c73..88056346 100644 --- a/templates/public/https.html +++ b/templates/public/https.html @@ -11,7 +11,7 @@ is the only page on the whole site that can be accessed without a secure connection, all other pages will redirect to the secure version.

    -

    Enter the secure site

    +

    Enter the secure site

    But my browser says the secure site is untrusted

    diff --git a/templates/public/index.html b/templates/public/index.html index 6ef6b4bf..64d19e6d 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -28,9 +28,9 @@

    Our community is friendly and helpful. Please hop on IRC channel and check out our - mailing + mailing lists to get your feet wet. Also glance through our - wiki if you want to learn + wiki if you want to learn more about Parabola.

    Architecture:Last Updated: {{ pkg.last_update|date("DATETIME_FORMAT") }} UTC
    Last Flag Request: From {{ flag_request.who() }} on {{ flag_request.created|date }}:
    {{ flag_request.message|linebreaksbr|default("{no message}") }}