diff --git a/media/js/src/modules/snipt.js b/media/js/src/modules/snipt.js index 8a8b136..6c17ee2 100644 --- a/media/js/src/modules/snipt.js +++ b/media/js/src/modules/snipt.js @@ -607,7 +607,7 @@ var $public = $('div.public', $el); var $blog_post = $('div.blog-post', $el); var $publish_date = $('div.publish-date', $el); - var $user = $('li.author a', $el); + var $user = $('li.author > a', $el); var is_public = $public.text() === 'True' ? true : false; var is_blog_post = $blog_post.text() === 'True' ? true : false; diff --git a/snipts/templates/snipts/snipt-js-template.html b/snipts/templates/snipts/snipt-js-template.html index 13be6e1..5ce5420 100644 --- a/snipts/templates/snipts/snipt-js-template.html +++ b/snipts/templates/snipts/snipt-js-template.html @@ -72,7 +72,9 @@ <%= snipt.user.username %> - <% if (window.user_has_pro) { %> + <% if (window.teams.indexOf(snipt.user.username) !== -1) { %> + Team + <% } else if (window.user_has_pro) { %> Pro <% } %> diff --git a/templates/base.html b/templates/base.html index 2919ed5..beabd2b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -386,6 +386,11 @@ window.user_ip = '{{ request.META.REMOTE_ADDR }}'; window.user_profile_id = {% firstof request.user.profile.id 'null' %}; window.user_email = '{{ request.user.email }}'; + window.teams = [ + {% for team in request.user.profile.teams %} + '{{ team.slug }}', + {% endfor %} + ] {% if public %} window.pub = {{ public|lower }};