forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the role 'Member' from the dropdown menu #256
- Loading branch information
1 parent
50a2bc4
commit df2707d
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
ckan/src/ckanext-igsn-theme/ckanext/igsn_theme/templates/organization/member_new.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{% ckan_extends %} | ||
|
||
{% block form %} | ||
<form class="dataset-form add-member-form" method='post'> | ||
{{ h.csrf_input() }} | ||
<div class="row"> | ||
<div class="col-md-5"> | ||
<div class="form-group control-medium"> | ||
{% if not user %} | ||
<label class="form-label" for="username"> | ||
{{ _('Existing User') }} | ||
</label> | ||
<p> | ||
{{ _('If you wish to add an existing user, search for their username below.') }} | ||
</p> | ||
{% endif %} | ||
<div class="controls"> | ||
{% if user %} | ||
<input type="hidden" name="username" value="{{ user.name }}" /> | ||
<input id="username" name="username" type="text" value="{{ user.name }}" | ||
disabled="True" class="form-control"> | ||
{% else %} | ||
<input id="username" type="text" name="username" placeholder="{{ _('Username') }}" | ||
value="" class="control-medium" data-module="autocomplete" | ||
data-module-source="/api/2/util/user/autocomplete?ignore_self=true&q=?"> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
{% if not user %} | ||
<div class="col-md-2 add-member-or-wrap"> | ||
<div class="add-member-or"> | ||
{{ _('or') }} | ||
</div> | ||
</div> | ||
<div class="col-md-5"> | ||
<div class="form-group control-medium"> | ||
<label class="form-label" for="email"> | ||
{{ _('New User') }} | ||
</label> | ||
<p> | ||
{{ _('If you wish to invite a new user, enter their email address.') }} | ||
</p> | ||
<div class="controls"> | ||
<input id="email" type="email" name="email" class="form-control" placeholder="{{ _('Email address') }}" > | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
{% set roles = roles|selectattr("value", "!=" , "member")|list %} | ||
|
||
{% if user and user.name == c.user and user_role == 'admin' %} | ||
{% set format_attrs = {'data-module': 'autocomplete', 'disabled': 'disabled'} %} | ||
{{ form.select('role', label=_('Role'), options=roles, selected=user_role, error='', attrs=format_attrs) }} | ||
{{ form.hidden('role', value=user_role) }} | ||
{% else %} | ||
{% set format_attrs = {'data-module': 'autocomplete'} %} | ||
{{ form.select('role', label=_('Role'), options=roles, selected=user_role, error='', attrs=format_attrs) }} | ||
{% endif %} | ||
|
||
<div class="form-actions"> | ||
{% if user %} | ||
<a href="{{ h.url_for(group_type + '.member_delete', id=group_dict.id, user=user.id) }}" class="btn btn-danger pull-left" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this member?') }}">{{ _('Delete') }}</a> | ||
<button class="btn btn-primary" type="submit" name="submit" > | ||
{{ _('Update Member') }} | ||
</button> | ||
{% else %} | ||
<button class="btn btn-primary" type="submit" name="submit" > | ||
{{ _('Add Member') }} | ||
</button> | ||
{% endif %} | ||
</div> | ||
</form> | ||
{% endblock %} | ||
|
||
|
||
{% block secondary_content %} | ||
{% if organization %} | ||
{% snippet 'snippets/organization.html', organization=organization %} | ||
{% else %} | ||
{{ super() }} | ||
{% endif %} | ||
<div class="module module-narrow module-shallow"> | ||
<h2 class="module-heading"> | ||
<i class="fa fa-lg fa-info-circle"></i> | ||
{{ _('What are roles?') }} | ||
</h2> | ||
<div class="module-content"> | ||
{% trans %} | ||
<p><strong>Admin:</strong> Can add/edit and delete datasets, as well as | ||
manage organization members.</p> | ||
<p><strong>Curator:</strong> Can add and edit datasets, but not manage | ||
organization members.</p> | ||
{% endtrans %} | ||
</div> | ||
</div> | ||
{% endblock %} |