Skip to content
This repository was archived by the owner on Jan 17, 2020. It is now read-only.

Use latest revision's title in all review actions #96

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyconde/reviews/templates/reviews/proposal_details.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "reviews/proposal_base.html" %}
{% load markup crispy_forms_tags i18n account_tags %}
{% block bodyclass %}{{ block.super }} proposaldetails{% endblock %}
{% block page_title %}{% blocktrans with title=proposal.title %}Review info: {{ current_title }}{% endblocktrans %}{% endblock %}
{% block title %}{% blocktrans with title=proposal.title %}Review info: {{ current_title }}{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=current_title %}Review info: {{ title }}{% endblocktrans %}{% endblock %}
{% block title %}{% blocktrans with title=current_title %}Review info: {{ title }}{% endblocktrans %}{% endblock %}
{% block details %}
<article class="proposal">
{% if proposal.kind.slug == 'training' %}
Expand Down
4 changes: 2 additions & 2 deletions pyconde/reviews/templates/reviews/review_list.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "reviews/proposal_base.html" %}
{% load markup account_tags i18n %}
{% block bodyclass %}{{ block.super }} reviewlist{% endblock %}
{% block title %}{% blocktrans with title=proposal.title %}Reviews of "{{ title }}"{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=proposal.title %}Reviews of "{{ title }}"{% endblocktrans %}{% endblock %}
{% block title %}{% blocktrans with title=current_title %}Reviews of "{{ title }}"{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=current_title %}Reviews of "{{ title }}"{% endblocktrans %}{% endblock %}
{% block details %}
{% if not object_list %}
<p class="empty">{% trans "This proposal has not yet been reviewed." %}</p>
Expand Down
4 changes: 2 additions & 2 deletions pyconde/reviews/templates/reviews/submit_review_form.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "reviews/proposal_base.html" %}
{% load crispy_forms_tags i18n %}
{% block bodyclass %}{{ block.super }} reviewform{% endblock %}
{% block title %}{% blocktrans with title=proposal.title %}Review "{{ title }}"{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=proposal.title %}Review "{{ title }}"{% endblocktrans %}{% endblock %}
{% block title %}{% blocktrans with title=current_title %}Review "{{ title }}"{% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=current_title %}Review "{{ title }}"{% endblocktrans %}{% endblock %}
{% block details %}
<div id="help">
{% blocktrans %}
Expand Down
4 changes: 2 additions & 2 deletions pyconde/reviews/templates/reviews/update_proposal.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends "reviews/proposal_base.html" %}
{% load crispy_forms_tags i18n %}
{% block bodyclass %}{{ block.super }} update-proposal{% endblock %}
{% block title %}{% blocktrans with title=proposal.title %}Editing "{{ title }}" proposal {% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=proposal.title %}Editing "{{ title }}" proposal {% endblocktrans %}{% endblock %}
{% block title %}{% blocktrans with title=current_title %}Editing "{{ title }}" proposal {% endblocktrans %}{% endblock %}
{% block page_title %}{% blocktrans with title=current_title %}Editing "{{ title }}" proposal {% endblocktrans %}{% endblock %}
{% block details %}
{% crispy form %}
{% endblock details %}
6 changes: 5 additions & 1 deletion pyconde/reviews/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def get_context_data(self, **kwargs):
'form': self.form,
'proposal': self.proposal,
'proposal_version': self.proposal_version,
'current_title': self.proposal_version.title if self.proposal_version else self.proposal.title,
}

@method_decorator(decorators.reviewer_required)
Expand Down Expand Up @@ -232,6 +233,7 @@ def get_context_data(self, **kwargs):
data = super(UpdateReviewView, self).get_context_data(**kwargs)
data['proposal'] = self.object.proposal
data['proposal_version'] = models.ProposalVersion.objects.get_latest_for(self.object.proposal)
data['current_title'] = data['proposal_version'].title if data['proposal_version'] else data['proposal'].title
return data

def get_success_url(self):
Expand Down Expand Up @@ -515,7 +517,8 @@ def get(self, request, *args, **kwargs):
return self.render_to_response({
'form': self.form,
'proposal': self.object,
'proposal_version': self.proposal_version
'proposal_version': self.proposal_version,
'current_title': self.proposal_version.title if self.proposal_version else self.object.title,
})

def post(self, request, *args, **kwargs):
Expand Down Expand Up @@ -581,6 +584,7 @@ def get_context_data(self, **kwargs):
data = super(ProposalReviewsView, self).get_context_data(**kwargs)
data['proposal'] = get_object_or_404(models.Proposal, pk=self.kwargs['proposal_pk'])
data['proposal_version'] = models.ProposalVersion.objects.get_latest_for(data['proposal'])
data['current_title'] = data['proposal_version'].title if data['proposal_version'] else data['proposal'].title
return data

def get_queryset(self):
Expand Down