views/layout.erb
<!DOCTYPE html>
<html lang="en">
<head>
<title>SequenceServer: Custom BLAST Server</title>
<meta name="author" content="Pragmatic Genomics Limited"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Custom BLAST server provided by SequenceServer (https://sequenceserver.com)"/>
<%= Rack::Csrf.metatag(env) %>
<link rel="stylesheet" media="screen,print" type="text/css" href="css/app.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body class="text-black relative">
<header id="header" class="border-b border-seqorange">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="flex flex-none items-center">
<div class="pr-8 md:pr-0 py-4">
<a href="https://sequenceserver.com" target="_blank" class="flex items-end">
<img src="sequenceserver_logo.webp" alt="sequenceserver_logo" width="1620" height="213" class="h-8 w-auto pr-2">
<span class="text-sm md:text-base">
<%= SequenceServer::VERSION %>
</span>
</a>
</div>
<div class="flex-grow"></div>
<ul class="flex space-x-2">
<li>
<a
href="https://sequenceserver.com/progress-on-BLAST-interface/"
class="underline text-seqblue"
data-update-check
data-version="<%= SequenceServer::VERSION %>"
target="_blank">
</a>
</li>
<li>
<a
class="text-seqblue flex items-center text-sm md:text-base hover:text-seqorange"
target="_blank"
href="https://sequenceserver.com/support">
<i class="fa-regular fa-comment w-4 h-4 mr-1 fill-current"></i>
Help & Support
</a>
</li>
</ul>
</div>
</div>
</header>
<noscript>
<div class="mx-auto px-4">
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">Our website cannot work without JavaScript.</strong>
<ul class="mt-2 list-disc list-inside">
<li>Please see if you can enable JavaScript in your browser's preferences.</li>
<li>If your browser doesn't support JavaScript, please consider upgrading to the latest version or using Firefox or Chrome.</li>
</ul>
</div>
</div>
</noscript>
<%= yield %>
<div class="mx-auto px-4">
<div class="container mx-auto max-w-screen-xl">
<p class="text-center text-sm">
Please cite data sources and <a class="text-seqblue" href="https://doi.org/10.1093/molbev/msz185">the paper</a> describing <a class="text-seqblue" href="https://wurmlab.com">our</a> <a class="text-seqblue" href="https://sequenceserver.com">SequenceServer BLAST interface</a>.
<a class="text-seqblue" href='https://sequenceserver.com'>
<em>
<%=
quote = [
"Visualize BLAST results.",
"Run BLAST on local computer.",
"BLAST on Mac.",
"BLAST on Windows.",
"Run blast on mac.",
"Blast analysis software.",
"Sequence Search on local computer.",
"Blast DNA sequence search.",
"Custom BLAST search.",
"Install blast on Mac.",
"Perform BLAST analyses.",
"Custom BLAST web interface.",
"SequenceServer: Local BLAST with bespoke html interface.",
"Set up custom BLAST interface with SequenceServer.",
"Easy BLASTing with SequenceServer.",
"BLAST against a custom, local database with SequenceServer.",
"Cloud BLAST custom genome.",
"NCBI BLAST alternative.",
"BLAST private transcriptome assembly in the Cloud.",
"Cloud server for comparative genomics, oligos, crisp, primers and more."
].sample
%>
</em>
</a>
</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
function suggestNewVersion(element, version) {
element.textContent = `New version v${version} is available`;
console.log(`New SequenceServer version available ${version}. Please consider updating.`)
}
const element = document.querySelector('[data-update-check]');
const currentVersion = element.getAttribute('data-version');
const cachedVersion = document.cookie.split(';').find((item) => item.trim().startsWith('newVersion='));
const upToDate = document.cookie.split(';').find((item) => item.trim().startsWith('versionIsLatest='));
if (upToDate) {
console.log('SequenceServer is up to date');
return;
}
if (cachedVersion) {
const newVersion = cachedVersion.split('=')[1];
if (newVersion !== currentVersion) {
suggestNewVersion(element, newVersion);
}
return;
}
console.log('Checking for new SequenceServer version...')
fetch(`https://updates.sequenceserver.com/?version=${currentVersion}`)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to check for new SequenceServer version')
}
})
.then(data => {
const date = new Date();
date.setTime(date.getTime() + (24 * 60 * 60 * 1000));
const expires = "; expires=" + date.toUTCString();
if (data.update_available) {
const newVersion = data.new_version;
document.cookie = `newVersion=${newVersion}${expires}; path=/`;
suggestNewVersion(element, newVersion);
} else {
console.log('SequenceServer is up to date');
document.cookie = `versionIsLatest=true${expires}; path=/`;
}
})
.catch(() => {});
});
</script>
</body>
</html>