add: profile connections, spotify connection

This commit is contained in:
trisua 2025-04-26 16:27:18 -04:00
parent a5c2356940
commit 33ba576d4a
31 changed files with 931 additions and 19 deletions

View file

@ -105,6 +105,13 @@
</div>
<div class="card flex flex-col gap-2">
<!-- prettier-ignore -->
<div style="display: contents;">
{% if profile.connections.Spotify and profile.connections.Spotify[0].data.name and profile.connections.Spotify[0].show_on_profile %}
{{ components::spotify_playing(state=profile.connections.Spotify[1]) }}
{% endif %}
</div>
<div class="w-full flex justify-between items-center">
<span class="notification chip">ID</span>
<button

View file

@ -29,6 +29,11 @@
{{ icon "cookie" }}
<span>{{ text "settings:tab.sessions" }}</span>
</a>
<a data-tab-button="connections" href="#/connections">
{{ icon "cable" }}
<span>{{ text "settings:tab.connections" }}</span>
</a>
</div>
<div class="w-full flex flex-col gap-2" data-tab="account">
@ -496,6 +501,46 @@
</button>
</div>
<div
class="card w-full tertiary hidden flex flex-col gap-2"
data-tab="connections"
>
<div class="card w-full flex flex-wrap gap-2">
{% if config.connections.spotify_client_id and not
user.connections.Spotify %}
<button
class="quaternary"
onclick="trigger('spotify::create_connection', ['{{ config.connections.spotify_client_id }}'])"
>
{{ icon "spotify" }}
<span>Spotify</span>
</button>
{% endif %}
</div>
{% for key, value in user.connections %}
<div class="card-nest">
<div class="card small flex items-center gap-2">
{% if key == "Spotify" %} {{ icon "spotify" }} {% endif %}
<b>
{% if value[0].data.name %} {{ value[0].data.name }} {% else
%} {{ key }} {% endif %}
</b>
</div>
<div class="card flex items-center gap-2">
<button
class="quaternary red small"
onclick="trigger('connections::delete', ['{{ key }}'])"
>
{{ text "general:action.delete" }}
</button>
</div>
</div>
{% endfor %}
</div>
<!-- prettier-ignore -->
<script type="application/json" id="settings_json">{{ user_settings_serde|safe }}</script>