From 85fa954a3810b233cb299f455546c4b2314400b3 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Fri, 26 May 2023 11:42:54 +0200 Subject: [PATCH 01/84] Improve some Forms (#24878) Don't really know a better name for this. I've gone through some Forms and added missing HTML attributes (mostly `maxlength`). I tried to fill the Forms with dummy Data and see if Gitea throws a Error (e.g. maximum length). If yes, I added the missing HTML attribute. While working on this, I discovered that the Form to add OAuth2 Apps just silently fails when filled with invalid data, so I fixed that too. --- routers/web/user/setting/oauth2_common.go | 1 + templates/admin/user/edit.tmpl | 12 ++++++------ templates/admin/user/new.tmpl | 2 +- templates/org/settings/options.tmpl | 2 +- templates/repo/create.tmpl | 4 ++-- templates/repo/issue/search.tmpl | 2 +- templates/repo/migrate/codebase.tmpl | 4 ++-- templates/repo/migrate/git.tmpl | 4 ++-- templates/repo/migrate/gitbucket.tmpl | 4 ++-- templates/repo/migrate/gitea.tmpl | 4 ++-- templates/repo/migrate/github.tmpl | 4 ++-- templates/repo/migrate/gitlab.tmpl | 4 ++-- templates/repo/migrate/gogs.tmpl | 4 ++-- templates/repo/migrate/onedev.tmpl | 4 ++-- templates/repo/settings/options.tmpl | 2 +- templates/user/settings/applications.tmpl | 2 +- .../user/settings/applications_oauth2_edit_form.tmpl | 4 ++-- .../user/settings/applications_oauth2_list.tmpl | 2 +- templates/user/settings/keys_ssh.tmpl | 2 +- templates/user/settings/profile.tmpl | 10 +++++----- 20 files changed, 39 insertions(+), 38 deletions(-) diff --git a/routers/web/user/setting/oauth2_common.go b/routers/web/user/setting/oauth2_common.go index f6ad1b2b381..5489b602608 100644 --- a/routers/web/user/setting/oauth2_common.go +++ b/routers/web/user/setting/oauth2_common.go @@ -31,6 +31,7 @@ func (oa *OAuth2CommonHandlers) renderEditPage(ctx *context.Context) { func (oa *OAuth2CommonHandlers) AddApp(ctx *context.Context) { form := web.GetForm(ctx).(*forms.EditOAuth2ApplicationForm) if ctx.HasError() { + ctx.Flash.Error(ctx.GetErrMsg()) // go to the application list page ctx.Redirect(oa.BasePathList) return diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 30109cc923a..00d21f24b00 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -9,7 +9,7 @@ {{.CsrfTokenHtml}}
- +
@@ -59,7 +59,7 @@
- +
@@ -72,18 +72,18 @@
- +
- +
- +

{{.locale.Tr "admin.users.max_repo_creation_desc"}}

@@ -181,7 +181,7 @@
- +
diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl index dbf01fb43ec..691d63aeade 100644 --- a/templates/admin/user/new.tmpl +++ b/templates/admin/user/new.tmpl @@ -53,7 +53,7 @@
- +
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl index 6f9f0765487..21b14200ff0 100644 --- a/templates/org/settings/options.tmpl +++ b/templates/org/settings/options.tmpl @@ -69,7 +69,7 @@
- +

{{.locale.Tr "admin.users.max_repo_creation_desc"}}

{{end}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 85b02f394d5..05e7052ff4e 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -43,7 +43,7 @@
- + {{.locale.Tr "repo.repo_name_helper"}}
@@ -61,7 +61,7 @@
- +
diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl index f24c2dbb7e0..97b22d36990 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -7,7 +7,7 @@ - + {{if .PageIsIssueList}} {{end}} diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index 5bfd3adc2d3..41e9c273bca 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -83,7 +83,7 @@
- +
@@ -99,7 +99,7 @@
- +
diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index fb6775e38c0..ba092a32a04 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -57,7 +57,7 @@
- +
@@ -73,7 +73,7 @@
- +
diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index e9515beeb2b..da14d569a8f 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -99,7 +99,7 @@
- +
@@ -115,7 +115,7 @@
- +
diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index f1d4e4f06b7..daa1205557e 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -95,7 +95,7 @@
- +
@@ -111,7 +111,7 @@
- +
diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index c591f2a4658..e9f2b11e75f 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -97,7 +97,7 @@
- +
@@ -113,7 +113,7 @@
- +
diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index 65559da152c..656b5c50ee8 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -94,7 +94,7 @@
- +
@@ -110,7 +110,7 @@
- +
diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index 8bc57861ade..78700a79104 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -97,7 +97,7 @@
- +
@@ -113,7 +113,7 @@
- +
diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index 8463782ae78..50858edd600 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -83,7 +83,7 @@
- +
@@ -99,7 +99,7 @@
- +
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index efcdaceb37d..83a6bc4ba18 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -826,7 +826,7 @@
- +
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 84d02c0a003..1c12a0a2b76 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -45,7 +45,7 @@ {{.CsrfTokenHtml}}
- +
diff --git a/templates/user/settings/applications_oauth2_edit_form.tmpl b/templates/user/settings/applications_oauth2_edit_form.tmpl index 8a9579c5c51..45f12f22d05 100644 --- a/templates/user/settings/applications_oauth2_edit_form.tmpl +++ b/templates/user/settings/applications_oauth2_edit_form.tmpl @@ -36,11 +36,11 @@ {{.CsrfTokenHtml}}
- +
- +
diff --git a/templates/user/settings/applications_oauth2_list.tmpl b/templates/user/settings/applications_oauth2_list.tmpl index ad38c60eb98..2e42ed27587 100644 --- a/templates/user/settings/applications_oauth2_list.tmpl +++ b/templates/user/settings/applications_oauth2_list.tmpl @@ -31,7 +31,7 @@ {{.CsrfTokenHtml}}
- +
diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index f6ea508cc8c..0a47c44bd83 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -12,7 +12,7 @@ {{.CsrfTokenHtml}}
- +
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index dc1bbc84d57..e6ba283a0cb 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -12,14 +12,14 @@ {{.locale.Tr "settings.change_username_prompt"}} {{.locale.Tr "settings.change_username_redirect_prompt"}} - + {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}

{{$.locale.Tr "settings.password_username_disabled"}}

{{end}}
- +
@@ -33,15 +33,15 @@
- +
- +
- +
From abccb86b36d8c9e680768fcff0c0dc05f1cd9447 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Fri, 26 May 2023 19:58:11 +0300 Subject: [PATCH 02/84] Show `bot` label next to username when rendering autor link if the user is a bot (#24943) If the user is a bot, we'll add a label next to the author link that says `bot`. I didn't localize `bot` because passing `locale` into the `autorlink` template would require changing all calls. # Example `yardenshoham` is a bot. ## Before ![image](https://github.com/go-gitea/gitea/assets/20454870/77390780-b763-4f0f-b358-bbccdbf17a5d) ## After ![image](https://github.com/go-gitea/gitea/assets/20454870/72af342f-ee76-4337-95ad-4ecaba853fed) --------- Signed-off-by: Yarden Shoham --- models/user/user.go | 5 +++++ templates/shared/user/authorlink.tmpl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/models/user/user.go b/models/user/user.go index 07d8177b6a9..2077d55f513 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -406,6 +406,11 @@ func (u *User) IsIndividual() bool { return u.Type == UserTypeIndividual } +// IsBot returns whether or not the user is of type bot +func (u *User) IsBot() bool { + return u.Type == UserTypeBot +} + // DisplayName returns full name if it's not empty, // returns username otherwise. func (u *User) DisplayName() string { diff --git a/templates/shared/user/authorlink.tmpl b/templates/shared/user/authorlink.tmpl index 71cbb8676e6..64ccc62cd01 100644 --- a/templates/shared/user/authorlink.tmpl +++ b/templates/shared/user/authorlink.tmpl @@ -1 +1 @@ -{{.GetDisplayName}} +{{.GetDisplayName}}{{if .IsBot}}bot{{end}} From d6cbf7f3156c55c89b69427b0247c8fd1fcab070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=88=E7=AC=91=E9=A3=8E=E7=94=9F=E9=97=B4?= Date: Sat, 27 May 2023 02:16:48 +0800 Subject: [PATCH 03/84] docs: remove an extraneous whitespace (#24949) --- docs/content/doc/development/oauth2-provider.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/development/oauth2-provider.en-us.md b/docs/content/doc/development/oauth2-provider.en-us.md index b279e97a6eb..cf045ac2fe6 100644 --- a/docs/content/doc/development/oauth2-provider.en-us.md +++ b/docs/content/doc/development/oauth2-provider.en-us.md @@ -94,7 +94,7 @@ For public clients, a redirect URI of a loopback IP address such as `http://127. 1. Redirect to user to the authorization endpoint in order to get their consent for accessing the resources: ```curl - https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE + https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&state=STATE ``` The `CLIENT_ID` can be obtained by registering an application in the settings. The `STATE` is a random string that will be send back to your application after the user authorizes. The `state` parameter is optional but should be used to prevent CSRF attacks. From 7de46b0749521932ad3560d6a8280ed1387be304 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Sat, 27 May 2023 00:25:56 +0000 Subject: [PATCH 04/84] [skip ci] Updated translations via Crowdin --- options/locale/locale_ru-RU.ini | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index e90c6e0059e..585c05373c1 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -785,6 +785,8 @@ access_token_deletion_cancel_action=Отменить access_token_deletion_confirm_action=Удалить access_token_deletion_desc=Удаление токена отзовёт доступ к вашей учетной записи у приложений, использующих его. Это действие не может быть отменено. Продолжить? delete_token_success=Токен удалён. Приложения, использующие его, больше не имеют доступа к вашему аккаунту. +select_scopes=Выберите полномочия +scopes_list=Полномочия: manage_oauth2_applications=Управление приложениями OAuth2 edit_oauth2_application=Изменить приложение OAuth2 @@ -863,6 +865,7 @@ email_notifications.enable=Включить почтовые уведомлен email_notifications.onmention=Посылать письмо на эл. почту только при упоминании email_notifications.disable=Отключить почтовые уведомления email_notifications.submit=Установить настройки электронной почты +email_notifications.andyourown=И ваши собственные уведомления visibility=Видимость пользователя visibility.public=Публичный @@ -892,6 +895,7 @@ clone_helper=Нужна помощь в клонировании? Посетит fork_repo=Форкнуть репозиторий fork_from=Форк от already_forked=Вы уже форкнули %s +fork_to_different_account=Ответвление для другой учётной записи fork_visibility_helper=Видимость форкнутого репозитория изменить нельзя. use_template=Использовать этот шаблон clone_in_vsc=Клонировать в VS Code @@ -1013,9 +1017,11 @@ migrate_items_releases=Релизы migrate_repo=Перенос репозитория migrate.clone_address=Перенос / Клонирование по URL migrate.clone_address_desc=Это может быть HTTP/HTTPS/GIT адрес или локальный путь существующего репозитория на сервере. +migrate.github_token_desc=Вы можете поместить один или несколько токенов, разделенных запятыми, чтобы сделать миграцию быстрее из-за ограничения скорости GitHub API. ПРЕДУПРЕЖДЕНИЕ: Злоупотребление этой функцией может нарушить политику поставщика услуг и привести к блокировке аккаунта. migrate.clone_local_path=или локальный путь на сервере migrate.permission_denied=У вас нет прав на импорт локальных репозиториев. migrate.permission_denied_blocked=Вы не можете импортировать с запрещённых хостов, пожалуйста, попросите администратора проверить настройки ALLOWED_DOMAINS/ALLOW_LOCALNETWORKS/BLOCKED_DOMAINS. +migrate.invalid_local_path=Недопустимый локальный путь. Он не существует или не является каталогом. migrate.invalid_lfs_endpoint=Конечная точка LFS недействительна. migrate.failed=Миграция не удалась: %v migrate.migrate_items_options=Токен доступа необходим для миграции дополнительных элементов @@ -1064,6 +1070,7 @@ cite_this_repo=Сослаться на этот репозиторий create_new_repo_command=Создать новый репозиторий из командной строки push_exist_repo=Отправка существующего репозитория из командной строки empty_message=В репозитории нет файлов. +broken_message=Данные Git, лежащие в основе репозитория, не могут быть прочитаны. Свяжитесь с администратором этого экземпляра или удалите этот репозиторий. code=Код code.desc=Исходный код, файлы, коммиты и ветки. @@ -1251,6 +1258,8 @@ projects.column.new_submit=Создать столбец projects.column.new=Новый столбец projects.column.set_default=Установить по умолчанию projects.column.set_default_desc=Назначить этот столбец по умолчанию для неклассифицированных задач и запросов на слияние +projects.column.unset_default=Снять установку по умолчанию +projects.column.unset_default_desc=Снять установку этого столбца по умолчанию projects.column.delete=Удалить столбец projects.column.deletion_desc=При удалении столбца проекта все связанные задачи перемещаются в 'Без категории'. Продолжить? projects.column.color=Цвет @@ -1427,6 +1436,9 @@ issues.save=Сохранить issues.label_title=Имя метки issues.label_description=Описание метки issues.label_color=Цвет метки +issues.label_exclusive=Эксклюзивный +issues.label_exclusive_desc=Назовите метку область/элемент, чтобы сделать ее взаимоисключающей с другими метками область/. +issues.label_exclusive_warning=Любые метки с конфликтующей областью будут удалены при редактировании меток задачи или запроса на слияние. issues.label_count=%d меток issues.label_open_issues=%d открытых задач issues.label_edit=Редактировать @@ -1583,6 +1595,7 @@ pulls.allow_edits_from_maintainers_desc=Пользователи с доступ pulls.allow_edits_from_maintainers_err=Не удалось обновить pulls.compare_changes_desc=Сравнить две ветки и создать запрос на слияние для изменений. pulls.has_viewed_file=Просмотрено +pulls.has_changed_since_last_review=Изменено с момента вашего последнего отзыва pulls.viewed_files_label=%[1]d из %[2]d файлов просмотрено pulls.expand_files=Показать все файлы pulls.collapse_files=Свернуть все файлы @@ -1960,6 +1973,7 @@ settings.trust_model.collaborator.long=Соавтор: Доверять подп settings.trust_model.collaborator.desc=Действительные подписи соавторов этого репозитория будут помечены как «доверенные» (независимо от того, соответствуют ли они автору коммита). В остальных случаях действительные подписи будут помечены как «недоверенные», если подпись соответствует автору коммита, и «не совпадающие», если нет. settings.trust_model.committer=Коммитер settings.trust_model.committer.long=Коммитер: Доверять подписям, соответствующим коммитерам (Это совпадает с GitHub и заставит подписать коммиты Gitea в качестве коммитера) +settings.trust_model.committer.desc=Действительные подписи будут помечены «доверенными», только если они соответствуют автору коммита, в противном случае они будут помечены «не совпадающими». Это заставит Gitea быть автором подписанных коммитов, а фактический автор будет обозначен в трейлерах Co-Authored-By: и Co-Committed-By: коммита. Ключ Gitea по умолчанию должен соответствовать пользователю в базе данных. settings.trust_model.collaboratorcommitter=Соавтор+Коммитер settings.trust_model.collaboratorcommitter.long=Соавтор+Коммитер: Доверять подписям соавторов, которые соответствуют автору коммита settings.trust_model.collaboratorcommitter.desc=Действительные подписи соавторов этого репозитория будут помечены «доверенными», если они соответствуют автору коммита. Действительные подписи будут помечены как «недоверенные», если подпись соответствует автору коммита, и «не совпадающие» впротивном случае. Это заставит Gitea быть отмеченным в качестве автора подписанного коммита, а фактический автор будет указан в трейлерах Co-Authored-By: и Co-Committed-By: коммита. Ключ Gitea по умолчанию должен соответствовать пользователю в базе данных. @@ -2133,6 +2147,7 @@ settings.protect_this_branch_desc=Предотвращает удаление, settings.protect_disable_push=Отключить отправку settings.protect_disable_push_desc=Отправка не будет разрешена в эту ветку. settings.protect_enable_push=Включить отправку +settings.protect_enable_push_desc=Любому, у кого есть доступ на запись, будет разрешена отправка изменений в эту ветку (но не принудительная отправка). settings.protect_whitelist_committers=Ограничение отправки по белому списку settings.protect_whitelist_committers_desc=Только пользователям или командам из белого списка будет разрешена отправка изменений в эту ветку (но не принудительная отправка). settings.protect_whitelist_deploy_keys=Белый список развёртываемых ключей с доступом на запись в push. @@ -2141,6 +2156,7 @@ settings.protect_whitelist_search_users=Поиск пользователей… settings.protect_whitelist_teams=Команды, члены которых могут отправлять изменения в эту ветку: settings.protect_whitelist_search_teams=Поиск команд… settings.protect_merge_whitelist_committers=Ограничить право на слияние белым списком +settings.protect_merge_whitelist_committers_desc=Разрешить принимать запросы на слияние в эту ветку только пользователям и командам из «белого списка». settings.protect_merge_whitelist_users=Пользователи с правом на слияние: settings.protect_merge_whitelist_teams=Команды, члены которых обладают правом на слияние: settings.protect_check_status_contexts=Включить проверку статуса @@ -2517,7 +2533,9 @@ teams.all_repositories_helper=Команда имеет доступ ко все teams.all_repositories_read_permission_desc=Эта команда предоставляет прочтено доступ к всем репозиториям: участники могут просматривать и клонировать репозитории. teams.all_repositories_write_permission_desc=Эта команда предоставляет Написать доступ к всем репозиториям: участники могут читать и выполнять push в репозитории. teams.all_repositories_admin_permission_desc=Эта команда предоставляет администратору доступ к всем репозиториям: участники могут читать, отправлять сообщения и добавлять соавторов в репозитории. +teams.invite.title=Вы были приглашены в команду %s в организации %s. teams.invite.by=Приглашен(а) %s +teams.invite.description=Нажмите на кнопку ниже, чтобы присоединиться к команде. [admin] dashboard=Панель From 4a58a8ca31cbaa35b41e82da925521afe7946a64 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 27 May 2023 12:06:08 +0200 Subject: [PATCH 05/84] Make the 500 page load themes (#24953) The 500 page was not loading theme CSS, so always appeared in light theme. This extracts the stylesheets into a shared template used by all pages. image Small related rant: I think there should only be one `` in all of the templates, but I see it was deliberatly done that the 500 page has its own `` because "it should only depend the minimal template functions", but I disagree because we are missing a lot of things that are in the regular ``. --- templates/base/head.tmpl | 13 +++---------- templates/base/stylesheets.tmpl | 8 ++++++++ templates/status/500.tmpl | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 templates/base/stylesheets.tmpl diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index d702b9fcef6..690cade8d7a 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -20,7 +20,6 @@ {{end}} - {{template "base/head_script" .}}
-
+
{{if .PrimaryLanguage}} {{.PrimaryLanguage.Language}} diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index aadaaa412a2..755c93fde30 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -2,117 +2,112 @@
{{template "user/overview/header" .}}
-
-
-
-
-

{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})

-
-
- {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}} - {{if .HasRepositoryAccess}} - {{.locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}} - {{else}} - {{.locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}} - {{end}} -
+
+
+

{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})

+
+
+ {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}} + {{if .HasRepositoryAccess}} + {{.locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}} + {{else}} + {{.locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}} + {{end}} +
+
+
+
+ {{template "package/content/alpine" .}} + {{template "package/content/cargo" .}} + {{template "package/content/chef" .}} + {{template "package/content/composer" .}} + {{template "package/content/conan" .}} + {{template "package/content/conda" .}} + {{template "package/content/container" .}} + {{template "package/content/cran" .}} + {{template "package/content/debian" .}} + {{template "package/content/generic" .}} + {{template "package/content/go" .}} + {{template "package/content/helm" .}} + {{template "package/content/maven" .}} + {{template "package/content/npm" .}} + {{template "package/content/nuget" .}} + {{template "package/content/pub" .}} + {{template "package/content/pypi" .}} + {{template "package/content/rpm" .}} + {{template "package/content/rubygems" .}} + {{template "package/content/swift" .}} + {{template "package/content/vagrant" .}} +
+
+ {{.locale.Tr "packages.details"}} + + {{if not (eq .PackageDescriptor.Package.Type "container")}}
-
-
- {{template "package/content/alpine" .}} - {{template "package/content/cargo" .}} - {{template "package/content/chef" .}} - {{template "package/content/composer" .}} - {{template "package/content/conan" .}} - {{template "package/content/conda" .}} - {{template "package/content/container" .}} - {{template "package/content/cran" .}} - {{template "package/content/debian" .}} - {{template "package/content/generic" .}} - {{template "package/content/go" .}} - {{template "package/content/helm" .}} - {{template "package/content/maven" .}} - {{template "package/content/npm" .}} - {{template "package/content/nuget" .}} - {{template "package/content/pub" .}} - {{template "package/content/pypi" .}} - {{template "package/content/rpm" .}} - {{template "package/content/rubygems" .}} - {{template "package/content/swift" .}} - {{template "package/content/vagrant" .}} -
-
-
- {{.locale.Tr "packages.details"}} -
-
{{svg .PackageDescriptor.Package.Type.SVGName 16 "gt-mr-3"}} {{.PackageDescriptor.Package.Type.Name}}
- {{if .HasRepositoryAccess}} -
- {{end}} -
{{svg "octicon-calendar" 16 "gt-mr-3"}} {{TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}}
-
{{svg "octicon-download" 16 "gt-mr-3"}} {{.PackageDescriptor.Version.DownloadCount}}
- {{template "package/metadata/alpine" .}} - {{template "package/metadata/cargo" .}} - {{template "package/metadata/chef" .}} - {{template "package/metadata/composer" .}} - {{template "package/metadata/conan" .}} - {{template "package/metadata/conda" .}} - {{template "package/metadata/container" .}} - {{template "package/metadata/cran" .}} - {{template "package/metadata/debian" .}} - {{template "package/metadata/generic" .}} - {{template "package/metadata/helm" .}} - {{template "package/metadata/maven" .}} - {{template "package/metadata/npm" .}} - {{template "package/metadata/nuget" .}} - {{template "package/metadata/pub" .}} - {{template "package/metadata/pypi" .}} - {{template "package/metadata/rpm" .}} - {{template "package/metadata/rubygems" .}} - {{template "package/metadata/swift" .}} - {{template "package/metadata/vagrant" .}} - {{if not (and (eq .PackageDescriptor.Package.Type "container") .PackageDescriptor.Metadata.Manifests)}} -
{{svg "octicon-database" 16 "gt-mr-3"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}
- {{end}} + {{.locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}}) +
+ {{range .PackageDescriptor.Files}} +
+ {{.File.Name}} + {{FileSize .Blob.Size}}
- {{if not (eq .PackageDescriptor.Package.Type "container")}} -
- {{.locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}}) -
- {{range .PackageDescriptor.Files}} -
- {{.File.Name}} - {{FileSize .Blob.Size}} -
- {{end}} -
+ {{end}} +
+ {{end}} + {{if .LatestVersions}} +
+ {{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}}) + {{.locale.Tr "packages.versions.view_all"}} +
+ {{range .LatestVersions}} +
+ {{.Version}} + {{DateTime "short" .CreatedUnix}} +
+ {{end}} +
+ {{end}} + {{if or .CanWritePackages .HasRepositoryAccess}} +
+
+ {{if .HasRepositoryAccess}} +
{{svg "octicon-issue-opened" 16 "gt-mr-3"}} {{.locale.Tr "repo.issues"}}
{{end}} - {{if .LatestVersions}} -
- {{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}}) - {{.locale.Tr "packages.versions.view_all"}} -
- {{range .LatestVersions}} -
- {{.Version}} - {{DateTime "short" .CreatedUnix}} -
- {{end}} -
- {{end}} - {{if or .CanWritePackages .HasRepositoryAccess}} -
-
- {{if .HasRepositoryAccess}} -
{{svg "octicon-issue-opened" 16 "gt-mr-3"}} {{.locale.Tr "repo.issues"}}
- {{end}} - {{if .CanWritePackages}} -
{{svg "octicon-tools" 16 "gt-mr-3"}} {{.locale.Tr "repo.settings"}}
- {{end}} -
+ {{if .CanWritePackages}} +
{{svg "octicon-tools" 16 "gt-mr-3"}} {{.locale.Tr "repo.settings"}}
{{end}}
-
+ {{end}}
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index c12b8149b08..bdaafbb36bf 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -1,15 +1,15 @@ -
+ {{.CsrfTokenHtml}} {{if .Flash}}
{{template "base/alert" .}}
{{end}} -
+
- {{template "shared/user/avatarlink" dict "Context" $.Context "user" .SignedUser}} -
+ {{avatar $.Context .SignedUser 40}} +
{{if .PageIsComparePull}} @@ -48,147 +48,145 @@
-
-
- {{template "repo/issue/branch_selector_field" .}} +
+ {{template "repo/issue/branch_selector_field" .}} - - {{template "repo/issue/labels/labels_selector_field" .}} - {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}} -
+
- -