Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add summary of outstanding moderation requests in "My lists" page #1194

Closed
dpc22 opened this issue Jun 14, 2021 · 3 comments · Fixed by #1219
Closed

Add summary of outstanding moderation requests in "My lists" page #1194

dpc22 opened this issue Jun 14, 2021 · 3 comments · Fixed by #1219
Labels
enhancement ready A PR is waiting to be merged. Close to be solved
Milestone

Comments

@dpc22
Copy link
Contributor

dpc22 commented Jun 14, 2021

Version

6.2.62

Installation method

My own rpm, derived from "official" RHEL source rpm.

My question

We are currently migrating 7,500 lists from Mailman to Sympa.

One of my users, who is owner/moderator for around 50 lists, commented that there is no easy way to get a summary of outstanding moderation requests. Instead they have to go to the "/sympa/my" page and drill down onto each list in turn.

Vanilla Mailman has the same problem, but I created a custom "mylists" landing page, similar to (and in fact probably modelled on) the Sympa "my" page. This provides direct links to the Mailman "listinfo" and "admin" pages for each list, and a simple count of outstanding moderation requests for each list in the link to the moderation page, e.g: "Moderate (4 messages)".

Would something similar be possible in Sympa?

The complexWhich method in the SOAP API is very close to what I am looking for, but doesn't contain any information about outstanding moderation requests for each list in the response. I couldn't immediately find an API method that gave a count of outstanding moderation requests for a given list.

@dpc22
Copy link
Contributor Author

dpc22 commented Aug 3, 2021

Just to add. I can implement this using the following patch which generates $which->{$l}{mod_count} for all of the lists where someone is a owner/moderation/subscriber. The my.tt2 template can then decide precisely what to display.

mod_count.patch.txt

I appreciate that my current approach is an awful hack, but there doesn't appear to be an obvious method that I can use in the Sympa::Spool::Moderation class that would give me a quick summary without having to interact through the actual messages using
Sympa::Spool->new()->next()

@ikedas
Copy link
Member

ikedas commented Aug 4, 2021

Hi @dpc22 ,

Counting moderation requests on particular list may be done by

$mod_count = Sympa::Spool::Moderation->new(context => $list)->size;

If you submit a new PR, we will review and merge it.

@dpc22
Copy link
Contributor Author

dpc22 commented Aug 4, 2021

Which would seem to be the attached, which is a bit less efficient but a lot more sensible than my initial effort. Thanks

sympa-6.2.64-dpc_mod_count.patch.txt

The objective is something looking like:

1

which works well when people admin or moderate lots of lists.

I'm just going to deploy this on our lists server. I will come back later and work out how to submit a PR. Thanks,

@ikedas ikedas linked a pull request Aug 4, 2021 that will close this issue
@ikedas ikedas added this to the 6.2.66 milestone Aug 4, 2021
@ikedas ikedas added the ready A PR is waiting to be merged. Close to be solved label Aug 4, 2021
@ikedas ikedas changed the title Summary of outstanding moderation requests Add summary of outstanding moderation requests in "My lists" page Aug 9, 2021
ikedas added a commit that referenced this issue Aug 9, 2021
… ikedas

Add summary of outstanding moderation requests in "My lists" page (#1194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready A PR is waiting to be merged. Close to be solved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants