Repository: e-valuation/EvaP

Issue:
Contributor page updates
Make the contributor pages more discoverable and update their layout
- [x] remove preview buttons for non-editors (or disable)
- [x] add infobox to preview pages
- [x] add explanatory tooltips to course states
- [x] update table layout following the student index page

cc @LanDihn, ref #544



Discussion:

Resolving patch:
diff --git a/evap/evaluation/templatetags/morefilters.py b/evap/evaluation/templatetags/morefilters.py
--- a/evap/evaluation/templatetags/morefilters.py
+++ b/evap/evaluation/templatetags/morefilters.py
@@ -1,7 +1,7 @@
 from django import template
 from django.conf import settings
 from django.template import Library
-from evap.evaluation.tools import LIKERT_NAMES, GRADE_NAMES, STATES_ORDERED, STUDENT_STATES_ORDERED, get_grade_color
+from evap.evaluation.tools import LIKERT_NAMES, GRADE_NAMES, STATES_ORDERED, STATE_DESCRIPTIONS, STUDENT_STATES_ORDERED, get_grade_color
 from evap.rewards.tools import can_user_use_reward_points
 
 register = Library()
@@ -45,6 +45,11 @@ def statename(state):
     return STATES_ORDERED.get(state)
 
 
+@register.filter(name='statedescription')
+def statedescription(state):
+    return STATE_DESCRIPTIONS.get(state)
+
+
 @register.filter(name='studentstatename')
 def studentstatename(state):
     return STUDENT_STATES_ORDERED.get(state)
diff --git a/evap/evaluation/tools.py b/evap/evaluation/tools.py
--- a/evap/evaluation/tools.py
+++ b/evap/evaluation/tools.py
@@ -45,6 +45,18 @@
     ('published', _('published'))
 ))
 
+# the descriptions used in tooltips for contributors
+STATE_DESCRIPTIONS = OrderedDict((
+    ('new', _('The course was newly created and will be prepared by the student representatives.')),
+    ('prepared', _('The course was prepared by the student representatives and is now available for editing to the responsible person.')),
+    ('lecturerApproved', _('The course was approved by the responsible person and will now be checked by the student representatives.')),
+    ('approved', _('All preparations are finished. The evaluation will begin once the defined start date is reached.')),
+    ('inEvaluation', _('The course is currently in evaluation until the defined end date is reached.')),
+    ('evaluated', _('The course was fully evaluated and will now be reviewed by the student representatives.')),
+    ('reviewed', _('The course was fully evaluated and reviewed by the student representatives. You will receive an email when its results are published.')),
+    ('published', _('The results for this course have been published.'))
+))
+
 # the names used for students
 STUDENT_STATES_ORDERED = OrderedDict((
     ('inEvaluation', _('in evaluation')),
diff --git a/evap/student/templatetags/student_templatetags.py b/evap/student/templatetags/student_templatetags.py
--- a/evap/student/templatetags/student_templatetags.py
+++ b/evap/student/templatetags/student_templatetags.py
@@ -3,5 +3,8 @@
 register = Library()
 
 @register.inclusion_tag('student_vote_questionnaire_group.html')
-def include_student_vote_questionnaire_group(questionnaire_group):
-	return {'questionnaire_group': questionnaire_group}
+def include_student_vote_questionnaire_group(questionnaire_group, preview):
+    return {
+        'questionnaire_group': questionnaire_group,
+        'preview': preview,
+    }


Test patch: