-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2512243
commit 4a46024
Showing
6 changed files
with
83 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,28 @@ | ||
<div class="container-fluid my-5 mx-5" style="height: 18em;" id="songForm"> | ||
<h3 class="text-left display-5">Let's predict the number of streams for a song</h3> | ||
|
||
<h3 class="text-left display-5">Let's predict the number of streams for a song</h3> | ||
|
||
<div class="text-danger font-weight-bold"> | ||
{% for error in errors %} | ||
<li>{{error}}</li> | ||
{% endfor %} | ||
</div> | ||
|
||
|
||
<h4 class="text-left display-7">Choose a song!</h4> | ||
|
||
|
||
|
||
<form id="myForm" action="/search_song" method="POST" hx-boost="true" hx-trigger="submit" hx-swap="outerHTML" | ||
hx-target="#songForm"> | ||
|
||
<div class="mb-3"> | ||
<input type="text" required placeholder="Choose an artist e.g Queen" name="artist" value="{{artist}}" | ||
class="form-control"> | ||
</div> | ||
|
||
<div class="mb-3"> | ||
<input type="text" required placeholder="Choose a song e.g Don't stop me now" name="song" value="{{song}}" | ||
class="form-control"> | ||
</div> | ||
<div class="text-danger font-weight-bold"> | ||
{% for error in errors %} | ||
<li>{{error}}</li> | ||
{% endfor %} | ||
</div> | ||
|
||
<div class="class text-center"> | ||
<button type="submit" hx-trigger="submit">Search</button> | ||
<!-- <button type="submit" hx-trigger="click" hx-get="/success_endpoint" hx-target="#songForm" | ||
hx-swap="innerHTML">Search</button> --> | ||
</div> | ||
<h4 class="text-left display-7">Choose a song!</h4> | ||
<form id="myForm" action="/search_song" method="POST" hx-boost="true" hx-trigger="submit" hx-swap="innerHTML" | ||
hx-target="#songForm"> | ||
|
||
<div class="mb-3"> | ||
<input type="text" required placeholder="Choose an artist e.g Queen" name="artist" value="{{artist}}" | ||
class="form-control"> | ||
</div> | ||
|
||
</form> | ||
<div class="mb-3"> | ||
<input type="text" required placeholder="Choose a song e.g Don't stop me now" name="song" value="{{song}}" | ||
class="form-control"> | ||
</div> | ||
|
||
<!-- <div hx-target="#songForm" hx-trigger="submit" hx-swap="innerHTML"></div> --> | ||
<div class="class text-center"> | ||
<button type="submit" hx-trigger="submit">Search</button> | ||
</div> | ||
|
||
|
||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
<div class="container-fluid my-5 mx-5" style="height: 18em;" id="songOutput"> | ||
<!-- <h2 class="text-center display-7">{{header}}</h2> --> | ||
|
||
|
||
<!-- <h2 class="text-center display-7">{{header}}</h2> --> | ||
<h3 class="text-left display-5">{{header}}</h3> | ||
|
||
<hr style="border-bottom: 1px solid #888"> | ||
|
||
Number of streams: {{prediction["prediction"]}} | ||
Message: {{prediction["message"]["text"]}} {{prediction["message"]["emoji"]}} | ||
|
||
<!-- <h4 class="text-left display-10">{{prediction["features"]}}</h4> --> | ||
|
||
<h3 class="text-left display-5">{{header}}</h3> | ||
<hr style="border-bottom: 1px solid #888"> | ||
|
||
<p class="fw-bold display-6">{{prediction["message"]["text"]}} {{prediction["message"]["emoji"]}}</p> | ||
|
||
|
||
<ul class="list-group"> | ||
<li class="list-group-item d-flex justify-content-between align-items-center"> | ||
Number of streams: {{prediction["prediction"]}} | ||
</li> | ||
|
||
{% for key, value in prediction["song_metadata"].items() %} | ||
{{key}}: {{ value }} | ||
<li class="list-group-item d-flex justify-content-between align-items-center"> | ||
{{key}}: {{ value }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
|
||
{% if prediction["preview_url"] is not none %} | ||
<div class="container-audio"> | ||
<audio controls> | ||
<source src={{prediction["preview_url"]}} /> | ||
</audio> | ||
</div> | ||
{% endif %} | ||
|
||
<div class="class text-center"> | ||
<a href="/"><button type="submit">Try it again!</button></a> | ||
|
||
</div> | ||
|
||
{% if prediction["preview_url"] is not none %} | ||
<div class="container-audio"> | ||
<audio controls> | ||
<source src={{prediction["preview_url"]}} /> | ||
</audio> | ||
</div> | ||
{% endif %} | ||
|
||
<div class="class text-center"> | ||
<a href="/"><button type="submit">Try it again!</button></a> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters