mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
pedagogy: basic display list of UV
This commit is contained in:
@ -43,6 +43,9 @@ class UV(models.Model):
|
||||
"""
|
||||
return user.is_in_group(settings.SITH_GROUP_PEDAGOGY_ADMIN_ID)
|
||||
|
||||
def can_be_viewed_by(self, user):
|
||||
return user.is_subscribed
|
||||
|
||||
code = models.CharField(
|
||||
_("code"),
|
||||
max_length=10,
|
||||
|
12
pedagogy/templates/pedagogy/guide.jinja
Normal file
12
pedagogy/templates/pedagogy/guide.jinja
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
{% extends "core/base.jinja" %}
|
||||
|
||||
{% block title %}
|
||||
{% trans %}UV Guide{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% for uv in object_list %}
|
||||
{{ uv.code }}
|
||||
{% endfor %}
|
||||
{% endblock content %}
|
@ -54,12 +54,16 @@ class UVCommentDetailView(DetailView):
|
||||
pass
|
||||
|
||||
|
||||
class UVListView(ListView):
|
||||
class UVListView(CanViewMixin, ListView):
|
||||
"""
|
||||
UV guide main page
|
||||
"""
|
||||
|
||||
pass
|
||||
# This is very basic and is prone to changment
|
||||
|
||||
model = UV
|
||||
ordering = ["code"]
|
||||
template_name = "pedagogy/guide.jinja"
|
||||
|
||||
|
||||
class UVCommentReportCreateView(CreateView):
|
||||
|
Reference in New Issue
Block a user