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

feature: custom repo buttons #15532

Closed
wants to merge 7 commits into from

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Apr 18, 2021

which is similar to Sponsor in github, and user can use it to do other things they like also :)

limit the buttons number to 3, because too many buttons will break header ui.

example view:
xx1

xx2

TODO:

  • wonder why centering ...
  • poping up message

which is similar to Sponsor in github,
and user can use it to do other
things they like also :)

limit the buttons number to 3, because
too many buttons will break header ui.

Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796 a1012112796 added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 18, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2021

Codecov Report

Merging #15532 (b0125ae) into master (6ea6e2b) will decrease coverage by 0.02%.
The diff coverage is 30.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15532      +/-   ##
==========================================
- Coverage   43.93%   43.90%   -0.03%     
==========================================
  Files         678      678              
  Lines       81742    81795      +53     
==========================================
+ Hits        35911    35915       +4     
- Misses      39980    40021      +41     
- Partials     5851     5859       +8     
Impacted Files Coverage Δ
modules/context/repo.go 51.99% <0.00%> (-1.16%) ⬇️
services/forms/repo_form.go 40.71% <ø> (ø)
routers/repo/setting.go 13.23% <7.14%> (-0.13%) ⬇️
models/repo.go 53.98% <55.55%> (+0.03%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
services/pull/check.go 26.02% <0.00%> (-2.74%) ⬇️
services/pull/patch.go 54.23% <0.00%> (-1.70%) ⬇️
services/pull/pull.go 43.47% <0.00%> (-0.46%) ⬇️
modules/queue/workerpool.go 60.00% <0.00%> (+1.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ea6e2b...b0125ae. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 18, 2021

const $detailModal = $('#detail-modal');

$('.show-repo-button-content').on('click', function () {
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be a good case for @silverwind's jsx PR, as I am concerned with the below line of injecting HTML and it creating an XSS issue.

Copy link
Member

@silverwind silverwind Apr 19, 2021

Choose a reason for hiding this comment

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

Probably not suitable. JSX is when you want to create a DOM structure completely in JS but in this case, it's some pre-rendered Markdown from the server. Generally I don't like putting HTML into data attributes, maybe it could be rendered directly but hidden via CSS, thought if this is just a dialog, that may already work without any JS involved.

Copy link
Member Author

Choose a reason for hiding this comment

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

@silverwind How about current way? Thanks

Copy link
Member

Choose a reason for hiding this comment

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

Better, thanks.

models/repo.go Outdated Show resolved Hide resolved
@silverwind
Copy link
Member

silverwind commented May 3, 2021

In you screenshot, the buttons are missing their left border. Something funky going on with fomantic styles? Oh, and please match button height to the other buttons.

@lunny lunny added the pr/wip This PR is not ready for review label Jun 5, 2021
@davidak
Copy link

davidak commented Oct 4, 2021

I would prefer a dedicated feature for funding.

I like how GitHub shows it now on the bottom of issues.

Screenshot from 2021-10-04 16-50-38

The users should fund free software!

@wxiaoguang
Copy link
Contributor

A hint about "wonder why centering ...": I also meet this problem and because the CSS is polluted globally. I have to bypass it by using style=xxx:

image

@wxiaoguang wxiaoguang mentioned this pull request Feb 18, 2023
@a1012112796 a1012112796 closed this May 1, 2023
@a1012112796 a1012112796 deleted the custom-repo-buttons branch May 1, 2023 06:28
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 1, 2023
@a1012112796 a1012112796 restored the custom-repo-buttons branch February 22, 2024 00:49
@a1012112796 a1012112796 deleted the custom-repo-buttons branch February 22, 2024 00:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/wip This PR is not ready for review type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants