forked from apim-haufe-io/wicked.ui
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* API category filtering * Fixing checkbox sidenav and grid column layout * Updating apis grid style and layout * Not all changes were pushed * Adding custom.css to layout.jade, changes are in global file, config * Updating media queries for responsive * Fixing condition were there are no categories in the eft column. * removing custom.css inclusion * New layout for API tags filtering * Fix package version * layout fix * version revert * Implement review comments * Make sure the layout looks good if no tags are used
- Loading branch information
1 parent
b5e9d62
commit 690dc47
Showing
3 changed files
with
106 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ | |
"esversion": 6 | ||
}, | ||
"name": "portal" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,85 @@ | ||
extends layout | ||
|
||
mixin checkBox(source, value) | ||
- var inputId = source | ||
- var inputValue = value | ||
- var label = source | ||
.checkbox | ||
label | ||
if inputValue | ||
input(name='#{inputId}' id='#{inputId}' class='tag' checked='checked' type='checkbox') | ||
| !{label} | ||
else | ||
input(name='#{inputId}' id='#{inputId}' class='tag' type='checkbox') | ||
| !{label} | ||
|
||
mixin apiCategories(apiTags, params) | ||
.panel.panel-default | ||
.panel-body.wicked-api-body | ||
form(role='form' action='/apis' method='GET') | ||
.form-group | ||
b API Categories | ||
input(name='filter' id='filter' value='on' type='hidden') | ||
each tag, i in apiTags | ||
+checkBox(tag, params[tag]) | ||
button(type='submit' onclick='checkCategoryFilter()').btn.btn-primary Filter | ||
| ||
a(class="btn btn-primary" href="/apis" role="button") Clear | ||
|
||
mixin apiDef(anApi) | ||
.col-md-4 | ||
.panel.panel-default | ||
.panel-body.wicked-api-body | ||
if glob.views.apis.showApiIcon | ||
img(src='/images/api-icon.png') | ||
if anApi.auth == 'oauth2' | ||
a(href='/help/apis' target='_blank') | ||
img(src='/images/oauth2-icon-32.png' align='right' title='API is secured over OAuth 2.0') | ||
else if anApi.auth == 'none' | ||
else | ||
a(href='/help/apis' target='_blank') | ||
img(src='/images/key-icon-32.png' align='right' title='API is secured over API keys') | ||
a(href='/apis/#{anApi.id}') | ||
h4= anApi.name | ||
if anApi.deprecated | ||
p(style='color:red;') <b>Deprecated</b> | ||
p!= anApi.desc | ||
a(class="btn btn-default" href="/apis/#{anApi.id}" role="button") Information » | ||
.panel.panel-default | ||
.panel-body.wicked-api-body | ||
if glob.views.apis.showApiIcon | ||
img(src='/images/api-icon.png') | ||
if anApi.auth == 'oauth2' | ||
a(href='/help/apis' target='_blank') | ||
img(src='/images/oauth2-icon-32.png' align='right' title='API is secured over OAuth 2.0') | ||
else if anApi.auth == 'none' | ||
else | ||
a(href='/help/apis' target='_blank') | ||
img(src='/images/key-icon-32.png' align='right' title='API is secured over API keys') | ||
a(href='/apis/#{anApi.id}') | ||
h4= anApi.name | ||
if anApi.deprecated | ||
p(style='color:red;') <b>Deprecated</b> | ||
p!= anApi.desc | ||
a(class="btn btn-default" href="/apis/#{anApi.id}" role="button") Information » | ||
|
||
|
||
|
||
block scripts | ||
script(type='text/javascript'). | ||
function checkCategoryFilter() { | ||
if($(".tag:checked").length <= 0){ | ||
$("input[id='filter']").remove(); | ||
} | ||
} | ||
|
||
block content | ||
.jumbotron.wicked-api-title | ||
.container.wicked-title-container | ||
h1= title | ||
.container.wicked-title-container | ||
h1= title | ||
|
||
p= glob.views.apis.titleTagline | ||
p= glob.views.apis.titleTagline | ||
|
||
.container.wicked-container | ||
if desc | ||
p!= desc | ||
|
||
p | ||
|
||
if desc | ||
p!= desc | ||
p | ||
div(class="row") | ||
- var length = apilist.length | ||
|
||
each api, i in apilist | ||
if (i % 3 == 0) | ||
.row | ||
- var apiClass = "col-md-12" | ||
if (apiTags.length > 0) | ||
div(class="col-md-3") | ||
+apiCategories(apiTags, params) | ||
- apiClass = "col-md-9" | ||
div(class=apiClass) | ||
each api, i in apilist | ||
if (i % 3 == 0) | ||
div(class="row") | ||
+apiDef(apilist[i]) | ||
if (i+1) < length | ||
+apiDef(apilist[i+1]) | ||
+apiDef(apilist[i+1]) | ||
if (i+2) < length | ||
+apiDef(apilist[i+2]) | ||
.row | ||
.col-md-1 | ||
p | ||
+apiDef(apilist[i+2]) |