/
manage_account.html.twig
141 lines (130 loc) · 4.33 KB
/
manage_account.html.twig
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
{% extends '@startupapi/page_with_sidebar.html.twig' %}
{% block content %}
<script>
STARTUPAPI.showMessages({
"user-removed": { 'class': 'success', 'text': 'User removed'},
"user-promoted": { 'class': 'success', 'text': 'User successfully promoted'},
"user-demoted": { 'class': 'success', 'text': 'User successfully demoted'},
"updated": { 'class': 'success', 'text': 'Account name updated'},
});
</script>
<div class="page-header">
<h1>
Accounts / <b>{{ account_name }}</b>
{% if account_isAdmin and not account_isIndividual %}
<a href="{{UserConfig.USERSROOTURL}}/edit_account.php" class="btn btn-default btn-xs">
<i class="glyphicon glyphicon-pencil"></i> Edit
</a>
{%endif%}
</h1>
</div>
{% if account_isIndividual %}
<form action="{{UserConfig.USERSROOTURL}}/controller/account.php" method="POST">
<input type="hidden" name="CSRF_NONCE" value="{{ AUTH.CSRF_NONCE }}"/>
Individual account
{% if user %}
for <i class="glyphicon glyphicon-user"></i> {{ user.name }}
{% endif %}
</form>
{%endif%}
{% if account_isAdmin %}
<div>
Status:
{% if account_isActive %}
<b class="label label-success">Active</b>
{%else%}
<b class="badge badge-important">Suspended</b>
{%endif%}
Plan:
{% if planIsSet %}
<span class="label label-info"><i class="glyphicon glyphicon-briefcase"></i> {{ plan_name }}</span>
{% else %}
<span class="label label-danger">NONE</span>
{% endif %}
{% if UserConfig.useSubscriptions %}
<a class="btn btn-default btn-xs" href="{{UserConfig.USERSROOTURL}}/subscription_details.php">
<i class="glyphicon glyphicon-list"></i>
Subscription details
</a>
{%endif%}
</div>
{%endif%}
{% if show_user_list %}
{% if account_isAdmin %}
<h3>Account Users</h3>
{% if account_isIndividual %}
{% if individual_no_admins %}
<p class="alert alert-danger">Attention, individual account has no admin user set</p>
{%else%}
<p class="alert alert-danger">Attention, multiple users are defined for an individual account</p>
{%endif%}
{%endif%}
<form action="{{UserConfig.USERSROOTURL}}/controller/account/account.php" method="POST">
<input type="hidden" name="CSRF_NONCE" value="{{ AUTH.CSRF_NONCE }}"/>
<table class="table table-striped">
{%for user in users %}
<tr>
<td>
<i class="glyphicon glyphicon-user"></i>
{{ user.name }}
{% if user.self %}
(it's you)
{% endif %}
</td>
<td>
{% if user.admin %}
<span class="label label-danger pull-right">admin</span>
{%endif%}
</td>
{% if user.self %}
<td>
<button class="btn btn-danger btn-xs disabled" disabled>
<i class="glyphicon glyphicon-circle-arrow-down"></i> Demote
</button>
</td>
<td>
<button class="btn btn-default btn-xs pull-right disabled" disabled>
<i class="glyphicon glyphicon-remove"></i> Remove
</button>
</td>
{%else%}
<td>
{% if user.admin %}
<button class="btn btn-xs btn-danger{% if user.self %} disabled{%endif%}" name="demote_user" value="{{ user.id }}">
<i class="glyphicon glyphicon-circle-arrow-down"></i> Demote
</button>
{%else%}
<button class="btn btn-default btn-xs{% if user.self %} disabled{%endif%}" name="promote_user" value="{{ user.id }}">
<i class="glyphicon glyphicon-circle-arrow-up"></i> Promote
</button>
{%endif%}
</td>
<td>
<button class="btn btn-default btn-xs pull-right remove_button" name="remove_user" value="{{ user.id }}"><i class="glyphicon glyphicon-remove"></i> Remove</button>
</td>
{%endif%}
</tr>
{%endfor%}
</table>
{% if not account_isIndividual %}
<a class="btn btn-default btn-xs" href="{{UserConfig.USERSROOTURL}}/invitations.php?joinaccount=yes"><i class="glyphicon glyphicon-plus"></i> Invite more users</a>
{%endif%}
<script>
$('.remove_button').on('click', function() {
return confirm('Are you sure you want to remove this user?');
});
</script>
</form>
{%else%}
<h3>Administrators</h3>
{%for user in users %}
{% if user.admin %}
<div>
<i class="glyphicon glyphicon-user"></i>
{{ user.name }}
</div>
{%endif%}
{%endfor%}
{%endif%}
{%endif%}
{% endblock %}