Skip to content

Add user badges#36752

Merged
lunny merged 15 commits intogo-gitea:mainfrom
bircni:feature/retry-badges
Mar 22, 2026
Merged

Add user badges#36752
lunny merged 15 commits intogo-gitea:mainfrom
bircni:feature/retry-badges

Conversation

@bircni
Copy link
Copy Markdown
Member

@bircni bircni commented Feb 25, 2026

Implemented #29798

This feature implements list badges, create new badges, view badge, edit badge and assign badge to users.

  • List all badges (screenshot)
  • Create new badges (screenshot)
  • View badge (screenshot) (screenshot)
  • Edit badge (screenshot)
  • Add user to badge (screenshot)

trying to reenable #31262

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 25, 2026
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/migrations labels Feb 25, 2026
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Feb 25, 2026

Addressed the open review threads with the following changes:

  1. Removed services/user/badge.go wrappers (UpdateBadge, DeleteBadge, GetBadgeUsers) and switched admin badge handlers to direct model calls.
  2. Removed redundant transaction wrapping by dropping the service wrappers and calling user_model.UpdateBadge / user_model.DeleteBadge directly.
  3. Fixed badge edit form semantics: removed invalid disabled usage on parent container, removed non-local, and made slug display readonly.
  4. Removed unnecessary id/for attributes in templates/admin/badge/edit.tmpl where framework defaults are sufficient.
  5. Removed no-op delete class from the badge delete modal.
  6. Moved the add-user form to the top of templates/admin/badge/users.tmpl and removed unused id attributes.
  7. Re-aligned and cleaned nested <div> structure in templates/admin/badge/view.tmpl for readability.
  8. Fixed control flow in DeleteBadgeUser: now returns immediately after flash + redirect on IsErrUserNotExist.
  9. Added dedicated AdminEditBadgeForm and updated route binding for badge edit, so edit validation no longer depends on slug input.

Validation run:

  • make fmt
  • make lint-go (0 issues)

@bircni bircni marked this pull request as ready for review February 25, 2026 18:28
@bircni bircni force-pushed the feature/retry-badges branch from 56aeab8 to 5cbe732 Compare February 26, 2026 18:30
@lunny
Copy link
Copy Markdown
Member

lunny commented Feb 26, 2026

It's better to have a user name search when inputing like other places.
image

@lunny
Copy link
Copy Markdown
Member

lunny commented Feb 26, 2026

image Align problem.

@bircni
Copy link
Copy Markdown
Member Author

bircni commented Feb 26, 2026

fixed

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 26, 2026
@lunny lunny added this to the 1.26.0 milestone Feb 26, 2026
Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need more improvements

@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 27, 2026
@bircni bircni reopened this Mar 18, 2026
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Mar 18, 2026

reopened - if there is still need for it sure but I want to focus on other stuff to improve currently

@wxiaoguang
Copy link
Copy Markdown
Contributor

So the maintainers from the origin PR can help to review: @techknowlogick

@techknowlogick

Copy link
Copy Markdown
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for continuing this PR <3

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 20, 2026
@lunny lunny marked this pull request as ready for review March 20, 2026 22:54
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 21, 2026
@GiteaBot
Copy link
Copy Markdown
Collaborator

@bircni please fix the merge conflicts. 🍵

@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 21, 2026
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Mar 21, 2026

@bircni please fix the merge conflicts. 🍵

Done!

@bircni
Copy link
Copy Markdown
Member Author

bircni commented Mar 21, 2026

Do I have to do something else?

@lunny
Copy link
Copy Markdown
Member

lunny commented Mar 22, 2026

Do I have to do something else?

It's better to update the PR description so that we have a better commit message.

@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 22, 2026
@bircni bircni mentioned this pull request Mar 22, 2026
lunny pushed a commit that referenced this pull request Mar 22, 2026
I'd like to apply as a maintainer.

Thanks to @TheFox0x7 for the suggestion.

Merged PRs:
- #36441
- #36571
- #36603
- #36768
- #36776
- #36783
- #36876
- #36883
- #36924

Ongoing work:
- #36514
- #36752
- #36912
@lunny lunny enabled auto-merge (squash) March 22, 2026 15:24
@lunny lunny merged commit 4ba9020 into go-gitea:main Mar 22, 2026
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 22, 2026
@bircni bircni deleted the feature/retry-badges branch March 22, 2026 15:51
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 23, 2026
* giteaofficial/main:
  Add user badges (go-gitea#36752)
  Apply as maintainer (go-gitea#36947)
  Refactor storage content-type handling of ServeDirectURL (go-gitea#36804)
  Add summary to action runs view (go-gitea#36883)
  feat: Add configurable permissions for Actions automatic tokens (go-gitea#36173)
  Feature: Add button to re-run failed jobs in Actions (go-gitea#36924)
  Support dark/light theme images in markdown (go-gitea#36922)
  fix go-gitea#36463: preserve sort order of exclusive labels from template repo (go-gitea#36931)
  fix(upgrade.sh): use HTTPS for GPG key import and restore SELinux context after upgrade (go-gitea#36930)
  [skip ci] Updated translations via Crowdin
  Make container registry support Apple Container (basic auth) (go-gitea#36920)
  Fix various trivial problems (go-gitea#36921)
silverwind added a commit to silverwind/gitea that referenced this pull request Mar 23, 2026
* origin/main:
  Update to eslint 10 (go-gitea#36925)
  Add user badges (go-gitea#36752)
  Apply as maintainer (go-gitea#36947)
  Refactor storage content-type handling of ServeDirectURL (go-gitea#36804)
  Add summary to action runs view (go-gitea#36883)
  feat: Add configurable permissions for Actions automatic tokens (go-gitea#36173)
  Feature: Add button to re-run failed jobs in Actions (go-gitea#36924)
  Support dark/light theme images in markdown (go-gitea#36922)
  fix go-gitea#36463: preserve sort order of exclusive labels from template repo (go-gitea#36931)
  fix(upgrade.sh): use HTTPS for GPG key import and restore SELinux context after upgrade (go-gitea#36930)
  [skip ci] Updated translations via Crowdin
  Make container registry support Apple Container (basic auth) (go-gitea#36920)
  Fix various trivial problems (go-gitea#36921)
  [skip ci] Updated translations via Crowdin

# Conflicts:
#	package.json
#	pnpm-lock.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/migrations modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants