flarum / flarum/issue-archive

Tag server-side response should extend core's Index

Open
#47 17 comments 0 reactions 0 assignees View on GitHub
good first issue Hacktoberfest
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently, there's a lot of duplication between the tags [Tag content handler](https://github.com/flarum/tags/blob/64c35d0fa5a221386fcb76790d92588c1347a1f1/src/Content/Tag.php#L57-L57) and core's [Index content handler](https://github.com/flarum/core/blob/b8754c7d7db07bbea25d15e285da9dadeece72ce/src/Forum/Content/Index.php#L64-L64). Similar duplication exists in "index" blade template vs "tag" blade template. I suspect that this issue similarly affects subscribe with the following page.

We should:
1. Refactor `Index` so generation of params (and maybe the preloaded API doc) is split into a protected method. Also make private methods protected.
2. Inherit `Index` for the tag and subscription content handlers
3. Make the discussion list portion of the index blade template a reusable template that can be used in core, tags, and subscriptions

Contributor guide

Open the contributing guide

Research direction

Start by comparing the linked src/Content/Tag.php and src/Forum/Content/Index.php handlers, then inspect the index and tag Blade templates and the subscription handler. Done means the tag and subscription handlers reuse core Index behavior and the discussion-list template is shared across core, tags, and subscriptions without the current duplication.

Written by the indexing model from the issue text.

Assessment

Domain
backend, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.