Adds a page and route for each repo that shows all users that have starred a given repo. This divides the star button within a repo page, adding an icon to the right side that can be clicked to open the new stars page.
Closes #427
Adds a page and route for each repo that shows all users that have starred a given repo. This divides the star button within a repo page, adding an icon to the right side that can be clicked to open the new stars page.
Closes #427
None yet.
None yet.
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
I think the difficulty with trying to style like codeberg is that it has distinctly different buttons for fork and view fork, and watch and view watchers, in addition to just stars and starrers. With how the buttons are set up currently on tangled, I'm not sure if it would make sense from a user's perspective if clicking on the number shows the starrers, since it visually looks like the same button as the star itself. (although maybe there is room to make a change, if you want to also add a fork count and "view forks" page.
GitHub also works a bit differently (although more similar to how this MR is set up). It treats the star button on a repo page as a star/unstar button, and requires clicking a different spot on the page to view who starred the repo (in the sidebar where it shows license, star and fork count etc.). Tangled doesn't exactly have an analog for this sidebar menu (but maybe there is room for a starrers section below where commits/branches are shown? -- I don't think it would make sense to need to scroll down to see this info though).
As for StarsHref, I made those functions to get the URL for the template, but I may have missed something so I'll take another pass to see if I can pull in the repo name and DID in a simpler way. (The lack of tooling for HTML templates does make this a bit tricky to poke at, so its quite possible I just missed something)
Dug in a bit more, I think it is necessary to get the repo name in order to populate the star page URL on the button. Also, I had an idea for the star button that I'll try later -- move the star count to where I have the new icon, and show "star" or "unstar" next to the star icon (basically just what codeberg does). If it looks good, but weird next to the other buttons I'll make a separate PR to make a similar change to the other buttons.
Okay, I was wrong, we can just pass .RepoName into the template, which removes the need for the StarsHref pattern. Latest version is a bit simpler, using a query param instead.
This isn't necessarily better since we need to add RepoName in a few places in the code, so I can revert this change if you'd rather keep the functions around instead.
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Looks like the diff got bigger from a bunch of unrelated changes. None of those were changed in any of commits, do I just need to rebase?
*any of my commits
Yeah that's a bug from our implementation 馃槄 Rebasing to master will fix it.
馃憤
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Signed-off-by: Patrick Dewey <p@pdewey.com>
Also, screenshots of what this new page and the stars button look like can be seen in the tangled discord
Thank you for the contribution! As .StarsHref is pretty constant for the repository, can we generate it from star handlers instead of receiving as a url query?
Or we can just not include the surrounding div on add Star htmx api.
I like the idea of generating it from a handler, I'll implement that.
overview, since there is nostarstabStarsHrefaround? not saying we shouldn't, just curious![icon "star" | count], where clicking on the count goes to the starred-by page, and clicking on the left portion performs the star creation/deletion action.