def detailed_actions_entries(request, u, page, *args, **kwargs): application = DALApplication.objects.get(name='core') logs = DALModel.objects.filter( user=u, application=application).order_by('created_at') return renderer(request, 'components/players/detailed/actions/entry.pug', logs, page)
def servers_roles_entries(request, page): obj = Role.objects.all() return renderer(request, 'components/admins/servers/roles/entry.pug', obj, page, size=1, overwrite=True, payload={'servers': Server.objects.all()})
def entries(request, page): name = request.resolver_match.url_name punishments = Punishment.objects.all() if "ban" in name: punishments = punishments.filter(is_banned=True) elif "mute" in name: punishments = punishments.filter(is_muted=True) elif "gag" in name: punishments = punishments.filter(is_gagged=True) return renderer(request, 'components/punishments/entry.pug', punishments, page)
def detailed_log_entries(request, u, date, page, *args, **kwargs): pages = ServerChat.objects.filter(user=u)\ .annotate(created_date=Cast('created_at', DateField()))\ .values('created_date')\ .distinct()\ .order_by('-created_date') date = pages[date - 1]['created_date'] logs = ServerChat.objects.annotate(created_date=Cast('created_at', DateField()))\ .filter(user=u, created_date=date).order_by('created_at') return renderer(request, 'components/players/detailed/logs/entry.pug', logs, page)
def servers_admins_entries(request, page): superusers = [] for superuser in User.objects.filter(is_superuser=True, is_steam=True): m = Membership() m.user = superuser m.is_superuser = True superusers.append(m) memberships = Membership.objects.all() return renderer(request, 'components/admins/servers/admins/entry.pug', memberships, page, extra=superusers)
def web_groups_entries(request, page): obj = Group.objects.all() permissions = Permission.objects.all() return renderer(request, 'components/admins/web/groups/entry.pug', obj, page, size=1, overwrite=True, payload={ 'permissions': permissions, 'excluded': ['core', 'log', 'auth'] })
def log_entries(request, s, page, *args, **kwargs): server = Server.objects.get(id=s) logs = ServerChat.objects.filter(server=server).order_by('-created_at') return renderer(request, 'components/servers/detailed/logs/entry.pug', logs, page)
def list(request, page, *args, **kwargs): obj = Server.objects.all() return renderer(request, 'components/servers/overview.pug', obj, page, execute=status, size=1, overwrite=True)
def web_admins_entries(request, page): users = User.objects.filter(is_active=True) return renderer(request, 'components/admins/web/admins/entry.pug', users, page)
def list_entries(request, page, *args, **kwargs): players = User.objects.filter(is_steam=True) return renderer(request, 'components/players/entry.pug', players, page)
def detailed_punishments_entries(request, u, page, *args, **kwargs): punishments = Punishment.objects.filter(user=u).order_by('created_at') return renderer(request, 'components/players/detailed/punishments/entry.pug', punishments, page)
def log(request, page, *args, **kwargs): obj = ServerChat.objects.filter(command=False).order_by('-updated_at') return renderer(request, 'components/chat/entry.pug', obj, page)