mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: remove ability to delete events from acp
This commit is contained in:
		| @@ -2,7 +2,6 @@ | |||||||
| 	"events": "Events", | 	"events": "Events", | ||||||
| 	"no-events": "There are no events", | 	"no-events": "There are no events", | ||||||
| 	"control-panel": "Events Control Panel", | 	"control-panel": "Events Control Panel", | ||||||
| 	"delete-events": "Delete Events", |  | ||||||
| 	"filters": "Filters", | 	"filters": "Filters", | ||||||
| 	"filters-apply": "Apply Filters", | 	"filters-apply": "Apply Filters", | ||||||
| 	"filter-type": "Event Type", | 	"filter-type": "Event Type", | ||||||
|   | |||||||
| @@ -5,26 +5,6 @@ define('admin/advanced/events', function () { | |||||||
| 	var	Events = {}; | 	var	Events = {}; | ||||||
|  |  | ||||||
| 	Events.init = function () { | 	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); | 		$('#apply').on('click', Events.refresh); | ||||||
| 	}; | 	}; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -327,14 +327,6 @@ SocketAdmin.errors.clear = function (socket, data, callback) { | |||||||
| 	meta.errors.clear(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) { | SocketAdmin.getSearchDict = async function (socket) { | ||||||
| 	const settings = await user.getSettings(socket.uid); | 	const settings = await user.getSettings(socket.uid); | ||||||
| 	const lang = settings.userLang || meta.config.defaultLang || 'en-GB'; | 	const lang = settings.userLang || meta.config.defaultLang || 'en-GB'; | ||||||
|   | |||||||
| @@ -21,7 +21,6 @@ | |||||||
| 						<!-- ENDIF events.user.picture --> | 						<!-- ENDIF events.user.picture --> | ||||||
| 					</a> | 					</a> | ||||||
| 					<a href="{config.relative_path}/user/{events.user.userslug}" target="_blank">{events.user.username}</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> | 					<span class="pull-right">{events.timestampISO}</span> | ||||||
| 					<pre class="well">{events.jsonString}</pre> | 					<pre class="well">{events.jsonString}</pre> | ||||||
| 				</div> | 				</div> | ||||||
| @@ -60,12 +59,5 @@ | |||||||
| 				</form> | 				</form> | ||||||
| 			</div> | 			</div> | ||||||
| 		</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> | ||||||
| </div> | </div> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user