diff --git a/apps/access/helpers.py b/apps/access/helpers.py index ee7a4bd8b7..9161bd31cf 100644 --- a/apps/access/helpers.py +++ b/apps/access/helpers.py @@ -6,6 +6,6 @@ import acl @register.function @jinja2.contextfunction -def check_ownership(context, object, require_owner): +def check_ownership(context, object, require_owner=False): return acl.check_ownership(context['request'], object, require_owner=require_owner) diff --git a/apps/bandwagon/models.py b/apps/bandwagon/models.py index 60f5b30535..d81f215fe2 100644 --- a/apps/bandwagon/models.py +++ b/apps/bandwagon/models.py @@ -140,6 +140,14 @@ class Collection(amo.models.ModelBase): return reverse('collections.vote', args=[self.author_nickname, self.slug, 'down']) + def edit_url(self): + return reverse('collections.edit', + args=[self.author_nickname, self.slug]) + + def delete_url(self): + return reverse('collections.delete', + args=[self.author_nickname, self.slug]) + @property def author_nickname(self): return self.author.nickname if self.author else 'anonymous' @@ -236,7 +244,7 @@ class Collection(amo.models.ModelBase): @caching.cached_method def publishable_by(self, user): - return bool(self.users.filter(pk=user.id)) + return bool(self.owned_by(user) or self.users.filter(pk=user.id)) @staticmethod def transformer(collections): diff --git a/apps/bandwagon/templates/bandwagon/ajax_new.html b/apps/bandwagon/templates/bandwagon/ajax_new.html index 1cd65e7270..2629dac1e8 100644 --- a/apps/bandwagon/templates/bandwagon/ajax_new.html +++ b/apps/bandwagon/templates/bandwagon/ajax_new.html @@ -1,4 +1,4 @@ -
+

{{ _('Start a New Collection') }}

diff --git a/apps/bandwagon/templates/bandwagon/barometer.html b/apps/bandwagon/templates/bandwagon/barometer.html index 88aec844cc..a4d1ca4d2e 100644 --- a/apps/bandwagon/templates/bandwagon/barometer.html +++ b/apps/bandwagon/templates/bandwagon/barometer.html @@ -3,13 +3,12 @@
-
- {# L10n: Link to remove a collection vote #} {{ _('Remove') }} + {# L10n: Link to remove a collection vote #} {% if user.is_anonymous() %}