mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 00:01:32 -04:00
Compare commits
7 Commits
558eea69bd
...
ae8e8f055e
Author | SHA1 | Date | |
---|---|---|---|
|
ae8e8f055e | ||
|
8099238618 | ||
|
e644cc9448 | ||
|
323135b97b | ||
|
9631958a82 | ||
|
a50d9af876 | ||
|
e97baed800 |
@ -46,6 +46,9 @@ overrides:
|
||||
- files: ["*.config.*"]
|
||||
rules:
|
||||
import/no-unused-modules: [0]
|
||||
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
|
||||
rules:
|
||||
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
|
||||
|
||||
rules:
|
||||
"@eslint-community/eslint-comments/disable-enable-pair": [2]
|
||||
@ -420,7 +423,7 @@ rules:
|
||||
no-restricted-exports: [0]
|
||||
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename]
|
||||
no-restricted-imports: [0]
|
||||
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
|
||||
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}]
|
||||
no-return-assign: [0]
|
||||
no-script-url: [2]
|
||||
no-self-assign: [2, {props: true}]
|
||||
|
@ -95,7 +95,7 @@ Some lint rules and IDEs also have warnings if the returned Promise is not handl
|
||||
### Fetching data
|
||||
|
||||
To fetch data, use the wrapper functions `GET`, `POST` etc. from `modules/fetch.js`. They
|
||||
accept a `data` option for the content, will automatically set CSFR token and return a
|
||||
accept a `data` option for the content, will automatically set CSRF token and return a
|
||||
Promise for a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
|
||||
|
||||
### HTML Attributes and `dataset`
|
||||
|
@ -41,6 +41,8 @@ func migratePullMirrors(x *xorm.Engine) error {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
RemoteAddress string `xorm:"VARCHAR(2048)"`
|
||||
RepoOwner string
|
||||
RepoName string
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
@ -59,7 +61,9 @@ func migratePullMirrors(x *xorm.Engine) error {
|
||||
|
||||
for {
|
||||
var mirrors []Mirror
|
||||
if err := sess.Limit(limit, start).Find(&mirrors); err != nil {
|
||||
if err := sess.Select("mirror.id, mirror.repo_id, mirror.remote_address, repository.owner_name as repo_owner, repository.name as repo_name").
|
||||
Join("INNER", "repository", "repository.id = mirror.repo_id").
|
||||
Limit(limit, start).Find(&mirrors); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -69,7 +73,7 @@ func migratePullMirrors(x *xorm.Engine) error {
|
||||
start += len(mirrors)
|
||||
|
||||
for _, m := range mirrors {
|
||||
remoteAddress, err := getRemoteAddress(sess, m.RepoID, "origin")
|
||||
remoteAddress, err := getRemoteAddress(m.RepoOwner, m.RepoName, "origin")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -100,6 +104,8 @@ func migratePushMirrors(x *xorm.Engine) error {
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
RemoteName string
|
||||
RemoteAddress string `xorm:"VARCHAR(2048)"`
|
||||
RepoOwner string
|
||||
RepoName string
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
@ -118,7 +124,9 @@ func migratePushMirrors(x *xorm.Engine) error {
|
||||
|
||||
for {
|
||||
var mirrors []PushMirror
|
||||
if err := sess.Limit(limit, start).Find(&mirrors); err != nil {
|
||||
if err := sess.Select("push_mirror.id, push_mirror.repo_id, push_mirror.remote_name, push_mirror.remote_address, repository.owner_name as repo_owner, repository.name as repo_name").
|
||||
Join("INNER", "repository", "repository.id = push_mirror.repo_id").
|
||||
Limit(limit, start).Find(&mirrors); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -128,7 +136,7 @@ func migratePushMirrors(x *xorm.Engine) error {
|
||||
start += len(mirrors)
|
||||
|
||||
for _, m := range mirrors {
|
||||
remoteAddress, err := getRemoteAddress(sess, m.RepoID, m.RemoteName)
|
||||
remoteAddress, err := getRemoteAddress(m.RepoOwner, m.RepoName, m.RemoteName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -153,25 +161,12 @@ func migratePushMirrors(x *xorm.Engine) error {
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
func getRemoteAddress(sess *xorm.Session, repoID int64, remoteName string) (string, error) {
|
||||
var ownerName string
|
||||
var repoName string
|
||||
has, err := sess.
|
||||
Table("repository").
|
||||
Cols("owner_name", "lower_name").
|
||||
Where("id=?", repoID).
|
||||
Get(&ownerName, &repoName)
|
||||
if err != nil {
|
||||
return "", err
|
||||
} else if !has {
|
||||
return "", fmt.Errorf("repository [%v] not found", repoID)
|
||||
}
|
||||
|
||||
func getRemoteAddress(ownerName, repoName, remoteName string) (string, error) {
|
||||
repoPath := filepath.Join(setting.RepoRootPath, strings.ToLower(ownerName), strings.ToLower(repoName)+".git")
|
||||
|
||||
remoteURL, err := git.GetRemoteAddress(context.Background(), repoPath, remoteName)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", fmt.Errorf("get remote %s's address of %s/%s failed: %v", remoteName, ownerName, repoName, err)
|
||||
}
|
||||
|
||||
u, err := giturl.Parse(remoteURL)
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
|
||||
// FilesystemClient is used to read LFS data from a filesystem path
|
||||
type FilesystemClient struct {
|
||||
lfsdir string
|
||||
lfsDir string
|
||||
}
|
||||
|
||||
// BatchSize returns the preferred size of batchs to process
|
||||
@ -25,16 +25,12 @@ func (c *FilesystemClient) BatchSize() int {
|
||||
|
||||
func newFilesystemClient(endpoint *url.URL) *FilesystemClient {
|
||||
path, _ := util.FileURLToPath(endpoint)
|
||||
|
||||
lfsdir := filepath.Join(path, "lfs", "objects")
|
||||
|
||||
client := &FilesystemClient{lfsdir}
|
||||
|
||||
return client
|
||||
lfsDir := filepath.Join(path, "lfs", "objects")
|
||||
return &FilesystemClient{lfsDir}
|
||||
}
|
||||
|
||||
func (c *FilesystemClient) objectPath(oid string) string {
|
||||
return filepath.Join(c.lfsdir, oid[0:2], oid[2:4], oid)
|
||||
return filepath.Join(c.lfsDir, oid[0:2], oid[2:4], oid)
|
||||
}
|
||||
|
||||
// Download reads the specific LFS object from the target path
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@ -17,7 +18,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/proxy"
|
||||
)
|
||||
|
||||
const batchSize = 20
|
||||
const httpBatchSize = 20
|
||||
|
||||
// HTTPClient is used to communicate with the LFS server
|
||||
// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md
|
||||
@ -29,7 +30,7 @@ type HTTPClient struct {
|
||||
|
||||
// BatchSize returns the preferred size of batchs to process
|
||||
func (c *HTTPClient) BatchSize() int {
|
||||
return batchSize
|
||||
return httpBatchSize
|
||||
}
|
||||
|
||||
func newHTTPClient(endpoint *url.URL, httpTransport *http.Transport) *HTTPClient {
|
||||
@ -43,28 +44,25 @@ func newHTTPClient(endpoint *url.URL, httpTransport *http.Transport) *HTTPClient
|
||||
Transport: httpTransport,
|
||||
}
|
||||
|
||||
client := &HTTPClient{
|
||||
client: hc,
|
||||
endpoint: strings.TrimSuffix(endpoint.String(), "/"),
|
||||
transfers: make(map[string]TransferAdapter),
|
||||
}
|
||||
|
||||
basic := &BasicTransferAdapter{hc}
|
||||
|
||||
client.transfers[basic.Name()] = basic
|
||||
client := &HTTPClient{
|
||||
client: hc,
|
||||
endpoint: strings.TrimSuffix(endpoint.String(), "/"),
|
||||
transfers: map[string]TransferAdapter{
|
||||
basic.Name(): basic,
|
||||
},
|
||||
}
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
func (c *HTTPClient) transferNames() []string {
|
||||
keys := make([]string, len(c.transfers))
|
||||
|
||||
i := 0
|
||||
for k := range c.transfers {
|
||||
keys[i] = k
|
||||
i++
|
||||
}
|
||||
|
||||
return keys
|
||||
}
|
||||
|
||||
@ -74,7 +72,6 @@ func (c *HTTPClient) batch(ctx context.Context, operation string, objects []Poin
|
||||
url := fmt.Sprintf("%s/objects/batch", c.endpoint)
|
||||
|
||||
request := &BatchRequest{operation, c.transferNames(), nil, objects}
|
||||
|
||||
payload := new(bytes.Buffer)
|
||||
err := json.NewEncoder(payload).Encode(request)
|
||||
if err != nil {
|
||||
@ -82,32 +79,17 @@ func (c *HTTPClient) batch(ctx context.Context, operation string, objects []Poin
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Trace("Calling: %s", url)
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, "POST", url, payload)
|
||||
req, err := createRequest(ctx, http.MethodPost, url, map[string]string{"Content-Type": MediaType}, payload)
|
||||
if err != nil {
|
||||
log.Error("Error creating request: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("Content-type", MediaType)
|
||||
req.Header.Set("Accept", MediaType)
|
||||
|
||||
res, err := c.client.Do(req)
|
||||
res, err := performRequest(ctx, c.client, req)
|
||||
if err != nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
}
|
||||
log.Error("Error while processing request: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("Unexpected server response: %s", res.Status)
|
||||
}
|
||||
|
||||
var response BatchResponse
|
||||
err = json.NewDecoder(res.Body).Decode(&response)
|
||||
if err != nil {
|
||||
@ -177,7 +159,7 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc
|
||||
link, ok := object.Actions["upload"]
|
||||
if !ok {
|
||||
log.Debug("%+v", object)
|
||||
return errors.New("Missing action 'upload'")
|
||||
return errors.New("missing action 'upload'")
|
||||
}
|
||||
|
||||
content, err := uc(object.Pointer, nil)
|
||||
@ -187,8 +169,6 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc
|
||||
|
||||
err = transferAdapter.Upload(ctx, link, object.Pointer, content)
|
||||
|
||||
content.Close()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -203,7 +183,7 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc
|
||||
link, ok := object.Actions["download"]
|
||||
if !ok {
|
||||
log.Debug("%+v", object)
|
||||
return errors.New("Missing action 'download'")
|
||||
return errors.New("missing action 'download'")
|
||||
}
|
||||
|
||||
content, err := transferAdapter.Download(ctx, link)
|
||||
@ -219,3 +199,59 @@ func (c *HTTPClient) performOperation(ctx context.Context, objects []Pointer, dc
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// createRequest creates a new request, and sets the headers.
|
||||
func createRequest(ctx context.Context, method, url string, headers map[string]string, body io.Reader) (*http.Request, error) {
|
||||
log.Trace("createRequest: %s", url)
|
||||
req, err := http.NewRequestWithContext(ctx, method, url, body)
|
||||
if err != nil {
|
||||
log.Error("Error creating request: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for key, value := range headers {
|
||||
req.Header.Set(key, value)
|
||||
}
|
||||
req.Header.Set("Accept", MediaType)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// performRequest sends a request, optionally performs a callback on the request and returns the response.
|
||||
// If the status code is 200, the response is returned, and it will contain a non-nil Body.
|
||||
// Otherwise, it will return an error, and the Body will be nil or closed.
|
||||
func performRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
|
||||
log.Trace("performRequest: %s", req.URL)
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return res, ctx.Err()
|
||||
default:
|
||||
}
|
||||
log.Error("Error while processing request: %v", err)
|
||||
return res, err
|
||||
}
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
defer res.Body.Close()
|
||||
return res, handleErrorResponse(res)
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func handleErrorResponse(resp *http.Response) error {
|
||||
var er ErrorResponse
|
||||
err := json.NewDecoder(resp.Body).Decode(&er)
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
log.Error("Error decoding json: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Trace("ErrorResponse: %v", er)
|
||||
return errors.New(er.Message)
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ func TestHTTPClientDownload(t *testing.T) {
|
||||
// case 0
|
||||
{
|
||||
endpoint: "https://status-not-ok.io",
|
||||
expectederror: "Unexpected server response: ",
|
||||
expectederror: io.ErrUnexpectedEOF.Error(),
|
||||
},
|
||||
// case 1
|
||||
{
|
||||
@ -207,7 +207,7 @@ func TestHTTPClientDownload(t *testing.T) {
|
||||
// case 6
|
||||
{
|
||||
endpoint: "https://empty-actions-map.io",
|
||||
expectederror: "Missing action 'download'",
|
||||
expectederror: "missing action 'download'",
|
||||
},
|
||||
// case 7
|
||||
{
|
||||
@ -217,27 +217,28 @@ func TestHTTPClientDownload(t *testing.T) {
|
||||
// case 8
|
||||
{
|
||||
endpoint: "https://upload-actions-map.io",
|
||||
expectederror: "Missing action 'download'",
|
||||
expectederror: "missing action 'download'",
|
||||
},
|
||||
// case 9
|
||||
{
|
||||
endpoint: "https://verify-actions-map.io",
|
||||
expectederror: "Missing action 'download'",
|
||||
expectederror: "missing action 'download'",
|
||||
},
|
||||
// case 10
|
||||
{
|
||||
endpoint: "https://unknown-actions-map.io",
|
||||
expectederror: "Missing action 'download'",
|
||||
expectederror: "missing action 'download'",
|
||||
},
|
||||
}
|
||||
|
||||
for n, c := range cases {
|
||||
client := &HTTPClient{
|
||||
client: hc,
|
||||
endpoint: c.endpoint,
|
||||
transfers: make(map[string]TransferAdapter),
|
||||
client: hc,
|
||||
endpoint: c.endpoint,
|
||||
transfers: map[string]TransferAdapter{
|
||||
"dummy": dummy,
|
||||
},
|
||||
}
|
||||
client.transfers["dummy"] = dummy
|
||||
|
||||
err := client.Download(context.Background(), []Pointer{p}, func(p Pointer, content io.ReadCloser, objectError error) error {
|
||||
if objectError != nil {
|
||||
@ -284,7 +285,7 @@ func TestHTTPClientUpload(t *testing.T) {
|
||||
// case 0
|
||||
{
|
||||
endpoint: "https://status-not-ok.io",
|
||||
expectederror: "Unexpected server response: ",
|
||||
expectederror: io.ErrUnexpectedEOF.Error(),
|
||||
},
|
||||
// case 1
|
||||
{
|
||||
@ -319,7 +320,7 @@ func TestHTTPClientUpload(t *testing.T) {
|
||||
// case 7
|
||||
{
|
||||
endpoint: "https://download-actions-map.io",
|
||||
expectederror: "Missing action 'upload'",
|
||||
expectederror: "missing action 'upload'",
|
||||
},
|
||||
// case 8
|
||||
{
|
||||
@ -329,22 +330,23 @@ func TestHTTPClientUpload(t *testing.T) {
|
||||
// case 9
|
||||
{
|
||||
endpoint: "https://verify-actions-map.io",
|
||||
expectederror: "Missing action 'upload'",
|
||||
expectederror: "missing action 'upload'",
|
||||
},
|
||||
// case 10
|
||||
{
|
||||
endpoint: "https://unknown-actions-map.io",
|
||||
expectederror: "Missing action 'upload'",
|
||||
expectederror: "missing action 'upload'",
|
||||
},
|
||||
}
|
||||
|
||||
for n, c := range cases {
|
||||
client := &HTTPClient{
|
||||
client: hc,
|
||||
endpoint: c.endpoint,
|
||||
transfers: make(map[string]TransferAdapter),
|
||||
client: hc,
|
||||
endpoint: c.endpoint,
|
||||
transfers: map[string]TransferAdapter{
|
||||
"dummy": dummy,
|
||||
},
|
||||
}
|
||||
client.transfers["dummy"] = dummy
|
||||
|
||||
err := client.Upload(context.Background(), []Pointer{p}, func(p Pointer, objectError error) (io.ReadCloser, error) {
|
||||
return io.NopCloser(new(bytes.Buffer)), objectError
|
||||
|
@ -29,10 +29,10 @@ const (
|
||||
|
||||
var (
|
||||
// ErrMissingPrefix occurs if the content lacks the LFS prefix
|
||||
ErrMissingPrefix = errors.New("Content lacks the LFS prefix")
|
||||
ErrMissingPrefix = errors.New("content lacks the LFS prefix")
|
||||
|
||||
// ErrInvalidStructure occurs if the content has an invalid structure
|
||||
ErrInvalidStructure = errors.New("Content has an invalid structure")
|
||||
ErrInvalidStructure = errors.New("content has an invalid structure")
|
||||
|
||||
// ErrInvalidOIDFormat occurs if the oid has an invalid format
|
||||
ErrInvalidOIDFormat = errors.New("OID has an invalid format")
|
||||
|
@ -6,8 +6,6 @@ package lfs
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
@ -15,7 +13,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// TransferAdapter represents an adapter for downloading/uploading LFS objects
|
||||
// TransferAdapter represents an adapter for downloading/uploading LFS objects.
|
||||
type TransferAdapter interface {
|
||||
Name() string
|
||||
Download(ctx context.Context, l *Link) (io.ReadCloser, error)
|
||||
@ -23,41 +21,48 @@ type TransferAdapter interface {
|
||||
Verify(ctx context.Context, l *Link, p Pointer) error
|
||||
}
|
||||
|
||||
// BasicTransferAdapter implements the "basic" adapter
|
||||
// BasicTransferAdapter implements the "basic" adapter.
|
||||
type BasicTransferAdapter struct {
|
||||
client *http.Client
|
||||
}
|
||||
|
||||
// Name returns the name of the adapter
|
||||
// Name returns the name of the adapter.
|
||||
func (a *BasicTransferAdapter) Name() string {
|
||||
return "basic"
|
||||
}
|
||||
|
||||
// Download reads the download location and downloads the data
|
||||
// Download reads the download location and downloads the data.
|
||||
func (a *BasicTransferAdapter) Download(ctx context.Context, l *Link) (io.ReadCloser, error) {
|
||||
resp, err := a.performRequest(ctx, "GET", l, nil, nil)
|
||||
req, err := createRequest(ctx, http.MethodGet, l.Href, l.Header, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err := performRequest(ctx, a.client, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
// Upload sends the content to the LFS server
|
||||
// Upload sends the content to the LFS server.
|
||||
func (a *BasicTransferAdapter) Upload(ctx context.Context, l *Link, p Pointer, r io.Reader) error {
|
||||
_, err := a.performRequest(ctx, "PUT", l, r, func(req *http.Request) {
|
||||
if len(req.Header.Get("Content-Type")) == 0 {
|
||||
req.Header.Set("Content-Type", "application/octet-stream")
|
||||
}
|
||||
|
||||
if req.Header.Get("Transfer-Encoding") == "chunked" {
|
||||
req.TransferEncoding = []string{"chunked"}
|
||||
}
|
||||
|
||||
req.ContentLength = p.Size
|
||||
})
|
||||
req, err := createRequest(ctx, http.MethodPut, l.Href, l.Header, r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if req.Header.Get("Content-Type") == "" {
|
||||
req.Header.Set("Content-Type", "application/octet-stream")
|
||||
}
|
||||
if req.Header.Get("Transfer-Encoding") == "chunked" {
|
||||
req.TransferEncoding = []string{"chunked"}
|
||||
}
|
||||
req.ContentLength = p.Size
|
||||
|
||||
res, err := performRequest(ctx, a.client, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -69,66 +74,15 @@ func (a *BasicTransferAdapter) Verify(ctx context.Context, l *Link, p Pointer) e
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = a.performRequest(ctx, "POST", l, bytes.NewReader(b), func(req *http.Request) {
|
||||
req.Header.Set("Content-Type", MediaType)
|
||||
})
|
||||
req, err := createRequest(ctx, http.MethodPost, l.Href, l.Header, bytes.NewReader(b))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Header.Set("Content-Type", MediaType)
|
||||
res, err := performRequest(ctx, a.client, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *BasicTransferAdapter) performRequest(ctx context.Context, method string, l *Link, body io.Reader, callback func(*http.Request)) (*http.Response, error) {
|
||||
log.Trace("Calling: %s %s", method, l.Href)
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, method, l.Href, body)
|
||||
if err != nil {
|
||||
log.Error("Error creating request: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
for key, value := range l.Header {
|
||||
req.Header.Set(key, value)
|
||||
}
|
||||
req.Header.Set("Accept", MediaType)
|
||||
|
||||
if callback != nil {
|
||||
callback(req)
|
||||
}
|
||||
|
||||
res, err := a.client.Do(req)
|
||||
if err != nil {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return res, ctx.Err()
|
||||
default:
|
||||
}
|
||||
log.Error("Error while processing request: %v", err)
|
||||
return res, err
|
||||
}
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return res, handleErrorResponse(res)
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func handleErrorResponse(resp *http.Response) error {
|
||||
defer resp.Body.Close()
|
||||
|
||||
er, err := decodeResponseError(resp.Body)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Request failed with status %s", resp.Status)
|
||||
}
|
||||
log.Trace("ErrorRespone: %v", er)
|
||||
return errors.New(er.Message)
|
||||
}
|
||||
|
||||
func decodeResponseError(r io.Reader) (ErrorResponse, error) {
|
||||
var er ErrorResponse
|
||||
err := json.NewDecoder(r).Decode(&er)
|
||||
if err != nil {
|
||||
log.Error("Error decoding json: %v", err)
|
||||
}
|
||||
return er, err
|
||||
}
|
||||
|
@ -225,6 +225,7 @@ func isOSWindows() bool {
|
||||
var driveLetterRegexp = regexp.MustCompile("/[A-Za-z]:/")
|
||||
|
||||
// FileURLToPath extracts the path information from a file://... url.
|
||||
// It returns an error only if the URL is not a file URL.
|
||||
func FileURLToPath(u *url.URL) (string, error) {
|
||||
if u.Scheme != "file" {
|
||||
return "", errors.New("URL scheme is not 'file': " + u.String())
|
||||
|
@ -123,6 +123,8 @@ unpin = Unpin
|
||||
|
||||
artifacts = Artifacts
|
||||
|
||||
archived = Archived
|
||||
|
||||
concept_system_global = Global
|
||||
concept_user_individual = Individual
|
||||
concept_code_repository = Repository
|
||||
@ -317,7 +319,6 @@ filter_by_team_repositories = Filter by team repositories
|
||||
feed_of = Feed of "%s"
|
||||
|
||||
show_archived = Archived
|
||||
archived = Archived
|
||||
show_both_archived_unarchived = Showing both archived and unarchived
|
||||
show_only_archived = Showing only archived
|
||||
show_only_unarchived = Showing only unarchived
|
||||
|
@ -428,7 +428,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{.locale.Tr "admin.auths.update"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "admin.auths.update"}}</button>
|
||||
<button class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.Source.ID}}">{{.locale.Tr "admin.auths.delete"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -73,7 +73,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{.locale.Tr "admin.auths.new"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "admin.auths.new"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -238,7 +238,7 @@
|
||||
<div class="ui tiny input">
|
||||
<input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required>
|
||||
</div>
|
||||
<button class="ui tiny green button">{{.locale.Tr "admin.config.send_test_mail_submit"}}</button>
|
||||
<button class="ui tiny primary button">{{.locale.Tr "admin.config.send_test_mail_submit"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
{{end}}
|
||||
|
@ -20,7 +20,7 @@
|
||||
<tbody>
|
||||
{{range .Entries}}
|
||||
<tr>
|
||||
<td><button type="submit" class="ui green button" name="op" value="{{.Name}}" title="{{$.locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
|
||||
<td><button type="submit" class="ui primary button" name="op" value="{{.Name}}" title="{{$.locale.Tr "admin.dashboard.operation_run"}}">{{svg "octicon-triangle-right"}}</button></td>
|
||||
<td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
|
||||
<td>{{.Spec}}</td>
|
||||
<td>{{DateTime "full" .Next}}</td>
|
||||
|
@ -15,55 +15,55 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_inactive_accounts">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.delete_repo_archives"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_repo_archives">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.delete_missing_repos"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.git_gc_repos"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="git_gc_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
{{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}}
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.resync_all_sshkeys"}}<br>
|
||||
{{.locale.Tr "admin.dashboard.resync_all_sshkeys.desc"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshkeys">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.resync_all_sshprincipals"}}<br>
|
||||
{{.locale.Tr "admin.dashboard.resync_all_sshprincipals.desc"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_sshprincipals">{{svg "octicon-play" 16}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.resync_all_hooks"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="resync_all_hooks">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.reinit_missing_repos"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="reinit_missing_repos">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.sync_external_users"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_external_users">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.repo_health_check"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="repo_health_check">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.delete_generated_repository_avatars"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="delete_generated_repository_avatars">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.locale.Tr "admin.dashboard.sync_repo_branches"}}</td>
|
||||
<td class="text right"><button type="submit" class="ui green button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
<td class="text right"><button type="submit" class="ui primary button" name="op" value="sync_repo_branches">{{svg "octicon-play"}} {{.locale.Tr "admin.dashboard.operation_run"}}</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<div class="item gt-df gt-ac">
|
||||
<span class="gt-f1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span>
|
||||
<div>
|
||||
<button class="ui button green show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{$.locale.Tr "repo.adopt_preexisting_label"}}</button>
|
||||
<button class="ui button primary show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{$.locale.Tr "repo.adopt_preexisting_label"}}</button>
|
||||
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
|
||||
<div class="header">
|
||||
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{.locale.Tr "admin.users.edit_account"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<form class="ui form" action="./edit" method="post">
|
||||
{{template "base/disable_form_autofill"}}
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_UserName}}error{{end}}">
|
||||
@ -147,7 +147,7 @@
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{.locale.Tr "admin.users.update_profile"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "admin.users.update_profile"}}</button>
|
||||
<button class="ui red button show-modal" data-modal="#delete-user-modal">{{.locale.Tr "admin.users.delete_account"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -157,7 +157,7 @@
|
||||
{{.locale.Tr "settings.avatar"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
|
||||
<form class="ui form" action="./avatar" method="post" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
{{if not .DisableGravatar}}
|
||||
<div class="inline field">
|
||||
@ -185,8 +185,8 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="./avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -197,7 +197,7 @@
|
||||
{{svg "octicon-trash"}}
|
||||
{{.locale.Tr "settings.delete_account_title"}}
|
||||
</div>
|
||||
<form class="ui form" method="post" action="{{.Link}}/delete">
|
||||
<form class="ui form" method="post" action="./delete">
|
||||
<div class="content">
|
||||
<p>{{.locale.Tr "settings.delete_account_desc"}}</p>
|
||||
{{$.CsrfTokenHtml}}
|
||||
|
@ -82,7 +82,7 @@
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{.locale.Tr "admin.users.new_account"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "admin.users.new_account"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@ Template Attributes:
|
||||
|
||||
Two buttons (negative, positive):
|
||||
* ModalButtonTypes: "yes" (default) or "confirm"
|
||||
* ModalButtonColors: "green" (default) / "blue" / "yellow"
|
||||
* ModalButtonColors: "primary" (default) / "blue" / "yellow"
|
||||
* ModalButtonCancelText
|
||||
* ModalButtonOkText
|
||||
|
||||
@ -26,13 +26,13 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal
|
||||
{{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}}
|
||||
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
|
||||
|
||||
{{$stylePositive := "green"}}
|
||||
{{$stylePositive := "primary"}}
|
||||
{{if eq .ModalButtonColors "blue"}}
|
||||
{{$stylePositive = "blue"}}
|
||||
{{else if eq .ModalButtonColors "yellow"}}
|
||||
{{$stylePositive = "yellow"}}
|
||||
{{end}}
|
||||
<button class="ui basic cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
|
||||
<button class="ui cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
|
||||
<button class="ui {{$stylePositive}} ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -27,10 +27,10 @@
|
||||
<button class="ui tiny red button">
|
||||
{{svg "octicon-warning" 14}} CJK文本测试
|
||||
</button>
|
||||
<button class="ui tiny green button">
|
||||
<button class="ui tiny primary button">
|
||||
{{svg "octicon-info" 14}} Button
|
||||
</button>
|
||||
<button class="ui tiny green button">
|
||||
<button class="ui tiny primary button">
|
||||
Button with long text
|
||||
</button>
|
||||
</div>
|
||||
|
@ -31,8 +31,8 @@
|
||||
<h2>Recommended colors:</h2>
|
||||
<button class="ui red button">Red</button>
|
||||
<button class="ui basic red button">Basic Red</button>
|
||||
<button class="ui green button">Green</button>
|
||||
<button class="ui basic green button">Basic Green</button>
|
||||
<button class="ui primary button">Green</button>
|
||||
<button class="ui basic primary button">Basic Green</button>
|
||||
<button class="ui blue button">Blue</button>
|
||||
<button class="ui basic blue button">Basic Blue</button>
|
||||
<button class="ui orange button">Orange</button>
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "org.create_org"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -47,9 +47,9 @@
|
||||
<div class="ui five wide column">
|
||||
{{if .CanCreateOrgRepo}}
|
||||
<div class="center aligned">
|
||||
<a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.locale.Tr "new_repo"}}</a>
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{.locale.Tr "new_repo"}}</a>
|
||||
{{if not .DisableNewPullMirrors}}
|
||||
<a class="ui green button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.locale.Tr "new_migrate"}}</a>
|
||||
<a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{.locale.Tr "new_migrate"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="gt-f1">
|
||||
{{$.locale.Tr "org.settings.labels_desc" | Str2html}}
|
||||
</div>
|
||||
<button class="ui small green new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
<button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{template "repo/issue/labels/label_new" .}}
|
||||
|
@ -79,7 +79,7 @@
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "org.settings.update_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "org.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<div class="extra content">
|
||||
<form class="ui form" action="" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button class="fluid ui green button">{{.locale.Tr "org.teams.join"}}</button>
|
||||
<button class="fluid ui primary button">{{.locale.Tr "org.teams.join"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<input class="prompt" name="uname" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button">{{.locale.Tr "org.teams.add_team_member"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "org.teams.add_team_member"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -133,9 +133,9 @@
|
||||
|
||||
<div class="field">
|
||||
{{if .PageIsOrgTeamsNew}}
|
||||
<button class="ui green button">{{.locale.Tr "org.create_team"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "org.create_team"}}</button>
|
||||
{{else}}
|
||||
<button class="ui green button">{{.locale.Tr "org.teams.update_settings"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "org.teams.update_settings"}}</button>
|
||||
{{if not (eq .Team.LowerName "owners")}}
|
||||
<button class="ui red button delete-button" data-url="{{.OrgLink}}/teams/{{.Team.Name | PathEscape}}/delete">{{.locale.Tr "org.teams.delete_team"}}</button>
|
||||
{{end}}
|
||||
|
@ -17,10 +17,10 @@
|
||||
<input class="prompt" name="repo_name" placeholder="{{.locale.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button gt-ml-3">{{.locale.Tr "add"}}</button>
|
||||
<button class="ui primary button gt-ml-3">{{.locale.Tr "add"}}</button>
|
||||
</form>
|
||||
<div class="gt-dib">
|
||||
<button class="ui green button link-action" data-modal-confirm="{{.locale.Tr "org.teams.add_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/addall">{{.locale.Tr "add_all"}}</button>
|
||||
<button class="ui primary button link-action" data-modal-confirm="{{.locale.Tr "org.teams.add_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/addall">{{.locale.Tr "add_all"}}</button>
|
||||
<button class="ui red button link-action" data-modal-confirm="{{.locale.Tr "org.teams.remove_all_repos_desc"}}" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/removeall">{{.locale.Tr "remove_all"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
{{template "base/alert" .}}
|
||||
{{if .IsOrganizationOwner}}
|
||||
<div class="text right">
|
||||
<a class="ui green button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{.locale.Tr "org.create_new_team"}}</a>
|
||||
<a class="ui primary button" href="{{.OrgLink}}/teams/new">{{svg "octicon-plus"}} {{.locale.Tr "org.create_new_team"}}</a>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
|
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{.locale.Tr "packages.settings.link.button"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "packages.settings.link.button"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -8,14 +8,14 @@
|
||||
</div>
|
||||
<form class="field" action="{{.Link}}/cargo/initialize" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button class="ui green button">{{$.locale.Tr "packages.owner.settings.cargo.initialize"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.initialize"}}</button>
|
||||
</form>
|
||||
<div class="field">
|
||||
<label>{{$.locale.Tr "packages.owner.settings.cargo.rebuild.description"}}</label>
|
||||
</div>
|
||||
<form class="field" action="{{.Link}}/cargo/rebuild" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button class="ui green button">{{$.locale.Tr "packages.owner.settings.cargo.rebuild"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.rebuild"}}</button>
|
||||
</form>
|
||||
<div class="field">
|
||||
<label>{{.locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label>
|
||||
|
@ -62,11 +62,11 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
{{if .IsEditRule}}
|
||||
<button class="ui green button" name="action" value="save">{{.locale.Tr "save"}}</button>
|
||||
<button class="ui primary button" name="action" value="save">{{.locale.Tr "save"}}</button>
|
||||
<button class="ui red button" name="action" value="remove">{{.locale.Tr "remove"}}</button>
|
||||
<a class="ui button" href="{{.Link}}/preview">{{.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a>
|
||||
{{else}}
|
||||
<button class="ui green button" name="action" value="save">{{.locale.Tr "add"}}</button>
|
||||
<button class="ui primary button" name="action" value="save">{{.locale.Tr "add"}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
</form>
|
||||
|
@ -11,7 +11,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="gt-text-right">
|
||||
<a class="ui small green button" href="{{$.Link}}/new">{{.locale.Tr "repo.projects.new"}}</a>
|
||||
<a class="ui small primary button" href="{{$.Link}}/new">{{.locale.Tr "repo.projects.new"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -75,7 +75,7 @@
|
||||
<input type="hidden" name="ref" value="{{if $.BranchName}}{{$.BranchName}}{{else}}{{$.Repository.DefaultBranch}}{{end}}">
|
||||
<input type="hidden" name="refType" value="branch">
|
||||
<input type="hidden" id="cherry-pick-type" name="cherry-pick-type"><br>
|
||||
<button type="submit" id="cherry-pick-submit" class="ui green button"></button>
|
||||
<button type="submit" id="cherry-pick-submit" class="ui primary button"></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
<div class="text right actions">
|
||||
<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
|
||||
<button class="ui green button">{{.locale.Tr "repo.branch.confirm_create_branch"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.branch.confirm_create_branch"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -123,7 +123,7 @@
|
||||
|
||||
<div class="text right actions">
|
||||
<button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button>
|
||||
<button class="ui green button">{{.locale.Tr "repo.tag.confirm_create_tag"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.tag.confirm_create_tag"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -220,7 +220,7 @@
|
||||
<br>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button{{if not .CanCreateRepo}} disabled{{end}}">
|
||||
<button class="ui primary button{{if not .CanCreateRepo}} disabled{{end}}">
|
||||
{{.locale.Tr "repo.create_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -232,8 +232,8 @@
|
||||
"DropzoneParentContainer" ".ui.form"
|
||||
)}}
|
||||
<div class="text right edit buttons">
|
||||
<button class="ui basic primary cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button>
|
||||
<button class="ui green save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button>
|
||||
<button class="ui cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button>
|
||||
<button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -24,14 +24,14 @@
|
||||
<span class="markup-info">{{svg "octicon-markup"}} {{$.root.locale.Tr "repo.diff.comment.markdown_info"}}</span>
|
||||
<div class="gt-text-right">
|
||||
{{if $.reply}}
|
||||
<button class="ui submit green tiny button btn-reply" type="submit">{{$.root.locale.Tr "repo.diff.comment.reply"}}</button>
|
||||
<button class="ui submit primary tiny button btn-reply" type="submit">{{$.root.locale.Tr "repo.diff.comment.reply"}}</button>
|
||||
<input type="hidden" name="reply" value="{{$.reply}}">
|
||||
<input type="hidden" name="single_review" value="true">
|
||||
{{else}}
|
||||
{{if $.root.CurrentReview}}
|
||||
<button name="pending_review" type="submit" class="ui submit green tiny button btn-add-comment">{{$.root.locale.Tr "repo.diff.comment.add_review_comment"}}</button>
|
||||
<button name="pending_review" type="submit" class="ui submit primary tiny button btn-add-comment">{{$.root.locale.Tr "repo.diff.comment.add_review_comment"}}</button>
|
||||
{{else}}
|
||||
<button name="pending_review" type="submit" class="ui submit green tiny button btn-start-review">{{$.root.locale.Tr "repo.diff.comment.start_review"}}</button>
|
||||
<button name="pending_review" type="submit" class="ui submit primary tiny button btn-start-review">{{$.root.locale.Tr "repo.diff.comment.start_review"}}</button>
|
||||
<button name="single_review" value="true" type="submit" class="ui submit tiny basic button btn-add-single">{{$.root.locale.Tr "repo.diff.comment.add_single_comment"}}</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -180,7 +180,7 @@
|
||||
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
|
||||
<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
|
||||
<div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
|
||||
<button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button>
|
||||
<button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button>
|
||||
</div>
|
||||
<div class="pullrequest-form {{if not .Flash}}gt-hidden{{end}}">
|
||||
{{template "repo/issue/new_form" .}}
|
||||
@ -204,14 +204,14 @@
|
||||
{{else if .Issue.IsClosed}}
|
||||
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
|
||||
{{else}}
|
||||
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button green show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
|
||||
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{.locale.Tr "repo.pulls.view"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{if and $.IsSigned (not .Repository.IsArchived)}}
|
||||
<div class="ui info message show-form-container {{if .Flash}}gt-hidden{{end}}">
|
||||
<button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button>
|
||||
<button class="ui button primary show-form">{{.locale.Tr "repo.pulls.new"}}</button>
|
||||
</div>
|
||||
{{else if .Repository.IsArchived}}
|
||||
<div class="ui warning message gt-text-center">
|
||||
|
@ -56,7 +56,7 @@
|
||||
</button>
|
||||
{{end}}
|
||||
{{if and $.SignedUserID (not $.Repository.IsArchived)}}
|
||||
<button class="comment-form-reply ui green tiny labeled icon button gt-ml-2 gt-mr-0">
|
||||
<button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0">
|
||||
{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}}
|
||||
</button>
|
||||
{{end}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div id="review-box">
|
||||
<button class="ui tiny green button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
|
||||
<button class="ui tiny primary button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
|
||||
{{.locale.Tr "repo.diff.review"}}
|
||||
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
@ -33,10 +33,10 @@
|
||||
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
|
||||
{{if $showSelfTooltip}}
|
||||
<span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_approve"}}">
|
||||
<button type="submit" name="type" value="approve" disabled class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
|
||||
<button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
|
||||
</span>
|
||||
{{else}}
|
||||
<button type="submit" name="type" value="approve" class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
|
||||
<button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
|
||||
{{end}}
|
||||
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
|
||||
{{if $showSelfTooltip}}
|
||||
|
@ -67,7 +67,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<button id="commit-button" type="submit" class="ui green button">
|
||||
<button id="commit-button" type="submit" class="ui primary button">
|
||||
{{if eq .commit_choice "commit-to-new-branch"}}{{.locale.Tr "repo.editor.propose_file_change"}}{{else}}{{.locale.Tr "repo.editor.commit_changes"}}{{end}}
|
||||
</button>
|
||||
<a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{.locale.Tr "repo.editor.cancel"}}</a>
|
||||
|
@ -61,11 +61,11 @@
|
||||
<p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui red cancel button">
|
||||
<button class="ui cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{.locale.Tr "repo.editor.cancel"}}
|
||||
</button>
|
||||
<button class="ui green ok button">
|
||||
<button class="ui primary ok button">
|
||||
{{svg "fontawesome-save"}}
|
||||
{{.locale.Tr "repo.editor.commit_changes"}}
|
||||
</button>
|
||||
|
@ -43,11 +43,11 @@
|
||||
<p>{{.locale.Tr "repo.editor.commit_empty_file_text"}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui red cancel button">
|
||||
<button class="ui cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{.locale.Tr "repo.editor.cancel"}}
|
||||
</button>
|
||||
<button class="ui green ok button">
|
||||
<button class="ui primary ok button">
|
||||
{{svg "fontawesome-save"}}
|
||||
{{.locale.Tr "repo.editor.commit_changes"}}
|
||||
</button>
|
||||
|
@ -48,7 +48,7 @@
|
||||
<form method="post" action="{{$.RepoLink}}/action/accept_transfer?redirect_to={{$.RepoLink}}">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<div data-tooltip-content="{{if $.CanUserAcceptTransfer}}{{$.locale.Tr "repo.transfer.accept_desc" $.RepoTransfer.Recipient.DisplayName}}{{else}}{{$.locale.Tr "repo.transfer.no_permission_to_accept"}}{{end}}">
|
||||
<button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}green {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
|
||||
<button type="submit" class="ui basic button {{if $.CanUserAcceptTransfer}}primary {{end}} ok small"{{if not $.CanUserAcceptTransfer}} disabled{{end}}>
|
||||
{{$.locale.Tr "repo.transfer.accept"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<br>{{.About | RenderEmojiPlain}}
|
||||
</div>
|
||||
<div class="column right aligned">
|
||||
<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui green button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
<a href="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -28,7 +28,7 @@
|
||||
<br>{{.About | RenderEmojiPlain}}
|
||||
</div>
|
||||
<div class="column right aligned">
|
||||
<a href="{{.URL}}" class="ui green button">{{svg "octicon-link-external"}} {{$.locale.Tr "repo.issues.choose.open_external_link"}}</a>
|
||||
<a href="{{.URL}}" class="ui primary button">{{svg "octicon-link-external"}} {{$.locale.Tr "repo.issues.choose.open_external_link"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,7 +41,7 @@
|
||||
<br/>{{.locale.Tr "repo.issues.choose.blank_about"}}
|
||||
</div>
|
||||
<div class="column right aligned">
|
||||
<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui green button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
<a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui primary button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,7 +29,10 @@
|
||||
<div class="divider"></div>
|
||||
{{end}}
|
||||
{{$previousExclusiveScope = $exclusiveScope}}
|
||||
<a class="item label-filter-item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}} {{RenderLabel $.Context .}}</a>
|
||||
<a class="item label-filter-item gt-df gt-ac" {{if .IsArchived}}data-is-archived{{end}} href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}{{end}}
|
||||
{{RenderLabel $.Context .}}
|
||||
<p class="gt-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="navbar gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
<button class="ui small green new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
<button class="ui small primary new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
|
5
templates/repo/issue/labels/label_archived.tmpl
Normal file
5
templates/repo/issue/labels/label_archived.tmpl
Normal file
@ -0,0 +1,5 @@
|
||||
{{if .IsArchived}}
|
||||
<span class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}">
|
||||
{{ctx.Locale.Tr "archived"}}
|
||||
</span>
|
||||
{{end}}
|
@ -33,11 +33,6 @@
|
||||
<li class="item">
|
||||
<div class="label-title">
|
||||
{{RenderLabel $.Context .}}
|
||||
{{if not .ArchivedUnix.IsZero}}
|
||||
<span class="gt-ml-3 gt-cursor-default gt-italic" data-tooltip-content="{{$.locale.Tr "repo.issues.label_archive_tooltip"}}">
|
||||
{{$.locale.Tr "home.archived"}}
|
||||
</span>
|
||||
{{end}}
|
||||
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
|
||||
</div>
|
||||
<div class="label-issues">
|
||||
@ -47,14 +42,17 @@
|
||||
<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="label-operation">
|
||||
{{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
|
||||
<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
|
||||
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
|
||||
{{else if $.PageIsOrgSettingsLabels}}
|
||||
<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
|
||||
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
|
||||
{{end}}
|
||||
<div class="label-operation gt-df">
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
<div class="gt-df gt-ml-auto">
|
||||
{{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
|
||||
<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
|
||||
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
|
||||
{{else if $.PageIsOrgSettingsLabels}}
|
||||
<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
|
||||
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
@ -78,9 +76,11 @@
|
||||
{{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
|
||||
</div>
|
||||
<div class="label-issues">
|
||||
<a class="open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
|
||||
<a class="open-issues" {{if .IsArchived}}data-is-archived{{end}} href="{{$.RepoLink}}/issues?labels={{.ID}}">{{svg "octicon-issue-opened"}} {{$.locale.Tr "repo.issues.label_open_issues" .NumOpenRepoIssues}}</a>
|
||||
</div>
|
||||
<div class="label-operation">
|
||||
{{template "repo/issue/labels/label_archived" .}}
|
||||
</div>
|
||||
<div class="label-operation"></div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -36,11 +36,11 @@
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button class="ui red basic cancel button">
|
||||
<button class="ui cancel button">
|
||||
{{svg "octicon-x"}}
|
||||
{{.locale.Tr "cancel"}}
|
||||
</button>
|
||||
<button class="ui green basic ok button">
|
||||
<button class="ui primary ok button">
|
||||
{{svg "octicon-check"}}
|
||||
{{.locale.Tr "repo.issues.create_label"}}
|
||||
</button>
|
||||
|
@ -18,13 +18,13 @@
|
||||
{{template "repo/issue/search" .}}
|
||||
{{if not .Repository.IsArchived}}
|
||||
{{if .PageIsIssueList}}
|
||||
<a class="ui small green button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
{{else}}
|
||||
<a class="ui small green button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
|
||||
<a class="ui small primary button new-pr-button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{if not .PageIsIssueList}}
|
||||
<a class="ui small green small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
|
||||
<a class="ui small primary small button issue-list-new{{if not .PullRequestCtx.Allowed}} disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
{{if not .Repository.IsArchived}}
|
||||
<!-- Action Button -->
|
||||
{{if .IsShowClosed}}
|
||||
<button class="ui green basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_open"}}</button>
|
||||
<button class="ui primary basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_open"}}</button>
|
||||
{{else}}
|
||||
<button class="ui red basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{.locale.Tr "repo.issues.action_close"}}</button>
|
||||
{{end}}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<div class="text right gt-f1">
|
||||
{{if or .CanWriteIssues .CanWritePulls}}
|
||||
{{if .Milestone.IsClosed}}
|
||||
<a class="ui green basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{$.locale.Tr "repo.milestones.open"}}
|
||||
<a class="ui primary basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/open">{{$.locale.Tr "repo.milestones.open"}}
|
||||
</a>
|
||||
{{else}}
|
||||
<a class="ui red basic button link-action" href data-url="{{$.RepoLink}}/milestones/{{.MilestoneID}}/close">{{$.locale.Tr "repo.milestones.close"}}
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}}
|
||||
<div class="ui right floated secondary menu">
|
||||
<a class="ui green button" href="{{$.RepoLink}}/milestones/new">{{.locale.Tr "repo.milestones.new"}}</a>
|
||||
<a class="ui primary button" href="{{$.RepoLink}}/milestones/new">{{.locale.Tr "repo.milestones.new"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
@ -44,11 +44,11 @@
|
||||
<a class="ui primary basic button" href="{{.RepoLink}}/milestones">
|
||||
{{.locale.Tr "repo.milestones.cancel"}}
|
||||
</a>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.milestones.modify"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.milestones.create"}}
|
||||
</button>
|
||||
{{end}}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="navbar gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
<a class="ui small green button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a>
|
||||
<a class="ui small primary button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/alert" .}}
|
||||
|
@ -35,7 +35,7 @@
|
||||
{{template "repo/issue/comment_tab" .}}
|
||||
{{end}}
|
||||
<div class="text right">
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{if .PageIsComparePull}}
|
||||
{{.locale.Tr "repo.pulls.create"}}
|
||||
{{else}}
|
||||
|
@ -92,7 +92,7 @@
|
||||
<div class="text right">
|
||||
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
|
||||
{{if .Issue.IsClosed}}
|
||||
<button id="status-button" class="ui green basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
|
||||
<button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
|
||||
{{.locale.Tr "repo.issues.reopen_issue"}}
|
||||
</button>
|
||||
{{else}}
|
||||
@ -105,7 +105,7 @@
|
||||
</button>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<button class="ui green button" tabindex="5">
|
||||
<button class="ui primary button" tabindex="5">
|
||||
{{.locale.Tr "repo.issues.create_comment"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -585,7 +585,7 @@
|
||||
</button>
|
||||
{{end}}
|
||||
{{if and $.SignedUserID (not $.Repository.IsArchived)}}
|
||||
<button class="comment-form-reply ui green tiny labeled icon button gt-ml-2 gt-mr-0">
|
||||
<button class="comment-form-reply ui primary tiny labeled icon button gt-ml-2 gt-mr-0">
|
||||
{{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}}
|
||||
</button>
|
||||
{{end}}
|
||||
|
@ -22,7 +22,7 @@
|
||||
<textarea name="content" class="form-control"></textarea>
|
||||
</div>
|
||||
<div class="text right">
|
||||
<button class="ui green button">{{.locale.Tr "repo.issues.create"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.issues.create"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -327,8 +327,8 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="ui green approve button">{{.locale.Tr "repo.issues.add_time_short"}}</button>
|
||||
<button class="ui red cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</button>
|
||||
<button class="ui primary approve button">{{.locale.Tr "repo.issues.add_time_short"}}</button>
|
||||
<button class="ui cancel button">{{.locale.Tr "repo.issues.add_time_cancel"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui fluid button issue-add-time gt-mt-3" data-tooltip-content='{{.locale.Tr "repo.issues.add_time"}}'>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<button id="edit-title" class="ui small basic button edit-button not-in-edit{{if .Issue.IsPull}} gt-mr-0{{end}}">{{.locale.Tr "repo.issues.edit"}}</button>
|
||||
{{end}}
|
||||
{{if not .Issue.IsPull}}
|
||||
<a role="button" class="ui small green button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
<a role="button" class="ui small primary button new-issue-button gt-mr-0" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
|
||||
|
@ -104,7 +104,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -78,7 +78,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -120,7 +120,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -116,7 +116,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -118,7 +118,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -115,7 +115,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -118,7 +118,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -38,7 +38,7 @@
|
||||
{{if .Failed}}
|
||||
<button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button>
|
||||
{{else}}
|
||||
<button class="ui basic red show-modal button" data-modal="#cancel-repo-modal">{{.locale.Tr "cancel"}}</button>
|
||||
<button class="ui basic show-modal button" data-modal="#cancel-repo-modal">{{.locale.Tr "cancel"}}</button>
|
||||
{{end}}
|
||||
<button id="repo_migrating_retry" data-migrating-task-retry-url="{{.Link}}/settings/migrate/retry" class="ui basic button gt-hidden">{{.locale.Tr "retry"}}</button>
|
||||
</div>
|
||||
|
@ -104,7 +104,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.migrate_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="ui container padded">
|
||||
<div class="gt-df gt-sb gt-ac gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
<a class="ui small green button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
|
||||
<a class="ui small primary button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
|
||||
</div>
|
||||
{{template "projects/view" .}}
|
||||
</div>
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button{{if not .CanForkRepo}} disabled{{end}}">
|
||||
<button class="ui primary button{{if not .CanForkRepo}} disabled{{end}}">
|
||||
{{.locale.Tr "repo.fork_repo"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -16,19 +16,19 @@
|
||||
</div>
|
||||
<div class="ui twelve wide column detail">
|
||||
<div class="gt-df gt-ac gt-sb gt-fw gt-mb-3">
|
||||
<h4 class="release-list-title gt-df gt-ac">
|
||||
<h4 class="release-list-title">
|
||||
<a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a>
|
||||
{{if .IsDraft}}
|
||||
<span class="ui yellow label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.draft"}}</span>
|
||||
<span class="ui yellow label">{{$.locale.Tr "repo.release.draft"}}</span>
|
||||
{{else if .IsPrerelease}}
|
||||
<span class="ui orange label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.prerelease"}}</span>
|
||||
<span class="ui orange label">{{$.locale.Tr "repo.release.prerelease"}}</span>
|
||||
{{else if not .IsTag}}
|
||||
<span class="ui green label gt-ml-3 gt-mt-1">{{$.locale.Tr "repo.release.stable"}}</span>
|
||||
<span class="ui green label">{{$.locale.Tr "repo.release.stable"}}</span>
|
||||
{{end}}
|
||||
</h4>
|
||||
<div class="gt-df gt-ac">
|
||||
<div>
|
||||
{{if and $.CanCreateRelease (not .IsTag)}}
|
||||
<a class="muted gt-ml-3 gt-df gt-ac" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow">
|
||||
<a class="muted" data-tooltip-content="{{$.locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow">
|
||||
{{svg "octicon-pencil"}}
|
||||
</a>
|
||||
{{end}}
|
||||
@ -38,7 +38,7 @@
|
||||
<p class="text grey">
|
||||
{{if gt .Publisher.ID 0}}
|
||||
<span class="author">
|
||||
{{ctx.AvatarUtils.Avatar .Publisher 20}}
|
||||
{{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}}
|
||||
<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
|
||||
</span>
|
||||
<span class="released">
|
||||
@ -55,9 +55,9 @@
|
||||
<p class="text grey">
|
||||
<span class="author">
|
||||
{{if .OriginalAuthor}}
|
||||
{{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}}
|
||||
{{svg "octicon-mark-github" 20 "gt-mr-2"}}{{.OriginalAuthor}}
|
||||
{{else if .Publisher}}
|
||||
{{ctx.AvatarUtils.Avatar .Publisher 20}}
|
||||
{{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}}
|
||||
<a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a>
|
||||
{{else}}
|
||||
Ghost
|
||||
@ -77,8 +77,9 @@
|
||||
<div class="markup desc">
|
||||
{{Str2html .Note}}
|
||||
</div>
|
||||
<details class="download gt-border-secondary-top gt-mt-4 gt-pt-4" {{if eq $idx 0}}open{{end}}>
|
||||
<summary class="gt-mb-4">
|
||||
<div class="divider"></div>
|
||||
<details class="download" {{if eq $idx 0}}open{{end}}>
|
||||
<summary class="gt-my-4">
|
||||
{{$.locale.Tr "repo.release.downloads"}}
|
||||
</summary>
|
||||
<ul class="list">
|
||||
@ -93,21 +94,21 @@
|
||||
{{if .Attachments}}
|
||||
{{range .Attachments}}
|
||||
<li>
|
||||
<span class="gt-float-right">
|
||||
<span class="ui text grey">{{.Size | FileSize}}</span>
|
||||
<a target="_blank" rel="nofollow" href="{{.DownloadURL}}">
|
||||
<strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
|
||||
</a>
|
||||
<div>
|
||||
<span class="text grey">{{.Size | FileSize}}</span>
|
||||
<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
|
||||
{{svg "octicon-info"}}
|
||||
</span>
|
||||
</span>
|
||||
<a target="_blank" rel="noopener noreferrer" href="{{.DownloadURL}}">
|
||||
<strong>{{svg "octicon-package" 16 "gt-mr-2"}}{{.Name}}</strong>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</details>
|
||||
<span class="dot"> </span>
|
||||
<div class="dot"></div>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
|
@ -15,7 +15,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and (not .PageIsTagList) .CanCreateRelease}}
|
||||
<a class="ui small green button" href="{{$.RepoLink}}/releases/new">
|
||||
<a class="ui small primary button" href="{{$.RepoLink}}/releases/new">
|
||||
{{.locale.Tr "repo.release.new_release"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
@ -26,7 +26,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.branches.update_default_branch"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.branches.update_default_branch"}}</button>
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
|
@ -44,7 +44,7 @@
|
||||
<div id="search-user-box" class="ui search input gt-vm">
|
||||
<input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<button class="ui green button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
<div id="search-team-box" class="ui search input gt-vm" data-org-name="{{.OrgName}}">
|
||||
<input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.add_team"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.add_team"}}</button>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="item">
|
||||
|
@ -34,7 +34,7 @@
|
||||
<small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.settings.add_deploy_key"}}
|
||||
</button>
|
||||
<button class="ui hide-panel button" data-panel="#add-deploy-key-panel">
|
||||
|
@ -18,7 +18,7 @@
|
||||
<div class="editor-loading is-loading"></div>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_githook"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_githook"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
</form>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<input type="hidden" name="oid" value="{{.Oid}} {{.Size}}">
|
||||
{{end}}
|
||||
{{end}}
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.lfs_pointers.associateAccessible" $.NumAssociatable}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -45,7 +45,7 @@
|
||||
<input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "settings.update_avatar"}}</button>
|
||||
<button class="ui red button link-action" data-url="{{.Link}}/avatar/delete">{{$.locale.Tr "settings.delete_current_avatar"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
@ -189,7 +189,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_mirror_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
@ -271,7 +271,7 @@
|
||||
<input id="push_mirror_interval" name="push_mirror_interval" value="{{if .push_mirror_interval}}{{.push_mirror_interval}}{{else}}{{.DefaultMirrorInterval}}{{end}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.mirror_settings.push_mirror.add"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
@ -586,7 +586,7 @@
|
||||
|
||||
<div class="divider"></div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -632,7 +632,7 @@
|
||||
|
||||
<div class="divider"></div>
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -653,7 +653,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -675,7 +675,7 @@
|
||||
{{end}}
|
||||
</span>
|
||||
<div class="field">
|
||||
<button class="ui green button" name="request_reindex_type" value="code">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
|
||||
<button class="ui primary button" name="request_reindex_type" value="code">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@ -694,7 +694,7 @@
|
||||
{{end}}
|
||||
</span>
|
||||
<div class="field">
|
||||
<button class="ui green button" name="request_reindex_type" value="stats">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
|
||||
<button class="ui primary button" name="request_reindex_type" value="stats">{{$.locale.Tr "repo.settings.reindex_button"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -255,7 +255,7 @@
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
|
||||
<button class="ui primary button">{{$.locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -57,14 +57,14 @@
|
||||
{{end}}
|
||||
<div class="field">
|
||||
{{if .PageIsEditProtectedTag}}
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{$.locale.Tr "save"}}
|
||||
</button>
|
||||
<a class="ui primary button" href="{{$.RepoLink}}/settings/tags">
|
||||
{{$.locale.Tr "cancel"}}
|
||||
</a>
|
||||
{{else}}
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{$.locale.Tr "repo.settings.tags.protection.create"}}
|
||||
</button>
|
||||
{{end}}
|
||||
|
@ -278,9 +278,9 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
{{if $isNew}}
|
||||
<button class="ui green button">{{.locale.Tr "repo.settings.add_webhook"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.settings.add_webhook"}}</button>
|
||||
{{else}}
|
||||
<button class="ui green button">{{.locale.Tr "repo.settings.update_webhook"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "repo.settings.update_webhook"}}</button>
|
||||
<a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.locale.Tr "repo.settings.delete_webhook"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="ui header flex-text-block gt-sb">
|
||||
{{.locale.Tr "repo.wiki.new_page"}}
|
||||
{{if .PageIsWikiEdit}}
|
||||
<a class="ui green tiny button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
<a class="ui tiny primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}?action={{if .PageIsWikiEdit}}_edit{{else}}_new{{end}}" method="post">
|
||||
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="text right">
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{.locale.Tr "repo.wiki.save_page"}}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<span>{{.locale.Tr "repo.wiki.pages"}}</span>
|
||||
<span>
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
<a class="ui green small button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
{{end}}
|
||||
</span>
|
||||
</h2>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<h2>{{.locale.Tr "repo.wiki.welcome"}}</h2>
|
||||
<p>{{.locale.Tr "repo.wiki.welcome_desc"}}</p>
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
<a class="ui green button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.create_first_page"}}</a>
|
||||
<a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.create_first_page"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -51,8 +51,8 @@
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
<div class="ui right">
|
||||
<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_edit">{{.locale.Tr "repo.wiki.edit_page_button"}}</a>
|
||||
<a class="ui green small button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
<a class="ui red small button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{.locale.Tr "repo.wiki.delete_page_button"}}</a>
|
||||
<a class="ui small primary button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
<a class="ui small red button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}?action=_delete" data-id="{{.PageURL}}">{{.locale.Tr "repo.wiki.delete_page_button"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="field">
|
||||
<button class="ui green button" data-url="{{.Link}}">{{.locale.Tr "actions.runners.update_runner"}}</button>
|
||||
<button class="ui primary button" data-url="{{.Link}}">{{.locale.Tr "actions.runners.update_runner"}}</button>
|
||||
<button class="ui red button delete-button show-modal" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
|
||||
{{.locale.Tr "actions.runners.delete_runner"}}</button>
|
||||
</div>
|
||||
|
@ -112,7 +112,7 @@
|
||||
{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="ui basic green button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
|
||||
<button class="ui basic primary button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
|
||||
{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}
|
||||
</button>
|
||||
{{end}}
|
||||
|
@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "install.confirm_password"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "install.confirm_password"}}</button>
|
||||
</div>
|
||||
<input id="code" name="code" type="hidden" value="{{.Code}}">
|
||||
{{else if .IsSendRegisterMail}}
|
||||
|
@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "settings.change_password"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "settings.change_password"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "sign_in"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
|
||||
<a href="{{AppSubUrl}}/user/forget_password">{{.locale.Tr "auth.forget_password"}}</a>
|
||||
</div>
|
||||
{{if .ShowRegistrationButton}}
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{if .LinkAccountMode}}
|
||||
{{.locale.Tr "auth.oauth_signin_submit"}}
|
||||
{{else}}
|
||||
|
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "sign_in"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
<button class="ui primary button">
|
||||
{{if .LinkAccountMode}}
|
||||
{{.locale.Tr "auth.oauth_signup_submit"}}
|
||||
{{else}}
|
||||
|
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "auth.openid_connect_submit"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.openid_connect_submit"}}</button>
|
||||
<a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "auth.create_new_account"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.create_new_account"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "auth.verify"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
|
||||
<a href="{{AppSubUrl}}/user/two_factor/scratch">{{.locale.Tr "auth.use_scratch_code" | Str2html}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">{{.locale.Tr "auth.verify"}}</button>
|
||||
<button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -101,9 +101,9 @@
|
||||
</div>
|
||||
{{if .SingleRepoLink}}
|
||||
{{if eq .SingleRepoAction "issue"}}
|
||||
<a class="ui green button gt-ml-4" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/issues/new/choose">{{.locale.Tr "repo.issues.new"}}</a>
|
||||
{{else if eq .SingleRepoAction "pull"}}
|
||||
<a class="ui green button gt-ml-4" href="{{.SingleRepoLink}}/compare">{{.locale.Tr "repo.pulls.new"}}</a>
|
||||
<a class="ui primary button gt-ml-4" href="{{.SingleRepoLink}}/compare">{{.locale.Tr "repo.pulls.new"}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user