mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 12:46:54 +00:00
commit
91dc2a89af
@ -57,8 +57,9 @@ INSTALLED_APPS = [
|
||||
'users',
|
||||
'branches',
|
||||
'atms',
|
||||
'banks',
|
||||
'atmlist',
|
||||
'banks',
|
||||
'banklist',
|
||||
'products',
|
||||
'productlist',
|
||||
'entitlementrequests',
|
||||
|
||||
@ -32,8 +32,7 @@ urlpatterns += i18n_patterns(
|
||||
url(r'^$', HomeView.as_view(), name="home"),
|
||||
url(r'^single-sign-on',
|
||||
OAuthInitiateView.as_view(), name='single-sign-on'),
|
||||
url(r'^logout$',
|
||||
LogoutView.as_view(), name='oauth-logout'),
|
||||
url(r'^logout$', LogoutView.as_view(), name='oauth-logout'),
|
||||
url(r'^systemviews/', include('systemviews.urls')),
|
||||
url(r'^accounts/', include('accounts.urls')),
|
||||
url(r'^account/list', include('accountlist.urls')),
|
||||
@ -42,8 +41,9 @@ urlpatterns += i18n_patterns(
|
||||
url(r'^users/', include('users.urls')),
|
||||
url(r'^branches/', include('branches.urls')),
|
||||
url(r'^atms/', include('atms.urls')),
|
||||
url(r'^banks/', include('banks.urls')),
|
||||
url(r'^atms/list', include('atmlist.urls')),
|
||||
url(r'^banks/', include('banks.urls')),
|
||||
url(r'^banks/list', include('banklist.urls')),
|
||||
url(r'^products/', include('products.urls')),
|
||||
url(r'^products/list', include('productlist.urls')),
|
||||
url(r'^customers/', include('customers.urls')),
|
||||
|
||||
@ -217,7 +217,7 @@
|
||||
<form method ="POST">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<h1>Hello ATM Attribute</h1>
|
||||
<h1>ATM Attributes</h1>
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<label class="form-group">{% trans "Attribute Name" %}:</label> <br>
|
||||
</div>
|
||||
|
||||
0
apimanager/banklist/__init__.py
Normal file
0
apimanager/banklist/__init__.py
Normal file
3
apimanager/banklist/admin.py
Normal file
3
apimanager/banklist/admin.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
apimanager/banklist/apps.py
Normal file
5
apimanager/banklist/apps.py
Normal file
@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class BanksConfig(AppConfig):
|
||||
name = 'banks_list'
|
||||
4
apimanager/banklist/models.py
Normal file
4
apimanager/banklist/models.py
Normal file
@ -0,0 +1,4 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
# -*- coding: utf-8 -*-
|
||||
18
apimanager/banklist/static/banklist/css/banklist.css
Normal file
18
apimanager/banklist/static/banklist/css/banklist.css
Normal file
@ -0,0 +1,18 @@
|
||||
#atms_list div {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
/* The actual popup (appears on top) */
|
||||
.popuptext {
|
||||
width: 250px;
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
border-radius: 6px;
|
||||
padding: 8px 0;
|
||||
z-index: 1;
|
||||
/*bottom: 125%;*/
|
||||
top:100%
|
||||
left: 50%;
|
||||
margin-left: -80px;
|
||||
}
|
||||
5
apimanager/banklist/static/banklist/js/banklist.js
Normal file
5
apimanager/banklist/static/banklist/js/banklist.js
Normal file
@ -0,0 +1,5 @@
|
||||
$(document).ready(function($) {
|
||||
$('#info').click(function() {
|
||||
alert("Hello World")
|
||||
});
|
||||
});
|
||||
32
apimanager/banklist/templates/banklist/banklist.html
Normal file
32
apimanager/banklist/templates/banklist/banklist.html
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends 'base.html' %} {% load static %} {% load i18n %}
|
||||
{% block page_title %} {{ block.super }} / {% trans "Bank List" %}{% endblock page_title %} {% block content %}
|
||||
<div id="banks">
|
||||
<h1>{% trans "Bank List" %}</h1>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover tablesorter" id="atms-list" aria-describedby="atms list">
|
||||
<thead>
|
||||
<th scope="col">{% trans "Bank Id" %}</th>
|
||||
<th scope="col">{% trans "Short Name" %}</th>
|
||||
<th scope="col">{% trans "Full Name" %}</th>
|
||||
<th scope="col">{% trans "Logo" %}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for bank in banks_list %}
|
||||
|
||||
{% url 'banks_update' bank.id as url_bank_update %}
|
||||
<tr data-bank-id="{{ bank.id }}">
|
||||
<td>{{ bank.id }}</td>
|
||||
<td>{{ bank.short_name }}</td>
|
||||
<td>{{ bank.full_name }}</td>
|
||||
<td>{{ bank.logo }}</td>
|
||||
|
||||
<td><a href="{{ url_bank_update }}" class="btn btn-primary">{% trans "Detail" %}</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 %}
|
||||
3
apimanager/banklist/tests.py
Normal file
3
apimanager/banklist/tests.py
Normal file
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
18
apimanager/banklist/urls.py
Normal file
18
apimanager/banklist/urls.py
Normal file
@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
URLs for Bank list app
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
from .views import BankListView #, ExportCsvView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$',
|
||||
BankListView.as_view(),
|
||||
name='bank-list'),
|
||||
|
||||
]
|
||||
"""
|
||||
url(r'^export_csv$',
|
||||
ExportCsvView.as_view(),
|
||||
name='export-bank-csv') """
|
||||
45
apimanager/banklist/views.py
Normal file
45
apimanager/banklist/views.py
Normal file
@ -0,0 +1,45 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Views of Bank List app
|
||||
"""
|
||||
import datetime
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
import json
|
||||
from django.urls import reverse_lazy
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic import FormView,TemplateView, View
|
||||
from banks.views import IndexBanksView
|
||||
from obp.api import API, APIError
|
||||
|
||||
|
||||
class BankListView(IndexBanksView, LoginRequiredMixin, FormView ):
|
||||
template_name = "banklist/banklist.html"
|
||||
success_url = '/banks/list'
|
||||
|
||||
def get_banks(self,context):
|
||||
api = API(self.request.session.get('obp'))
|
||||
try:
|
||||
urlpath = '/banks'
|
||||
result = api.get(urlpath)
|
||||
banks_list = []
|
||||
if 'banks' in result:
|
||||
banks_list.extend(result["banks"])
|
||||
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 banks_list
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(BankListView, self).get_context_data(**kwargs)
|
||||
banks_list = self.get_banks(context)
|
||||
context.update({
|
||||
'banks_list': banks_list
|
||||
})
|
||||
return context
|
||||
@ -58,13 +58,14 @@
|
||||
<li {% if metrics_summary_url in request.path %} class="active" {% endif %}><a href="{{ metrics_summary_url }}">{% trans "KPI Dashboard" %}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% url "system_view" as system_view_url %} {% url "banks_create" as banks_create_url %} {% url "accounts-create" as accounts_create_url %} {% url "account-list" as accounts_list_url %} {% url "branches_list" as branches_list_url %} {% url "customers-create" as customers_create_url %} {% url "customer-list" as customer_list_url %} {% url "atms_create" as atms_create_url %} {% url "atm-list" as atm_list_url %} {% url "product-list" as product_list_url %} {% url "products-create" as product_create_url %}
|
||||
{% url "system_view" as system_view_url %} {% url "banks_create" as banks_create_url %} {% url "bank-list" as bank_list_url %} {% url "accounts-create" as accounts_create_url %} {% url "account-list" as accounts_list_url %} {% url "branches_list" as branches_list_url %} {% url "customers-create" as customers_create_url %} {% url "customer-list" as customer_list_url %} {% url "atms_create" as atms_create_url %} {% url "atm-list" as atm_list_url %} {% url "product-list" as product_list_url %} {% url "products-create" as product_create_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">
|
||||
<li {% if system_view_url in request.path %} class="active" {% endif %}><a href="{{ system_view_url }}">{% trans "System Views" %}</a></li>
|
||||
<hr class="dropdown-hr">
|
||||
<li {% if banks_create_url in request.path %} class="active" {% endif %}><a href="{{ banks_create_url }}">{% trans "Bank Create" %}</a></li>
|
||||
<li {% if bank_list_url in request.path %} class="active" {% endif %}><a href="{{ bank_list_url }}">{% trans "Bank List" %}</a></li>
|
||||
<li {% if accounts_create_url in request.path %} class="active" {% endif %}><a href="{{ accounts_create_url }}">{% trans "Account Create" %}</a></li>
|
||||
<li {% if accounts_list_url in request.path %} class="active" {% endif %}><a href="{{ accounts_list_url }}">{% trans "Account List" %}</a></li>
|
||||
<li {% if customers_create_url in request.path %} class="active" {% endif %}><a href="{{ customers_create_url }}">{% trans "Customer Create" %}</a></li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user