From 9fc714c315f461dfb45c2afb9310f88aaacf433b Mon Sep 17 00:00:00 2001 From: Kasper Brandt Date: Mon, 24 Aug 2015 15:13:48 +0300 Subject: [PATCH] [#1633] Update project editor with IATI partner roles --- akvo/rest/views/project_editor.py | 3 ++- akvo/templates/myrsr/project_editor.html | 2 +- .../partner_input.html | 20 +++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/akvo/rest/views/project_editor.py b/akvo/rest/views/project_editor.py index 6f00c270f0..4ba25e1bd0 100644 --- a/akvo/rest/views/project_editor.py +++ b/akvo/rest/views/project_editor.py @@ -80,7 +80,7 @@ PARTNER_FIELDS = ( ('organisation', 'value-partner-', 'related-object'), - ('iati_organisation_role', 'iati-organisation-role-', 'integer'), + ('iati_organisation_role', 'partner-role-', 'integer'), ('funding_amount', 'funding-amount-', 'decimal'), ) @@ -487,6 +487,7 @@ def log_addition(obj, user): change_message=change_message ) + @api_view(['POST']) @permission_classes((IsAuthenticated, )) def project_editor_delete_document(request, project_pk=None, document_pk=None): diff --git a/akvo/templates/myrsr/project_editor.html b/akvo/templates/myrsr/project_editor.html index 899eaf3178..00059c36fe 100644 --- a/akvo/templates/myrsr/project_editor.html +++ b/akvo/templates/myrsr/project_editor.html @@ -1248,7 +1248,7 @@
{% trans 'Keywords' %}
fundingInputNode = parentNode.getElementsByTagName("input")[1]; fundingNode = fundingInputNode.parentNode.parentNode; - if (node.options[node.selectedIndex].value === 'funding') { + if (node.options[node.selectedIndex].value === '1') { fundingInputNode.removeAttribute('disabled'); fundingInputNode.className += ' priority1'; diff --git a/akvo/templates/myrsr/project_editor_partials/partner_input.html b/akvo/templates/myrsr/project_editor_partials/partner_input.html index 7fe670932b..a59c0fbfc9 100644 --- a/akvo/templates/myrsr/project_editor_partials/partner_input.html +++ b/akvo/templates/myrsr/project_editor_partials/partner_input.html @@ -21,16 +21,16 @@
- + + + + + + {% if partnership.iati_organisation_role == 100 %}{% endif %} - {% if partnership.partner_type == 'sponsor' %}

{% trans "The 'sponsor' role will soon be removed, please select a different role for this organisation." %}

{% endif %} + {% if partnership.iati_organisation_role == 100 %}

{% trans "The 'sponsor' role will soon be removed, please select a different role for this organisation." %}

{% endif %}
-
+
{{ project.get_currency_display }} + {% if partnership.iati_organisation_role != 1 %} disabled {% endif %}>