diff --git a/pillar/web/nodes/custom/comments.py b/pillar/web/nodes/custom/comments.py index f61fae8a..14cc036f 100644 --- a/pillar/web/nodes/custom/comments.py +++ b/pillar/web/nodes/custom/comments.py @@ -134,7 +134,7 @@ def comments_for_node(node_id): project = Project({'_id': node.project}) can_post_comments = project.node_type_has_method('comment', 'POST', api=api) can_comment_override = request.args.get('can_comment', 'True') == 'True' - can_post_comments = can_post_comments and can_comment_override + can_post_comments = can_post_comments and can_comment_override and current_user.has_cap('subscriber') # Query for all children, i.e. comments on the node. comments = Node.all({ diff --git a/src/templates/_macros/_menu.pug b/src/templates/_macros/_menu.pug index 6fa73729..88ebba4d 100644 --- a/src/templates/_macros/_menu.pug +++ b/src/templates/_macros/_menu.pug @@ -40,6 +40,11 @@ li(class="dropdown") title="View subscription info") i.pi-heart-filled span You have a free account. + | {% elif current_user.has_cap('can-renew-subscription') %} + a.navbar-item(target='_blank', href="/renew", title="Renew subscription") + i.pi-heart + span.info Your subscription is not active. + span.renew Click here to renew. | {% else %} a.navbar-item( href="https://store.blender.org/product/membership/" diff --git a/src/templates/errors/layout.pug b/src/templates/errors/layout.pug index 0335f77b..50ddefb8 100644 --- a/src/templates/errors/layout.pug +++ b/src/templates/errors/layout.pug @@ -2,7 +2,7 @@ doctype html(lang="en") head meta(charset="utf-8") - title Error + title {% block title %}Error{% endblock %} meta(name="viewport", content="width=device-width, initial-scale=1.0") link(href="{{ url_for('static_pillar', filename='assets/ico/favicon.png') }}", rel="shortcut icon") @@ -10,7 +10,7 @@ html(lang="en") link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css') }}", rel="stylesheet") link(href="{{ url_for('static_pillar', filename='assets/css/base.css') }}", rel="stylesheet") link(href='//fonts.googleapis.com/css?family=Roboto:300,400', rel='stylesheet', type='text/css') + | {% block head %}{% endblock %} body.error | {% block body %}{% endblock %} - diff --git a/src/templates/nodes/custom/_node_details.pug b/src/templates/nodes/custom/_node_details.pug index 511815d1..a4384169 100644 --- a/src/templates/nodes/custom/_node_details.pug +++ b/src/templates/nodes/custom/_node_details.pug @@ -74,6 +74,15 @@ | Download | {% endif %} + | {% elif current_user.has_cap('can-renew-subscription') %} + li.download + a.btn.btn-success( + title="Renew your subscription to download", + target="_blank", + href="/renew") + i.pi-heart + | Renew subscription to download + | {% elif current_user.is_authenticated %} li.download a.btn( diff --git a/src/templates/nodes/custom/asset/video/view_embed.pug b/src/templates/nodes/custom/asset/video/view_embed.pug index 528ef3b5..ae1faf90 100644 --- a/src/templates/nodes/custom/asset/video/view_embed.pug +++ b/src/templates/nodes/custom/asset/video/view_embed.pug @@ -27,8 +27,14 @@ span small Support Blender and get awesome stuff! hr - a.subscribe(href="{{ url_for('cloud.join') }}") Subscribe + | {% if current_user.has_cap('can-renew-subscription') %} + a.subscribe(href="/renew") You have a subscription, it just needs to be renewed. Renew your subscription now! + | {% else %} + a.subscribe(href="{{ url_for('cloud.join') }}") Subscribe to Blender Cloud. + | {% endif %} + | {% if current_user.is_anonymous %} a(href="{{ url_for('users.login') }}") Already a subscriber? Log in + | {% endif %} | {% endif %} diff --git a/src/templates/nodes/custom/comment/list_embed.pug b/src/templates/nodes/custom/comment/list_embed.pug index 79b167c2..bdc1c910 100644 --- a/src/templates/nodes/custom/comment/list_embed.pug +++ b/src/templates/nodes/custom/comment/list_embed.pug @@ -49,6 +49,9 @@ | {% if current_user.has_cap('subscriber') %} i.pi-lock | Only project members can comment. + | {% elif current_user.has_cap('can-renew-subscription') %} + i.pi-heart + a(href='/renew', target='_blank') Renew your subscription to join the conversation! | {% else %} | Join the conversation! Subscribe to Blender Cloud now. | {% endif %} diff --git a/src/templates/projects/index_dashboard.pug b/src/templates/projects/index_dashboard.pug index 67b313c8..41b3136a 100644 --- a/src/templates/projects/index_dashboard.pug +++ b/src/templates/projects/index_dashboard.pug @@ -40,12 +40,17 @@ meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/ba | {% endif %} | {% if current_user.has_cap('subscriber') %} - li.create( + li.create#project-create( data-url="{{ url_for('projects.create') }}") - a.btn.btn-success#project-create( + a.btn.btn-success( href="{{ url_for('projects.create') }}") i.pi-plus | Create Project + | {% elif current_user.has_cap('can-renew-subscription') %} + li.create + a.btn(href="/renew", target="_blank") + i.pi-heart + | Renew subscription to create a project | {% endif %} nav.nav-tabs__tab.active#own_projects @@ -83,6 +88,13 @@ meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/ba .projects__list-details a.title(href="{{ url_for('projects.create') }}") | Create a project to get started! + | {% elif current_user.has_cap('can-renew-subscription') %} + li.projects__list-item(data-url="https://store.blender.org/renew-my-subscription.php") + a.projects__list-thumbnail + i.pi-plus + .projects__list-details + a.title(href="https://store.blender.org/renew-my-subscription.php") + | Renew your Blender Cloud subscription to create your own projects! | {% else %} li.projects__list-item(data-url="/join") a.projects__list-thumbnail @@ -222,7 +234,7 @@ script. }); // Create project - $nav_tabs_list.find('li.create').on('click', function(e){ + $('#project-create').on('click', function(e){ e.preventDefault(); $(this).addClass('disabled');