mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 11:16:50 +00:00
feature add ATM page with addition fields
This commit is contained in:
parent
ee958ab042
commit
d74836200d
@ -1,5 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class BranchesConfig(AppConfig):
|
||||
class AtmsConfig(AppConfig):
|
||||
name = 'atms'
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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 %}
|
||||
<div id="atms_list">
|
||||
<h1>ATMs</h1>
|
||||
<h1>ATMs</h1>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% if form.non_field_errors %}
|
||||
<form method="post">
|
||||
{% csrf_token %} {% if form.non_field_errors %}
|
||||
<div class="alert alert-danger">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
@ -17,227 +11,280 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_id.errors %}<div class="alert alert-danger">{{ form.atm_id.errors }}</div>{% endif %}
|
||||
{% if form.atm_id.errors %}
|
||||
<div class="alert alert-danger">{{ form.atm_id.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_id.label_tag }}
|
||||
{{ form.atm_id }}
|
||||
{{ form.atm_id.label_tag }} {{ form.atm_id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.bank_id.errors %}<div class="alert alert-danger">{{ form.bank_id.errors }}</div>{% endif %}
|
||||
{% if form.bank_id.errors %}
|
||||
<div class="alert alert-danger">{{ form.bank_id.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.bank_id.label_tag }}
|
||||
{{ form.bank_id }}
|
||||
{{ form.bank_id.label_tag }} {{ form.bank_id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.name.errors %}<div class="alert alert-danger">{{ form.name.errors }}</div>{% endif %}
|
||||
{% if form.name.errors %}
|
||||
<div class="alert alert-danger">{{ form.name.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.name.label_tag }}
|
||||
{{ form.name }}
|
||||
{{ form.name.label_tag }} {{ form.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_type.errors %}<div class="alert alert-danger">{{ form.atm_type.errors }}</div>{% endif %}
|
||||
{% if form.services.errors %}
|
||||
<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_type.label_tag }}
|
||||
{{ form.atm_type }}
|
||||
{{ form.services.label_tag }} {{ form.services }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.location_latitude.errors %}<div class="alert alert-danger">{{ form.location_latitude.errors }}</div>{% endif %}
|
||||
{% if form.location_latitude.errors %}
|
||||
<div class="alert alert-danger">{{ form.location_latitude.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.location_latitude.label_tag }}
|
||||
{{ form.location_latitude }}
|
||||
{{ form.location_latitude.label_tag }} {{ form.location_latitude }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.location_longitude.errors %}<div class="alert alert-danger">{{ form.location_longitude.errors }}</div>{% endif %}
|
||||
{% if form.location_longitude.errors %}
|
||||
<div class="alert alert-danger">{{ form.location_longitude.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.location_longitude.label_tag }}
|
||||
{{ form.location_longitude }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.meta_license_name.errors %}<div class="alert alert-danger">{{ form.meta_license_name.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.meta_license_name.label_tag }}
|
||||
{{ form.meta_license_name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_routing_scheme.errors %}<div class="alert alert-danger">{{ form.atm_routing_scheme.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_routing_scheme.label_tag }}
|
||||
{{ form.atm_routing_scheme }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_routing_address.errors %}<div class="alert alert-danger">{{ form.atm_routing_address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_routing_address.label_tag }}
|
||||
{{ form.atm_routing_address }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.is_accessible.errors %}<div class="alert alert-danger">{{ form.is_accessible.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.is_accessible.label_tag }}
|
||||
{{ form.is_accessible }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.accessibleFeatures.errors %}<div class="alert alert-danger">{{ form.accessibleFeatures.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.accessibleFeatures.label_tag }}
|
||||
{{ form.accessibleFeatures }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.more_info.errors %}<div class="alert alert-danger">{{ form.more_info.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.more_info.label_tag }}
|
||||
{{ form.more_info }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.phone_number.errors %}<div class="alert alert-danger">{{ form.phone_number.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.phone_number.label_tag }}
|
||||
{{ form.phone_number }}
|
||||
{{ form.location_longitude.label_tag }} {{ form.location_longitude }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.services.errors %}<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
{% if form.meta_license_name.errors %}
|
||||
<div class="alert alert-danger">{{ form.meta_license_name.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.services.label_tag }}
|
||||
{{ form.services }}
|
||||
{{ form.meta_license_name.label_tag }} {{ form.meta_license_name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.located_at.errors %}
|
||||
<div class="alert alert-danger">{{ form.located_at.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.located_at.label_tag }} {{ form.located_at }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.has_deposit_capability.errors %}
|
||||
<div class="alert alert-danger">{{ form.has_deposit_capability.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.has_deposit_capability.label_tag }} {{ form.has_deposit_capability }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.address.errors %}<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
{% if form.is_accessible.errors %}
|
||||
<div class="alert alert-danger">{{ form.is_accessible.errors }}</div>
|
||||
{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.address.label_tag }}
|
||||
{{ form.address }}
|
||||
{{ form.is_accessible.label_tag }} {{ form.is_accessible }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.lobby.errors %}<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
{% if form.accessibleFeatures.errors %}
|
||||
<div class="alert alert-danger">{{ form.accessibleFeatures.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.lobby.label_tag }}
|
||||
{{ form.lobby }}
|
||||
{{ form.accessibleFeatures.label_tag }} {{ form.accessibleFeatures }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.drive_up.errors %}<div class="alert alert-danger">{{ form.drive_up.errors }}</div>{% endif %}
|
||||
{% if form.more_info.errors %}
|
||||
<div class="alert alert-danger">{{ form.more_info.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.drive_up.label_tag }}
|
||||
{{ form.drive_up }}
|
||||
{{ form.more_info.label_tag }} {{ form.more_info }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 hidden-xs">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.notes.errors %}
|
||||
<div class="alert alert-danger">{{ form.notes.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-green">Add</button>
|
||||
{{ form.notes.label_tag }} {{ form.notes }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.supported_languages.errors %}
|
||||
<div class="alert alert-danger">{{ form.supported_languages.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.supported_languages.label_tag }} {{ form.supported_languages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.supported_currencies.errors %}
|
||||
<div class="alert alert-danger">{{ form.supported_currencies.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.supported_currencies.label_tag }} {{ form.supported_currencies }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.location_categories.errors %}
|
||||
<div class="alert alert-danger">{{ form.location_categories.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.location_categories.label_tag }} {{ form.location_categories }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.minimum_withdrawal.errors %}
|
||||
<div class="alert alert-danger">{{ form.minimum_withdrawal.errors }}
|
||||
</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.minimum_withdrawal.label_tag }} {{ form.minimum_withdrawal }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.site_name.errors %}
|
||||
<div class="alert alert-danger">{{ form.site_name.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.site_name.label_tag }} {{ form.site_name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.branch_identification.errors %}
|
||||
<div class="alert alert-danger">{{ form.branch_identification.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.branch_identification.label_tag }} {{ form.branch_identification }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.site_identification.errors %}
|
||||
<div class="alert alert-danger">{{ form.site_identification.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.site_identification.label_tag }} {{ form.site_identification }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4"> {% if form.cash_withdrawal_national_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_national_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover tablesorter" id="branches-list" aria-describedby="branches list">
|
||||
<thead>
|
||||
<th scope="col">ATM Id</th>
|
||||
<th scope="col">Bank Id</th>
|
||||
<th scope="col">ATM Name</th>
|
||||
<th scope="col">More_info</th>
|
||||
<th scope="col">Update Button</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for atm in atms_list %}
|
||||
{% url 'atms_update' atm.id atm.bank_id as url_atm_update %}
|
||||
<tr data-atm-id="{{ branch.id }}">
|
||||
<td>{{ atm.id }}</td>
|
||||
<td>{{ atm.bank_id }}</td>
|
||||
<td>{{ atm.name }}</td>
|
||||
<td>
|
||||
<div class="popuptext">
|
||||
<ul>
|
||||
<li>Address:
|
||||
<ul>
|
||||
<li>line1: {{atm.address.line_1}}</li>
|
||||
<li>line2: {{atm.address.line_2}}</li>
|
||||
<li>line3: {{atm.address.line_3}}</li>
|
||||
<li>city: {{atm.address.city}}</li>
|
||||
<li>county: {{atm.address.county}}</li>
|
||||
<li>state: {{atm.address.state}}</li>
|
||||
<li>postcode: {{atm.address.postcode}}</li>
|
||||
<li>country_code: {{atm.address.country_code}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Location:
|
||||
<ul>
|
||||
<li>latitude: {{atm.location.latitude}}</li>
|
||||
<li>longitude: {{atm.location.longitude}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Meta License:
|
||||
<ul>
|
||||
<li>id: {{atm.meta.license.id}}</li>
|
||||
<li>name: {{atm.meta.license.name}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Routing
|
||||
<ul>
|
||||
<li>Scheme: {{atm.atm_routing.scheme}}</li>
|
||||
<li>Address: {{atm.atm_routing.address}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Type: {{atm.branch_type}}</li>
|
||||
<li>More Info: {{atm.more_info}}</li>
|
||||
<li>Phone Number: {{atm.phone_number}}</li>
|
||||
<li>Accessible Features: {{atm.accessibleFeatures}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="{{ url_branch_update }}" class="btn btn-primary">Update</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.balance_inquiry_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.balance_inquiry_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.cash_withdrawal_international_fee.errors %}
|
||||
<div class="alert alert-danger">{{ form.cash_withdrawal_international_fee.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.address.errors %}
|
||||
<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.address.label_tag }} {{ form.address }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
{% if form.lobby.errors %}
|
||||
<div class="alert alert-danger">{{ form.lobby.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.lobby.label_tag }} {{ form.lobby }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajs %}
|
||||
{% comment %}
|
||||
<script type="text/javascript" src="{% static 'branches/js/branches.js' %}"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
{% endcomment %}
|
||||
{% endblock extrajs %}
|
||||
|
||||
|
||||
{% block extracss %}
|
||||
<link href="{% static 'branches/css/branches.css' %}" rel="stylesheet">
|
||||
{% endblock extracss %}
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 hidden-xs">
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-green">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover tablesorter" id="atms-list" aria-describedby="atms list">
|
||||
<thead>
|
||||
<th scope="col">ATM Id</th>
|
||||
<th scope="col">Bank Id</th>
|
||||
<th scope="col">ATM Name</th>
|
||||
<th scope="col">More_info</th>
|
||||
<th scope="col">Update Button</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %}
|
||||
<tr data-atm-id="{{ branch.id }}">
|
||||
<td>{{ atm.id }}</td>
|
||||
<td>{{ atm.bank_id }}</td>
|
||||
<td>{{ atm.name }}</td>
|
||||
<td>
|
||||
<div class="popuptext">
|
||||
<ul>
|
||||
<li>Address:
|
||||
<ul>
|
||||
<li>line1: {{atm.address.line_1}}</li>
|
||||
<li>line2: {{atm.address.line_2}}</li>
|
||||
<li>line3: {{atm.address.line_3}}</li>
|
||||
<li>city: {{atm.address.city}}</li>
|
||||
<li>county: {{atm.address.county}}</li>
|
||||
<li>state: {{atm.address.state}}</li>
|
||||
<li>postcode: {{atm.address.postcode}}</li>
|
||||
<li>country_code: {{atm.address.country_code}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Location:
|
||||
<ul>
|
||||
<li>latitude: {{atm.location.latitude}}</li>
|
||||
<li>longitude: {{atm.location.longitude}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Meta License:
|
||||
<ul>
|
||||
<li>id: {{atm.meta.license.id}}</li>
|
||||
<li>name: {{atm.meta.license.name}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Routing
|
||||
<ul>
|
||||
<li>Scheme: {{atm.atm_routing.scheme}}</li>
|
||||
<li>Address: {{atm.atm_routing.address}}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>ATM Type: {{atm.branch_type}}</li>
|
||||
<li>More Info: {{atm.more_info}}</li>
|
||||
<!-- <li>Phone Number: {{atm.phone_number}}</li>-->
|
||||
<li>Accessible Features: {{atm.accessibleFeatures}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="{{ url_branch_update }}" class="btn btn-primary">Update</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %}
|
||||
<link href="{% static 'atms/css/atms.css' %}" rel="stylesheet"> {% endblock extracss %}
|
||||
@ -4,7 +4,7 @@
|
||||
{% block page_title %}{{ block.super }} / Atms{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
<div id="branches">
|
||||
<div id="atms">
|
||||
<h1>Update atm</h1>
|
||||
<h2>{{ bank_id }} : {{ atm_id }}</h2>
|
||||
<form method="post">
|
||||
@ -58,7 +58,6 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.meta_license_id.errors %}<div class="alert alert-danger">{{ form.meta_license_id.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
@ -73,7 +72,6 @@
|
||||
{{ form.meta_license_name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.accessibleFeatures.errors %}<div class="alert alert-danger">{{ form.accessibleFeatures.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
@ -108,12 +106,11 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.atm_type.errors %}<div class="alert alert-danger">{{ form.atm_type.errors }}</div>{% endif %}
|
||||
{% if form.services.errors %}<div class="alert alert-danger">{{ form.services.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.atm_type.label_tag }}
|
||||
{{ form.atm_type }}
|
||||
{{ form.services.label_tag }}
|
||||
{{ form.services }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
@ -124,10 +121,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.phone_number.errors %}<div class="alert alert-danger">{{ form.phone_number.errors }}</div>{% endif %}
|
||||
{% if form.supported_currencies.errors %}<div class="alert alert-danger">{{ form.supported_currencies.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.phone_number.label_tag }}
|
||||
{{ form.phone_number }}
|
||||
{{ form.supported_currencies.label_tag }}
|
||||
{{ form.supported_currencies }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -140,10 +137,16 @@
|
||||
{{ form.services }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.has_deposit_capability.errors %}<div class="alert alert-danger">{{ form.has_deposit_capability.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.has_deposit_capability.label_tag }}
|
||||
{{ form.has_deposit_capability }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
{% if form.address.errors %}<div class="alert alert-danger">{{ form.address.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
@ -160,13 +163,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<!-- <div class="col-xs-12 col-sm-4">
|
||||
{% if form.drive_up.errors %}<div class="alert alert-danger">{{ form.drive_up.errors }}</div>{% endif %}
|
||||
<div class="form-group">
|
||||
{{ form.drive_up.label_tag }}
|
||||
{{ form.drive_up }}
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Update" class="btn btn-primary" />
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
<label for="password">Password:</label>
|
||||
{{ directlogin_form.password }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group"<!--style="visibility:hidden"-->
|
||||
<label for="consumer-key">Consumer Key:</label>
|
||||
{{ directlogin_form.consumer_key }}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user