Minimal single-column layout for direct /finger/<user> links
Direct links now render a results-first single-column view: drop the About Finger panel, success banner, timestamp and back-to-home button, and replace the lookup card with a small inline form next to the heading. The interactive /finger page keeps its original two-column layout.
This commit is contained in:
@@ -167,7 +167,7 @@ def finger_direct(username):
|
||||
else:
|
||||
error = output
|
||||
|
||||
return render_template('finger.html', title=f'Finger - {username}', result=result, error=error, username=username)
|
||||
return render_template('finger.html', title=f'Finger - {username}', result=result, error=error, username=username, direct=True)
|
||||
|
||||
@app.route('/api/finger')
|
||||
@app.route('/api/finger/<path:username>')
|
||||
|
||||
@@ -1,6 +1,55 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if direct %}
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3">
|
||||
<h1 class="h5 mb-0">🔍 Finger Command</h1>
|
||||
<form method="POST" action="{{ url_for('finger') }}" class="d-flex" role="search">
|
||||
<input type="text" class="form-control form-control-sm me-2" id="username" name="username"
|
||||
value="{{ username or '' }}"
|
||||
placeholder="[email protected]"
|
||||
pattern="[a-zA-Z0-9.\-_@]*"
|
||||
title="Alphanumeric characters, dots, hyphens, underscores, and @ symbol allowed"
|
||||
style="max-width: 260px;">
|
||||
<button type="submit" class="btn btn-sm btn-primary">
|
||||
<i class="fas fa-search"></i> Finger
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">
|
||||
{% if username %}
|
||||
Results for "{{ username }}"
|
||||
{% else %}
|
||||
System Users
|
||||
{% endif %}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
<strong>Error:</strong> {{ error }}
|
||||
</div>
|
||||
{% elif result %}
|
||||
<div class="finger-output">
|
||||
<pre class="rounded mb-0"><code>{{ result }}</code></pre>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<i class="fas fa-terminal fa-3x mb-3"></i>
|
||||
<p>No information available.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<h1 class="mb-4">🔍 Finger Command</h1>
|
||||
@@ -99,6 +148,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
function clearForm() {
|
||||
@@ -107,9 +157,11 @@ function clearForm() {
|
||||
window.location.href = "{{ url_for('finger') }}";
|
||||
}
|
||||
|
||||
{% if not direct %}
|
||||
// Auto-focus on username input when page loads
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('username').focus();
|
||||
});
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user