Skip to main content

max / makenotwork

2.0 KB · 52 lines History Blame Raw
1 <div class="content-section sessions-tab raised" id="sessions-list">
2 <div class="section-header">
3 <h2 class="subsection-title">Active Sessions</h2>
4 </div>
5
6 <p class="form-hint mb-pane">These are the devices currently logged in to your account. If you don't recognize a session, revoke it.</p>
7
8 {% if sessions.is_empty() %}
9 <p>No active sessions.</p>
10 {% else %}
11 <table class="data-table sessions-table well">
12 <thead>
13 <tr>
14 <th>Device</th>
15 <th>IP Address</th>
16 <th>Signed In</th>
17 <th>Last Active</th>
18 <th></th>
19 </tr>
20 </thead>
21 <tbody>
22 {% for s in sessions %}
23 <tr>
24 <td class="device-cell">
25 {% if let Some(ua) = s.user_agent %}{{ ua }}{% else %}Unknown device{% endif %}
26 {% if let Some(current_id) = current_session_id %}{% if s.id == *current_id %}<span class="badge ml-2" data-tone="success">Current</span>{% endif %}{% endif %}
27 </td>
28 <td>{% if let Some(ip) = s.ip_address %}{{ ip }}{% else %}--{% endif %}</td>
29 <td>{{ s.created_at.format("%b %d, %Y %H:%M UTC") }}</td>
30 <td>{{ s.last_active_at.format("%b %d, %Y %H:%M UTC") }}</td>
31 <td>
32 {% if let Some(current_id) = current_session_id %}
33 {% if s.id != *current_id %}
34 {{ crate::quasi::session_acts::html(s.id)|safe }}
35 {% endif %}
36 {% else %}
37 {{ crate::quasi::session_acts::html(s.id)|safe }}
38 {% endif %}
39 </td>
40 </tr>
41 {% endfor %}
42 </tbody>
43 </table>
44
45 {% if sessions.len() > 1 %}
46 <div class="mt-section">
47 {{ crate::quasi::session_acts::all_others_html()|safe }}
48 </div>
49 {% endif %}
50 {% endif %}
51 </div>
52