diff --git a/CHANGES.rst b/CHANGES.rst index a314898..2340f3d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ Changelog - Add a final `.` at end of help title message displayed when hovering the `Signed/Not signed` icon in the UI. [gbastien] +- Improved file ordering in session. + [chris-adam] 1.0.0 (2026-08-14) ------------------ diff --git a/src/imio/esign/adapters.py b/src/imio/esign/adapters.py index a1118ba..16b2197 100644 --- a/src/imio/esign/adapters.py +++ b/src/imio/esign/adapters.py @@ -20,6 +20,16 @@ def get_context_uid(self): return None +class DefaultItemOrderProvider(object): + """Default adapter that orders items by their position in the context container.""" + + def __init__(self, context): + self.context = context + + def get_item_order(self): + return {a.UID(): idx for idx, a in enumerate(self.context.values())} + + class FilesBelongingToAGivenSession(object): def __init__(self, context): self.context = context diff --git a/src/imio/esign/configure.zcml b/src/imio/esign/configure.zcml index cb1a5e0..de4a599 100644 --- a/src/imio/esign/configure.zcml +++ b/src/imio/esign/configure.zcml @@ -23,6 +23,11 @@ provides=".interfaces.IContextUidProvider" for="*" /> + +