New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix communities creation check #187
Fix communities creation check #187
Conversation
<h2> | ||
{{ _('My communities') }} | ||
<div class="pull-right"> | ||
<a href="{{url_for('.new')}}" class="btn btn-primary"><i class="icon-plus-sign"></i> {{ _('New') }}</a> | ||
<a href="{{url_for('.new')}}" class="btn btn-primary" {{ "disabled" if not can_user_create_community(current_user) }}><i class="icon-plus-sign"></i> {{ _('New') }}</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a href="{{url_for('.new')}}" class="btn btn-primary" {{ "disabled" if not can_user_create_community(current_user) }}><i class="icon-plus-sign"></i> {{ _('New') }}</a> | |
<a href="{{url_for('.new')}}" class="btn btn-primary {{ "disabled" if not can_user_create_community(current_user) }}" {{ "disabled" if not can_user_create_community(current_user) }}><i class="icon-plus-sign"></i> {{ _('New') }}</a> |
This also makes the button unclickable
@@ -10,10 +10,13 @@ | |||
<div class="well"> | |||
{% if current_user.is_authenticated %} | |||
{% if mycommunities %} | |||
{% if not can_user_create_community(current_user) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extract this as a variable at the beginning of the template:
{% set can_create_community = can_user_create_community(current_user) %}
and then use appropriately below
invenio_communities/views/ui.py
Outdated
@@ -177,6 +176,10 @@ def new(): | |||
for at least one week. If you want to speed up the process, you \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of \
, it's better to use string literal lines in parentheses, just to be sure about the whitespace
d1a0df1
to
d4dcaab
Compare
d4dcaab
to
22e12c6
Compare
No description provided.