Commit 546e4040 authored by carlosribas's avatar carlosribas
Browse files

Add a message on the site

parent 3e1933ce
......@@ -47,6 +47,11 @@ pipeline {
type: 'PT_BRANCH',
description: 'Name of the branch to test and deploy'
)
string(
name: 'MESSAGE',
defaultValue: '',
description: 'Message to show on the website'
)
}
stages {
stage("Update settings") {
......@@ -146,6 +151,14 @@ pipeline {
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/templates/portal/message'
if (params.MESSAGE) {
sh 'echo ${params.MESSAGE}' > rnacentral/portal/templates/portal/message
sh 'echo ${params.MESSAGE}' > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/templates/portal/message
}
}
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.pyc'
sh 'cat $LOCAL_SETTINGS > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
......
/* Position it at the top of the screen */
#show-message {
visibility: hidden; /* Hidden by default. Visible on click */
min-width: 250px; /* Set a default minimum width */
margin-left: -125px; /* Divide value of min-width by 2 */
background-color: #333; /* Black background color */
color: #fff; /* White text color */
text-align: center; /* Centered text */
border-radius: 2px; /* Rounded borders */
padding: 16px; /* Padding */
position: fixed; /* Sit on top of the screen */
z-index: 1; /* Add a z-index if needed */
left: 50%; /* Center it */
top: 150px; /* 150px from the top */
}
#show-message.show {
visibility: visible; /* Show the message */
/* Add animation: Take 0.5 seconds to fade in and out.
However, delay the fade out process for 4.5 seconds */
-webkit-animation: fadein 0.5s, fadeout 0.5s 4.5s;
animation: fadein 0.5s, fadeout 0.5s 4.5s;
}
/* Animations to fade the message in and out */
@-webkit-keyframes fadein {
from {top: 0; opacity: 0;}
to {top: 150px; opacity: 1;}
}
@keyframes fadein {
from {top: 0; opacity: 0;}
to {top: 150px; opacity: 1;}
}
@-webkit-keyframes fadeout {
from {top: 150px; opacity: 1;}
to {top: 0; opacity: 0;}
}
@keyframes fadeout {
from {top: 150px; opacity: 1;}
to {top: 0; opacity: 0;}
}
\ No newline at end of file
......@@ -58,6 +58,7 @@ limitations under the License.
<link rel="stylesheet" href="{% static "node_modules/@rnacentral/genoverse/dist/css/trackControls.css" %}">
<link rel="stylesheet" href="{% static "node_modules/@rnacentral/genoverse/dist/css/tooltips.css" %}">
<link rel="stylesheet" href="{% static "node_modules/angularjs-slider/dist/rzslider.css" %}">
<link rel="stylesheet" href="{% static "css/show-message.css" %}">
{% endblock stylesheets %}
{% endcompress %}
......@@ -98,7 +99,7 @@ limitations under the License.
{% block extra_head %}{% endblock %}
</head>
<body class="level2" ng-controller="MainContent">
<body class="level2" ng-controller="MainContent" onload="showMessage()">
<header>
{% include "portal/header.html" %}
</header>
......@@ -119,6 +120,9 @@ limitations under the License.
</noscript>
<div ng-show="!displaySearchInterface">
<div id="show-message">
{% include "portal/message" %}
</div>
{% block content %}{% endblock %}
</div>
<text-search-results ng-if="displaySearchInterface"></text-search-results>
......@@ -245,6 +249,16 @@ limitations under the License.
console.log('Welcome to the RNAcentral javascript console!');
</script>
<script>
function showMessage() {
let x = document.getElementById("show-message");
x.className = "show";
// After 5 seconds, remove the show class from DIV
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 5000);
}
</script>
<!--[if lte IE 8]>
<script type="text/javascript">
// bootstrap angular.js manually on IE < 8
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment