Pretifies index.mustache with bootstrap 5

- updates visual layout to be more readable
- adds basic functionality for javascript callback functions to update
  various useful elements through api
  - note, these updates are currently implemented through a bootstrap
    modal
  - note, these updates are currently commented out through mustache.
- adds a vim modeline to enable manual folding
This commit is contained in:
Ariana Giroux 2022-07-24 17:01:05 -06:00
parent c8fe794144
commit 6799e2513b
1 changed files with 83 additions and 10 deletions

View File

@ -9,25 +9,98 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="">
<link rel="icon" type="image/x-icon" href=""/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<header>
</header>
<main>
<h2 id="streamTitle">{{streamTitle}}</h2>
<p>Stream online? <span id="streamOnline">{{online}}</span></p>
<hr>
<p>Current Viewers: <span id="currentViewers">{{viewerCount}}</span></p>
<p>Session Max Viewers: <span id="sessionMaxViewerCount">{{sessionMaxViewerCount}}</span></p>
<p>Overall Max Viewers: <span id="overallMaxViewerCount">{{overallMaxViewerCount}}</span></p>
<hr>
<p>Current tags: <span id="tags">{{tags}}</span></p>
<div class="container" style="background-color:rgba(0,0,0,0.1);padding:1rem">
<div class="row" style="background-color:rgb(256,256,256);padding:1rem;">
<div class="row">
<div class="col">
<h2 style="text-align:left">Stream Title: <em><span id="streamTitle">{{streamTitle}}</span></em></h2>
</div>
<div class="col">
<h3 style="text-align:right">Stream online? <em><span id="streamOnline">{{online}}</span></em></h3>
</div>
</div>
<hr>
<div class="row">
<div class="col">
<p>Current Viewers: <span id="currentViewers">{{viewerCount}}</span></p>
</div>
<div class="col">
<p>Session Max Viewers: <span id="sessionMaxViewerCount">{{sessionMaxViewerCount}}</span></p>
</div>
<div class="col">
<p>Overall Max Viewers: <span id="overallMaxViewerCount">{{overallMaxViewerCount}}</span></p>
</div>
</div>
<hr>
<div class="container" style="background-color:rgba(0,0,0,0.2)">
<div class="card" style="padding:1rem;margin:0.5rem 0">
<h4 class="card-title">Current tags:</h4>
<p id="tags" class="card-text" style="padding:1rem">{{tags}}</p>
</div>
</div>
<div class="row" style="margin-top:1rem">
<div class="col">
<button type="button" class="btn btn-light mx-auto d-block" style="width:12em" data-bs-toggle="modal" data-bs-target="#streamTitleModal">Update Stream Title</button>
{{!<div class="modal fade" id="streamTitleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Update Stream Title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form onsubmit="updateStreamTitle(document.getElementById('streamTitleInput').value)" style="width:100%" id="streamTitleForm">
<input type="text" name="streamTitle" id="streamTitleInput" style="width:100%" />
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button submit" form="streamTitleForm" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>}}
</div>
</div>
<div class="col">
<button type="button" class="btn btn-light mx-auto d-block" style="width:12em" data-bs-toggle="modal" data-bs-target="#tagsModal">Update Tags</button>
{{!<div class="modal fade" id="tagsModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Update Tags</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form onsubmit="updateTags(document.getElementById('tagsInput').value)" style="width:100%" id="tagsForm">
<input type="text" name="tagsInput" id="tagsInput" style="width:100%" />
</form>
<p class="small text-center">Seperate tags by comma.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button submit" form="streamTitleForm" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>}}
</div>
</div>
</div>
</div>
</main>
<footer>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="/static/script.js"></script>
</body>
<script src="/static/script.js"></script>
<!-- vim: foldmethod=manual
-->
</html>