Add admin links to review sections that the user can manager

This commit is contained in:
James Polley 2017-09-22 22:28:27 +10:00
parent 1e20731e32
commit ba98c36868
3 changed files with 14 additions and 1 deletions

View file

@ -256,6 +256,14 @@
<li><a href="{% url "user_reviewed" section.section.slug %}">Reviewed by you</a></li>
<li><a href="{% url "user_not_reviewed" section.section.slug %}">Not Reviewed by you</a></li>
</ul>
{% if section in manage_sections %}
<ul>
<li><a href="{% url "review_bulk_update" section.section.slug %}">Bulk Update</a></li>
<li><a href="{% url "result_notification" section.section.slug "accepted" %}">Send notifications</a></li>
<li><a href="{% url "review_status" section.section.slug %}">Voting Status</a></li>
<li><a href="{% url "review_admin" section.section.slug %}">Reviewer Stats</a></li>
</ul>
{% endif %}
</div>
</div>
</div>

View file

@ -40,7 +40,7 @@ def proposal_submit(request):
messages.info(request, _("To submit a proposal, please "
"<a href='{0}'>log in</a> and create a speaker profile "
"via the dashboard.".format(settings.LOGIN_URL)))
return redirect("home") # @@@ unauth'd speaker info page?
return redirect("dashboard") # @@@ unauth'd speaker info page?
else:
try:
request.user.speaker_profile

View file

@ -3,9 +3,14 @@ from symposion.proposals.models import ProposalSection
def reviews(request):
sections = []
manage_sections = {}
for section in ProposalSection.objects.all():
if request.user.has_perm("reviews.can_review_%s" % section.section.slug):
sections.append(section)
if request.user.has_perm("reviews.can_manage_%s" % section.section.slug):
manage_sections.setdefault(section, []).append
return {
"review_sections": sections,
"manage_sections": manage_sections
}