checkers
This commit is contained in:
parent
20dc4c7f02
commit
364dd5119c
@ -18,8 +18,12 @@ class SolutionsTableView(BaseView):
|
||||
queryset = Solution.objects.all()
|
||||
if 'teacher' in self.request.GET.keys():
|
||||
if 'set_id' in self.request.GET.keys():
|
||||
if self.request.user != self.entities.set.creator and self.request.user.username not in self.entities.set.editors:
|
||||
raise AccessError()
|
||||
queryset = queryset.filter(set_id=self.request.GET['set_id'])
|
||||
elif 'task_id' in self.request.GET.keys():
|
||||
if self.request.user != self.entities.task.creator and self.request.user.username not in self.entities.task.editors:
|
||||
raise AccessError()
|
||||
queryset = queryset.filter(task_id=self.request.GET['task_id'], set=None)
|
||||
else:
|
||||
raise AccessError()
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
{% block main %}
|
||||
<h4>
|
||||
<table class="table" style="width: 30%;">
|
||||
<table class="table" style="width: 50%;">
|
||||
<tr>
|
||||
<td>
|
||||
Id решения
|
||||
@ -13,6 +13,14 @@
|
||||
{{ solution.id }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Пользователь
|
||||
</td>
|
||||
<td>
|
||||
<a href="/account?username={{ solution.user.username }}"><img src="{{ solution.user.userinfo.profile_pic_url }}" width="30px" height="30px" style="border-radius: 50%; margin-right: 10px;">{{ solution.user.username }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Задача
|
||||
@ -21,12 +29,20 @@
|
||||
<a href="/task?{% if solution.set %}{% with settask=solution.set|settask:solution.task %}setTask_id={{ settask.id }}{% endwith %}{% else %}task_id={{ solution.task.id }}{% endif %}">{{ solution.task.name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Время отправки
|
||||
</td>
|
||||
<td>
|
||||
{{ solution.time_sent }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Язык
|
||||
</td>
|
||||
<td>
|
||||
<img src="{{ solution.language.logo_url }}" width="30px" height="30px">
|
||||
<img src="{{ solution.language.logo_url }}" width="30px" height="30px"> {{ solution.language.name }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -39,6 +55,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</h4>
|
||||
<hr><hr>
|
||||
<h4>Файлы решения</h4>
|
||||
{% for entity in solution.files %}
|
||||
<h5>{{ entity.filename }}</h5>
|
||||
|
Loading…
Reference in New Issue
Block a user