diff --git a/hypha/apply/projects/templates/application_projects/vendor_detail.html b/hypha/apply/projects/templates/application_projects/vendor_detail.html index 417e4ce8b63c6ae7bf7f2dcd105dcc763c6ba0be..25e3ffbfefefa4ac4af049b1fbc42fdf4c2d83d6 100644 --- a/hypha/apply/projects/templates/application_projects/vendor_detail.html +++ b/hypha/apply/projects/templates/application_projects/vendor_detail.html @@ -1,12 +1,12 @@ {% extends "base-apply.html" %} -{% load bleach_tags %} +{% load bleach_tags i18n %} -{% block title %}Vendor Info for {{ project.title }} {% endblock %} +{% block title %}{% trans "Vendor Information for" %} {{ project.title }} {% endblock %} {% block content %} <div class="admin-bar"> <div class="admin-bar__inner"> - <h2 class="heading heading--no-margin">Vendor Information for {{ project.title }}</h2> + <h2 class="heading heading--no-margin">{% trans "Vendor Information for" %} {{ project.title }}</h2> </div> </div> @@ -32,7 +32,6 @@ {% if question == 'Due Diligence Documents' %} <div class="card card--solid"> <div class="card__inner"> - <!-- <h5 class="card__heading">Reciepts</h5> --> {% for document in due_diligence_documents %} <p class="card__text"><a href="{% url "apply:projects:vendor-documents" pk=project.pk vendor_pk=project.vendor.pk file_pk=document.pk %}">{{ document.document.name }}</a></p> {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/vendor_success.html b/hypha/apply/projects/templates/application_projects/vendor_success.html index 27c953800d35c4a281bb0f458f492be0050a7598..68c7f1692191f9b468dbdd2074b31f4702fd3c0b 100644 --- a/hypha/apply/projects/templates/application_projects/vendor_success.html +++ b/hypha/apply/projects/templates/application_projects/vendor_success.html @@ -15,6 +15,7 @@ <p>We will use this information to create the contract for your project.</p> <p>Once this has happened, we will send you a message with your contract.</p> <p>We'll ask you to read it, and if everything is OK, you can sign it.</p> + <a href="{% url 'apply:projects:detail' pk=project.pk %}">{% trans "Visit Project Detail Page" %}</a> </div> {% endblock %} diff --git a/hypha/apply/projects/views/vendor.py b/hypha/apply/projects/views/vendor.py index d6923f7e5d6f2c3181f3dd9bb9353c4e01dbc039..86f46f6852e3363ee6719f636d009fccefe19431 100644 --- a/hypha/apply/projects/views/vendor.py +++ b/hypha/apply/projects/views/vendor.py @@ -1,20 +1,21 @@ -from django.contrib.auth.models import User -from hypha.apply.projects.models.vendor import VendorFormSettings import json + from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import UserPassesTestMixin -from django.views.generic.detail import DetailView -from django.utils import timezone -from django.http import Http404 from django.core.exceptions import PermissionDenied -from django.utils.decorators import method_decorator from django.db.models.fields.files import FieldFile +from django.http import Http404 from django.shortcuts import get_object_or_404, render +from django.utils import timezone +from django.utils.decorators import method_decorator +from django.utils.translation import gettext_lazy as _ +from django.views.generic.detail import DetailView from formtools.wizard.views import SessionWizardView from wagtail.core.models import Site + from addressfield.fields import ADDRESS_FIELDS_ORDER -from hypha.apply.utils.storage import PrivateStorage -from hypha.apply.utils.storage import PrivateMediaView +from hypha.apply.projects.models.vendor import VendorFormSettings +from hypha.apply.utils.storage import PrivateMediaView, PrivateStorage from ..forms import ( CreateVendorFormStep1, @@ -24,7 +25,13 @@ from ..forms import ( CreateVendorFormStep5, CreateVendorFormStep6, ) -from ..models import BankInformation, DueDiligenceDocument, Project, ProjectSettings, Vendor +from ..models import ( + BankInformation, + DueDiligenceDocument, + Project, + ProjectSettings, + Vendor, +) def show_extra_info_form(wizard): @@ -139,7 +146,7 @@ class CreateVendorView(VendorAccessMixin, SessionWizardView): f.close() form = self.get_form('documents') form.delete_temporary_files() - return render(self.request, 'application_projects/vendor_success.html') + return render(self.request, 'application_projects/vendor_success.html', {'project': vendor_project}) def get_form_initial(self, step): vendor_project = self.get_project() @@ -213,7 +220,7 @@ class VendorDetailView(VendorAccessMixin, DetailView): vendor_form_settings = VendorFormSettings.for_request(self.request) data = {} group = 0 - data.setdefault(group, {'title': 'Vendor Information', 'questions': list()}) + data.setdefault(group, {'title': str(_('Vendor Information')), 'questions': list()}) data[group]['questions'] = [ (getattr(vendor_form_settings, 'name_label'), vendor.name), (getattr(vendor_form_settings, 'contractor_name_label'), vendor.contractor_name), @@ -222,7 +229,7 @@ class VendorDetailView(VendorAccessMixin, DetailView): ('Due Diligence Documents', ''), ] group = group + 1 - data.setdefault(group, {'title': 'Bank Account Information', 'questions': list()}) + data.setdefault(group, {'title': str(_('Bank Account Information')), 'questions': list()}) bank_info = vendor.bank_info data[group]['questions'] = [ (getattr(vendor_form_settings, 'account_holder_name_label'), bank_info.account_holder_name if bank_info else ''), @@ -231,12 +238,12 @@ class VendorDetailView(VendorAccessMixin, DetailView): (getattr(vendor_form_settings, 'account_currency_label'), bank_info.account_currency if bank_info else ''), ] group = group + 1 - data.setdefault(group, {'title': '(Optional) Extra Information for Accepting Payments', 'questions': list()}) + data.setdefault(group, {'title': str(_('(Optional) Extra Information for Accepting Payments')), 'questions': list()}) data[group]['questions'] = [ (getattr(vendor_form_settings, 'branch_address_label'), self.get_address_display(bank_info.branch_address) if bank_info else ''), ] group = group + 1 - data.setdefault(group, {'title': 'Intermediary Bank Account Information', 'questions': list()}) + data.setdefault(group, {'title': str(_('Intermediary Bank Account Information')), 'questions': list()}) iba_info = bank_info.iba_info if bank_info else None data[group]['questions'] = [ (getattr(vendor_form_settings, 'ib_account_routing_number_label'), iba_info.account_routing_number if iba_info else ''), @@ -245,7 +252,7 @@ class VendorDetailView(VendorAccessMixin, DetailView): (getattr(vendor_form_settings, 'ib_branch_address_label'), self.get_address_display(iba_info.branch_address) if iba_info else ''), ] group = group + 1 - data.setdefault(group, {'title': 'Account Holder National Identity Document Information', 'questions': list()}) + data.setdefault(group, {'title': str(_('Account Holder National Identity Document Information')), 'questions': list()}) data[group]['questions'] = [ (getattr(vendor_form_settings, 'nid_type_label'), bank_info.nid_type if bank_info else ''), (getattr(vendor_form_settings, 'nid_number_label'), bank_info.nid_number if bank_info else ''), diff --git a/hypha/locale/en/LC_MESSAGES/django.po b/hypha/locale/en/LC_MESSAGES/django.po index 592a6499c0f0f4f1384e9cf48a5a68a9f2206ad7..bbb2a0631135db169142b143f9407e7820230c35 100644 --- a/hypha/locale/en/LC_MESSAGES/django.po +++ b/hypha/locale/en/LC_MESSAGES/django.po @@ -2479,6 +2479,10 @@ msgstr "" msgid "Contractor Setup Completed" msgstr "" +#: hypha/apply/projects/templates/application_projects/vendor_success.html:18 +msgid "Visit Project Detail Page" +msgstr "" + #: hypha/apply/projects/models/vendor.py:45 msgid "Yes, the account belongs to the organisation above" msgstr "" @@ -2486,3 +2490,27 @@ msgstr "" #: hypha/apply/projects/models/vendor.py:46 msgid "No, it is a personal bank account" msgstr "" + +#: hypha/apply/projects/views/vendor.py:223 +msgid "Vendor Information" +msgstr "" + +#: hypha/apply/projects/views/vendor.py:232 +msgid "Bank Account Information" +msgstr "" + +#: hypha/apply/projects/views/vendor.py:241 +msgid "(Optional) Extra Information for Accepting Payments" +msgstr "" + +#: hypha/apply/projects/views/vendor.py:246 +msgid "Intermediary Bank Account Information" +msgstr "" + +#: hypha/apply/projects/views/vendor.py:255 +msgid "Account Holder National Identity Document Information" +msgstr "" + +#: hypha/apply/projects/templates/application_projects/vendor_detail.html:4,9 +msgid "Vendor Information for" +msgstr ""