Refactor admin user settings page

- Fix header hierarchy
- [frio] Fix panel display
This commit is contained in:
Hypolite Petovan 2020-04-01 19:45:31 -04:00
parent 76feae2203
commit cc15381007
4 changed files with 441 additions and 417 deletions

View file

@ -1,159 +1,179 @@
<script> <script>
function confirm_delete(uname){ function confirm_delete(uname) {
return confirm( "{{$confirm_delete}}".format(uname)); return confirm("{{$confirm_delete}}".format(uname));
} }
function confirm_delete_multi(){
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}"); return confirm("{{$confirm_delete_multi}}");
} }
function selectall(cls){
$("."+cls).attr('checked','checked'); function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false; return false;
} }
</script> </script>
<div id='adminpage'> <div id="adminpage">
<h1>{{$title}} - {{$page}}</h1> <h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/admin/users" method="post"> <form action="{{$baseurl}}/admin/users" method="post">
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<h3>{{$h_pending}}</h3> <h2>{{$h_pending}}</h2>
{{if $pending}} {{if $pending}}
<table id='pending'> <table id="pending">
<thead> <thead>
<tr> <tr>
{{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}} {{foreach $th_pending as $th}}
<th></th> <th>{{$th}}</th>{{/foreach}}
<th></th> <th></th>
</tr> <th></th>
</thead> </tr>
<tbody> </thead>
<tbody>
{{foreach $pending as $u}} {{foreach $pending as $u}}
<tr> <tr>
<td class="created">{{$u.created}}</td> <td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td> <td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td> <td class="email">{{$u.email}}</td>
<td class="checkbox"><input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" /></td> <td class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
</td>
<td class="tools"> <td class="tools">
<a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title='{{$approve}}'><span class='icon like'></span></a> <a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title='{{$deny}}'><span class='icon dislike'></span></a> <span class="icon like"></span>
</a>
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
<span class="icon dislike"></span>
</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td> <td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr> </tr>
{{/foreach}} {{/foreach}}
</tbody> </tbody>
</table> </table>
<div class='selectall'><a href='#' onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div> <div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
<div class="submit"><input type="submit" name="page_users_deny" value="{{$deny}}"/> <input type="submit" name="page_users_approve" value="{{$approve}}" /></div> <div class="submit">
{{else}} <input type="submit" name="page_users_deny" value="{{$deny}}"/>
<p>{{$no_pending}}</p> <input type="submit" name="page_users_approve" value="{{$approve}}"/>
{{/if}} </div>
{{else}}
<h3>{{$h_users}}</h3> <p>{{$no_pending}}</p>
{{if $users}} {{/if}}
<table id='users'>
<thead> <h2>{{$h_users}}</h2>
<tr> {{if $users}}
<th></th> <table id="users">
{{foreach $th_users as $th}} <thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th> <th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}"> <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}} {{if $order_users == $th.1}}
{{if $order_direction_users == "+"}} {{if $order_direction_users == "+"}}
&#8595; &#8595;
{{else}}
&#8593;
{{/if}}
{{else}} {{else}}
&#8597; &#8593;
{{/if}} {{/if}}
{{$th.0}}</a> {{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th> </th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class='icon' src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class='name'><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td>
<td class='email'>{{$u.email}}</td>
<td class='register_date'>{{$u.register_date}}</td>
<td class='login_date'>{{$u.login_date}}</td>
<td class='lastitem_date'>{{$u.lastitem_date}}</td>
<td class='login_date'>{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/></td>
{{else}}
&nbsp;
{{/if}}
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title='{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}'><span class='icon block {{if $u.blocked==0}}dim{{/if}}'></span></a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title='{{$delete}}' onclick="return confirm_delete('{{$u.name}}')"><span class='icon drop'></span></a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}} {{/foreach}}
</tbody> <th></th>
</table> <th></th>
<div class='selectall'><a href='#' onclick="return selectall('users_ckbx');">{{$select_all}}</a></div> </tr>
<div class="submit"> </thead>
<input type="submit" name="page_users_block" value="{{$block}}" /> <tbody>
<input type="submit" name="page_users_unblock" value="{{$unblock}}" /> {{foreach $users as $u}}
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()" />
</div>
{{else}}
NO USERS?!?
{{/if}}
</form>
{{if $deleted}}
<h3>{{$h_deleted}}</h3>
<table id='deleted'>
<thead>
<tr> <tr>
<th></th> <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
{{foreach $th_deleted as $th}}<th>{{$th}}</th>{{/foreach}} <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon drop"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr> </tr>
</thead> {{/foreach}}
<tbody> </tbody>
{{foreach $deleted as $u}} </table>
<tr> <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<td><img class='icon' src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td> <div class="submit">
<td class='name'><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td> <input type="submit" name="page_users_block" value="{{$block}}"/>
<td class='email'>{{$u.email}}</td> <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<td class='register_date'>{{$u.register_date}}</td> <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
<td class='login_date'>{{$u.login_date}}</td> </div>
<td class='lastitem_date'>{{$u.lastitem_date}}</td> {{else}}
<td class='login_date'>{{$u.deleted}}</td> NO USERS?!?
</tr> {{/if}}
{{/foreach}} </form>
</tbody> {{if $deleted}}
</table> <h2>{{$h_deleted}}</h2>
{{/if}} <table id="deleted">
<h3>{{$h_newuser}}</h3> <thead>
<form action="{{$baseurl}}/admin/users" method="post"> <tr>
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> <th></th>
<table id='users'> {{foreach $th_deleted as $th}}
<tbody> <th>{{$th}}</th>
<tr> {{/foreach}}
<td>{{include file="field_input.tpl" field=$newusername}}</td> </tr>
</tr> </thead>
<tr> <tbody>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td> {{foreach $deleted as $u}}
</tr> <tr>
<tr> <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td> <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
</tr> <td class="email">{{$u.email}}</td>
</tbody> <td class="register_date">{{$u.register_date}}</td>
</table> <td class="login_date">{{$u.login_date}}</td>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}" /></div> <td class="lastitem_date">{{$u.lastitem_date}}</td>
</form> <td class="login_date">{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{/if}}
<h2>{{$h_newuser}}</h2>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<tbody>
<tr>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
</form>
</div> </div>

View file

@ -1,6 +1,5 @@
#admin-users.adminpage > h1 { padding: 0 15px; } #admin-users.adminpage > h1 { padding: 0 15px; }
#admin-users.adminpage .panel-collapse { margin-left: -15px; margin-right: -15px; }
#adminpage.adminpage > h1 { padding: 0 15px; } #adminpage.adminpage > h1 { padding: 0 15px; }
@ -18,5 +17,8 @@ tr.details th {
border-top: 0!important; border-top: 0!important;
} }
.adminpage td > .checkbox { margin: 0; } .adminpage td > .checkbox,
.adminpage th > .checkbox {
margin: 0;
}
.adminpage td { word-break: break-all; } .adminpage td { word-break: break-all; }

View file

@ -18,26 +18,31 @@
** **
--> -->
<div class="panel"> <div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="admin-settings-pending"> <div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-pending">
<h4> <h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-pending-collapse" aria-expanded="{{if count($pending) > 0}}true{{else}}false{{/if}}" aria-controls="admin-settings-pending-collapse"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-pending-collapse" aria-expanded="{{if count($pending) > 0}}true{{else}}false{{/if}}" aria-controls="admin-settings-pending-collapse">
{{$h_pending}} ({{count($pending)}}) {{$h_pending}} ({{count($pending)}})
</a> </a>
</h4> </h2>
</div> </div>
<div id="admin-settings-pending-collapse" class="panel-collapse collapse {{if count($pending) > 0}}in{{/if}}" role="tabpanel" aria-labelledby="admin-settings-pending"> <div id="admin-settings-pending-collapse" class="panel-collapse collapse {{if count($pending) > 0}}in{{/if}}" role="tabpanel" aria-labelledby="admin-settings-pending">
{{if $pending}} {{if $pending}}
<table id="pending" class="table table-hover"> <table id="pending" class="table table-hover">
<thead> <thead>
<tr> <tr>
<th></th> <th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/>
<label for="admin-settings-pending-select"></label>
</div>
</th>
{{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}} {{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}}
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{foreach $pending as $u}} {{foreach $pending as $u}}
<tr> <tr>
<td> <td>
<div class="checkbox"> <div class="checkbox">
@ -53,37 +58,27 @@
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a> <a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
</td> </td>
</tr> </tr>
{{if $u.note}} {{if $u.note}}
<tr class="details"> <tr class="details">
<td></td> <td></td>
<th>{{$pendingnotetext}}</th> <th>{{$pendingnotetext}}</th>
<td colspan="4">{{$u.note}}</td> <td colspan="4">{{$u.note}}</td>
</tr> </tr>
{{/if}} {{/if}}
{{/foreach}} {{/foreach}}
</tbody> </tbody>
</table> </table>
<div class="panel-footer"> <div class="panel-footer">
<div class="row"> <button type="submit" name="page_users_deny" value="1" class="btn btn-primary">
<div class="col-xs-3 admin-settings-footer-elements"> <i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
<div class="checkbox"> </button>
<input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/> <button type="submit" name="page_users_approve" value="1" class="btn btn-warinig">
<label for="admin-settings-pending-select"></label> <i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
</div> </button>
</div>
<div class="col-xs-9 admin-settings-footer-elements text-right">
<button type="submit" name="page_users_deny" value="1" class="btn btn-primary">
<i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
</button>
<button type="submit" name="page_users_approve" value="1" class="btn btn-warinig">
<i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
</button>
</div>
</div>
</div> </div>
{{else}} {{else}}
<div class="panel-body text-center text-muted">{{$no_pending}}</div> <div class="panel-body text-center text-muted">{{$no_pending}}</div>
{{/if}} {{/if}}
</div> </div>
</div> </div>
@ -95,48 +90,52 @@
** **
--> -->
<div class="panel"> <div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="admin-settings-user"> <div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-user">
<h4> <h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-user-collapse" aria-expanded="false" aria-controls="admin-settings-user-collapse"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-user-collapse" aria-expanded="false" aria-controls="admin-settings-user-collapse">
{{$h_users}} ({{count($users)}}) {{$h_users}} ({{count($users)}})
</a> </a>
</h4> </h2>
</div> </div>
<div id="admin-settings-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-user"> <div id="admin-settings-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-user">
{{if $users}} {{if $users}}
<div class="panel-body"> <table id="users" class="table table-hover">
<table id="users" class="table table-hover"> <thead>
<thead> <tr>
<tr> <th>
<th></th> <div class="checkbox">
<th></th> <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
{{foreach $th_users as $k=>$th}} <label for="admin-settings-users-select"></label>
{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }} </div>
<th class="th-{{$k}}"> </th>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="btn-link table-order"> <th></th>
{{if $order_users == $th.1}} {{foreach $th_users as $k=>$th}}
{{if $order_direction_users == "+"}} {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
&#8595; <th class="th-{{$k}}">
{{else}} <button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="btn-link table-order">
&#8593; {{if $order_users == $th.1}}
{{/if}} {{if $order_direction_users == "+"}}
&#8595;
{{else}} {{else}}
&#8597; &#8593;
{{/if}} {{/if}}
{{$th.0}} {{else}}
</button> &#8597;
</th> {{/if}}
{{/if}} {{$th.0}}
{{/foreach}} </button>
<th></th> </th>
</tr> {{/if}}
</thead> {{/foreach}}
<tbody> <th></th>
{{foreach $users as $u}} </tr>
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}"> </thead>
<td> <tbody>
{{foreach $users as $u}}
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
<td>
{{if $u.is_deletable}} {{if $u.is_deletable}}
<div class="checkbox"> <div class="checkbox">
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/> <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
@ -145,135 +144,121 @@
{{else}} {{else}}
&nbsp; &nbsp;
{{/if}} {{/if}}
</td> </td>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td> <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td> <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
<td>{{$u.email}}</td> <td>{{$u.email}}</td>
{{if $order_users == $th_users.2.1}} {{if $order_users == $th_users.2.1}}
<td>{{$u.register_date}}</td> <td>{{$u.register_date}}</td>
{{/if}}
{{if $order_users == $th_users.3.1}}
<td>{{$u.login_date}}</td>
{{/if}}
{{if $order_users == $th_users.4.1}}
<td>{{$u.lastitem_date}}</td>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<td>
<i class="fa
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}}
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}} {{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
{{if $order_users == $th_users.3.1}} <td class="text-right">
<td>{{$u.login_date}}</td> <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
{{/if}} </td>
</tr>
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
<td>&nbsp;</td>
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users == $th_users.4.1}} {{if $order_users != $th_users.3.1}}
<td>{{$u.lastitem_date}}</td> <p>
{{/if}} <button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}}
</p>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }} {{if $order_users != $th_users.4.1}}
<td> <p>
<i class="fa <button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}} &#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}} </p>
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}} {{/if}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
<td class="text-right"> {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button> <p>
</td> <button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
</tr> &#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}"> </p>
<td>&nbsp;</td> {{/if}}
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users != $th_users.3.1}} </td>
<p> <td class="text-right">
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order"> {{if $u.is_deletable}}
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}} {{if $u.blocked}}
</p> <a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
{{/if}} <i class="fa fa-circle-o" aria-hidden="true"></i>
</a>
{{if $order_users != $th_users.4.1}} {{else}}
<p> <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order"> <i class="fa fa-ban" aria-hidden="true"></i>
&#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}} </a>
</p> {{/if}}
{{/if}} <a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
{{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }} </a>
<p> {{else}}
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order"> &nbsp;
&#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{/if}}
</p> </td>
{{/if}} </tr>
{{/foreach}}
</td> </tbody>
<td class="text-right"> </table>
{{if $u.is_deletable}}
{{if $u.blocked}}
<a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
<i class="fa fa-circle-o" aria-hidden="true"></i>
</a>
{{else}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
<i class="fa fa-ban" aria-hidden="true"></i>
</a>
{{/if}}
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</div>
{{else}}
<div class="panel-body text-center bg-danger">NO USERS?!?</div>
{{/if}}
<div class="panel-footer"> <div class="panel-footer">
{{if $users}} <button type="submit" name="page_users_block" value="1" class="btn btn-warning">
<div class="row"> <i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
<div class="col-xs-3 admin-settings-footer-elements"> </button>
<div class="checkbox"> <button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
<input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/> <i class="fa fa-circle-o" aria-hidden="true"></i> {{$unblock}}
<label for="admin-settings-users-select"></label> </button>
</div> <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
</div> <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
<div class="col-xs-9 admin-settings-footer-elements text-right"> </button>
<button type="submit" name="page_users_block" value="1" class="btn btn-warning">
<i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
</button>
<button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
<i class="fa fa-circle-o" aria-hidden="true"></i> {{$unblock}}
</button>
<button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
<i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
</button>
</div>
</div>
{{/if}}
</div> </div>
{{else}}
<div class="panel-body text-center bg-danger">NO USERS?!?</div>
{{/if}}
</div> </div>
</div> </div>
<!-- <!--
** **
* *
@ -283,12 +268,12 @@
--> -->
{{if $deleted}} {{if $deleted}}
<div class="panel"> <div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="admin-settings-deleted"> <div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-deleted">
<h4> <h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-deleted-collapse" aria-expanded="false" aria-controls="admin-settings-deleted-collapse"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-deleted-collapse" aria-expanded="false" aria-controls="admin-settings-deleted-collapse">
{{$h_deleted}} ({{count($deleted)}}) {{$h_deleted}} ({{count($deleted)}})
</a> </a>
</h4> </h2>
</div> </div>
<div id="admin-settings-deleted-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-deleted"> <div id="admin-settings-deleted-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-deleted">
@ -328,12 +313,12 @@
** **
--> -->
<div class="panel"> <div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="admin-settings-new-user"> <div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-new-user">
<h4> <h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-new-user-collapse" aria-expanded="false" aria-controls="admin-settings-new-user-collapse"> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-new-user-collapse" aria-expanded="false" aria-controls="admin-settings-new-user-collapse">
{{$h_newuser}} {{$h_newuser}}
</a> </a>
</h4> </h2>
</div> </div>
<div id="admin-settings-new-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-new-user"> <div id="admin-settings-new-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-new-user">
@ -342,11 +327,9 @@
{{include file="field_input.tpl" field=$newusernickname}} {{include file="field_input.tpl" field=$newusernickname}}
{{include file="field_input.tpl" field=$newuseremail}} {{include file="field_input.tpl" field=$newuseremail}}
</div> </div>
<div class="panel-footer text-right"> <div class="panel-footer">
<button type="submit" class="btn btn-primary">{{$submit}}</button> <button type="submit" class="btn btn-primary">{{$submit}}</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,77 +1,89 @@
<script> <script>
function confirm_delete(uname){ function confirm_delete(uname) {
return confirm( "{{$confirm_delete}}".format(uname)); return confirm("{{$confirm_delete}}".format(uname));
} }
function confirm_delete_multi(){
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}"); return confirm("{{$confirm_delete_multi}}");
} }
function selectall(cls){
$("."+cls).attr('checked','checked'); function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false; return false;
} }
</script> </script>
<div id='adminpage'> <div id="adminpage">
<h1>{{$title}} - {{$page}}</h1> <h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/admin/users" method="post"> <form action="{{$baseurl}}/admin/users" method="post">
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<h3>{{$h_pending}}</h3> <h2>{{$h_pending}}</h2>
{{if $pending}} {{if $pending}}
<table id='pending'> <table id="pending">
<thead> <thead>
<tr> <tr>
{{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}} {{foreach $th_pending as $th}}
<th>{{$th}}</th>
{{/foreach}}
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{foreach $pending as $u}} {{foreach $pending as $u}}
<tr> <tr>
<td class="created">{{$u.created}}</td> <td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td> <td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td> <td class="email">{{$u.email}}</td>
<td class="checkbox"><input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" /></td> <td class="checkbox">
<td class="tools"> <input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
<a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title='{{$approve}}'><span class='icon like'></span></a> </td>
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title='{{$deny}}'><span class='icon dislike'></span></a> <td class="tools">
</td> <a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
</tr> <span class="icon like"></span>
<tr> </a>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td> <a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
</tr> <span class="icon dislike"></span>
{{/foreach}} </a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody> </tbody>
</table> </table>
<div class='selectall'><a href='#' onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div> <div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
<div class="submit"><input type="submit" name="page_users_deny" value="{{$deny}}"/> <input type="submit" name="page_users_approve" value="{{$approve}}" /></div> <div class="submit"><input type="submit" name="page_users_deny" value="{{$deny}}"/>
<input type="submit" name="page_users_approve" value="{{$approve}}"/>
</div>
{{else}} {{else}}
<p>{{$no_pending}}</p> <p>{{$no_pending}}</p>
{{/if}} {{/if}}
<h3>{{$h_users}}</h3> <h2>{{$h_users}}</h2>
{{if $users}} {{if $users}}
<table id='users'> <table id="users">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
{{foreach $th_users as $th}} {{foreach $th_users as $th}}
<th> <th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}"> <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}} {{if $order_users == $th.1}}
{{if $order_direction_users == "+"}} {{if $order_direction_users == "+"}}
&#8595; &#8595;
{{else}}
&#8593;
{{/if}}
{{else}} {{else}}
&#8597; &#8593;
{{/if}} {{/if}}
{{$th.0}}</a> {{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th> </th>
{{/foreach}} {{/foreach}}
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
@ -79,23 +91,28 @@
<tbody> <tbody>
{{foreach $users as $u}} {{foreach $users as $u}}
<tr> <tr>
<td><img class='icon' src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td> <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class='name'><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td> <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class='email'>{{$u.email}}</td> <td class="email">{{$u.email}}</td>
<td class='register_date'>{{$u.register_date}}</td> <td class="register_date">{{$u.register_date}}</td>
<td class='login_date'>{{$u.login_date}}</td> <td class="login_date">{{$u.login_date}}</td>
<td class='lastitem_date'>{{$u.lastitem_date}}</td> <td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class='login_date'>{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td> <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox"> <td class="checkbox">
{{if $u.is_deletable}} {{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/></td> <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}} {{else}}
&nbsp; &nbsp;
{{/if}} {{/if}}
</td>
<td class="tools"> <td class="tools">
{{if $u.is_deletable}} {{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title='{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}'><span class='icon {{if $u.blocked==0}}unlock{{else}}lock{{/if}}'></span></a> <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title='{{$delete}}' onclick="return confirm_delete('{{$u.name}}')"><span class='icon delete'></span></a> <span class="icon {{if $u.blocked==0}}unlock{{else}}lock{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon delete"></span>
</a>
{{else}} {{else}}
&nbsp; &nbsp;
{{/if}} {{/if}}
@ -104,56 +121,58 @@
{{/foreach}} {{/foreach}}
</tbody> </tbody>
</table> </table>
<div class='selectall'><a href='#' onclick="return selectall('users_ckbx');">{{$select_all}}</a></div> <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit"> <div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}" /> <input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_unblock" value="{{$unblock}}" /> <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()" /> <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div> </div>
{{else}} {{else}}
NO USERS?!? NO USERS?!?
{{/if}} {{/if}}
</form> </form>
{{if $deleted}} {{if $deleted}}
<h3>{{$h_deleted}}</h3> <h2>{{$h_deleted}}</h2>
<table id='deleted'> <table id="deleted">
<thead> <thead>
<tr>
<th></th>
{{foreach $th_deleted as $th}}
<th>{{$th}}</th>
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $deleted as $u}}
<tr> <tr>
<th></th> <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
{{foreach $th_deleted as $th}}<th>{{$th}}</th>{{/foreach}} <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.deleted}}</td>
</tr> </tr>
</thead> {{/foreach}}
<tbody> </tbody>
{{foreach $deleted as $u}} </table>
<tr> {{/if}}
<td><img class='icon' src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td> <h2>{{$h_newuser}}</h2>
<td class='name'><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td> <form action="{{$baseurl}}/admin/users" method="post">
<td class='email'>{{$u.email}}</td> <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<td class='register_date'>{{$u.register_date}}</td> <table id="users">
<td class='login_date'>{{$u.login_date}}</td> <tbody>
<td class='lastitem_date'>{{$u.lastitem_date}}</td> <tr>
<td class='login_date'>{{$u.deleted}}</td> <td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr> </tr>
{{/foreach}} <tr>
</tbody> <td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</table> </tr>
{{/if}} <tr>
<h3>{{$h_newuser}}</h3> <td>{{include file="field_input.tpl" field=$newuseremail}}</td>
<form action="{{$baseurl}}/admin/users" method="post"> </tr>
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> </tbody>
<table id='users'> </table>
<tbody> <div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
<tr> </form>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}" /></div>
</form>
</div> </div>