Skip to content

Commit

Permalink
Add Branches page OpenBankProject#75
Browse files Browse the repository at this point in the history
verify should come from settings and default to true OpenBankProject#78
  • Loading branch information
PengfeiLi0218 committed Feb 8, 2019
1 parent ed35561 commit 739c44d
Show file tree
Hide file tree
Showing 11 changed files with 706 additions and 12 deletions.
1 change: 1 addition & 0 deletions apimanager/apimanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
'obp',
'consumers',
'users',
'branches',
'entitlementrequests',
'customers',
'metrics',
Expand Down
1 change: 1 addition & 0 deletions apimanager/apimanager/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
url(r'^consumers/', include('consumers.urls')),
url(r'^entitlementrequests/', include('entitlementrequests.urls')),
url(r'^users/', include('users.urls')),
url(r'^branches/', include('branches.urls')),
url(r'^customers/', include('customers.urls')),
url(r'^metrics/', include('metrics.urls')),
url(r'^config/', include('config.urls')),
Expand Down
2 changes: 2 additions & 0 deletions apimanager/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
<li{% if metrics_summary_url in request.path %} class="active"{% endif %}><a href="{{ metrics_summary_url }}">KPI Dashboard</a></li>
</ul>
</li>
{% url "branches_list" as branches_list_url %}
{% url "customers-create" as customers_create_url %}
<li class="dropdown{% if customers_create_url in request.path %} active{% endif %}">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Resources</a>
<ul class="dropdown-menu">
<li{% if customers_create_url in request.path %} class="active"{% endif %}><a href="{{ customers_create_url }}">Customers</a></li>
<li{% if branches_list_url in request.path %} class="active"{% endif %}><a href="{{ branches_list_url }}">Branches</a></li>
</ul>
</li>
{% url "config-index" as config_index_url %}
Expand Down
268 changes: 268 additions & 0 deletions apimanager/branches/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
"""
Forms of branches app
"""

from django import forms

import random


class CreateBranchForm(forms.Form):

branch_id = forms.CharField(
label='Branch Id',
widget=forms.TextInput(
attrs={
'placeholder': 'branch-id-{}'.format(random.randint(1,1000)),
'class': 'form-control',
}
),
initial='branch-id-{}'.format(random.randint(1,1000)),
)

bank_id = forms.ChoiceField(
label='Bank',
widget=forms.Select(
attrs={
'class': 'form-control',
}
),
choices=[],
)
name = forms.CharField(
label='Name',
widget=forms.TextInput(
attrs={
'placeholder': 'The name of the branch',
'class': 'form-control',
}
),
required=True
)
address_line1 = forms.CharField(
label='address_line1',
widget=forms.TextInput(
attrs={
'placeholder': 'No 1 the Road',
'class': 'form-control',
}
),
required=False
)

address_line2 = forms.CharField(
label='address_line2',
widget=forms.TextInput(
attrs={
'placeholder': 'The Place',
'class': 'form-control',
}
),
required=False
)

address_line3 = forms.CharField(
label='address_line3',
widget=forms.TextInput(
attrs={
'placeholder': 'The Hill',
'class': 'form-control',
}
),
required=False
)

address_city = forms.CharField(
label='city',
widget=forms.TextInput(
attrs={
'placeholder': 'Berlin',
'class': 'form-control',
}
),
required=False
)

address_county = forms.CharField(
label='county',
widget=forms.TextInput(
attrs={
'placeholder': 'String',
'class': 'form-control',
}
),
required=False
)

address_state = forms.CharField(
label='state',
widget=forms.TextInput(
attrs={
'placeholder': 'Brandenburg',
'class': 'form-control',
}
),
required=False
)

address_postcode = forms.CharField(
label='state',
widget=forms.TextInput(
attrs={
'placeholder': '13359',
'class': 'form-control',
}
),
required=False
)

address_country_code = forms.CharField(
label='country_code',
widget=forms.TextInput(
attrs={
'placeholder': 'DE',
'class': 'form-control',
}
),
required=False
)

location_latitude = forms.FloatField(
label='Latitude',
widget=forms.TextInput(
attrs={
'placeholder': 37.0,
'class': 'form-control',
}
),
required=False,
)

location_longitude = forms.FloatField(
label='Longitude',
widget=forms.TextInput(
attrs={
'placeholder': 110.0,
'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='Lobby',
widget=forms.TextInput(
attrs={
'placeholder': 'None',
'class': 'form-control',
}
),
required=False,
)
drive_up = forms.CharField(
label='Drive Up',
widget=forms.TextInput(
attrs={
'placeholder': 'None', # noqa
'class': 'form-control',
}
),
required=False,
)
branch_routing_scheme = forms.CharField(
label='Branch Routing Scheme',
widget=forms.TextInput(
attrs={
'placeholder': 'OBP',
'class': 'form-control',
}
),
required=False,
)
branch_routing_address = forms.CharField(
label='Branch Routing Address',
widget=forms.TextInput(
attrs={
'placeholder': '123abc',
'class': 'form-control',
}
),
required=False,
)
is_accessible = forms.CharField(
label='is accessible',
widget=forms.TextInput(
attrs={
'placeholder': 'true',
'class': 'form-control',
}
),
required=False,
)
accessibleFeatures = forms.CharField(
label='Accessible Features',
widget=forms.TextInput(
attrs={
'placeholder': 'wheelchair, atm usuable by the visually impaired',
'class': 'form-control',
}
),
required=False,
)
branch_type = forms.CharField(
label='Branch type',
widget=forms.TextInput(
attrs={
'placeholder': 'Full service store',
'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,
)

phone_number = forms.CharField(
label='Mobile Phone Number',
widget=forms.TextInput(
attrs={
'placeholder': 'E.g. +49 123 456 78 90 12',
'class': 'form-control',
}
),
required=False,
)

def __init__(self, *args, **kwargs):
kwargs.setdefault('label_suffix', '')
super(CreateBranchForm, self).__init__(*args, **kwargs)
18 changes: 18 additions & 0 deletions apimanager/branches/static/branches/css/branches.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#branches_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 changes: 5 additions & 0 deletions apimanager/branches/static/branches/js/branches.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$(document).ready(function($) {
$('#info').click(function() {
alert("Hello World")
});
});
Loading

0 comments on commit 739c44d

Please sign in to comment.