-
Notifications
You must be signed in to change notification settings - Fork 2k
/
member_new.html
91 lines (86 loc) · 3.59 KB
/
member_new.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends "organization/edit_base.html" %}
{% import 'macros/form.html' as form %}
{% set user = c.user_dict %}
{% block subtitle %}{{ _('Edit Member') if user else _('Add Member') }} - {{ super() }}{% endblock %}
{% block primary_content_inner %}
{% link_for _('Back to all members'), controller='organization', action='members', id=organization.name, class_='btn pull-right', icon='arrow-left' %}
<h1 class="page-heading">
{% block page_heading %}{{ _('Edit Member') if user else _('Add Member') }}{% endblock %}
</h1>
{% block form %}
<form class="dataset-form form-horizontal add-member-form" method='post'>
<div class="row-fluid">
<div class="control-group control-medium">
{% if not user %}
<label class="control-label" for="username">
{{ _('Existing User') }}
</label>
<span>
{{ _('If you wish to add an existing user, search for their username below.') }}
</span>
{% 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="control-medium">
{% 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?q=?">
{% endif %}
</div>
</div>
{% if not user %}
<div class="add-member-or">
{{ _('or') }}
</div>
<div class="control-group control-medium">
<label class="control-label" for="email">
{{ _('New User') }}
</label>
<span>
{{ _('If you wish to invite a new user, enter their email address.') }}
</span>
<div class="controls">
<input id="email" type="email" name="email" placeholder="{{ _('Email address') }}" >
</div>
</div>
{% endif %}
</div>
{% set format_attrs = {'data-module': 'autocomplete'} %}
{{ form.select('role', label=_('Role'), options=c.roles, selected=c.user_role, error='', attrs=format_attrs) }}
<div class="form-actions">
{% if user %}
{% set locale = h.dump_json({'content': _('Are you sure you want to delete this member?')}) %}
<a href="{% url_for controller='organization', action='member_delete', id=c.group_dict.id, user=user.id %}" class="btn btn-danger pull-left" data-module="confirm-action" data-module-i18n="{{ locale }}">{{ _('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 %}
{% endblock %}
{% block secondary_content %}
{{ super() }}
<div class="module module-narrow module-shallow">
<h2 class="module-heading">
<i class="icon-large icon-info-sign"></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>Editor:</strong> Can add and edit datasets, but not manage
organization members.</p>
<p><strong>Member:</strong> Can view the organization's private
datasets, but not add new datasets.</p>
{% endtrans %}
</div>
{% endblock %}