spee.ch/views/partials/topBar.handlebars

32 lines
1.4 KiB
Handlebars
Raw Normal View History

2017-09-27 00:12:47 +02:00
<div class="row top-bar">
<a href="https://en.wikipedia.org/wiki/Freedom_of_information" target="_blank"><img id="logo" src="/assets/img/content-freedom-64px.png"/></a>
2017-07-26 03:49:02 +02:00
<h1 id="title"><a href="/">Spee.ch</a></h1><span class="top-bar-left">(beta)</span>
2017-08-25 01:09:04 +02:00
<a href="/popular" class="top-bar-right">popular</a>
<a href="https://github.com/lbryio/spee.ch" target="_blank" class="top-bar-right">source</a>
2017-07-28 05:50:11 +02:00
<a href="/about" class="top-bar-right">help</a>
2017-09-19 17:47:24 +02:00
{{#if user}}
2017-09-27 00:12:47 +02:00
<select type="text" class="select" onchange="toggleLogin(event)">
<option value="none">@{{user.userName}}</option>
<option value="view">view</option>
<option value="logout">logout</option>
</select>
2017-09-19 17:47:24 +02:00
{{else}}
<a href="/login" class="top-bar-right">login</a>
{{/if}}
2017-07-28 05:50:11 +02:00
<div class="top-bar-tagline">Open-source, decentralized image and video hosting.</div>
2017-09-27 00:12:47 +02:00
</div>
<script type="text/javascript">
function toggleLogin (event) {
console.log(event);
const selectedOption = event.target.selectedOptions[0].value;
if (selectedOption === 'logout') {
console.log('login');
window.location.href = '/logout';
} else if (selectedOption === 'view') {
console.log('view channel');
window.location.href = '/{{user.channelName}}:{{user.channelClaimId}}';
}
}
</script>