diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-04-20 21:45:40 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-04-20 22:45:20 +0800 |
commit | 5d0140ef04ababd93c45b5126ee1b412bd778da5 (patch) | |
tree | ef1c8adf417e7c1d4e556d50877dfaf4e1f263aa /templates | |
parent | 627f5aca263da2513fe6d592becd3b505d97dd21 (diff) | |
download | patchwork-5d0140ef04ababd93c45b5126ee1b412bd778da5.tar patchwork-5d0140ef04ababd93c45b5126ee1b412bd778da5.tar.gz |
bundles: Remove separate public bundle views
Having two views for bundles (public and non-public) can cause confusion
when bundle owners want to share a URL; it's not obvious that the
private URL isn't shareable.
This change removes the private URLs, and puts all bundles under the
/bundle/<username>/<bundlename>/ URL space. For non-public bundles, this
will just 404 for non-owners.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/patchwork/bundle-public.html | 20 | ||||
-rw-r--r-- | templates/patchwork/bundle.html | 9 | ||||
-rw-r--r-- | templates/patchwork/bundles.html | 5 | ||||
-rw-r--r-- | templates/patchwork/profile.html | 3 |
4 files changed, 8 insertions, 29 deletions
diff --git a/templates/patchwork/bundle-public.html b/templates/patchwork/bundle-public.html deleted file mode 100644 index 1a0347f..0000000 --- a/templates/patchwork/bundle-public.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "base.html" %} - -{% load person %} - -{% block title %}{{project.name}}{% endblock %} -{% block heading %}bundle: {{bundle.owner.username}} / -{{bundle.name}}{% endblock %} - -{% block body %} - -<p>This bundle contains patches for the {{ bundle.project.linkname }} -project.</p> - -<p><a -href="{% url patchwork.views.bundle.public_mbox username=bundle.owner.username bundlename=bundle.name %}" ->Download bundle as mbox</a></p> - -{% include "patchwork/patch-list.html" %} - -{% endblock %} diff --git a/templates/patchwork/bundle.html b/templates/patchwork/bundle.html index a2933d5..54c2fcc 100644 --- a/templates/patchwork/bundle.html +++ b/templates/patchwork/bundle.html @@ -14,17 +14,17 @@ </script> {% endblock %} {% block title %}{{project.name}}{% endblock %} -{% block heading %}bundle: {{bundle.name}}{% endblock %} +{% block heading %}bundle: {{bundle.owner.username}} / +{{bundle.name}}{% endblock %} {% block body %} <p>This bundle contains patches for the {{ bundle.project.linkname }} project.</p> -<p><a href="{% url patchwork.views.bundle.mbox bundle_id=bundle.id %}" ->Download bundle as mbox</a></p> - +<p><a href="{% url patchwork.views.bundle.mbox username=bundle.owner.username bundlename=bundle.name %}">Download bundle as mbox</a></p> +{% if bundleform %} <form method="post"> {% csrf_token %} <input type="hidden" name="form" value="bundle"/> @@ -45,6 +45,7 @@ project.</p> </form> <div style="clear: both; padding: 1em;"></div> +{% endif %} {% include "patchwork/patch-list.html" %} diff --git a/templates/patchwork/bundles.html b/templates/patchwork/bundles.html index 5340a64..3624f81 100644 --- a/templates/patchwork/bundles.html +++ b/templates/patchwork/bundles.html @@ -17,8 +17,7 @@ </tr> {% for bundle in bundles %} <tr> - <td><a href="{% url patchwork.views.bundle.bundle bundle_id=bundle.id %}" - >{{ bundle.name }}</a></td> + <td><a href="{{ bundle.get_absolute_url }}">{{ bundle.name }}</a></td> <td>{{ bundle.project.linkname }}</td> <td> {% if bundle.public %} @@ -27,7 +26,7 @@ </td> <td style="text-align: right">{{ bundle.n_patches }}</td> <td style="text-align: center;"><a - href="{% url patchwork.views.bundle.mbox bundle_id=bundle.id %}" + href="{% url patchwork.views.bundle.mbox username=bundle.owner.username bundlename=bundle.name %}" ><img src="/images/16-em-down.png" width="16" height="16" alt="download" title="download"/></a></td> <td style="text-align: center;"> diff --git a/templates/patchwork/profile.html b/templates/patchwork/profile.html index 130b947..c02845b 100644 --- a/templates/patchwork/profile.html +++ b/templates/patchwork/profile.html @@ -104,8 +104,7 @@ address.</p> <p>You have the following bundle{{ bundle|length|pluralize }}:</p> <ul> {% for bundle in bundles %} - <li><a href="{% url patchwork.views.bundle.bundle bundle_id=bundle.id %}" - >{{ bundle.name }}</a></li> + <li><a href="{{ bundle.get_absolute_url }}">{{ bundle.name }}</a></li> {% endfor %} </ul> <p>Visit the <a href="{%url patchwork.views.bundle.bundles %}">bundles |