[PROPOSAL/FEATURE REQUEST/CALL FOR HELP] Expose the "findRecentPaginated()" function of "CommentRepository"

Submitted by kore in Postmill (edited )

Hello,

Over in https://raddle.me/f/meta/55551 we're talking about ways to facilitate discussion. One idea that seems popular, unobtrusive, and does not "force" conversations is to offer an option to sort by most recent comments.

Looking through the source of Postmill, it seems that a function to return a paginated list of the most recent comments already exists, in CommentRepository.php.

I unfortunately do not have the php skill to figure out how to expose this function on the site. It looks like the stuff that does front page sorting is in FrontController.php.

Anyway, any leads on this would be much appreciated. Like I said, looks pretty straightforward, I just don't really know what I need to do.

EDIT: okay so raddle.me/comments exists. I think it'd be cool to put a link to this page titled "recent comments" in a tab right next to "most commented" on the front page. I can probably do the code myself i literally just need someone to help me find where the code that actually makes those tabs is.

6

Comments

You must log in or register to comment.

kore OP wrote

Okay so the really hacky easy solution would be for me to just edit

/templates/_includes/site_nav.html.twig

To include a "Comments" link next to "Forums"

This is the only thing that I feel like I have the ability and time to do.

2

selver wrote (edited )

If you've downloaded the project and do a search for "controversial" you should be able to figure it out. It's not in too many places.

2

kore OP wrote

oof, maybe i spoke too soon about being able to do it myself

I'm assuming you mean _macros.html.twig?

I see the macro for submission_sort but it seems like it'd be super hacky to just stick in a link to the "comments" in that section (also seems like it'd require some sort of if statement since the sorting doesn't really make sense for just linking to the comments page)?? i dont even know what language this file is in

2

selver wrote

I'll jump in the riot chat in 5-10 minutes and take a look at it. I don't know much about the code either but I can try to help out a bit

1

Fossidarity wrote (edited )

The template for the HTML of the sorting/tabs seems to be here: https://gitlab.com/edgyemma/Postmill/blob/master/templates/front/base.html.twig

1

kore OP wrote

yeah that's just the "featured/all/subscribed/moderated," not the sorting stuff. it'd be easier for me to put it there though

2

kore OP wrote

yeah i found that too it's just all done by accessing the variables of the Submission class. There's no example in the code that I can find that demonstrates how to access the variables of the comments of the submission and I do not have the skill to figure it out myself.

2