Skip to content

Commit

Permalink
Add new default files for about, terms, contact and faq
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Mar 1, 2019
1 parent 10f0d76 commit 0b53292
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 39 deletions.
2 changes: 1 addition & 1 deletion lib/jsorolla
66 changes: 66 additions & 0 deletions src/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
~ Copyright 2015-2016 OpenCB
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dom-module id="about-web">
<template>
<!--<style include="jso-styles">-->
<style>
.about-center {
margin: auto;
width: 65%;
text-align: justify;
font-size: 16px;
color: #797979;
}
</style>

<!-- This is where main application is rendered -->
<div class="about-center">
<h1>About</h1>
<hr>

</div>
</template>

<script>

class About extends Polymer.Element {

constructor() {
super();
}

static get is() {
return 'about-web';
}

static get properties() {
return {
version: {
type: String
}
}
}

_attachDom(dom) {
this.appendChild(dom);
}

}

customElements.define(About.is, About);
</script>
</dom-module>
21 changes: 13 additions & 8 deletions src/conf/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,19 @@ const application = {
settings: {
visibility: "public",
},
about: [
{name: "Documentation", url: "http://docs.opencb.org/display/iva/IVA+Home", icon: "fa fa-book"},
{name: "Tutorial", url: "http://docs.opencb.org/display/iva/Tutorials", icon: ""},
{name: "Source code", url: "https://github.com/opencb/iva", icon: "fa fa-github"},
{name: "Releases", url: "https://github.com/opencb/iva/releases", icon: ""},
{name: "Contact", url: "http://docs.opencb.org/display/iva/About", icon: "fa fa-envelope"},
{name: "FAQ", url: "", icon: ""},
],
about: {
dropdown: false,
links: [
{id: "documentation", name: "Documentation", url: "http://docs.opencb.org/display/iva/IVA+Home", icon: "fa fa-book"},
{id: "tutorial", name: "Tutorial", url: "http://docs.opencb.org/display/iva/Tutorials", icon: ""},
{id: "code", name: "Source code", url: "https://github.com/opencb/iva", icon: "fa fa-github"},
{id: "releases", name: "Releases", url: "https://github.com/opencb/iva/releases", icon: ""},
{id: "about", name: "About", url: "http://docs.opencb.org/display/iva/About", icon: "fa fa-envelope"},
{id: "terms", name: "Terms", url: "http://docs.opencb.org/display/iva/About", icon: "fa fa-envelope"},
{id: "contact", name: "Contact", url: "http://docs.opencb.org/display/iva/About", icon: "fa fa-envelope"},
{id: "faq", name: "FAQ", url: "", icon: ""},
]
},
login: {
visible: true,
},
Expand Down
66 changes: 66 additions & 0 deletions src/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
~ Copyright 2015-2016 OpenCB
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dom-module id="contact-web">
<template>
<!--<style include="jso-styles">-->
<style>
.contact-center {
margin: auto;
width: 65%;
text-align: justify;
font-size: 16px;
color: #797979;
}
</style>

<!-- This is where main application is rendered -->
<div class="contact-center">
<h1>Contact</h1>
<hr>

</div>
</template>

<script>

class Contact extends Polymer.Element {

constructor() {
super();
}

static get is() {
return 'contact-web';
}

static get properties() {
return {
version: {
type: String
}
}
}

_attachDom(dom) {
this.appendChild(dom);
}

}

customElements.define(Contact.is, Contact);
</script>
</dom-module>
66 changes: 66 additions & 0 deletions src/faq.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
~ Copyright 2015-2016 OpenCB
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dom-module id="faq-web">
<template>
<!--<style include="jso-styles">-->
<style>
.faq-center {
margin: auto;
width: 65%;
text-align: justify;
font-size: 16px;
color: #797979;
}
</style>

<!-- This is where main application is rendered -->
<div class="faq-center">
<h1>Frequently Asked Questions</h1>
<hr>

</div>
</template>

<script>

class Faq extends Polymer.Element {

constructor() {
super();
}

static get is() {
return 'faq-web';
}

static get properties() {
return {
version: {
type: String
}
}
}

_attachDom(dom) {
this.appendChild(dom);
}

}

customElements.define(Faq.is, Faq);
</script>
</dom-module>
107 changes: 77 additions & 30 deletions src/iva-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<link rel="import" href="../node_modules/@polymer/polymer/lib/elements/custom-style.html">
<link rel="import" href="jso-styles.html">
<link rel="import" href="welcome.html">
<link rel="import" href="about.html">
<link rel="import" href="terms.html">
<link rel="import" href="contact.html">
<link rel="import" href="faq.html">

<link rel="import" href="../lib/jsorolla/src/core/webcomponents/opencga/opencga-gene-view.html">
<link rel="import" href="../lib/jsorolla/src/core/webcomponents/opencga/opencga-transcript-view.html">
Expand Down Expand Up @@ -204,20 +208,33 @@
</template>

<!-- About dropdown menu-->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false"> About <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<template is="dom-repeat" items="{{config.about}}">
<li>
<a href$="{{item.url}}" target="_blank"><i class$="{{item.icon}}" aria-hidden="true"></i>
{{item.name}}
</a>
</li>
</template>
</ul>
</li>
<template is="dom-if" if="{{config.about.dropdown}}">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-haspopup="true" aria-expanded="false"> About <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<template is="dom-repeat" items="{{config.about.links}}">
<li>
<a href$="{{item.url}}" target="_blank"><i class$="{{item.icon}}" aria-hidden="true"></i>
{{item.name}}
</a>
</li>
</template>
</ul>
</li>
</template>

<template is="dom-if" if="{{!config.about.dropdown}}">
<template is="dom-repeat" items="{{config.about.links}}" as="link">
<!--<li>-->
<!--<a href="#" data-study="{{std.alias}}" data-project="{{proj.name}}" on-click="onStudySelect">{{std.alias}}</a>-->
<!--</li>-->
<li>
<a href="#{{link.id}}" role="button" on-click="changeTool">{{link.name}}</a>
</li>
</template>
</template>

<!-- Login/Logout button -->
<template is="dom-if" if="{{config.login.visible}}">
Expand Down Expand Up @@ -247,15 +264,41 @@


<!-- This is where main application is rendered -->
<template is="dom-if" if="{{config.enabledComponents.home}}">
<div class="center">
<div class="content" id="home">
<welcome-web project={{opencgaSession.project}} study="{{opencgaSession.study.alias}}" version="{{config.version}}"
cellbase-client={{cellbaseClient}} on-search="quickSearch"></welcome-web>
<div>
<template is="dom-if" if="{{config.enabledComponents.home}}">
<div class="center">
<div class="content" id="home">
<welcome-web project={{opencgaSession.project}} study="{{opencgaSession.study.alias}}" version="{{config.version}}"
cellbase-client={{cellbaseClient}} on-search="quickSearch"></welcome-web>
</div>

</div>
</template>

<template is="dom-if" if="{{config.enabledComponents.about}}">
<div class="content" id="about">
<about-web version="{{config.version}}"></about-web>
</div>
</template>

<template is="dom-if" if="{{config.enabledComponents.terms}}">
<div class="content" id="terms">
<terms-web version="{{config.version}}"></terms-web>
</div>
</template>

<template is="dom-if" if="{{config.enabledComponents.contact}}">
<div class="content" id="contact">
<contact-web version="{{config.version}}"></contact-web>
</div>
</div>
</template>
</template>

<template is="dom-if" if="{{config.enabledComponents.faq}}">
<div class="content" id="faq">
<faq-web version="{{config.version}}"></faq-web>
</div>
</template>
</div>
<!-- This is where main IVA application is rendered -->
<div>
<template is="dom-if" if="{{config.enabledComponents.browser}}">
Expand Down Expand Up @@ -305,19 +348,19 @@
<template is="dom-if" if="{{config.enabledComponents.clinical}}">
<div class="content" id="clinical">
<opencga-variant-clinical opencga-session="{{opencgaSession}}" config="[[config.tools.clinical]]"
population-frequencies="{{config.populationFrequencies}}"
protein-substitution-scores="{{config.proteinSubstitutionScores}}"
consequence-types="{{config.consequenceTypes}}"
opencga-client="{{opencgaClient}}" cellbase-client="{{cellbaseClient}}"
on-notifymessage="onNotifyMessage" event-notify-name="{{config.notifyEventMessage}}" >
population-frequencies="{{config.populationFrequencies}}"
protein-substitution-scores="{{config.proteinSubstitutionScores}}"
consequence-types="{{config.consequenceTypes}}"
opencga-client="{{opencgaClient}}" cellbase-client="{{cellbaseClient}}"
on-notifymessage="onNotifyMessage" event-notify-name="{{config.notifyEventMessage}}" >
</opencga-variant-clinical>
</div>
</template>

<template is="dom-if" if="{{config.enabledComponents.panel}}">
<div class="content" id="panel">
<opencga-panel-browser opencga-session="{{opencgaSession}}" opencga-client="{{opencgaClient}}" cellbase-client="{{cellbaseClient}}"
on-notifymessage="onNotifyMessage" event-notify-name="{{config.notifyEventMessage}}" ></opencga-panel-browser>
on-notifymessage="onNotifyMessage" event-notify-name="{{config.notifyEventMessage}}" ></opencga-panel-browser>
</div>
</template>

Expand Down Expand Up @@ -527,6 +570,10 @@

// We can customise which components are active by default, this improves the first loading time.
_config.enabledComponents.home = true;
_config.enabledComponents.about = false;
_config.enabledComponents.contact = false;
_config.enabledComponents.terms = false;
_config.enabledComponents.faq = false;

// Enable tools reading the configuration
for (let tool in _config.tools) {
Expand Down Expand Up @@ -801,9 +848,9 @@
if (UtilsNew.isNotEmpty(_message)) {
this.notifySession = NotificationUtils.showNotify(_message, UtilsNew.MESSAGE_INFO,
{}, {
delay: 0,
onClosed: this.onCloseRefreshNotify.bind(this)
}, this.opencgaClient, this.notifySession);
delay: 0,
onClosed: this.onCloseRefreshNotify.bind(this)
}, this.opencgaClient, this.notifySession);
}
}

Expand Down
Loading

0 comments on commit 0b53292

Please sign in to comment.