summaryrefslogtreecommitdiff
path: root/templates/mod/view_ip.html
blob: c49880ae66307120d13ab74a8480485b1cd82e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{% for board_posts in posts %}
	<fieldset>
		<legend>
			<a href="?/{{ config.board_path|sprintf(board_posts.board.uri) }}{{ config.file_index }}">
				{{ config.board_abbreviation|sprintf(board_posts.board.uri) }}
				 - 
				 {{ board_posts.board.title|e }}
			</a>
		</legend>
		{{ board_posts.posts|join('<hr>') }}
	</fieldset>
{% endfor %}

{% if mod|hasPermission(config.mod.view_notes) %}
	<fieldset id="notes">
		<legend>
			{% set notes_on_record = 'note' ~ (notes|count != 1 ? 's' : '') ~ ' on record' %}
			<legend>{{ notes|count }} {% trans notes_on_record %}</legend>
		</legend>
		
		{% if notes|count > 0 %}
			<table class="modlog">
				<tr>
					<th>{% trans 'Staff' %}</th>
					<th>{% trans 'Note' %}</th>
					<th>{% trans 'Date' %}</th>
					{% if mod|hasPermission(config.mod.remove_notes) %}
						<th>{% trans 'Actions' %}</th>
					{% endif %}
				</tr>
				{% for note in notes %}
					<tr>
						<td class="minimal">
							{% if note.username %}
								<a href="?/new_PM/{{ note.username|e }}">{{ note.username|e }}</a>
							{% else %}
								<em>{% trans 'deleted?' %}</em>
							{% endif %}
						</td>
						<td>
							{{ note.body }}
						</td>
						<td class="minimal">
							{{ note.time|date(config.post_date) }}
						</td>
						{% if mod|hasPermission(config.mod.remove_notes) %}
							<td class="minimal">
								<a href="?/IP/{{ ip }}/remove_note/{{ note.id }}">
									<small>[{% trans 'remove' %}]</small>
								</a>
							</td>
						{% endif %}
					</tr>
				{% endfor %}
			</table>
		{% endif %}
		
		{% if mod|hasPermission(config.mod.create_notes) %}
			<form action="" method="post" style="margin:0">
				<table>
					<tr>
						<th>{% trans 'Staff' %}</th>
						<td>{{ mod.username|e }}</td>
					</tr>
					<tr>
						<th>
							<label for="note">{% trans 'Note' %}</label>
						</th>
						<td>
							<textarea id="note" name="note" rows="5" cols="30"></textarea>
						</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" value="{% trans 'New note' %}"></td>
					</tr>
				</table>
			</form>
		{% endif %}
	</fieldset>
{% endif %}

{% if bans|count > 0 and mod|hasPermission(config.mod.view_ban) %}
	<fieldset id="bans">
		{% set bans_on_record = 'ban' ~ (bans|count != 1 ? 's' : '') ~ ' on record' %}
		<legend>{{ bans|count }} {% trans bans_on_record %}</legend>
		
		{% for ban in bans %}
			<form action="" method="post" style="text-align:center">
				<table style="width:400px;margin-bottom:10px;border-bottom:1px solid #ddd;padding:5px">
					<tr>
						<th>{% trans 'Status' %}</th>
						<td>
							{% if config.mod.view_banexpired and ban.expires != 0 and ban.expires < time() %}
								{% trans 'Expired' %}
							{% else %}
								{% trans 'Active' %}
							{% endif %}
						</td>
					</tr>
					<tr>
						<th>{% trans 'IP' %}</th>
						<td>{{ ban.ip }}</td>
					</tr>
					<tr>
						<th>{% trans 'Reason' %}</th>
						<td>
							{% if ban.reason %}
								{{ ban.reason }}
							{% else %}
								<em>{% trans 'no reason' %}</em>
							{% endif %}
						</td>
					</tr>
					<tr>
						<th>{% trans 'Board' %}</th>
						<td>
							{% if ban.board %}
								{{ config.board_abbreviation|sprintf(ban.board) }}
							{% else %}
								<em>{% trans 'all boards' %}</em>
							{% endif %}
						</td>
					</tr>
					<tr>
						<th>{% trans 'Set' %}</th>
						<td>{{ ban.set|date(config.post_date) }}</td>
					</tr>
					<tr>
						<th>{% trans 'Expires' %}</th>
						<td>
							{% if ban.expires %}
								{{ ban.expires|date(config.post_date) }}
							{% else %}
								<em>{% trans 'never' %}</em>
							{% endif %}
						</td>
					</tr>
					<tr>
						<th>{% trans 'Staff' %}</th>
						<td>
							{% if ban.username %}
								{{ ban.username|e }}
							{% else %}
								<em>{% trans 'deleted?' %}</em>
							{% endif %}
						</td>
					</tr>
				</table>
				<input type="hidden" name="ban_id" value="{{ ban.id }}">
				<input type="submit" name="unban" value="{% trans 'Remove ban' %}">
			</form>
		{% endfor %}
	</fieldset>
{% endif %}

{% if mod|hasPermission(config.mod.ban) %}
	<fieldset>
		<legend>{% trans 'New ban' %}</legend>
		{% set redirect = '?/IP/' ~ ip ~ '#bans' %}
		{% include 'mod/ban_form.html' %}
	</fieldset>
{% endif %}