split up the /collection and /collections urls (bug 564317)
This commit is contained in:
Родитель
3505b866dc
Коммит
2bc653c937
|
@ -419,7 +419,8 @@
|
|||
{# TODO reverse URLs #}
|
||||
<form action="{{ remora_url('/collections/addtocollection') }}"
|
||||
method="post" id="coll_publish"
|
||||
data-coll-url="{{ remora_url('/collections') }}">
|
||||
data-detail-url="{{ remora_url('/collection') }}/"
|
||||
data-json-url="{{ remora_url('/collections/json') }}">
|
||||
<div>
|
||||
<a href="{{ remora_url('/collections/') }}" class="what">
|
||||
{{ _("What's this?", 'addons_display_a_license_what') }}</a>
|
||||
|
|
|
@ -330,6 +330,13 @@ class TestDetailPage(test_utils.TestCase):
|
|||
doc = pq(r.content)
|
||||
eq_(0, len(doc('.avatar')))
|
||||
|
||||
def test_collection_detal_url(self):
|
||||
self.client.login(username='regular@mozilla.com', password='password')
|
||||
r = self.client.get(reverse('addons.detail', args=[3615]))
|
||||
url = pq(r.content)('[data-detail-url]').attr('data-detail-url')
|
||||
eq_(url, '/en-US/firefox/collection/')
|
||||
test_collection_detal_url.xxx = 3
|
||||
|
||||
|
||||
class TestTagsBox(test_utils.TestCase):
|
||||
fixtures = ['base/addontag']
|
||||
|
|
|
@ -53,10 +53,9 @@ var addons_display = {
|
|||
|
||||
/* general initialization */
|
||||
$(document).ready(function() {
|
||||
var coll_url = $('#coll_publish').attr('data-coll-url');
|
||||
addons_display.init({
|
||||
jsonURL: coll_url+'/json',
|
||||
collViewURL: coll_url+'/',
|
||||
jsonURL: $('#coll_publish').attr('data-json-url'),
|
||||
collViewURL: $('#coll_publish').attr('data-detail-url'),
|
||||
loggedIn: $(document.body).attr('data-anonymous')
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче