Skip to content

Commit

Permalink
change for issue #518
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouji2013 committed Aug 10, 2022
1 parent a35023f commit 77bf288
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 11 deletions.
69 changes: 69 additions & 0 deletions web/src/main/webapp/api-apps.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<html>
<div class=container style=padding:20px>
<h2>External Applications of CTD² API</h2>
<p>The applications listed below provide additional ways to view and use the Dashboard data. They are developed by
3rd
parties, leveraging the Dashboard API. These applications are the responsibility of their developers and are not
created or maintained by the NCI.</p>
<div class=container>
<div class="row">
<div class="col-sm">
<div class="card" style="width: 18rem;">
<img src="img/logos/ctd2_overall.png" class="card-img-top" alt="..."
style="max-height:190px;object-fit: contain">
<div class="card-body">
<h5 class="card-title">CTD² Demo Application</h5>
<p class="card-text">
<dl>
<dt>Developer</dt>
<dd>CTD² Group</dd>
<dt>Description</dt>
<dd>Demonstration application of mashup with MolePro API.</dd>
<dt>URL</dt>
<dd>http://192.168.255.255/demo</dd>
<dt>Contact Email</dt>
<dd>ocg@mail.nih.gov</dd>
<dt>Date Added</dt>
<dd>July 1st, 2021</dd>
</dl>
</p>
<a href="#" class="btn btn-primary">Go to the site</a>
</div>
</div>
</div>
<div class="col-sm">
<div class="card" style="width: 18rem;">
<img src="https://www.cancer.gov/sites/g/files/xnrzdm211/files/styles/cgov_article/public/cgov_image/media_image/900/800/files/nci-shady-grove-building-article.jpg?h=10690783&itok=NBJtLxFt"
class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">3rd Party Applications</h5>
<p class="card-text">
<dl>
<dt>Developer</dt>
<dd>John Doe</dd>
<dt>Description</dt>
<dd>Another application using CTD² API.</dd>
<dt>URL</dt>
<dd>https://www.example.com</dd>
<dt>Contact Email</dt>
<dd>johndoe@somewhere.com</dd>
<dt>Date Added</dt>
<dd>January 1st, 2022</dd>
</dl>
</p>
<a href="https://www.example.com" class="btn btn-primary">Go to the site</a>
</div>
</div>
</div>
<div class="col-sm">
<div class="card" style="width: 15rem;">
<div class="card-body">
<p class="card-text">more applications to be shown here</p>
</div>
</div>
</div>
</div>
</div>
</div>

</html>
32 changes: 21 additions & 11 deletions web/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,28 @@
<li><a target="_blank" href="https://ocg.cancer.gov/programs/ctd2">OCG/CTD² Home Page</a></li>
<li><a href="#cite">How to Cite</a></li>
<li><a href="#api-documentation">API Documentation</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/publications">Publications</a>
<li class="dropdown-submenu"><a tabindex="-1" href="#">Applications</a>
<ul class="dropdown-menu">
<li><a target="_blank" href="/registration">Application Registration (Developers)</a></li>
<li><a target="_blank" href="#applications">Dashboard Applications</a></li>
</ul>
</li>
<li class="dropdown-submenu"><a tabindex="-1" href="#">Network Resources</a>
<ul class="dropdown-menu">
<li><a target="_blank" href="https://ocg.cancer.gov/programs/ctd2">CTD² Home Page</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/publications">Publications</a>
</li>
<li><a target="_blank" href="https://ocg.cancer.gov/programs/ctd2/data-portal">Data
Portal - Downloads</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/analytical-tools">Analytical
Tools</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/supported-reagents">Supported
Reagents</a></li>
</ul>
</li>
<li><a href="" class="help-navigate">Glossary</a></li>
<li><a target="_blank" href="https://ocg.cancer.gov/programs/ctd2/data-portal">Data
Portal - Downloads</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/analytical-tools">Analytical
Tools</a></li>
<li><a target="_blank"
href="https://ocg.cancer.gov/programs/ctd2/supported-reagents">Supported
Reagents</a></li>
<li class="dropdown-submenu"><a tabindex="-1" href="#">Outside Resources</a>
<ul class="dropdown-menu">
<li><a target="_blank" href="http://www.lincsproject.org/">LINCS</a></li>
Expand Down
18 changes: 18 additions & 0 deletions web/src/main/webapp/js/ctd2.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,23 @@ import MraView from './mra.js'
}
});

const Applications = Backbone.View.extend({
el: $("#main-container"),
template: _.template($("#applications-tmpl").html()),
render: function () {
fetch("api-apps.html")
.then(response => {
if(!response.ok) throw new Error("API Applications Page Missing")
return response.text()
})
.then(data => $(this.el).html(this.template({api_apps: data})))
.catch(error => {
$(this.el).html(this.template({api_apps: error}))
});
return this;
}
});

const HelpNavigateView = Backbone.View.extend({
template: _.template($("#help-navigate-tmpl").html()),

Expand Down Expand Up @@ -3376,6 +3393,7 @@ import MraView from './mra.js'
"cite": viewOnlyRouter(HowToCiteView),
"api-documentation": viewOnlyRouter(ApiDocumentation),
"master-export": viewOnlyRouter(MasterExportView),
"applications": viewOnlyRouter(Applications),
"*actions": "home",
},

Expand Down

1 comment on commit 77bf288

@zhouji2013
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of this is revived from 20114fd

Please sign in to comment.