Skip to content

Commit

Permalink
Merge pull request #373 from kikkomep/CU-8693gr669_chore-fix-layout-o…
Browse files Browse the repository at this point in the history
…f-linked-accounts

chore: fix linked accounts table layout
  • Loading branch information
kikkomep authored Jan 12, 2024
2 parents ee3c60a + 753596c commit e1f7f05
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 58 deletions.
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

0 comments on commit e1f7f05

Please sign in to comment.