Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix linked accounts table layout #373

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 56 additions & 57 deletions lifemonitor/auth/templates/auth/account_tab.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,62 @@
<h3 class="card-title"><b>Connected accounts</b></h3>
</div>

<div class="card-body p-1">
<table class="table table-striped">
<thead>
<tr>
<th style="width: 60px; height: 80px;"></th>
<th style="width: 300px; height: 80px;">Provider</th>
<th style="height: 80px; text-align: center;">User ID</th>
<th style="width: 150px;"></th>
</tr>
</thead>
<tbody>
{% for user_identity in user_identities %}
<tr>
<td style="height: 60px; vertical-align: middle; text-align: center;">
{{ macros.render_provider_fa_icon(user_identity.provider, color="black") }}
</td>
<td style="width: 300px; vertical-align: middle;">
{{user_identity.provider.name}}
</td>
<td style="height: 100px; max-width: 150px; padding: 20px; text-align: center; vertical-align: middle;">
{% if user_identity.identity %}
<div>
{{ user_identity.identity.provider_user_id }}
</div>
<div class="text-muted small" style="font-size: 0.7em;">
<a class="fw-light" href="{{user_identity.provider.get_user_profile_page(user_identity.identity)}}" target="_blank"
title="Click to open '{{user_identity.provider.name}}' website">
see <b>{{user_identity.provider.name}}</b> profile
</a>
</div>
{% endif %}
</td>
{% if user_identity.identity %}
<td style="vertical-align: middle;">
{% if current_user.oauth_identity|length > 1 or current_user.has_password %}
<a title="Click to unlink your '{{user_identity.provider.client_name}}' identity"
onclick="disconnect('{{user_identity.provider.name}}', '{{user_identity.provider.client_name}}')">
<span class="badge bg-success" style="width: 75px; margin-right: 5px;">CONNECTED</span>
<i class="fas fa-link fa-xs" style="color: black;"></i>
</a>
{% else %}
<span class="badge bg-success" style="width: 75px; margin-right: 5px;">CONNECTED</span>
{% endif %}

</td>
{% else %}
<td style="vertical-align: middle;">
<a href="/oauth2/login/{{user_identity.provider.client_name}}"
title="Click to link your '{{user_identity.provider.client_name}}' identity">
<span class="badge bg-primary" style="width: 75px; margin-right: 5px;">CONNECT</span>
<i class="fas fa-unlink fa-xs" style="color: black;"></i>
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<div class="card-body p-1 table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th style="width: 60px;" scope="col"></th>
<th style="width: 100%;"scope="col">Provider</th>
<th style="width: 300px;" scope="col">User ID</th>
<th style="min-width: 150px;" scope="col"></th>
</tr>
</thead>
<tbody>
{% for user_identity in user_identities %}
<tr style="height: 80px;">
<td class="align-middle text-center">
{{ macros.render_provider_fa_icon(user_identity.provider, color="black") }}
</td>
<td class="align-middle">
{{user_identity.provider.name}}
</td>
<td class="align-middle" style="min-width: 150px; max-width: 300px;">
{% if user_identity.identity %}
<div>
{{ user_identity.identity.provider_user_id }}
</div>
<div class="text-muted small mt-2" style="font-size: 0.7em;">
<a class="fw-light" href="{{user_identity.provider.get_user_profile_page(user_identity.identity)}}"
target="_blank"
title="Click to open '{{user_identity.provider.name}}' website">
see <b>{{user_identity.provider.name}}</b> profile
</a>
</div>
{% endif %}
</td>
<td class="align-middle text-center" style="min-width: 150px;">
{% if user_identity.identity %}
{% if current_user.oauth_identity|length > 1 or current_user.has_password %}
<a title="Click to unlink your '{{user_identity.provider.client_name}}' identity"
onclick="disconnect('{{user_identity.provider.name}}', '{{user_identity.provider.client_name}}')">
<span class="badge bg-success" style="width: 75px; margin-right: 5px;">CONNECTED</span>
<i class="fas fa-link fa-xs" style="color: black;"></i>
</a>
{% else %}
<span class="badge bg-success" style="width: 75px; margin-right: 5px;">CONNECTED</span>
<i class="fas fa-link fa-xs" style="color: gray;"></i>
{% endif %}
{% else %}
<a href="/oauth2/login/{{user_identity.provider.client_name}}"
title="Click to link your '{{user_identity.provider.client_name}}' identity">
<span class="badge bg-primary" style="width: 75px; margin-right: 5px;">CONNECT</span>
<i class="fas fa-unlink fa-xs" style="color: black;"></i>
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

Expand Down
2 changes: 1 addition & 1 deletion lifemonitor/auth/templates/auth/profile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="col-md-9">
<div class="card card-primary card-outline">
<div class="card-header p-2">
<ul class="nav nav-pills">
<ul class="nav nav-pills justify-content-center justify-content-lg-start">
<li class="nav-item">
<a class="nav-link font-weight-bold" tab="accountsTab"
href="#accounts" data-toggle="tab">Account</a>
Expand Down