mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
Add other sorting options: A-Z, Z-A, new-old, old-new
This commit is contained in:
parent
5c48f82f41
commit
4c64393df1
@ -141,6 +141,12 @@ def get_alias_infos_with_pagination_v2(
|
||||
|
||||
if sort == "old2new":
|
||||
q = q.order_by(Alias.created_at)
|
||||
elif sort == "new2old":
|
||||
q = q.order_by(Alias.created_at.desc())
|
||||
elif sort == "a2z":
|
||||
q = q.order_by(Alias.email)
|
||||
elif sort == "z2a":
|
||||
q = q.order_by(Alias.email.desc())
|
||||
else:
|
||||
# default sorting
|
||||
q = q.order_by(latest_activity.desc())
|
||||
|
@ -70,7 +70,16 @@
|
||||
Sort by most recent activity
|
||||
</option>
|
||||
<option value="old2new" {% if sort == "old2new" %} selected {% endif %}>
|
||||
Oldest Alias to Newest
|
||||
Alias Old-Recent
|
||||
</option>
|
||||
<option value="old2new" {% if sort == "new2old" %} selected {% endif %}>
|
||||
Alias Recent-Old
|
||||
</option>
|
||||
<option value="a2z" {% if sort == "a2z" %} selected {% endif %}>
|
||||
Alias A-Z
|
||||
</option>
|
||||
<option value="z2a" {% if sort == "z2a" %} selected {% endif %}>
|
||||
Alias Z-A
|
||||
</option>
|
||||
</select>
|
||||
|
||||
|
@ -3,7 +3,6 @@ from flask_login import login_required, current_user
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import joinedload
|
||||
|
||||
from app import email_utils
|
||||
from app.api.serializer import get_alias_infos_with_pagination_v2
|
||||
from app.dashboard.base import dashboard_bp
|
||||
from app.extensions import db
|
||||
@ -13,7 +12,6 @@ from app.models import (
|
||||
ClientUser,
|
||||
DeletedAlias,
|
||||
AliasGeneratorEnum,
|
||||
Mailbox,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user