34 lines
No EOL
1.3 KiB
Handlebars
34 lines
No EOL
1.3 KiB
Handlebars
<div class="row-wide nav-bar">
|
|
<div class="nav-bar-title-section">
|
|
<a href="/"><span class="nav-bar-title">Spee.ch</span></a><span class="nav-bar-title nav-bar-title--superscript">(beta)</span>
|
|
<div class="nav-bar-link-section">
|
|
<a class="nav-bar-link" href="https://github.com/lbryio/spee.ch" target="_blank">source</a>
|
|
<a class="nav-bar-link" href="/about">about</a>
|
|
{{#if user}}
|
|
<select type="text" class="select nav-bar-link" onchange="toggleLogin(event)">
|
|
<option value="none">@{{user.userName}}</option>
|
|
<option value="view">view</option>
|
|
<option value="logout">logout</option>
|
|
</select>
|
|
{{else}}
|
|
<a class="nav-bar-link" href="/login">login</a>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</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> |