Add block clause (#1)
parent
18cf8ea74d
commit
10dff6e266
13
gui.py
13
gui.py
|
@ -114,6 +114,13 @@ def gui_results(form):
|
|||
players.append(player.strip())
|
||||
players_clause = " AND ({})".format(" OR ".join(["cu.user LIKE '{}%%'".format(p) for p in players]))
|
||||
|
||||
blocks = []
|
||||
blocks_clause = ""
|
||||
if form.blocks:
|
||||
for block in form.blocks.split(","):
|
||||
blocks.append(block.strip())
|
||||
blocks_clause = " AND ({})".format(" OR ".join(["cmm.material LIKE 'minecraft:{}%%'".format(b) for b in blocks]))
|
||||
|
||||
worlds_clause = ""
|
||||
worlds = [world["id"] for world in form.worlds if world["checked"]]
|
||||
if len(worlds):
|
||||
|
@ -147,10 +154,11 @@ def gui_results(form):
|
|||
{ignore_environment}
|
||||
{players}
|
||||
{coords}
|
||||
{blocks}
|
||||
{worlds}
|
||||
{time}
|
||||
'''.format(action=",".join(block_actions), ignore_environment=ignore_environment, players=players_clause,
|
||||
coords=coords_clause, worlds=worlds_clause, time=time_clause))
|
||||
coords=coords_clause, blocks=blocks_clause, worlds=worlds_clause, time=time_clause))
|
||||
|
||||
# Chat
|
||||
if form.chat:
|
||||
|
@ -175,8 +183,9 @@ def gui_results(form):
|
|||
{worlds}
|
||||
{players}
|
||||
{coords}
|
||||
{blocks}
|
||||
{time}
|
||||
'''.format(worlds=worlds_clause, players=players_clause, coords=coords_clause, time=time_clause))
|
||||
'''.format(worlds=worlds_clause, players=players_clause, coords=coords_clause, blocks=blocks_clause, time=time_clause))
|
||||
|
||||
# Commands
|
||||
if form.command:
|
||||
|
|
|
@ -310,15 +310,15 @@ class GUIResult(models.Model):
|
|||
@property
|
||||
def display_action(self):
|
||||
if self.type == "block":
|
||||
return "Block Break" if self.action == "0" else "Block Place" if self.action == "1" else "Interact/Used"
|
||||
return "Block Break" if str(self.action) == "0" else "Block Place" if str(self.action) == "1" else "Interact/Used"
|
||||
if self.type == "chat":
|
||||
return "Chat"
|
||||
if self.type == "container":
|
||||
return "Took from Container" if self.action == "0" else "Placed in Container"
|
||||
return "Took from Container" if str(self.action) == "0" else "Placed in Container"
|
||||
if self.type == "command":
|
||||
return "Command"
|
||||
if self.type == "session":
|
||||
return "Logout" if self.action == "0" else "Login"
|
||||
return "Logout" if str(self.action) == "0" else "Login"
|
||||
if self.type == "sign":
|
||||
return "Sign"
|
||||
return self.action
|
||||
|
|
Loading…
Reference in New Issue