diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-03 18:54:56 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-03 18:54:56 +0800 |
commit | 041ec1330a999aa77b6abc71f8b6f2f5204d0017 (patch) | |
tree | 9deead3f538201d5c5e076351d7a8538dfd75085 | |
parent | README: Update status on patch conversions (diff) | |
download | forge-041ec1330a999aa77b6abc71f8b6f2f5204d0017.tar.gz forge-041ec1330a999aa77b6abc71f8b6f2f5204d0017.tar.zst forge-041ec1330a999aa77b6abc71f8b6f2f5204d0017.zip |
HTML: Add contribution guidelines in the MR tabv0.1.16
-rw-r--r-- | http_handle_repo_index.go | 2 | ||||
-rw-r--r-- | http_server.go | 3 | ||||
-rw-r--r-- | templates/repo_contrib_index.tmpl | 22 |
3 files changed, 18 insertions, 9 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index 4a60af1..164fd65 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -95,8 +95,6 @@ func httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, params map[st params["commits"] = commits params["readme_filename"] = readmeFilename params["readme"] = readmeRendered - params["http_clone_url"] = genHTTPRemoteURL(groupPath, repoName) - params["ssh_clone_url"] = genSSHRemoteURL(groupPath, repoName) params["notes"] = notes renderTemplate(w, "repo_index", params) diff --git a/http_server.go b/http_server.go index 0a474cc..e234d64 100644 --- a/http_server.go +++ b/http_server.go @@ -190,6 +190,9 @@ func (router *forgeHTTPRouter) ServeHTTP(writer http.ResponseWriter, request *ht repoURLRoot = repoURLRoot + url.PathEscape(part) + "/" } params["repo_url_root"] = repoURLRoot + params["repo_patch_mailing_list"] = repoURLRoot[1:] + "@" + config.LMTP.Domain + params["http_clone_url"] = genHTTPRemoteURL(groupPath, moduleName) + params["ssh_clone_url"] = genSSHRemoteURL(groupPath, moduleName) if len(segments) == sepIndex+3 { if redirectDir(writer, request) { diff --git a/templates/repo_contrib_index.tmpl b/templates/repo_contrib_index.tmpl index a4c5098..c7ae45c 100644 --- a/templates/repo_contrib_index.tmpl +++ b/templates/repo_contrib_index.tmpl @@ -44,17 +44,25 @@ </div> </div> <div class="padding-wrapper"> + <h2>How to submit a merge request</h2> + <pre>git clone {{ .ssh_clone_url }} +cd powxy +git checkout -b contrib/name_of_your_contribution +# edit and commit stuff +git push -u origin HEAD</pre> + <p>Pushes that update branches in other namespaces, or pushes to existing contribution branches belonging to other SSH keys, will be automatically +rejected, unless you are an authenticated maintainer. Otherwise, a merge request is automatically opened, and the maintainers are notified via IRC.</p> + <p>Alternatively, you may <a href="https://git-send-email.io">email patches</a> to <a href="mailto:{{ .repo_patch_mailing_list }}">{{ .repo_patch_mailing_list }}</a>.</p> + </div> + <div class="padding-wrapper"> <table id="recent-merge_requests" class="wide"> <thead> - <tr class="title-row"> - <th colspan="3">Merge requests</th> + <tr> + <th scope="col">ID</th> + <th scope="col">Title</th> + <th scope="col">Status</th> </tr> </thead> - <tr> - <th scope="col">ID</th> - <th scope="col">Title</th> - <th scope="col">Status</th> - </tr> <tbody> {{- range .merge_requests -}} <tr> |