From d74836200d5fd7473770840fc9eafe9688c79c94 Mon Sep 17 00:00:00 2001 From: Reena_Aheer Date: Sun, 17 Apr 2022 12:43:42 +0200 Subject: [PATCH] feature add ATM page with addition fields --- apimanager/atms/apps.py | 2 +- apimanager/atms/forms.py | 140 ++++++-- apimanager/atms/templates/atms/index.html | 397 ++++++++++++--------- apimanager/atms/templates/atms/update.html | 29 +- apimanager/atms/views.py | 96 ++++- apimanager/base/templates/home.html | 2 +- 6 files changed, 430 insertions(+), 236 deletions(-) diff --git a/apimanager/atms/apps.py b/apimanager/atms/apps.py index b3752af..6908fb3 100644 --- a/apimanager/atms/apps.py +++ b/apimanager/atms/apps.py @@ -1,5 +1,5 @@ from django.apps import AppConfig -class BranchesConfig(AppConfig): +class AtmsConfig(AppConfig): name = 'atms' diff --git a/apimanager/atms/forms.py b/apimanager/atms/forms.py index f59de43..1297832 100644 --- a/apimanager/atms/forms.py +++ b/apimanager/atms/forms.py @@ -1,5 +1,5 @@ """ -Forms of branches app +Forms of ATM app """ from django import forms @@ -33,7 +33,7 @@ class CreateAtmForm(forms.Form): label='Name', widget=forms.TextInput( attrs={ - 'placeholder': 'The name of the branch', + 'placeholder': 'The name of the ATM', 'class': 'form-control', } ), @@ -103,7 +103,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) - drive_up = forms.CharField( + """drive_up = forms.CharField( label='Drive Up', widget=forms.Textarea( attrs={ @@ -112,9 +112,9 @@ class CreateAtmForm(forms.Form): } ), required=False, - ) - atm_routing_scheme = forms.CharField( - label='Branch Routing Scheme', + )""" + located_at = forms.CharField( + label='ATM location', widget=forms.TextInput( attrs={ 'placeholder': 'OBP', @@ -123,16 +123,6 @@ class CreateAtmForm(forms.Form): ), required=False, ) - atm_routing_address = forms.CharField( - label='Branch Routing Address', - widget=forms.TextInput( - attrs={ - 'placeholder': '123abc', - 'class': 'form-control', - } - ), - required=False, - ) is_accessible = forms.ChoiceField( label='is accessible', widget=forms.Select( @@ -152,11 +142,11 @@ class CreateAtmForm(forms.Form): ), required=False, ) - atm_type = forms.CharField( - label='ATM type', + services = forms.CharField( + label='Services', widget=forms.TextInput( attrs={ - 'placeholder': 'Full service store', + 'placeholder': 'Service store', 'class': 'form-control', } ), @@ -173,27 +163,73 @@ class CreateAtmForm(forms.Form): required=False, ) - phone_number = forms.CharField( - label='Mobile Phone Number', - widget=forms.TextInput( + supported_currencies = forms.ChoiceField( + label='Supported Currencies', + widget=forms.Select( attrs={ - 'placeholder': 'E.g. +49 123 456 78 90 12', 'class': 'form-control', } ), required=False, ) - - located_at = forms.CharField( - label='More information', + notes = forms.ChoiceField( + label='Write Notes', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + location_categories = forms.ChoiceField( + label='Write location Category', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + minimum_withdrawal = forms.CharField( + label='Minimum Withdrawal', widget=forms.TextInput( attrs={ - 'placeholder': 'short walk to the lake from here', + 'placeholder': '5', 'class': 'form-control', } ), required=False, ) + site_name = forms.CharField( + label='Site Name', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Site Name ', + 'class': 'form-control', + } + ), + required=False, + ) + branch_identification = forms.CharField( + label='Branch Identification', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Branch Identification', + 'class': 'form-control', + } + ), + required=False, + ) + site_identification = forms.CharField( + label='Site Identification', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Site Identification', + 'class': 'form-control', + } + ), + required=False, + ) services = forms.CharField( label='Services', @@ -206,6 +242,56 @@ class CreateAtmForm(forms.Form): required=False, ) + supported_languages = forms.ChoiceField( + label='supported_languages', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + has_deposit_capability = forms.ChoiceField( + label='Deposit Capabilities', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + cash_withdrawal_national_fee = forms.CharField( + label='Cash Withdrawal National fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Cash withdrawal national fee', + 'class': 'form-control', + } + ), + required=False, + ) + cash_withdrawal_international_fee = forms.CharField( + label='Cash Withdrawal international fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Cash withdrawal international fee', + 'class': 'form-control', + } + ), + required=False, + ) + balance_inquiry_fee = forms.CharField( + label='Balance Inquiry Fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Balance Inquiry Fee', + 'class': 'form-control', + } + ), + required=False, + ) + + def __init__(self, *args, **kwargs): kwargs.setdefault('label_suffix', '') super(CreateAtmForm, self).__init__(*args, **kwargs) diff --git a/apimanager/atms/templates/atms/index.html b/apimanager/atms/templates/atms/index.html index 80f9db7..edd0f36 100644 --- a/apimanager/atms/templates/atms/index.html +++ b/apimanager/atms/templates/atms/index.html @@ -1,15 +1,9 @@ -{% extends 'base.html' %} -{% load static %} - -{% block page_title %}{{ block.super }} / atms{% endblock page_title %} - -{% block content %} +{% extends 'base.html' %} {% load static %} {% block page_title %}{{ block.super }} / atms{% endblock page_title %} {% block content %}
-

ATMs

+

ATMs

-
- {% csrf_token %} - {% if form.non_field_errors %} + + {% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
@@ -17,227 +11,280 @@
- {% if form.atm_id.errors %}
{{ form.atm_id.errors }}
{% endif %} + {% if form.atm_id.errors %} +
{{ form.atm_id.errors }}
{% endif %}
- {{ form.atm_id.label_tag }} - {{ form.atm_id }} + {{ form.atm_id.label_tag }} {{ form.atm_id }}
- {% if form.bank_id.errors %}
{{ form.bank_id.errors }}
{% endif %} + {% if form.bank_id.errors %} +
{{ form.bank_id.errors }}
{% endif %}
- {{ form.bank_id.label_tag }} - {{ form.bank_id }} + {{ form.bank_id.label_tag }} {{ form.bank_id }}
- {% if form.name.errors %}
{{ form.name.errors }}
{% endif %} + {% if form.name.errors %} +
{{ form.name.errors }}
{% endif %}
- {{ form.name.label_tag }} - {{ form.name }} + {{ form.name.label_tag }} {{ form.name }}
- {% if form.atm_type.errors %}
{{ form.atm_type.errors }}
{% endif %} + {% if form.services.errors %} +
{{ form.services.errors }}
{% endif %}
- {{ form.atm_type.label_tag }} - {{ form.atm_type }} + {{ form.services.label_tag }} {{ form.services }}
- {% if form.location_latitude.errors %}
{{ form.location_latitude.errors }}
{% endif %} + {% if form.location_latitude.errors %} +
{{ form.location_latitude.errors }} +
{% endif %}
- {{ form.location_latitude.label_tag }} - {{ form.location_latitude }} + {{ form.location_latitude.label_tag }} {{ form.location_latitude }}
- {% if form.location_longitude.errors %}
{{ form.location_longitude.errors }}
{% endif %} + {% if form.location_longitude.errors %} +
{{ form.location_longitude.errors }} +
{% endif %}
- {{ form.location_longitude.label_tag }} - {{ form.location_longitude }} -
-
-
- -
-
- {% if form.meta_license_name.errors %}
{{ form.meta_license_name.errors }}
{% endif %} -
- {{ form.meta_license_name.label_tag }} - {{ form.meta_license_name }} -
-
-
- {% if form.atm_routing_scheme.errors %}
{{ form.atm_routing_scheme.errors }}
{% endif %} -
- {{ form.atm_routing_scheme.label_tag }} - {{ form.atm_routing_scheme }} -
-
-
- {% if form.atm_routing_address.errors %}
{{ form.atm_routing_address.errors }}
{% endif %} -
- {{ form.atm_routing_address.label_tag }} - {{ form.atm_routing_address }} -
-
-
- -
-
- {% if form.is_accessible.errors %}
{{ form.is_accessible.errors }}
{% endif %} -
- {{ form.is_accessible.label_tag }} - {{ form.is_accessible }} -
-
-
- {% if form.accessibleFeatures.errors %}
{{ form.accessibleFeatures.errors }}
{% endif %} -
- {{ form.accessibleFeatures.label_tag }} - {{ form.accessibleFeatures }} -
-
-
- {% if form.more_info.errors %}
{{ form.more_info.errors }}
{% endif %} -
- {{ form.more_info.label_tag }} - {{ form.more_info }} -
-
-
- -
-
- {% if form.phone_number.errors %}
{{ form.phone_number.errors }}
{% endif %} -
- {{ form.phone_number.label_tag }} - {{ form.phone_number }} + {{ form.location_longitude.label_tag }} {{ form.location_longitude }}
- {% if form.services.errors %}
{{ form.services.errors }}
{% endif %} + {% if form.meta_license_name.errors %} +
{{ form.meta_license_name.errors }} +
{% endif %}
- {{ form.services.label_tag }} - {{ form.services }} + {{ form.meta_license_name.label_tag }} {{ form.meta_license_name }} +
+
+
+ {% if form.located_at.errors %} +
{{ form.located_at.errors }}
{% endif %} +
+ {{ form.located_at.label_tag }} {{ form.located_at }} +
+
+
+ {% if form.has_deposit_capability.errors %} +
{{ form.has_deposit_capability.errors }}
{% endif %} +
+ {{ form.has_deposit_capability.label_tag }} {{ form.has_deposit_capability }}
- {% if form.address.errors %}
{{ form.address.errors }}
{% endif %} + {% if form.is_accessible.errors %} +
{{ form.is_accessible.errors }}
+ {% endif %}
- {{ form.address.label_tag }} - {{ form.address }} + {{ form.is_accessible.label_tag }} {{ form.is_accessible }}
- {% if form.lobby.errors %}
{{ form.lobby.errors }}
{% endif %} + {% if form.accessibleFeatures.errors %} +
{{ form.accessibleFeatures.errors }} +
{% endif %}
- {{ form.lobby.label_tag }} - {{ form.lobby }} + {{ form.accessibleFeatures.label_tag }} {{ form.accessibleFeatures }}
- {% if form.drive_up.errors %}
{{ form.drive_up.errors }}
{% endif %} + {% if form.more_info.errors %} +
{{ form.more_info.errors }}
{% endif %}
- {{ form.drive_up.label_tag }} - {{ form.drive_up }} + {{ form.more_info.label_tag }} {{ form.more_info }}
- - +
+
+ {% if form.location_categories.errors %} +
{{ form.location_categories.errors }}
{% endif %} +
+ {{ form.location_categories.label_tag }} {{ form.location_categories }} +
+
+
+ {% if form.minimum_withdrawal.errors %} +
{{ form.minimum_withdrawal.errors }} +
{% endif %} +
+ {{ form.minimum_withdrawal.label_tag }} {{ form.minimum_withdrawal }} +
+
+
+ {% if form.site_name.errors %} +
{{ form.site_name.errors }}
{% endif %} +
+ {{ form.site_name.label_tag }} {{ form.site_name }} +
+
+
+
+
+ {% if form.branch_identification.errors %} +
{{ form.branch_identification.errors }}
{% endif %} +
+ {{ form.branch_identification.label_tag }} {{ form.branch_identification }} +
+
+
+ {% if form.site_identification.errors %} +
{{ form.site_identification.errors }}
{% endif %} +
+ {{ form.site_identification.label_tag }} {{ form.site_identification }} +
+
+
{% if form.cash_withdrawal_national_fee.errors %} +
{{ form.cash_withdrawal_national_fee.errors }}
{% endif %} +
{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }} +
+
-
- - - - - - - - - - {% for atm in atms_list %} - {% url 'atms_update' atm.id atm.bank_id as url_atm_update %} - - - - - - - - {% endfor %} - -
ATM IdBank IdATM NameMore_infoUpdate Button
{{ atm.id }}{{ atm.bank_id }}{{ atm.name }} -
-
    -
  • Address: -
      -
    • line1: {{atm.address.line_1}}
    • -
    • line2: {{atm.address.line_2}}
    • -
    • line3: {{atm.address.line_3}}
    • -
    • city: {{atm.address.city}}
    • -
    • county: {{atm.address.county}}
    • -
    • state: {{atm.address.state}}
    • -
    • postcode: {{atm.address.postcode}}
    • -
    • country_code: {{atm.address.country_code}}
    • -
    -
  • -
  • Location: -
      -
    • latitude: {{atm.location.latitude}}
    • -
    • longitude: {{atm.location.longitude}}
    • -
    -
  • -
  • Meta License: -
      -
    • id: {{atm.meta.license.id}}
    • -
    • name: {{atm.meta.license.name}}
    • -
    -
  • -
  • ATM Routing -
      -
    • Scheme: {{atm.atm_routing.scheme}}
    • -
    • Address: {{atm.atm_routing.address}}
    • -
    -
  • -
  • ATM Type: {{atm.branch_type}}
  • -
  • More Info: {{atm.more_info}}
  • -
  • Phone Number: {{atm.phone_number}}
  • -
  • Accessible Features: {{atm.accessibleFeatures}}
  • -
-
-
Update
-
+
+
+
+ {% if form.balance_inquiry_fee.errors %} +
{{ form.balance_inquiry_fee.errors }}
{% endif %} +
+ {{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }} +
+
+
+ {% if form.cash_withdrawal_international_fee.errors %} +
{{ form.cash_withdrawal_international_fee.errors }}
{% endif %} +
+ {{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }} +
+
+
+
+
+ {% if form.address.errors %} +
{{ form.address.errors }}
{% endif %} +
+ {{ form.address.label_tag }} {{ form.address }} +
+
+
+ {% if form.lobby.errors %} +
{{ form.lobby.errors }}
{% endif %} +
+ {{ form.lobby.label_tag }} {{ form.lobby }} +
+
-{% endblock %} - -{% block extrajs %} -{% comment %} - - -{% endcomment %} -{% endblock extrajs %} -{% block extracss %} - -{% endblock extracss %} \ No newline at end of file + + +
+ +
+ + +
+ + + + + + + + + + {% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %} + + + + + + + + {% endfor %} + +
ATM IdBank IdATM NameMore_infoUpdate Button
{{ atm.id }}{{ atm.bank_id }}{{ atm.name }} +
+
    +
  • Address: +
      +
    • line1: {{atm.address.line_1}}
    • +
    • line2: {{atm.address.line_2}}
    • +
    • line3: {{atm.address.line_3}}
    • +
    • city: {{atm.address.city}}
    • +
    • county: {{atm.address.county}}
    • +
    • state: {{atm.address.state}}
    • +
    • postcode: {{atm.address.postcode}}
    • +
    • country_code: {{atm.address.country_code}}
    • +
    +
  • +
  • Location: +
      +
    • latitude: {{atm.location.latitude}}
    • +
    • longitude: {{atm.location.longitude}}
    • +
    +
  • +
  • Meta License: +
      +
    • id: {{atm.meta.license.id}}
    • +
    • name: {{atm.meta.license.name}}
    • +
    +
  • +
  • ATM Routing +
      +
    • Scheme: {{atm.atm_routing.scheme}}
    • +
    • Address: {{atm.atm_routing.address}}
    • +
    +
  • +
  • ATM Type: {{atm.branch_type}}
  • +
  • More Info: {{atm.more_info}}
  • + +
  • Accessible Features: {{atm.accessibleFeatures}}
  • +
+
+
Update
+
+
+{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %} + {% endblock extracss %} \ No newline at end of file diff --git a/apimanager/atms/templates/atms/update.html b/apimanager/atms/templates/atms/update.html index fd20dbb..8169785 100644 --- a/apimanager/atms/templates/atms/update.html +++ b/apimanager/atms/templates/atms/update.html @@ -4,7 +4,7 @@ {% block page_title %}{{ block.super }} / Atms{% endblock page_title %} {% block content %} -
+

Update atm

{{ bank_id }} : {{ atm_id }}

@@ -58,7 +58,6 @@
-
{% if form.meta_license_id.errors %}
{{ form.meta_license_id.errors }}
{% endif %}
@@ -73,7 +72,6 @@ {{ form.meta_license_name }}
-
{% if form.accessibleFeatures.errors %}
{{ form.accessibleFeatures.errors }}
{% endif %}
@@ -108,12 +106,11 @@
-
- {% if form.atm_type.errors %}
{{ form.atm_type.errors }}
{% endif %} + {% if form.services.errors %}
{{ form.services.errors }}
{% endif %}
- {{ form.atm_type.label_tag }} - {{ form.atm_type }} + {{ form.services.label_tag }} + {{ form.services }}
@@ -124,10 +121,10 @@
- {% if form.phone_number.errors %}
{{ form.phone_number.errors }}
{% endif %} + {% if form.supported_currencies.errors %}
{{ form.supported_currencies.errors }}
{% endif %}
- {{ form.phone_number.label_tag }} - {{ form.phone_number }} + {{ form.supported_currencies.label_tag }} + {{ form.supported_currencies }}
@@ -140,10 +137,16 @@ {{ form.services }}
+
+ {% if form.has_deposit_capability.errors %}
{{ form.has_deposit_capability.errors }}
{% endif %} +
+ {{ form.has_deposit_capability.label_tag }} + {{ form.has_deposit_capability }} +
+
-
{% if form.address.errors %}
{{ form.address.errors }}
{% endif %}
@@ -160,13 +163,13 @@
-
+
diff --git a/apimanager/atms/views.py b/apimanager/atms/views.py index b946fbd..06532d8 100644 --- a/apimanager/atms/views.py +++ b/apimanager/atms/views.py @@ -34,7 +34,12 @@ class IndexAtmView(LoginRequiredMixin, FormView): try: fields['bank_id'].choices = self.api.get_bank_id_choices() fields['is_accessible'].choices = [('','Choose...'),(True, True), (False, False)] - fields['drive_up'].initial = json.dumps({ + fields['has_deposit_capability'].choices = [('','Choose...'),(True, True), (False, False)] + fields['supported_languages'].choices = [('','Choose...'),("en", "en"), ("fr", "fr"), ("de", "de")] + fields['notes'].choices = [('','Choose...'),("String1", "String1"), ("String2", "String2")] + fields['supported_currencies'].choices = [('','Choose...'),("EUR", "EUR"), ("MXN", "MXN"), ("USD", "USD")] + fields['location_categories'].choices = [('','Choose...'),("ATBI", "ATBI"), ("ATBE", "ATBE")] + """fields['drive_up'].initial = json.dumps({ "monday": { "opening_time": "10:00", "closing_time": "18:00" @@ -63,7 +68,7 @@ class IndexAtmView(LoginRequiredMixin, FormView): "opening_time": "10:00", "closing_time": "18:00" } - }, indent=4) + }, indent=4)""" fields['lobby'].initial = json.dumps({ "monday": [ @@ -148,17 +153,26 @@ class IndexAtmView(LoginRequiredMixin, FormView): } }, "lobby": json.loads(data['lobby']), - "drive_up": json.loads(data["drive_up"]), - "branch_routing": { - "scheme": data["branch_routing_scheme"] if data["branch_routing_scheme"]!="" else "license name", - "address": data["branch_routing_address"] if data["branch_routing_address"]!="" else "license name" - }, + #"drive_up": json.loads(data["drive_up"]), "is_accessible": data["is_accessible"] if data["is_accessible"]!="" else "false", + "has_deposit_capability": data["has_deposit_capability"] if data["has_deposit_capability"]!="" else "false", + "supported_languages": data["supported_languages"] if data["supported_languages"]!="" else "false", + "supported_currencies": data["supported_currencies"] if data["supported_currencies"]!="" else "false", + "notes": data["notes"] if data["notes"]!="" else "false", + "location_categories": data["location_categories"] if data["location_categories"]!="" else "false", "accessibleFeatures": data["accessibleFeatures"] if data["accessibleFeatures"]!="" else "accessible features name", + "minimum_withdrawal": data["minimum_withdrawal"] if data["minimum_withdrawal"]!="" else "false", + "branch_identification": data["branch_identification"] if data["branch_identification"]!="" else "false", + "site_identification": data["site_identification"] if data["site_identification"]!="" else "false", + "site_name": data["site_name"] if data["site_name"]!="" else "false", + "cash_withdrawal_national_fee": data["cash_withdrawal_national_fee"] if data["cash_withdrawal_national_fee"]!="" else "false", + "cash_withdrawal_international_fee": data["cash_withdrawal_international_fee"] if data["cash_withdrawal_international_fee"]!="" else "false", + "balance_inquiry_fee": data["balance_inquiry_fee"] if data["balance_inquiry_fee"]!="" else "false", "branch_type": data["branch_type"] if data["branch_type"]!="" else "branch type", "more_info": data["more_info"] if data["more_info"]!="" else "more info", + "located_at": data["located_at"] if data["located_at"]!="" else "located_at", "phone_number": data["phone_number"] if data["phone_number"]!="" else "phone number", - "services": data["services"] if data["services"]!="" else "services" + "services": data["services"] if data["services"]!="" else "services", } result = self.api.post(urlpath, payload=payload) except APIError as err: @@ -250,21 +264,53 @@ class UpdateAtmView(LoginRequiredMixin, FormView): fields['location_longitude'].initial = result['location']['longitude'] fields['meta_license_id'].initial = result['meta']['license']['id'] fields['meta_license_name'].initial = result['meta']['license']['name'] - fields['atm_routing_scheme'].initial = result['atm_routing']['scheme'] - fields['atm_routing_address'].initial = result['atm_routing']['address'] - print("This is result", result) + fields['minimum_withdrawal'].initial = result['minimum_withdrawal'] + fields['branch_identification'].initial = result['branch_identification'] if result['is_accessible'].lower()=='true': fields['is_accessible'].choices = [(True, True), (False, False)] else: fields['is_accessible'].choices = [(False, False), (True, True)] - fields['accessibleFeatures'].initial = result['accessibleFeatures'] - fields['atm_type'].initial = result['atm_type'] + if result['has_deposit_capability'].lower()=='true': + fields['has_deposit_capability'].choices = [(True, True), (False, False)] + else: + fields['has_deposit_capability'].choices = [(False, False), (True, True)] + fields['has_deposit_capability'].initial = result['accessibleFeatures'] + fields['site_identification'].initial = result['site_identification'] + fields['site_name'].initial = result['site_name'] + fields['cash_withdrawal_national_fee'].initial = result['cash_withdrawal_national_fee'] + fields['cash_withdrawal_international_fee'].initial = result['cash_withdrawal_international_fee'] + fields['balance_inquiry_fee'].initial = result['balance_inquiry_fee'] + fields['services'].initial = result['services'] fields['located_at'].initial = result['located_at'] fields['more_info'].initial = result['more_info'] + fields['located_at'].initial = result['located_at'] fields['phone_number'].initial = result['phone_number'] fields['lobby'].initial = json.dumps(result['lobby'], indent=4) - print(result, "Hello World") - fields['drive_up'].initial = json.dumps(result['drive_up'], indent=4) + if result['supported_languages'].lower()=='en': + fields['supported_languages'].choices = [("en", "en"), ("fr", "fr"), ("de", "de")] + elif result['supported_languages'].lower()=='fr': + fields['supported_languages'].choices = [("fr", "fr"), ("en", "en"), ("de", "de")] + else: + fields['supported_languages'].choices = [("de", "de"),("fr", "fr"), ("en", "en")] + fields['supported_languages'].initial = result['supported_languages'] + if result['supported_currencies'].lower()=='eur': + fields['supported_currencies'].choices = [("EUR", "EUR"), ("MXN", "MXN"), ("USD", "USD")] + elif result['supported_currencies'].lower()=='mxn': + fields['supported_currencies'].choices = [("MXN", "MXN"), ("EUR", "EUR"), ("USD", "USD")] + else: + fields['supported_currencies'].choices = [("USD", "USD"),("MXN", "MXN"), ("EUR", "EUR")] + fields['supported_currencies'].initial = result['supported_currencies'] + if result['notes'].lower()=='string1': + fields['notes'].choices = [("String1", "String1"),("String2", "String2")] + else: + fields['notes'].choices = [("String2", "String2"),("String1", "String1")] + fields['notes'].initial = result['notes'] + if result['location_categories'].lower()=='atbi': + fields['location_categories'].choices = [("ATBI", "ATBI"),("ATBE", "ATBE")] + else: + fields['location_categories'].choices = [("ATBE", "ATBE"),("ATBI", "ATBI")] + fields['location_categories'].initial = result['location_categories'] + #fields['drive_up'].initial = json.dumps(result['drive_up'], indent=4) except APIError as err: messages.error(self.request, err) except Exception as err: @@ -291,16 +337,28 @@ class UpdateAtmView(LoginRequiredMixin, FormView): } }, "lobby": json.loads(data["lobby"]), - "drive_up": json.loads(data["drive_up"]), + #"drive_up": json.loads(data["drive_up"]), "branch_routing": { "scheme": data["atm_routing_scheme"] if data["atm_routing_scheme"] != "" else "license name", "address": data["atm_routing_address"] if data["atm_routing_address"] != "" else "license name" }, - "is_accessible": data["is_accessible"], + "has_deposit_capability": data["has_deposit_capability"], "accessibleFeatures": data["accessibleFeatures"], - "atm_type": data["atm_type"], + "minimum_withdrawal": data["minimum_withdrawal"], + "branch_identification": data["branch_identification"], + "site_identification": data["site_identification"], + "site_name": data["site_name"], + "cash_withdrawal_national_fee": data["cash_withdrawal_national_fee"], + "cash_withdrawal_international_fee": data["cash_withdrawal_international_fee"], + "balance_inquiry_fee": data["balance_inquiry_fee"], + "services": data["services"], "more_info": data["more_info"], - "phone_number": data["phone_number"] + "located_at": data["located_at"], + "phone_number": data["phone_number"], + "supported_languages": data["supported_languages"], + "supported_currencies": data["supported_currencies"], + "notes": data["notes"], + "location_categories": data["location_categories"] } try: result = self.api.put(urlpath, payload=payload) diff --git a/apimanager/base/templates/home.html b/apimanager/base/templates/home.html index 6eb5b66..6eaf3ad 100644 --- a/apimanager/base/templates/home.html +++ b/apimanager/base/templates/home.html @@ -39,7 +39,7 @@ {{ directlogin_form.password }}
-
+
{{ directlogin_form.consumer_key }}