@@ -27,6 +27,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
27
27
28
28
<div class =" col-lg-8 mx-auto my-auto confirm e-mail-card" id =" confirm-email-card" style =" display: none;" >
29
29
<section class =" py-sm-7 py-5 position-relative" >
30
+ <div class =" header-greeting" ><h1 class =" text-white" >Hello</h1 ></div >
30
31
<div class =" container card blur" >
31
32
<div class =" row" >
32
33
<div class =" col-12 mx-auto" >
@@ -44,6 +45,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
44
45
45
46
<div class =" col-lg-8 mx-auto my-auto no-instances-card" id =" no-instances-card" style =" display: none;" >
46
47
<section class =" py-sm-7 py-5 position-relative" >
48
+ <div class =" header-greeting" ><h1 class =" text-white" >Hello</h1 ></div >
47
49
<div class =" container card blur" >
48
50
<div class =" row" >
49
51
<div class =" col-12 mx-auto" >
@@ -62,6 +64,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
62
64
63
65
<div class =" col-md-12 col-lm-12 col-lg-8 mx-auto my-auto main-instance-card" id =" main-instance-card" style =" display: none;" >
64
66
<section class =" py-sm-7 py-5 position-relative" >
67
+ <div class =" header-greeting mt-7" ><h1 class =" text-white" >Hello</h1 ></div >
65
68
<div class =" row instances-row" id =" instances-row" style =" margin-top: 4rem;" >
66
69
67
70
</div >
@@ -132,10 +135,14 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
132
135
133
136
console.log('User is logged in');
134
137
console.log(pb.authStore.model)
138
+
135
139
const isVerified = pb.authStore.model && pb.authStore.model.verified
136
140
// Check if the user is confirmed
137
141
if( !isVerified ) {
138
142
console.log('User is not confirmed');
143
+ Array.from(document.getElementsByClassName('header-greeting')).forEach(element => {
144
+ element.innerHTML = '<h2 class="text-white">Hello ' + pb.authStore.model.name + ' 👋</h2>';
145
+ });
139
146
document.getElementById('confirm-email-card').style.display = 'block';
140
147
document.getElementById('loading-card').style.display = 'none';
141
148
} else {
@@ -159,6 +166,11 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
159
166
// This user has more than 1 instance. Adapt the layout
160
167
console.log('User has more than 1 instance');
161
168
column_layout = "col-lg-6"
169
+ Array.from(document.getElementsByClassName('header-greeting')).forEach(element => {
170
+ element.innerHTML = '<h2 class="text-white">Hello ' + pb.authStore.model.name + ' 👋 here\'s your ' + records.length + ' instances:</h2>';
171
+ });
172
+ } else {
173
+
162
174
}
163
175
164
176
// Get the first instance
@@ -177,12 +189,23 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
177
189
const date = new Date(instance.created);
178
190
const options = { year: 'numeric', month: 'short', day: 'numeric' };
179
191
192
+ var is_last = false;
193
+ var iteration_layout = column_layout;
194
+ if( i == records.length - 1 ) {
195
+ is_last = true;
196
+ }
197
+
198
+ // if last instance and odd number of instances, use full width, otherwise use column_layout
199
+ if( is_last && records.length % 2 != 0 ) {
200
+ iteration_layout = "col-lg-12";
201
+ }
202
+
180
203
instances_html += `
181
- <div class="${column_layout } instance-column-layout">
204
+ <div class="${iteration_layout } instance-column-layout">
182
205
<div class="container card blur mt-4">
183
206
<div class="row">
184
207
<div class="col-12 mx-auto">
185
- <div class="row py-5" >
208
+ <div class="row pt-5 pb-2 >
186
209
<div class="col-lg-3 col-md-5 position-relative my-auto text-center">
187
210
<img class="img border-radius-lg max-width-200 w-100 position-relative z-index-2" src="/img/icon-cloud-white.png" alt="icon">
188
211
</div>
0 commit comments