feat: remove ability to delete events from acp

v1.18.x
Baris Usakli 5 years ago
parent f52f98fb89
commit 554e67116f

@ -2,7 +2,6 @@
"events": "Events",
"no-events": "There are no events",
"control-panel": "Events Control Panel",
"delete-events": "Delete Events",
"filters": "Filters",
"filters-apply": "Apply Filters",
"filter-type": "Event Type",

@ -5,26 +5,6 @@ define('admin/advanced/events', function () {
var Events = {};
Events.init = function () {
$('[data-action="clear"]').on('click', function () {
socket.emit('admin.deleteAllEvents', function (err) {
if (err) {
return app.alertError(err.message);
}
$('.events-list').empty();
});
});
$('.delete-event').on('click', function () {
var parentEl = $(this).parents('[data-eid]');
var eid = parentEl.attr('data-eid');
socket.emit('admin.deleteEvents', [eid], function (err) {
if (err) {
return app.alertError(err.message);
}
parentEl.remove();
});
});
$('#apply').on('click', Events.refresh);
};

@ -327,14 +327,6 @@ SocketAdmin.errors.clear = function (socket, data, callback) {
meta.errors.clear(callback);
};
SocketAdmin.deleteEvents = function (socket, eids, callback) {
events.deleteEvents(eids, callback);
};
SocketAdmin.deleteAllEvents = function (socket, data, callback) {
events.deleteAll(callback);
};
SocketAdmin.getSearchDict = async function (socket) {
const settings = await user.getSettings(socket.uid);
const lang = settings.userLang || meta.config.defaultLang || 'en-GB';

@ -21,7 +21,6 @@
<!-- ENDIF events.user.picture -->
</a>
<a href="{config.relative_path}/user/{events.user.userslug}" target="_blank">{events.user.username}</a>
<span class="pull-right delete-event"><i class="fa fa-trash-o"></i></span>
<span class="pull-right">{events.timestampISO}</span>
<pre class="well">{events.jsonString}</pre>
</div>
@ -60,12 +59,5 @@
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<button class="btn btn-block btn-danger" data-action="clear">
<i class="fa fa-eraser"></i> [[admin/advanced/events:delete-events]]
</button>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save