Putting links in Nav bar

This commit is contained in:
Simon Redfern 2016-02-15 15:57:19 +01:00
parent 5ada837e3d
commit 5b95d442a1
3 changed files with 101 additions and 36 deletions

View File

@ -52,8 +52,6 @@ Present a list of OBP resource URLs
class ApiExplorer extends Loggable {
val listAllBanks = S.param("list-all-banks").getOrElse("false").toBoolean
logger.info(s"all_banks in url param is $listAllBanks")
@ -74,9 +72,6 @@ class ApiExplorer extends Loggable {
logger.info(s"transaction_id in url param is $presetTransactionId")
def stringToOptBoolean (x: String) : Option[Boolean] = x.toLowerCase match {
case "true" | "yes" | "1" | "-1" => Some(true)
case "false" | "no" | "0" => Some(false)
@ -95,16 +90,13 @@ class ApiExplorer extends Loggable {
y <- stringToOptBoolean(x)
} yield y
logger.info(s"showPSD2 is $showPSD2")
val showOBWG: Option[Boolean] = for {
x <- S.param("obwg")
y <- stringToOptBoolean(x)
} yield y
logger.info(s"showOBWG is $showOBWG")
@ -178,10 +170,19 @@ class ApiExplorer extends Loggable {
logger.info (s"API version to use is: $apiVersion")
// To link to API home page (this is duplicated in OAuthClient)
val baseUrl = Props.get("api_hostname", S.hostName)
// Use to show the developer the current base version url
val baseVersionUrl = s"${OAuthClient.currentApiBaseUrl}/$apiVersion"
// Get a list of resource docs from the API server
// This will throw an exception if resource_docs key is not populated
// Convert the json representation to ResourceDoc (pretty much a one to one mapping)
@ -235,7 +236,7 @@ class ApiExplorer extends Loggable {
"Meta data, data sharing, data redaction and entitlements is included. ")
case List(None, None, None) => ("OBP",
"These APIs support the full range of functionality including: Transaction history, payments, counterparty and transaction metadata, delegated account access, data redaction and entitlements.")
"The full set of Open Bank Project APIs supports functionality including: Transaction history, payments, onboarding & KYC, cards, customer and customer messages, counterparty and transaction metadata, delegated account access, data redaction and entitlements.")
case List(Some(true), None, None) => ("Core OBP",
"This core set of APIs is chosen to support common customer facing applications that rely on existing core banking services only. " +
@ -583,6 +584,7 @@ class ApiExplorer extends Loggable {
".info-box__headline *" #> s"$headline" &
"@version_path *" #> s"$baseVersionUrl" &
"@version_path [href]" #> s"$baseVersionUrl" &
"#api_home_link [href]" #> s"$baseUrl" &
"@views_box [style]" #> s"display: $displayViews;" &
".info-box__about_selected *" #> s"$catalogDescription" &
".resource" #> resources.map { i =>

View File

@ -2,41 +2,85 @@
<div data-lift="ApiExplorer.showResources">
<section class="breadcrumb-section">
<div class="container">
<div class="breadcrumbs">
<ul class="breadcrumbs__row">
<li class="breadcrumbs__list">
<a id="api_home_link" href="simon says" class="breadcrumbs__link">API Home</a>
</li>
Versions:
<li class="breadcrumbs__list">
<a class="version" href="./?version=1.2.1">1.2.1</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=1.3.0">1.3.0</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=1.4.0">1.4.0</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=2.0.0">2.0.0</a>
</li>
Catalogs:
<li class="breadcrumbs__list">
<a class="version" href="./?version=2.0.0&core=true">Core</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=2.0.0&psd2=true">PSD2</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=2.0.0&obwg=true">UK</a>
</li>
<li class="breadcrumbs__list">
<a class="version" href="./?version=2.0.0">All</a>
</li>
</ul>
<div class="version_path">
API Root: <a name="version_path" class="version" href="version path">version path</a>
</div>
<div style="clear: both"></div>
</div>
</div>
</section>
<section class="api-info-section">
<div class="container">
<div class="info-box">
<h2 class="info-box__headline">Use the API in the context of your login</h2>
<div class="text-wrapper">
Versions: <a class="version" href="./?version=1.2.1">1.2.1</a>&nbsp;&nbsp;
<a class="version" href="./?version=1.3.0">1.3.0</a>&nbsp;&nbsp;
<a class="version" href="./?version=1.4.0">1.4.0</a>&nbsp;&nbsp;
<a class="version" href="./?version=2.0.0">2.0.0</a>&nbsp;&nbsp;
</div>
<div class="text-wrapper">
Catalogs: <a class="version" href="./?version=2.0.0&core=true">Core</a>&nbsp;&nbsp;
<a class="version" href="./?version=2.0.0&psd2=true">PSD2</a>&nbsp;&nbsp;
<a class="version" href="./?version=2.0.0&obwg=true">UK</a>&nbsp;&nbsp;
<a class="version" href="./?version=2.0.0">All</a>
</div>
<div class="text-wrapper">
<a name="version_path" class="version" href="version path">version path</a>
</div>
</div>
<div class="info-box">
<h2 class="info-box__about_selected">This version...</h2>
<h3 class="info-box__about_selected">This version...</h3>
</div>
</div>
</section>
<section class="option-section">

View File

@ -116,6 +116,25 @@ a img {
.breadcrumbs__row {
padding: 0;
margin: 0;
float: left;
font-size: 12px;
line-height: 16px;
color: #fff;
}
.version_path {
display: inline-block;
float: right;
padding: 14px 2px 12px 2px;
margin: 0 0 0 0;
font-size: 12px;
line-height: 16px;
color: #fff;
letter-spacing: 0.2px;
text-decoration: none;
}
.breadcrumbs__list {
@ -167,11 +186,11 @@ a img {
.info-box__about_selected {
font-weight: 300;
font-size: 25px;
font-size: 20px;
color: #fff;
line-height: 29px;
margin: 0 0 0 0;
padding: 21px 0 8px 0;
padding: 5px 0 8px 0;
letter-spacing: 0.5px;
}