/feature Add Product List Page

This commit is contained in:
Reena-cell 2022-09-29 15:37:49 +02:00
parent d147637388
commit 0269200534
9 changed files with 245 additions and 577 deletions

View File

@ -48,7 +48,6 @@ INSTALLED_APPS = [
'bootstrap3',
'bootstrap_datepicker_plus',
'mathfilters',
'base',
'obp',
'consumers',
@ -56,6 +55,7 @@ INSTALLED_APPS = [
'branches',
'atms',
'atmlist',
'productlist',
'entitlementrequests',
'customers',
'metrics',

View File

@ -40,6 +40,7 @@ urlpatterns += i18n_patterns(
url(r'^branches/', include('branches.urls')),
url(r'^atms/', include('atms.urls')),
url(r'^atms/list', include('atmlist.urls')),
url(r'^products/list', include('productlist.urls')),
url(r'^customers/', include('customers.urls')),
url(r'^metrics/', include('metrics.urls')),
url(r'^config/', include('config.urls')),

View File

@ -59,7 +59,7 @@
<li {% if metrics_summary_url in request.path %} class="active" {% endif %}><a href="{{ metrics_summary_url }}">{% trans "KPI Dashboard" %}</a></li>
</ul>
</li>
{% url "branches_list" as branches_list_url %} {% url "customers-create" as customers_create_url %} {% url "atms_create" as atms_create_url %} {% url "atm-list" as atm_list_url %}
{% url "branches_list" as branches_list_url %} {% url "customers-create" as customers_create_url %} {% url "atms_create" as atms_create_url %} {% url "atm-list" as atm_list_url %} {% url "product-list" as product_list_url %}
<li class="dropdown{% if customers_create_url in request.path %} active{% endif %}">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">{% trans "Resources" %}</a>
<ul class="dropdown-menu">
@ -68,6 +68,7 @@
<li {% if branches_list_url in request.path %} class="active" {% endif %}><a href="{{ branches_list_url }}">{% trans "Branches" %}</a></li>
<li {% if atms_create_url in request.path %} class="active" {% endif %}><a href="{{ atms_create_url }}">{% trans "ATM Create" %}</a></li>
<li {% if atm_list_url in request.path %} class="active" {% endif %}><a href="{{ atm_list_url }}">{% trans "ATM List" %}</a></li>
<li {% if product_list_url in request.path %} class="active" {% endif %}><a href="{{ product_list_url }}">{% trans "Product List" %}</a></li>
</ul>
</li>
{% url "config-index" as config_index_url %} {% url "webui-index" as webui_props_index_url %} {% url "methodrouting-index" as methodrouting_index_url %} {% url "connectormethod" as connectormethod_url %} {% url "dynamicendpoints-index" as dynamic_endpoints_index_url %} {% url "apicollections-index" as api_collections_index_url %}
@ -94,13 +95,13 @@
</li>
{% endif %}
<!--<ul class="nav navbar-nav navbar-right" style="padding-top:13px; margin-left:12rem">-->
<li style="margin-left:55%; position:fixed">
<li style="margin-left:50%; position:fixed">
{% if user.is_authenticated %}
<p class="navbar-right" style="margin-top:8px"><span id="navbar-login-username">{{API_USERNAME}}</span>&nbsp;&nbsp;<a href="/logout" class="btn btn-default">{% trans "Logout" %} </a></p>
{% endif %}
</li>
<!--</ul>-->
<li><a style="text-decoration: none; color:#fff; cursor:pointer; margin-left:60rem">
<li style="text-decoration: none; color:#fff; cursor:pointer; margin-left:50rem"><a style="color:#fff;">
<span id="uk">English</span>
|
<span id="es">Spanish</span></a></li>

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-20 13:08+0200\n"
"POT-Creation-Date: 2022-09-29 14:00+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -70,208 +70,210 @@ msgstr "francés"
msgid "Spanish"
msgstr "español"
#: atmlist/forms.py:14 atmlist/templates/atmlist/atmlist.html:11
#: atms/forms.py:14
msgid "ATM Id"
msgstr "ID del cajero automático"
#: atmlist/forms.py:25 atmlist/templates/atmlist/atmlist.html:12
#: atms/forms.py:25 branches/templates/branches/index.html:161
#: users/templates/users/detail.html:97
#: users/templates/users/invitation.html:22
msgid "Bank Id"
msgstr "Id del banco"
#: atmlist/forms.py:35 atms/forms.py:35 branches/forms.py:33
#: consumers/templates/consumers/index.html:58
msgid "Name"
msgstr "Nombre"
#: atmlist/forms.py:38 atms/forms.py:38
msgid "The name of the ATM"
msgstr "La configuración de la API"
#: atmlist/forms.py:46 atmlist/templates/atmlist/atmlist.html:27
#: atms/forms.py:46 branches/forms.py:43
#: branches/templates/branches/index.html:176
#: branches/templates/branches/index.html:203
msgid "Address"
msgstr "Dirección"
#: atmlist/forms.py:56 atms/forms.py:56 branches/forms.py:53
msgid "Latitude"
msgstr "Latitud"
#: atmlist/forms.py:67 atms/forms.py:67 branches/forms.py:64
msgid "Longitude"
msgstr "Longitud"
#: atmlist/forms.py:78 atms/forms.py:78
msgid "Meta License Id"
msgstr "Meta Licencia"
#: atmlist/forms.py:89 atms/forms.py:89
msgid "Meta License Name"
msgstr "Nombre de la Licencia"
#: atmlist/forms.py:100 atms/forms.py:100
msgid "Opening Hours"
msgstr "Horario de atención"
#: atmlist/forms.py:110 atms/forms.py:110
msgid "Monday"
msgstr "Lunes"
#: atmlist/forms.py:120 atms/forms.py:120
msgid "Tuesday"
msgstr "Martes"
#: atmlist/forms.py:130 atms/forms.py:130
msgid "Wednesday"
msgstr "Wednesday"
#: atmlist/forms.py:140 atms/forms.py:140
msgid "Thursday"
msgstr "Jueves"
#: atmlist/forms.py:150 atms/forms.py:150
msgid "Friday"
msgstr "Viernes"
#: atmlist/forms.py:160 atms/forms.py:160
msgid "Saturday"
msgstr "Sábado"
#: atmlist/forms.py:170 atms/forms.py:170
msgid "Sunday"
msgstr "Sunday"
#: atmlist/forms.py:180 atms/forms.py:180
msgid "Is Accessible"
msgstr "Producción y validación es"
#: atmlist/forms.py:189 atms/forms.py:189
msgid "ATM location"
msgstr "Ubicación"
#: atmlist/forms.py:199 atms/forms.py:199 branches/forms.py:166
msgid "More information"
msgstr "Más información"
#: atmlist/forms.py:202 atms/forms.py:202 branches/forms.py:169
msgid "short walk to the lake from here"
msgstr "corto paseo hasta el lago desde aquí"
#: atmlist/forms.py:209 atms/forms.py:209
msgid "Deposit Capabilities"
msgstr "Tiene capacidad de depósito"
#: atmlist/forms.py:218 atms/forms.py:218
msgid "Supported Languages"
msgstr "Idiomas admitidos"
#: atmlist/forms.py:227 atms/forms.py:227
msgid "Services"
msgstr "Servicios"
#: atmlist/forms.py:230 atms/forms.py:230
msgid "Service store"
msgstr "Servicios"
#: atmlist/forms.py:237 atms/forms.py:237 branches/forms.py:146
#: branches/templates/branches/index.html:209
msgid "Accessible Features"
msgstr "Características accesibles"
#: atmlist/forms.py:240 atms/forms.py:240
msgid "wheelchair, atm usuable by the visually impaired"
msgstr "Rollstuhl, für Sehbehinderte nutzbar"
#: atmlist/forms.py:247 atms/forms.py:247
msgid "Supported Currencies"
msgstr "Divisas Soportadas"
#: atmlist/forms.py:256 atms/forms.py:256
msgid "Write Notes"
msgstr "Notas:"
#: atmlist/forms.py:265 atms/forms.py:265
msgid "Write location Category"
msgstr "Categorías de ubicación"
#: atmlist/forms.py:274 atms/forms.py:274
msgid "Minimum Withdrawal"
msgstr "El retiro mínimo"
#: atmlist/forms.py:284 atms/forms.py:284
msgid "Branch Identification"
msgstr "Identificación de la sucursal"
#: atmlist/forms.py:287 atms/forms.py:287
msgid "Enter your Branch Identification"
msgstr "Identificación de la sucursal"
#: atmlist/forms.py:294 atms/forms.py:294
msgid "Site Identification"
msgstr "IDENTIFICACIÓN DEL LUGAR"
#: atmlist/forms.py:297 atms/forms.py:297
msgid "Enter your Site Identification"
msgstr "IDENTIFICACIÓN DEL LUGAR"
#: atmlist/forms.py:304 atms/forms.py:304
msgid "Site Name"
msgstr "Nobre del sitio"
#: atmlist/forms.py:307 atms/forms.py:307
msgid "Enter your Site Name "
msgstr "Nobre del sitio"
#: atmlist/forms.py:314 atms/forms.py:314
msgid "Cash Withdrawal National fee"
msgstr "Cargo Nacional por Retiro de Efectivo"
#: atmlist/forms.py:317 atms/forms.py:317
msgid "Cash withdrawal national fee"
msgstr "Cargo Nacional por Retiro de Efectivo"
#: atmlist/forms.py:324 atms/forms.py:324
msgid "Cash Withdrawal international fee"
msgstr "Cargo internacional por retiro de efectivo"
#: atmlist/forms.py:327 atms/forms.py:327
msgid "Cash withdrawal international fee"
msgstr "Cargo internacional por retiro de efectivo"
#: atmlist/forms.py:334 atmlist/forms.py:337 atms/forms.py:334
#: atms/forms.py:337
msgid "Balance Inquiry Fee"
msgstr "Cargo por consulta de saldo"
#: atmlist/templates/atmlist/atmlist.html:2
#: atmlist/templates/atmlist/atmlist.html:4 base/templates/base.html:70
msgid "ATM List"
msgstr "Vista de Cajeros Automáticos"
#: atmlist/templates/atmlist/atmlist.html:6
#: productlist/templates/productlist/productlist.html:6
#: users/templates/users/includes/filter_pagination.html:12
msgid "Export CSV"
msgstr "Exportar CSV"
#: atmlist/templates/atmlist/atmlist.html:11 atms/forms.py:14
msgid "ATM Id"
msgstr "ID del cajero automático"
#: atmlist/templates/atmlist/atmlist.html:12 atms/forms.py:25
#: branches/templates/branches/index.html:161
#: productlist/templates/productlist/productlist.html:12
#: users/templates/users/detail.html:97
#: users/templates/users/invitation.html:22
msgid "Bank Id"
msgstr "Id del banco"
#: atmlist/templates/atmlist/atmlist.html:13
msgid "ATM Name"
msgstr "Nombre del cajero automático"
#: atmlist/templates/atmlist/atmlist.html:14
#: productlist/templates/productlist/productlist.html:14
msgid "More info"
msgstr "Más información"
#: atmlist/templates/atmlist/atmlist.html:27 atms/forms.py:46
#: branches/forms.py:43 branches/templates/branches/index.html:176
#: branches/templates/branches/index.html:203
#: productlist/templates/productlist/productlist.html:27
msgid "Address"
msgstr "Dirección"
#: atmlist/templates/atmlist/atmlist.html:36
#: consumers/templates/consumers/index.html:76
#: productlist/templates/productlist/productlist.html:36
#: users/templates/users/index.html:69
msgid "View"
msgstr "Ver"
#: atms/forms.py:35 branches/forms.py:33
#: consumers/templates/consumers/index.html:58
msgid "Name"
msgstr "Nombre"
#: atms/forms.py:38
msgid "The name of the ATM"
msgstr "La configuración de la API"
#: atms/forms.py:56 branches/forms.py:53
msgid "Latitude"
msgstr "Latitud"
#: atms/forms.py:67 branches/forms.py:64
msgid "Longitude"
msgstr "Longitud"
#: atms/forms.py:78
msgid "Meta License Id"
msgstr "Meta Licencia"
#: atms/forms.py:89
msgid "Meta License Name"
msgstr "Nombre de la Licencia"
#: atms/forms.py:100
msgid "Opening Hours"
msgstr "Horario de atención"
#: atms/forms.py:110
msgid "Monday"
msgstr "Lunes"
#: atms/forms.py:120
msgid "Tuesday"
msgstr "Martes"
#: atms/forms.py:130
msgid "Wednesday"
msgstr "Wednesday"
#: atms/forms.py:140
msgid "Thursday"
msgstr "Jueves"
#: atms/forms.py:150
msgid "Friday"
msgstr "Viernes"
#: atms/forms.py:160
msgid "Saturday"
msgstr "Sábado"
#: atms/forms.py:170
msgid "Sunday"
msgstr "Sunday"
#: atms/forms.py:180
msgid "Is Accessible"
msgstr "Producción y validación es"
#: atms/forms.py:189
msgid "ATM location"
msgstr "Ubicación"
#: atms/forms.py:199 branches/forms.py:166
msgid "More information"
msgstr "Más información"
#: atms/forms.py:202 branches/forms.py:169
msgid "short walk to the lake from here"
msgstr "corto paseo hasta el lago desde aquí"
#: atms/forms.py:209
msgid "Deposit Capabilities"
msgstr "Tiene capacidad de depósito"
#: atms/forms.py:218
msgid "Supported Languages"
msgstr "Idiomas admitidos"
#: atms/forms.py:227
msgid "Services"
msgstr "Servicios"
#: atms/forms.py:230
msgid "Service store"
msgstr "Servicios"
#: atms/forms.py:237 branches/forms.py:146
#: branches/templates/branches/index.html:209
msgid "Accessible Features"
msgstr "Características accesibles"
#: atms/forms.py:240
msgid "wheelchair, atm usuable by the visually impaired"
msgstr "Rollstuhl, für Sehbehinderte nutzbar"
#: atms/forms.py:247
msgid "Supported Currencies"
msgstr "Divisas Soportadas"
#: atms/forms.py:256
msgid "Write Notes"
msgstr "Notas:"
#: atms/forms.py:265
msgid "Write location Category"
msgstr "Categorías de ubicación"
#: atms/forms.py:274
msgid "Minimum Withdrawal"
msgstr "El retiro mínimo"
#: atms/forms.py:284
msgid "Branch Identification"
msgstr "Identificación de la sucursal"
#: atms/forms.py:287
msgid "Enter your Branch Identification"
msgstr "Identificación de la sucursal"
#: atms/forms.py:294
msgid "Site Identification"
msgstr "IDENTIFICACIÓN DEL LUGAR"
#: atms/forms.py:297
msgid "Enter your Site Identification"
msgstr "IDENTIFICACIÓN DEL LUGAR"
#: atms/forms.py:304
msgid "Site Name"
msgstr "Nobre del sitio"
#: atms/forms.py:307
msgid "Enter your Site Name "
msgstr "Nobre del sitio"
#: atms/forms.py:314
msgid "Cash Withdrawal National fee"
msgstr "Cargo Nacional por Retiro de Efectivo"
#: atms/forms.py:317
msgid "Cash withdrawal national fee"
msgstr "Cargo Nacional por Retiro de Efectivo"
#: atms/forms.py:324
msgid "Cash Withdrawal international fee"
msgstr "Cargo internacional por retiro de efectivo"
#: atms/forms.py:327
msgid "Cash withdrawal international fee"
msgstr "Cargo internacional por retiro de efectivo"
#: atms/forms.py:334 atms/forms.py:337
msgid "Balance Inquiry Fee"
msgstr "Cargo por consulta de saldo"
#: atms/templates/atms/index.html:3 base/templates/base.html:69
msgid "ATM Create"
msgstr "Creada"
@ -357,42 +359,48 @@ msgstr "Consumidores"
msgid "Branches"
msgstr "Sucursales"
#: base/templates/base.html:75
#: base/templates/base.html:71
#: productlist/templates/productlist/productlist.html:2
#: productlist/templates/productlist/productlist.html:4
msgid "Product List"
msgstr "Produkt Liste"
#: base/templates/base.html:76
msgid "Configurations"
msgstr "Configuraciones"
#: base/templates/base.html:77 config/templates/config/index.html:8
#: base/templates/base.html:78 config/templates/config/index.html:8
msgid "Config"
msgstr "Configuraciones"
#: base/templates/base.html:79
#: base/templates/base.html:80
msgid "Webui Props"
msgstr "Accesorios webui"
#: base/templates/base.html:81
#: base/templates/base.html:82
msgid "Method Routings"
msgstr "Enrutamiento de métodos"
#: base/templates/base.html:83
#: base/templates/base.html:84
#: connectormethod/templates/connectormethod/detail.html:6
#: connectormethod/templates/connectormethod/index.html:6
msgid "Connector Methods"
msgstr "Métricas del conector"
#: base/templates/base.html:85
#: base/templates/base.html:86
#: dynamicendpoints/templates/dynamicendpoints/index.html:7
msgid "Dynamic Endpoints"
msgstr "Puntos finales dinámicos"
#: base/templates/base.html:88
#: base/templates/base.html:89
msgid "My API Collections"
msgstr "Mis colecciones de API"
#: base/templates/base.html:93
#: base/templates/base.html:94
msgid "API Tester"
msgstr "Métricas de la API"
#: base/templates/base.html:99
#: base/templates/base.html:100
msgid "Logout"
msgstr "Cerrar la sesión"
@ -438,7 +446,7 @@ msgstr "Autentificar"
msgid "Choose ..."
msgstr "Seleccione..."
#: base/templates/home.html:32
#: base/templates/home.html:36
msgid "Proceed to authentication server"
msgstr "Weiter zum Authentifizierungsserver"
@ -1497,6 +1505,16 @@ msgstr "Maximo de llamadas por día"
msgid "Calls per month"
msgstr "llamadas por mes"
#: productlist/templates/productlist/productlist.html:11
msgid "Product Code"
msgstr ""
#: productlist/templates/productlist/productlist.html:13
#, fuzzy
#| msgid "Function Name"
msgid "Product Name"
msgstr "Nombre de la función"
#: users/forms.py:15 users/templates/users/detail.html:67
#: users/templates/users/detail.html:96
msgid "Role name"
@ -1649,8 +1667,6 @@ msgid "Web UI Props Value"
msgstr "Accesorios webui"
#: webui/templates/webui/index.html:18
#, fuzzy
#| msgid "Web UI Props Id"
msgid "Props Id"
msgstr "Accesorios webui"

View File

@ -1,346 +0,0 @@
"""
Forms of ATMs app
"""
from django import forms
from django.utils.translation import ugettext_lazy as _
import random
class CreateAtmForm(forms.Form):
atm_id = forms.CharField(
label=_('ATM Id'),
widget=forms.TextInput(
attrs={
'placeholder': 'atm-id-{}'.format(random.randint(1,1000)),
'class': 'form-control',
}
),
initial='atm-id-{}'.format(random.randint(1,1000)),
)
bank_id = forms.ChoiceField(
label=_('Bank Id'),
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
choices=[],
)
name = forms.CharField(
label=_('Name'),
widget=forms.TextInput(
attrs={
'placeholder': _('The name of the ATM'),
'class': 'form-control',
}
),
required=True
)
address = forms.CharField(
label=_('Address'),
widget=forms.Textarea(
attrs={
'class': 'form-control',
}
),
required=False
)
location_latitude = forms.FloatField(
label=_('Latitude'),
widget=forms.TextInput(
attrs={
'placeholder': " ",
'class': 'form-control',
}
),
required=False,
)
location_longitude = forms.FloatField(
label=_('Longitude'),
widget=forms.TextInput(
attrs={
'placeholder': " ",
'class': 'form-control',
}
),
required=False,
)
meta_license_id = forms.CharField(
label=_('Meta License Id'),
widget=forms.TextInput(
attrs={
'placeholder': 'PDDL',
'class': 'form-control',
}
),
required=False,
)
meta_license_name = forms.CharField(
label=_('Meta License Name'),
widget=forms.TextInput(
attrs={
'placeholder': 'Open Data Commons Public Domain Dedication and License',
'class': 'form-control',
}
),
required=False,
)
lobby = forms.CharField(
label=_('Opening Hours'),
widget=forms.Textarea(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
monday = forms.CharField(
label=_('Monday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
tuesday = forms.CharField(
label=_('Tuesday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
wednesday = forms.CharField(
label=_('Wednesday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
thursday = forms.CharField(
label=_('Thursday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
friday = forms.CharField(
label=_('Friday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
saturday = forms.CharField(
label=_('Saturday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
sunday = forms.CharField(
label=_('Sunday'),
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
is_accessible = forms.ChoiceField(
label=_('Is Accessible'),
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
required=False,
)
located_at = forms.CharField(
label=_('ATM location'),
widget=forms.TextInput(
attrs={
'placeholder': 'OBP',
'class': 'form-control',
}
),
required=False,
)
more_info = forms.CharField(
label=_('More information'),
widget=forms.TextInput(
attrs={
'placeholder': _('short walk to the lake from here'),
'class': 'form-control',
}
),
required=False,
)
has_deposit_capability = forms.ChoiceField(
label=_('Deposit Capabilities'),
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
required=False,
)
supported_languages = forms.ChoiceField(
label=_('Supported Languages'),
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
required=False,
)
services = forms.CharField(
label=_('Services'),
widget=forms.TextInput(
attrs={
'placeholder': _('Service store'),
'class': 'form-control',
}
),
required=False,
)
accessibility_features = forms.CharField(
label=_('Accessible Features'),
widget=forms.TextInput(
attrs={
'placeholder': _('wheelchair, atm usuable by the visually impaired'),
'class': 'form-control',
}
),
required=False,
)
supported_currencies = forms.ChoiceField(
label=_('Supported Currencies'),
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
required=False,
)
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': '5',
'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,
)
site_name = forms.CharField(
label=_('Site Name'),
widget=forms.TextInput(
attrs={
'placeholder': _('Enter your Site Name '),
'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)

View File

@ -8,19 +8,19 @@
<div class="table-responsive">
<table class="table table-hover tablesorter" id="product-list" aria-describedby="atms list">
<thead>
<th scope="col">{% trans "ATM Id" %}</th>
<th scope="col">{% trans "Product Code" %}</th>
<th scope="col">{% trans "Bank Id" %}</th>
<th scope="col">{% trans "ATM Name" %}</th>
<th scope="col">{% trans "Product Name" %}</th>
<th scope="col">{% trans "More info" %}</th>
</thead>
<tbody>
{% for atm in atms_list %}
{% for product in products_list %}
{% url 'atms_update' atm.id atm.bank_id as url_atm_update %}
<tr data-atm-id="{{ atm.id }}">
<td>{{ atm.id }}</td>
<td>{{ atm.bank_id }}</td>
<td>{{ atm.name }}</td>
<!--{% url 'atms_update' atm.id atm.bank_id as url_atm_update %}-->
<tr data-product-code="{{ product.code }}">
<td>{{ product.code }}</td>
<td>{{ product.bank_id }}</td>
<td>{{ product.name }}</td>
<td>
<div class="popuptext">
<ul>
@ -42,4 +42,4 @@
</div>
</div>
{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %}
<link href="{% static 'atms/css/atms.css' %}" rel="stylesheet"> {% endblock extracss %}
<link href="{% static 'productlist/css/product.css' %}" rel="stylesheet"> {% endblock extracss %}

View File

@ -4,12 +4,12 @@ URLs for metrics app
"""
from django.conf.urls import url
from .views import AtmListView, ExportCsvView
from .views import ProductListView, ExportCsvView
urlpatterns = [
url(r'^$',
AtmListView.as_view(),
name='atm-list'),
ProductListView.as_view(),
name='product-list'),
url(r'^export_csv$',
ExportCsvView.as_view(),
name='export-csv')

View File

@ -12,15 +12,12 @@ import json
from django.urls import reverse_lazy
from django.http import HttpResponse
from django.views.generic import FormView,TemplateView, View
from atms.views import IndexAtmsView
from obp.api import API, APIError
import csv
class AtmListView(IndexAtmsView, LoginRequiredMixin, FormView ):
template_name = "atmlist/atmlist.html"
success_url = '/atms/list'
class ProductListView(LoginRequiredMixin, FormView ):
template_name = "productlist/productlist.html"
success_url = '/products/list'
def get_banks(self):
api = API(self.request.session.get('obp'))
try:
@ -34,30 +31,29 @@ class AtmListView(IndexAtmsView, LoginRequiredMixin, FormView ):
messages.error(self.request, err)
return []
def get_atms(self, context):
def get_products(self):
api = API(self.request.session.get('obp'))
try:
self.bankids = self.get_banks()
atms_list = []
products_list = []
for bank_id in self.bankids:
urlpath = '/banks/{}/atms'.format(bank_id)
urlpath = '/banks/{}/products'.format(bank_id)
result = api.get(urlpath)
#print(result)
if 'atms' in result:
atms_list.extend(result['atms'])
#print(result, "This is a result")
if 'products' in result:
products_list.extend(result['products'])
except APIError as err:
messages.error(self.request, err)
return []
except Exception as inst:
messages.error(self.request, "Unknown Error {}".format(type(inst).__name__))
return []
return atms_list
return products_list
def get_context_data(self, **kwargs):
context = super(IndexAtmsView, self).get_context_data(**kwargs)
atms_list = self.get_atms(context)
products_list = self.get_products()
context = {}
context.update({
'atms_list': atms_list,
'products_list': products_list,
'bankids': self.bankids
})
return context
@ -79,13 +75,13 @@ class ExportCsvView(LoginRequiredMixin, View):
api = API(self.request.session.get('obp'))
try:
self.bankids = self.get_banks()
atms_list = []
products_list = []
for bank_id in self.bankids:
urlpath = '/banks/{}/atms'.format(bank_id)
urlpath = '/banks/{}/products'.format(bank_id)
result = api.get(urlpath)
#print(result)
if 'atms' in result:
atms_list.extend(result['atms'])
if 'products' in result:
products_list.extend(result['products'])
except APIError as err:
messages.error(self.request, err)
except Exception as inst:
@ -93,10 +89,10 @@ class ExportCsvView(LoginRequiredMixin, View):
response = HttpResponse(content_type = 'text/csv')
response['Content-Disposition'] = 'attachment;filename= Atms'+ str(datetime.datetime.now())+'.csv'
writer = csv.writer(response)
writer.writerow(["id","name","notes","line_1","line_2","line_3","city", "county", "state", "postcode","country_code", "longitude","latitude","more_info"])
writer.writerow(["product_code","bank_id","name","parent_product_code","more_info_url","terms_and_conditions_url","description", "license", "id", "name"])
for user in atms_list:
writer.writerow([user['id'],user['name'], user['notes'], user["address"]['line_1'], user["address"]['line_2'],
user["address"]['line_3'], user["address"]['city'], user["address"]['county'], user["address"]['state'], user["address"]['postcode'], user["address"]['country_code'], user["location"]['longitude'], user["location"]['latitude'], user['more_info']])
writer.writerow([user['product_code'],user['bank_id'], user['name'], user["parent_product_code"], user["more_info_url"],
user["terms_and_conditions_url"], user["description"], user["license"]['id'], user["license"]['name']])
return response
#print(atms_list)