{% for course, iejs in object_list.items %}
- <div class="course_title">{{ course.title }}</div>
+ <div class="course_title">{{ course.title }}{% if auditor %} - {{ auditor.iej }}{% endif %}</div>
<div class="course_content">
{% for iej, years in iejs.items %}
</div>
{% for year, docs in years.items %}
- <span class="doc_type_title">{{ year }}</span>
<table class="listing" width="100%">
<tbody>
{% for doc in docs %}
<tr>
- <td {% if forloop.first %}class="border-top"{% endif %} width="90%">{% if doc.file %}<a href="{% url teleforma-document-view doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="50%">{% if doc.file %}<a href="{% url teleforma-document-view doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
+
+ <td {% if forloop.first %}class="border-top"{% endif %} width="40%">{% if doc.file %}<a href="{% url teleforma-document-view doc.id %}" target="_blank" title="{% trans "View" %}">{% endif %}{{ year }}{% if doc.file %}</a>{% endif %}</td>
+
+
<td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">{% if doc.file %}<a href="{% url teleforma-document-download doc.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
</tr>
{% endfor %}
template_name='teleforma/annals.html'
def get_queryset(self):
- self.iej = None
user = self.request.user
-
if user.is_staff or user.is_superuser or user.professor.all():
docs = Document.objects.filter(is_annal=True)
else:
auditors = user.auditor.all()
if auditors:
auditor = auditors[0]
- self.iej = auditor.iej
- docs = Document.objects.filter(is_annal=True, iej=self.iej)
+ docs = Document.objects.filter(is_annal=True, iej=auditor.iej)
return format_annals(docs)
def get_context_data(self, **kwargs):
+ user = self.request.user
+ auditors = user.auditor.all()
context = super(AnnalsView, self).get_context_data(**kwargs)
context['iejs'] = IEJ.objects.all()
+ context['iej'] = auditor.iej
all_courses = get_courses(self.request.user)
context['all_courses'] = all_courses
return context
- @method_decorator(permission_required('is_staff'))
+ @method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(AnnalsView, self).dispatch(*args, **kwargs)
docs = Document.objects.filter(is_annal=True, course=self.course)
return format_annals(docs)
+