-
Notifications
You must be signed in to change notification settings - Fork 29
/
logger_list.html
214 lines (189 loc) · 14 KB
/
logger_list.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
{% extends 'base.html' %}
{% block bodydata %}
data-project-id="{{ project.id }}"
data-project-locked="{{ project.islocked }}"
{% endblock %}
{% block title %} | Project: {{ project.name }} - Logger{% endblock %}
{% block main %}
<div class="page-header">
<div class="container">
<h1 class="smaller">
{% if project.islocked %}<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>{% endif %}
<a href="{% url 'admin:project_overview' project.id %}">{{ project.name }}</a>
</h1>
{% include 'projects/navigation.html' %}
</div>
</div>
<div class="container">
{% include 'snippets/messages.html' %}
<div class="row">
<div class="col-md-8 col-md-push-2">
<h3 class="header">
{% if project.islocked %}<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>{% endif %}
<span>History</span>
</h3>
{% for log in logs %}
{% if forloop.first %}
<ul class="list-unstyled overview-list">
{% endif %}
<li>
<h6>{{log.created}}</h6>
<h4>
{% if log.action.class == 'Project' %}
{%if log.action.id == 'created' %}
{{log.action.class}} {{log.action.id}} with a name <a href="{% url 'admin:project_overview' log.project.id %}"> {{ log.project.name }} </a>
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{log.action.id}}
{%elif log.action.id == 'updated' %}
{%if log.action.field == 'name' %}
{{log.action.class}} renamed to <a href="{% url 'admin:project_settings' log.project.id %}"> {{ log.project.name }} </a>
{%elif log.action.field == 'islocked' %}
{{log.action.class}} <a href="{% url 'admin:project_settings' log.project.id %}"> {{ log.project.name }} </a> is {%if log.action.value == 'True' %} locked {%else%} unlocked {% endif %}
{%elif log.action.field == 'isprivate' %}
{{log.action.class}} <a href="{% url 'admin:project_settings' log.project.id %}"> {{ log.project.name }} </a> is now {%if log.action.value == 'True' %} private {%else%} public {% endif %}
{%elif log.action.field == 'status' %}
{{log.action.class}} <a href="{% url 'admin:project_settings' log.project.id %}"> {{ log.project.name }} </a> is now {{log.action.value}}
{%elif log.action.field == 'geographic_extent' %}
{{log.action.class}} <a href="{% url 'admin:project_settings' log.project.id %}">{{ log.project.name }} </a> Project geographic extent changed
{%elif log.action.field == 'everyone_contributes' %}
{%if log.action.value == 'auth' %}
Only authenticated users can now contribute to the project
{%elif log.action.value == 'true' %}
All users can now contribute to the project
{%elif log.action.value == 'false' %}
Only specified members can now contribute to the project
{% endif %}
{% endif %}
{% endif %}
{% elif log.action.class == 'Admins' %}
{%if log.action.id == 'created' %}
User {{log.action.user_display_name}} added as an adminstrator of the project <a href="{% url 'admin:project_settings' log.project.id %}">{{ log.project.name }} </a>
{%elif log.action.id == 'deleted' %}
User {{log.action.user_display_name}} removed from adminstrators of the project <a href="{% url 'admin:project_settings' log.project.id %}">{{ log.project.name }} </a>
{% endif %}
{% elif log.action.class == 'Category' %}
{%if log.action.id == 'created' %}
{{log.action.class}} {{log.action.id}} with name <a href="{% url 'admin:category_overview' log.project.id log.category.id %}"> {{ log.category.name }} </a>
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{ log.category.name }} {{log.action.id}}
{%else%}
{%if log.action.field == 'name' %}
{{log.action.class}} renamed to <a href="{% url 'admin:category_overview' log.project.id log.category.id %}"> {{ log.category.name }} </a>
{%elif log.action.field == 'status' %}
{{log.action.class}} <a href="{% url 'admin:category_overview' log.project.id log.category.id %}"> {{ log.category.name }} </a> is {%if log.action.value == 'active' %} activated {% else %} deactivated {% endif %}
{%elif log.action.field == 'default_status' %}
Default status for contributions of category <a href="{% url 'admin:category_overview' log.project.id log.category.id %}"> {{ log.category.name }} </a> is "{{log.action.value}}"
{% else %}
<a href="">## {{ log.action.id }} ## -- {{ log.action.class }} @@@@ {{ log.action.field }} ??? {{ log.action.value}}- date: {{log.modified}}</a>
{% endif %}
{% endif %}
{% elif log.action.class == 'Subset' %}
{%if log.action.id == 'created' %}
{{log.action.class}} {{log.action.id}} with a name <a href="{% url 'admin:subset_settings' log.project.id log.subset.id %}"> {{ log.subset.name }} </a>
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{ log.subset.name }} {{log.action.id}}
{%elif log.action.field == 'name' %}
{{log.action.class}} renamed to <a href="{% url 'admin:subset_settings' log.project.id log.subset.id %}"> {{ log.subset.name }} </a>
{% endif %}
{% elif log.action.class == 'UserGroup' %}
{%if log.action.id == 'created' %}
{{log.action.class}} {{log.action.id}} with a name <a href="{% url 'admin:usergroup_settings' log.project.id log.usergroup.id %}"> {{ log.usergroup.name }} </a>
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{ log.category.name }} {{log.action.id}}
{%else%}
{%if log.action.field == 'name' %}
{{log.action.class}} renamed to <a href="{% url 'admin:usergroup_settings' log.project.id log.usergroup.id %}"> {{ log.usergroup.name }} </a>
{%elif log.action.field == 'default_status' %}
Default status for contribution of {{log.action.class}} <a href="{% url 'admin:usergroup_settings' log.project.id log.usergroup.id %}"> {{ log.usergroup.name }} </a> is "{{log.action.value}}"
{%elif log.action.field == 'can_contribute' %}
Members of the user group can now contribute to the project
{%elif log.action.field == 'can_moderate' %}
Members of the user group can now moderate contributions of the project
{%elif log.action.field == 'can_view' %}
Members of the user group can now view data of the project
{% endif %}
{% endif %}
{% elif log.action.class == 'UserGroup_users' %}
{%if log.action.subaction == 'add' %}
User {{log.action.user_display_name}} added to user group <a href="{% url 'admin:usergroup_overview' log.project.id log.usergroup.id %}"> {{ log.usergroup.name }} </a>
{%elif log.action.subaction == 'remove' %}
User {{log.action.user_display_name}} removed from User group <a href="{% url 'admin:usergroup_overview' log.project.id log.usergroup.id %}"> {{ log.usergroup.name }} </a>
{% endif %}
{% elif log.action.class == 'Field' %}
{%if log.action.id == 'created' %}
{{log.field.type}} {{log.action.id}} field with name <a href="{% url 'admin:category_field_settings' log.project.id log.category.id log.field.id %}"> {{ log.field.name }} </a> for category <a href="{% url 'admin:category_overview' log.project.id log.category.id %}"> {{ log.category.name }} </a>
{%elif log.action.id == 'deleted' %}
{{log.field.type}} {{log.action.id}} for category <a href="{% url 'admin:category_overview' log.project.id log.category.id %}">{{ log.category.name }} </a>
{%else%}
{%if log.action.field == 'name' %}
{{log.field.type}} field renamed to <a href="{% url 'admin:category_field_settings' log.project.id log.category.id log.field.id %}"> {{ log.field.name }}
{%elif log.action.field == 'status' %}
{{log.field.type}} field is now {{log.action.value}}
{%elif log.action.field == 'required' %}
{{log.field.type}} field set as {%if log.action.value == 'False' %} optional {% else %} mandayory{% endif %}
{% endif %}
{% endif %}
{% elif log.action.class == 'Location' %}
{%if log.action.id == 'created' %}
{{log.action.class}} added
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{log.action.id}}
{%else%}
{%if log.action.field == 'name' %}
{{log.action.class}} renamed to {{log.location.name}}
{%elif log.action.field == 'geometry' %}
{{log.action.class}} geometry changed
{% endif %}
{% endif %}
{% elif log.action.class == 'Comment' %}
{%if log.action.id == 'created' %}
{{log.action.class}} added to observation
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{log.action.id}} from observation
{% endif %}
{% elif log.action.class == 'Observation' %}
{%if log.action.id == 'created' %}
{{log.action.class}} added, and now is {{log.action.value}}
{%elif log.action.id == 'deleted' %}
{{log.action.class}} {{log.action.id}}
{%else%}
{%if log.action.field == 'properties' %}
Observation properties changed
{%elif log.action.field == 'status' %}
{% if log.action.value == 'review' %}
{{log.action.class}} reported
{% elif log.action.value == 'active' %}
{{log.action.class}} activated
{% elif log.action.value == 'pending' %}
{{log.action.class}} suspended
{% endif %}
{% endif %}
{% endif %}
{% elif log.action.class == 'MediaFile' %}
{%if log.action.id == 'created' %}
{{log.mediafile.type}} media file added to observation
{%elif log.action.id == 'deleted' %}
{{log.mediafile.type}} media file {{log.action.id}} from observation
{% endif %}
{% else %}
<a href="">## {{ log.action.id }} ## -- {{ log.action.class }} @@@@ {{ log.action.field }} ??? {{ log.action.value}}- date: {{log.modified}}</a>
{% endif %}
</h4>
</li>
{% if forloop.last %}
</ul>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endblock %}
{% block libraries %}
<script src="/static/lib/moment/moment.min.js"></script>
<script src="/static/lib/handlebars/handlebars.js"></script>
<script src="/static/js/templates.js"></script>
<link rel="stylesheet" href="/static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script src="/static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="/static/js/admin.ui.filters.data.js"></script>
<script src="/static/js/admin.ui.forms.validate.js"></script>
{% endblock %}