From 08f67821d1c2002711f519b2f7a09c7a8b5c8c2e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 11 Feb 2010 22:16:58 -0600 Subject: Make the package files view look better Make it look more like the dependencies and required-by panes on the main package details page. Some day you might even find it shows up below there too via an AJAX call or something. Signed-off-by: Dan McGee --- templates/packages/files.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/packages/files.html b/templates/packages/files.html index 145bcf24..dc0c64b7 100644 --- a/templates/packages/files.html +++ b/templates/packages/files.html @@ -1,11 +1,16 @@ {% extends "base.html" %} -{% block title %}Pkg: {{ pkg.pkgname }} - Arch Linux Package File List{% endblock %} +{% block title %}Arch Linux - Package File List - {{ pkg.pkgname }}{% endblock %} {% block content %}
-

Viewing Files: {{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

- {% for file in files %} - {{ file.path }}
- {% endfor %} +

{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

+
+

Files:

+
    + {% for file in files %} +
  • {{ file.path }}
  • + {% endfor %} +
+
{% endblock %} -- cgit v1.2.3-54-g00ecf From e119c75838a0c91fd63c9b2aa2bb3940cd6eaee5 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 11 Feb 2010 22:18:02 -0600 Subject: Re-add link to package files Put the link that has been commented back on the page, and point it at the new URL for package files. Also fix the page title to be more in line with all the other pages on the site. Signed-off-by: Dan McGee --- templates/packages/details.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/packages/details.html b/templates/packages/details.html index 5c3c9497..f696231a 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -1,6 +1,5 @@ {% extends "base.html" %} -{% load package_extras %} -{% block title %}Pkg: {{ pkg.pkgname }} - Arch Linux Package Details{% endblock %} +{% block title %}Arch Linux - Package Details - {{ pkg.pkgname }}{% endblock %} {% block content %}

{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

@@ -9,7 +8,7 @@

{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

  • SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})
  • SVN Entries (trunk)
  • Bug Reports
  • - +
  • View File List
  • {% if pkg.needupdate %} This package has been flagged out-of-date -- cgit v1.2.3-54-g00ecf From 8314777c5858b8f9dd954ef906e19de1322a61d0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Feb 2010 10:08:04 -0600 Subject: Make files view AJAX if supported This will put the filelist inline on the package details page if using a capable browser. It should still fallback to a separate page if necessary (e.g. all those users using links on the site). Signed-off-by: Dan McGee --- packages/views.py | 5 ++++- templates/packages/details.html | 19 ++++++++++++++++++- templates/packages/files-ajax.html | 8 ++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 templates/packages/files-ajax.html (limited to 'templates') diff --git a/packages/views.py b/packages/views.py index 9956b6ce..c5f87865 100644 --- a/packages/views.py +++ b/packages/views.py @@ -182,7 +182,10 @@ def files(request, name='', repo='', arch=''): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) files = PackageFile.objects.filter(pkg=pkg).order_by('path') - return render_to_response('packages/files.html', RequestContext(request, {'pkg':pkg,'files':files})) + template = 'packages/files.html' + if request.is_ajax(): + template = 'packages/files-ajax.html' + return render_to_response(template, RequestContext(request, {'pkg':pkg,'files':files})) @permission_required('main.change_package') def unflag(request, pkgid): diff --git a/templates/packages/details.html b/templates/packages/details.html index f696231a..7e5216e3 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -8,7 +8,6 @@

    {{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

  • SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})
  • SVN Entries (trunk)
  • Bug Reports
  • -
  • View File List
  • {% if pkg.needupdate %} This package has been flagged out-of-date @@ -102,6 +101,24 @@

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

    +
    +

    Files:

    + +
  • + + {% endblock %} diff --git a/templates/packages/files-ajax.html b/templates/packages/files-ajax.html new file mode 100644 index 00000000..9b4c83ad --- /dev/null +++ b/templates/packages/files-ajax.html @@ -0,0 +1,8 @@ +
    +

    Files:

    +
      + {% for file in files %} +
    • {{ file.path }}
    • + {% endfor %} +
    +
    -- cgit v1.2.3-54-g00ecf From 7e1e5a5e8a2f3231d0878612508aba06f4397024 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Feb 2010 10:31:55 -0600 Subject: files: template reuse Get rid of the copy/paste by including the sub-template. Signed-off-by: Dan McGee --- packages/views.py | 2 +- templates/packages/files-ajax.html | 8 -------- templates/packages/files-list.html | 8 ++++++++ templates/packages/files.html | 9 +-------- 4 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 templates/packages/files-ajax.html create mode 100644 templates/packages/files-list.html (limited to 'templates') diff --git a/packages/views.py b/packages/views.py index e95d4a2b..8a2b4ec3 100644 --- a/packages/views.py +++ b/packages/views.py @@ -186,7 +186,7 @@ def files(request, name='', repo='', arch=''): files = PackageFile.objects.filter(pkg=pkg).order_by('path') template = 'packages/files.html' if request.is_ajax(): - template = 'packages/files-ajax.html' + template = 'packages/files-list.html' return render_to_response(template, RequestContext(request, {'pkg':pkg,'files':files})) @permission_required('main.change_package') diff --git a/templates/packages/files-ajax.html b/templates/packages/files-ajax.html deleted file mode 100644 index 9b4c83ad..00000000 --- a/templates/packages/files-ajax.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -

    Files:

    -
      - {% for file in files %} -
    • {{ file.path }}
    • - {% endfor %} -
    -
    diff --git a/templates/packages/files-list.html b/templates/packages/files-list.html new file mode 100644 index 00000000..9b4c83ad --- /dev/null +++ b/templates/packages/files-list.html @@ -0,0 +1,8 @@ +
    +

    Files:

    +
      + {% for file in files %} +
    • {{ file.path }}
    • + {% endfor %} +
    +
    diff --git a/templates/packages/files.html b/templates/packages/files.html index dc0c64b7..1d87246c 100644 --- a/templates/packages/files.html +++ b/templates/packages/files.html @@ -3,14 +3,7 @@ {% block content %}

    {{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}

    -
    -

    Files:

    -
      - {% for file in files %} -
    • {{ file.path }}
    • - {% endfor %} -
    -
    + {% include "packages/files-list.html" %}
    {% endblock %} -- cgit v1.2.3-54-g00ecf From ffa7ea1b1f276ba146be5a8533a1125ee947e433 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 27 Feb 2010 12:44:18 -0600 Subject: Show message if no files available Signed-off-by: Dan McGee --- templates/packages/details.html | 6 +++--- templates/packages/files-list.html | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/packages/details.html b/templates/packages/details.html index 7e5216e3..94e9f161 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -103,9 +103,9 @@

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

    Files:

    - +

    + View File List +

    diff --git a/templates/packages/files-list.html b/templates/packages/files-list.html index 9b4c83ad..d26a11e9 100644 --- a/templates/packages/files-list.html +++ b/templates/packages/files-list.html @@ -1,8 +1,12 @@

    Files:

    + {% if files.count %}
      {% for file in files %}
    • {{ file.path }}
    • {% endfor %}
    + {% else %} +

    No filelist available.

    + {% endif %}
    -- cgit v1.2.3-54-g00ecf