first commit
This commit is contained in:
30
admininistrator/view/template/user/api.twig
Normal file
30
admininistrator/view/template/user/api.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-api" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="api" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#api').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#api').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
183
admininistrator/view/template/user/api_form.twig
Normal file
183
admininistrator/view/template/user/api_form.twig
Normal file
@ -0,0 +1,183 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-api" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-api" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-ip" data-bs-toggle="tab" class="nav-link">{{ tab_ip }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-session" data-bs-toggle="tab" class="nav-link">{{ tab_session }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-username" class="col-sm-2 col-form-label">{{ entry_username }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" value="{{ username }}" placeholder="{{ entry_username }}" id="input-username" class="form-control"/>
|
||||
<div id="error-username" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-key" class="col-sm-2 col-form-label">{{ entry_key }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="key" placeholder="{{ entry_key }}" rows="5" id="input-key" class="form-control mb-1">{{ key }}</textarea>
|
||||
<button type="button" id="button-generate" class="btn btn-primary"><i class="fa-solid fa-rotate"></i> {{ button_generate }}</button>
|
||||
<div id="error-key" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/>
|
||||
<input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-ip" class="tab-pane">
|
||||
<div class="alert alert-info"><i class="fa-solid fa-info-circle"></i> {{ text_ip }}</div>
|
||||
<div class="table-responsive">
|
||||
<table id="ip" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ entry_ip }}</td>
|
||||
<td class="text-end"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set ip_row = 0 %}
|
||||
{% for api_ip in api_ips %}
|
||||
<tr id="ip-row-{{ ip_row }}">
|
||||
<td class="text-start"><input type="text" name="api_ip[]" value="{{ api_ip }}" placeholder="{{ entry_ip }}" class="form-control"/></td>
|
||||
<td class="text-end"><button type="button" onclick="$('#ip-row-{{ ip_row }}').remove()" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% set ip_row = ip_row + 1 %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="text-end"><button type="button" id="button-ip" data-bs-toggle="tooltip" title="{{ button_ip_add }}" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-session" class="tab-pane">
|
||||
<div class="table-responsive">
|
||||
<table id="session" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_token }}</td>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-start">{{ column_date_modified }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if api_sessions %}
|
||||
{% for api_session in api_sessions %}
|
||||
<tr>
|
||||
<td class="text-start">{{ api_session.session_id }}</td>
|
||||
<td class="text-start">{{ api_session.ip }}</td>
|
||||
<td class="text-start">{{ api_session.date_added }}</td>
|
||||
<td class="text-start">{{ api_session.date_modified }}</td>
|
||||
<td class="text-end"><button type="button" value="{{ api_session.api_session_id }}" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="api_id" value="{{ api_id }}" id="input-api-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-generate').on('click', function () {
|
||||
rand = '';
|
||||
|
||||
string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
rand += string[Math.floor(Math.random() * (string.length - 1))];
|
||||
}
|
||||
|
||||
$('#input-key').val(rand);
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
var ip_row = {{ ip_row }};
|
||||
|
||||
$('#button-ip').on('click', function () {
|
||||
html = '<tr id="ip-row-' + ip_row + '">';
|
||||
html += ' <td class="text-end"><input type="text" name="api_ip[]" value="" placeholder="{{ entry_ip|escape('js') }}" class="form-control"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" onclick="$(\'#ip-row-' + ip_row + '\').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#ip tbody').append(html);
|
||||
|
||||
ip_row++;
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#session button').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=user/api.deletesession&user_token={{ user_token }}&api_session_id=' + $(element).val(),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#tab-session').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#tab-session').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).parent().parent().remove();
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
38
admininistrator/view/template/user/api_list.twig
Normal file
38
admininistrator/view/template/user/api_list.twig
Normal file
@ -0,0 +1,38 @@
|
||||
<form id="form-api" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#api">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_username }}"{% if sort == 'username' %} class="{{ order|lower }}"{% endif %}>{{ column_username }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_status }}"{% if sort == 'status' %} class="{{ order|lower }}"{% endif %}>{{ column_status }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_date_added }}"{% if sort == 'date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_date_modified }}"{% if sort == 'date_modified' %} class="{{ order|lower }}"{% endif %}>{{ column_date_modified }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if apis %}
|
||||
{% for api in apis %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ api.api_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ api.username }}</td>
|
||||
<td class="text-start">{{ api.status }}</td>
|
||||
<td class="text-start">{{ api.date_added }}</td>
|
||||
<td class="text-start">{{ api.date_modified }}</td>
|
||||
<td class="text-end"><a href="{{ api.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
86
admininistrator/view/template/user/profile.twig
Normal file
86
admininistrator/view/template/user/profile.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-user" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_edit }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-user" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<fieldset>
|
||||
<legend>{{ text_user }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-username" class="col-sm-2 col-form-label">{{ entry_username }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" value="{{ username }}" placeholder="{{ entry_username }}" id="input-username" class="form-control"/>
|
||||
<div id="error-username" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-firstname" class="col-sm-2 col-form-label">{{ entry_firstname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control"/>
|
||||
<div id="error-firstname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-lastname" class="col-sm-2 col-form-label">{{ entry_lastname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control"/>
|
||||
<div id="error-lastname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-email" class="col-sm-2 col-form-label">{{ entry_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
|
||||
<div id="error-email" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-image" class="col-sm-2 col-form-label">{{ entry_image }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="card image">
|
||||
<img src="{{ thumb }}" alt="" title="" id="thumb-image" data-oc-placeholder="{{ placeholder }}" class="card-img-top"/> <input type="hidden" name="image" value="{{ image }}" id="input-image"/>
|
||||
<div class="card-body">
|
||||
<button type="button" data-oc-toggle="image" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-primary btn-sm btn-block"><i class="fa-solid fa-pencil"></i> {{ button_edit }}</button>
|
||||
<button type="button" data-oc-toggle="clear" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-warning btn-sm btn-block"><i class="fa-regular fa-trash-can"></i> {{ button_clear }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_password }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-password" class="col-sm-2 col-form-label">{{ entry_password }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="password" value="{{ password }}" placeholder="{{ entry_password }}" id="input-password" class="form-control" autocomplete="new-password"/>
|
||||
<div id="error-password" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-confirm" class="col-sm-2 col-form-label">{{ entry_confirm }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="confirm" value="{{ confirm }}" placeholder="{{ entry_confirm }}" id="input-confirm" class="form-control"/>
|
||||
<div id="error-confirm" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
30
admininistrator/view/template/user/user.twig
Normal file
30
admininistrator/view/template/user/user.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-user" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="user" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#user').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#user').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
34
admininistrator/view/template/user/user_authorize.twig
Normal file
34
admininistrator/view/template/user/user_authorize.twig
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-start">{{ column_user_agent }}</td>
|
||||
<td class="text-start">{{ column_status }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if authorizes %}
|
||||
{% for authorize in authorizes %}
|
||||
<tr>
|
||||
<td class="text-start"><a href="https://whatismyipaddress.com/ip/{{ user_login.ip }}" target="_blank">{{ authorize.ip }}</a></td>
|
||||
<td class="text-start">{{ authorize.user_agent }}</td>
|
||||
<td class="text-start">{{ authorize.status }}</td>
|
||||
<td class="text-start">{{ authorize.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ authorize.delete }}" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
182
admininistrator/view/template/user/user_form.twig
Normal file
182
admininistrator/view/template/user/user_form.twig
Normal file
@ -0,0 +1,182 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-user" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-user" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-authorize" data-bs-toggle="tab" class="nav-link">{{ tab_authorize }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-login" data-bs-toggle="tab" class="nav-link">{{ tab_login }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<fieldset>
|
||||
<legend>{{ text_user }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-username" class="col-sm-2 col-form-label">{{ entry_username }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" value="{{ username }}" placeholder="{{ entry_username }}" id="input-username" class="form-control"/>
|
||||
<div id="error-username" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-user-group" class="col-sm-2 col-form-label">{{ entry_user_group }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="user_group_id" id="input-user-group" class="form-select">
|
||||
{% for user_group in user_groups %}
|
||||
<option value="{{ user_group.user_group_id }}"{% if user_group.user_group_id == user_group_id %} selected{% endif %}>{{ user_group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-firstname" class="col-sm-2 col-form-label">{{ entry_firstname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control"/>
|
||||
<div id="error-firstname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-lastname" class="col-sm-2 col-form-label">{{ entry_lastname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control"/>
|
||||
<div id="error-lastname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-email" class="col-sm-2 col-form-label">{{ entry_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
|
||||
<div id="error-email" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-image" class="col-sm-2 col-form-label">{{ entry_image }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="card image">
|
||||
<img src="{{ thumb }}" alt="" title="" id="thumb-image" data-oc-placeholder="{{ placeholder }}" class="card-img-top"/> <input type="hidden" name="image" value="{{ image }}" id="input-image"/>
|
||||
<div class="card-body">
|
||||
<button type="button" data-oc-toggle="image" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-primary btn-sm btn-block"><i class="fa-solid fa-pencil"></i> {{ button_edit }}</button>
|
||||
<button type="button" data-oc-toggle="clear" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-warning btn-sm btn-block"><i class="fa-regular fa-trash-can"></i> {{ button_clear }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_password }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-password" class="col-sm-2 col-form-label">{{ entry_password }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="password" value="{{ password }}" placeholder="{{ entry_password }}" id="input-password" class="form-control" autocomplete="new-password"/>
|
||||
<div id="error-password" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-confirm" class="col-sm-2 col-form-label">{{ entry_confirm }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="confirm" value="{{ confirm }}" placeholder="{{ entry_confirm }}" id="input-confirm" class="form-control"/>
|
||||
<div id="error-confirm" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_other }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/>
|
||||
<input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="user_id" value="{{ user_id }}" id="input-user-id"/>
|
||||
</div>
|
||||
<div id="tab-authorize" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_authorize }}</legend>
|
||||
<div id="authorize">{{ authorize }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="tab-login" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_login }}</legend>
|
||||
<div id="login">{{ login }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#authorize').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#authorize').load(this.href);
|
||||
});
|
||||
|
||||
$('#authorize').on('click', '.btn', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['redirect']) {
|
||||
location = json['redirect'];
|
||||
}
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#authorize').load('index.php?route=user/user.authorize&user_token={{ user_token }}&user_id={{ user_id }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#login').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#login').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
30
admininistrator/view/template/user/user_group.twig
Normal file
30
admininistrator/view/template/user/user_group.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-user-group" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="user-group" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#user-group').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#user-group').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
102
admininistrator/view/template/user/user_group_form.twig
Normal file
102
admininistrator/view/template/user/user_group_form.twig
Normal file
@ -0,0 +1,102 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-user-group" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-user-group" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_permission }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="user-group-permission" class="form-control" style="height: 250px; overflow: auto;">
|
||||
<table class="table table-borderless table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="w-50"></td>
|
||||
<td class="text-center">{{ text_access }}</label></td>
|
||||
<td class="text-center">{{ text_modify }}</label></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>{{ text_all }}</strong></td>
|
||||
<td class="text-center"><input type="checkbox" id="input-permission-access" class="form-check-input" onchange="$('#user-group-permission input[name^=\'permission[access]\']').prop('checked', $(this).prop('checked'));"/></td>
|
||||
<td class="text-center"><input type="checkbox" id="input-permission-modify" class="form-check-input" onchange="$('#user-group-permission input[name^=\'permission[modify]\']').prop('checked', $(this).prop('checked'));"/></td>
|
||||
</tr>
|
||||
{% for permission in permissions %}
|
||||
<tr>
|
||||
<td><label>{{ permission }}</label></td>
|
||||
<td class="text-center"><input type="checkbox" name="permission[access][]" value="{{ permission }}" class="form-check-input"{% if permission in access %} checked{% endif %}/></td>
|
||||
<td class="text-center"><input type="checkbox" name="permission[modify][]" value="{{ permission }}" class="form-check-input"{% if permission in modify %} checked{% endif %}/></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_extension }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="user-group-extension" class="form-control" style="height: 250px; overflow: auto;">
|
||||
<table class="table table-borderless table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="w-50"></td>
|
||||
<td class="text-center">{{ text_access }}</td>
|
||||
<td class="text-center">{{ text_modify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>{{ text_all }}</strong></td>
|
||||
<td class="text-center"><input type="checkbox" id="input-permission-access" class="form-check-input" onchange="$('#user-group-extension input[name^=\'permission[access]\']').prop('checked', $(this).prop('checked'));"/></td>
|
||||
<td class="text-center"><input type="checkbox" id="input-permission-modify" class="form-check-input" onchange="$('#user-group-extension input[name^=\'permission[modify]\']').prop('checked', $(this).prop('checked'));"/></td>
|
||||
</tr>
|
||||
{% for extension in extensions %}
|
||||
<tr>
|
||||
<td><label>{{ extension }}</label></td>
|
||||
<td class="text-center"><input type="checkbox" name="permission[access][]" value="{{ extension }}" class="form-check-input"{% if extension in access %} checked{% endif %}/></td>
|
||||
<td class="text-center"><input type="checkbox" name="permission[modify][]" value="{{ extension }}" class="form-check-input"{% if extension in modify %} checked{% endif %}/></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="user_group_id" value="{{ user_group_id }}" id="input-user-group-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('table tbody label').on('click', function () {
|
||||
var checked = $(this).parent().parent().find(':checkbox:first').prop('checked');
|
||||
|
||||
$(this).parent().parent().find(':checkbox').prop('checked', !checked);
|
||||
$(this).parent().parent().find(':checkbox').prop('checked', !checked);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/user/user_group_list.twig
Normal file
32
admininistrator/view/template/user/user_group_list.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<form id="form-user-group" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#user-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if user_groups %}
|
||||
{% for user_group in user_groups %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ user_group.user_group_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ user_group.name }}</td>
|
||||
<td class="text-end"><a href="{{ user_group.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
36
admininistrator/view/template/user/user_list.twig
Normal file
36
admininistrator/view/template/user/user_list.twig
Normal file
@ -0,0 +1,36 @@
|
||||
<form id="form-user" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#user">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_username }}"{% if sort == 'username' %} class="{{ order|lower }}"{% endif %}>{{ column_username }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_status }}"{% if sort == 'status' %} class="{{ order|lower }}"{% endif %}>{{ column_status }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_date_added }}"{% if sort == 'date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if users %}
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ user.user_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ user.username }}</td>
|
||||
<td class="text-start">{{ user.status }}</td>
|
||||
<td class="text-start">{{ user.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ user.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
30
admininistrator/view/template/user/user_login.twig
Normal file
30
admininistrator/view/template/user/user_login.twig
Normal file
@ -0,0 +1,30 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-start">{{ column_user_agent }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if logins %}
|
||||
{% for login in logins %}
|
||||
<tr>
|
||||
<td class="text-start"><a href="https://whatismyipaddress.com/ip/{{ login.ip }}" target="_blank">{{ login.ip }}</a></td>
|
||||
<td class="text-start">{{ login.user_agent }}</td>
|
||||
<td class="text-start">{{ login.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
Reference in New Issue
Block a user