You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

options.tmpl 27 kB

Template Repositories (#8768) * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
5 years ago
Template Repositories (#8768) * Start work on templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Continue work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix IsTemplate vs IsGenerated Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tabs vs spaces * Tabs vs Spaces * Add templates to API & start adding tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix integration tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove unused User Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move template tests to existing repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Minor re-check updates and cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix optionalbool Signed-off-by: jolheiser <john.olheiser@gmail.com> * make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Test fixes and icon change Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add new user and repo for tests Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests (finally) Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update meta repo with env variables Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move generation to create page Combine with repo create template Modify API search to prioritize owner for repo Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix tests and coverage Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix swagger and JS lint Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix API searching for own private repos Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change wording Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix repo search test. User had a private repo that didn't show up Signed-off-by: jolheiser <john.olheiser@gmail.com> * Another search test fix Signed-off-by: jolheiser <john.olheiser@gmail.com> * Clarify git content Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Feedback updates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add topics WIP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish adding topics Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update locale Signed-off-by: jolheiser <john.olheiser@gmail.com>
5 years ago
3 years ago
Repository avatars (#6986) * Repository avatars - first variant of code from old work for gogs - add migration 87 - add new option in app.ini - add en-US locale string - add new class in repository.less * Add changed index.css, remove unused template name * Update en-us doc about configuration options * Add comments to new functions, add new option to docker app.ini * Add comment for lint * Remove variable, not needed * Fix formatting * Update swagger api template * Check if avatar exists * Fix avatar link/path checks * Typo * TEXT column can't have a default value * Fixes: - remove old avatar file on upload - use ID in name of avatar file - users may upload same files - add simple tests * Fix fmt check * Generate PNG instead of "static" GIF * More informative comment * Fix error message * Update avatar upload checks: - add file size check - add new option - update config docs - add new string to en-us locale * Fixes: - use FileHEader field for check file size - add new test - upload big image * Fix formatting * Update comments * Update log message * Removed wrong style - not needed * Use Sync2 to migrate * Update repos list view - bigger avatar - fix html blocks alignment * A little adjust avatar size * Use small icons for explore/repo list * Use new cool avatar preparation func by @lafriks * Missing changes for new function * Remove unused import, move imports * Missed new option definition in app.ini Add file size check in user/profile avatar upload * Use smaller field length for Avatar * Use session to update repo DB data, update DeleteAvatar - use session too * Fix err variable definition * As suggested @lafriks - return as soon as possible, code readability
6 years ago
4 years ago
3 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. {{template "base/head" .}}
  2. <div class="repository settings options">
  3. {{template "repo/header" .}}
  4. {{template "repo/settings/navbar" .}}
  5. <div class="ui container">
  6. {{template "base/alert" .}}
  7. <h4 class="ui top attached header">
  8. {{.i18n.Tr "repo.settings.basic_settings"}}
  9. </h4>
  10. <div class="ui attached segment">
  11. <form class="ui form" action="{{.Link}}" method="post">
  12. {{.CsrfTokenHtml}}
  13. <input type="hidden" name="action" value="update">
  14. <div class="required field {{if .Err_RepoName}}error{{end}}">
  15. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  16. <input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  17. </div>
  18. <div class="inline field">
  19. <label>{{.i18n.Tr "repo.repo_size"}}</label>
  20. <span>{{SizeFmt .Repository.Size}}</span>
  21. </div>
  22. <div class="inline field">
  23. <label>{{.i18n.Tr "repo.template"}}</label>
  24. <div class="ui checkbox">
  25. <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
  26. <label>{{.i18n.Tr "repo.template_helper"}}</label>
  27. </div>
  28. </div>
  29. {{if not .Repository.IsFork}}
  30. <div class="inline field">
  31. <label>{{.i18n.Tr "repo.visibility"}}</label>
  32. <div class="ui checkbox">
  33. {{if .IsAdmin}}
  34. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  35. {{else}}
  36. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
  37. {{end}}
  38. <label>{{.i18n.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
  39. </div>
  40. </div>
  41. {{end}}
  42. <div class="field {{if .Err_Description}}error{{end}}">
  43. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  44. <textarea id="description" name="description" rows="2" maxlength="254">{{.Repository.Description}}</textarea>
  45. </div>
  46. <div class="field {{if .Err_Website}}error{{end}}">
  47. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  48. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  49. </div>
  50. <div class="field">
  51. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  52. </div>
  53. </form>
  54. <div class="ui divider"></div>
  55. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  56. {{.CsrfTokenHtml}}
  57. <div class="inline field">
  58. <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  59. <input name="avatar" type="file" >
  60. </div>
  61. <div class="field">
  62. <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  63. <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  64. </div>
  65. </form>
  66. </div>
  67. {{if .Repository.IsMirror}}
  68. <h4 class="ui top attached header">
  69. {{.i18n.Tr "repo.settings.mirror_settings"}}
  70. </h4>
  71. <div class="ui attached segment">
  72. <form class="ui form" method="post">
  73. {{.CsrfTokenHtml}}
  74. <input type="hidden" name="action" value="mirror">
  75. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  76. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  77. <div class="ui checkbox">
  78. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  79. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  80. </div>
  81. </div>
  82. <div class="inline field {{if .Err_Interval}}error{{end}}">
  83. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  84. <input id="interval" name="interval" value="{{.MirrorInterval}}">
  85. </div>
  86. <div class="field {{if .Err_MirrorAddress}}error{{end}}">
  87. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  88. <input id="mirror_address" name="mirror_address" value="{{MirrorFullAddress .Mirror}}" required>
  89. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  90. </div>
  91. <div class="ui accordion optional field">
  92. <label class="ui title {{if .Err_Auth}}text red active{{end}}">
  93. <i class="icon dropdown"></i>
  94. <label for="">{{.i18n.Tr "repo.need_auth"}}</label>
  95. </label>
  96. <div class="content {{if .Err_Auth}}active{{else if (MirrorUserName .Mirror)}}active{{end}}">
  97. <div class="inline field {{if .Err_Auth}}error{{end}}">
  98. <label for="mirror_username">{{.i18n.Tr "username"}}</label>
  99. <input id="mirror_username" name="mirror_username" value="{{MirrorUserName .Mirror}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
  100. </div>
  101. <input class="fake" type="password">
  102. <div class="inline field {{if .Err_Auth}}error{{end}}">
  103. <label for="mirror_password">{{.i18n.Tr "password"}}</label>
  104. <input id="mirror_password" name="mirror_password" type="password" value="{{MirrorPassword .Mirror}}" {{if not .mirror_password}}data-need-clear="true"{{end}}>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="field">
  109. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  110. </div>
  111. </form>
  112. <div class="ui divider"></div>
  113. <form class="ui form" method="post">
  114. {{.CsrfTokenHtml}}
  115. <input type="hidden" name="action" value="mirror-sync">
  116. <div class="inline field">
  117. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  118. <span>{{.Mirror.UpdatedUnix.AsTime}}</span>
  119. </div>
  120. <div class="field">
  121. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  122. </div>
  123. </form>
  124. </div>
  125. {{end}}
  126. <h4 class="ui top attached header">
  127. {{.i18n.Tr "repo.settings.advanced_settings"}}
  128. </h4>
  129. <div class="ui attached segment">
  130. <form class="ui form" method="post">
  131. {{.CsrfTokenHtml}}
  132. <input type="hidden" name="action" value="advanced">
  133. {{$isDatasetEnabled := .Repository.UnitEnabled $.UnitTypeDatasets }}
  134. <div class="inline field">
  135. <label>{{.i18n.Tr "repo.datasets"}}</label>
  136. <div class="ui checkbox">
  137. <input class="enable-system" name="enable_dataset" type="checkbox" {{if $isDatasetEnabled}}checked{{end}}>
  138. <label>{{.i18n.Tr "repo.settings.dataset_desc"}}</label>
  139. </div>
  140. </div>
  141. {{$isCloudBrainEnabled := .Repository.UnitEnabled $.UnitTypeCloudBrain }}
  142. <div class="inline field">
  143. <label>{{.i18n.Tr "repo.cloudbrain"}}</label>
  144. <div class="ui checkbox">
  145. <input class="enable-system" name="enable_cloud_brain" type="checkbox" {{if $isCloudBrainEnabled}}checked{{end}}>
  146. <label>{{.i18n.Tr "repo.settings.cloudbrain_desc"}}</label>
  147. </div>
  148. </div>
  149. {{$isCloudBrainEnabled := .Repository.UnitEnabled $.UnitTypeCloudBrain }}
  150. <div class="inline field">
  151. <label>{{.i18n.Tr "repo.model_manager"}}</label>
  152. <div class="ui checkbox">
  153. <input class="enable-system" name="enable_model_manager" type="checkbox" {{if $isCloudBrainEnabled}}checked{{end}}>
  154. <label>{{.i18n.Tr "repo.settings.model_desc"}}</label>
  155. </div>
  156. </div>
  157. {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  158. <div class="inline field">
  159. <label>{{.i18n.Tr "repo.wiki"}}</label>
  160. {{if and (.UnitTypeWiki.UnitGlobalDisabled) (.UnitTypeExternalWiki.UnitGlobalDisabled)}}
  161. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  162. {{else}}
  163. <div class="ui checkbox">
  164. {{end}}
  165. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
  166. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  167. </div>
  168. </div>
  169. <div class="field {{if not $isWikiEnabled}}disabled{{end}}" id="wiki_box">
  170. <div class="field">
  171. {{if .UnitTypeWiki.UnitGlobalDisabled}}
  172. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  173. {{else}}
  174. <div class="ui radio checkbox">
  175. {{end}}
  176. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="false" data-target="#external_wiki_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}checked{{end}}/>
  177. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  178. </div>
  179. </div>
  180. <div class="field">
  181. {{if .UnitTypeExternalWiki.UnitGlobalDisabled}}
  182. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  183. {{else}}
  184. <div class="ui radio checkbox">
  185. {{end}}
  186. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.UnitTypeExternalWiki}}checked{{end}}/>
  187. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  188. </div>
  189. </div>
  190. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
  191. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  192. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
  193. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  194. </div>
  195. </div>
  196. <div class="ui divider"></div>
  197. {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
  198. <div class="inline field">
  199. <label>{{.i18n.Tr "repo.issues"}}</label>
  200. {{if and (.UnitTypeIssues.UnitGlobalDisabled) (.UnitTypeExternalTracker.UnitGlobalDisabled)}}
  201. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  202. {{else}}
  203. <div class="ui checkbox">
  204. {{end}}
  205. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
  206. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  207. </div>
  208. </div>
  209. <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
  210. <div class="field">
  211. {{if .UnitTypeIssues.UnitGlobalDisabled}}
  212. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  213. {{else}}
  214. <div class="ui radio checkbox">
  215. {{end}}
  216. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="false" data-context="#internal_issue_box" data-target="#external_issue_box" {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}checked{{end}}/>
  217. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  218. </div>
  219. </div>
  220. <div class="field {{if (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
  221. {{if .Repository.CanEnableTimetracker}}
  222. <div class="field">
  223. <div class="ui checkbox">
  224. <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
  225. <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
  226. </div>
  227. </div>
  228. <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
  229. <div class="ui checkbox">
  230. <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
  231. <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
  232. </div>
  233. </div>
  234. {{end}}
  235. <div class="field">
  236. <div class="ui checkbox">
  237. <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled)}}checked{{end}}>
  238. <label>{{.i18n.Tr "repo.issues.dependency.setting"}}</label>
  239. </div>
  240. </div>
  241. </div>
  242. <div class="field">
  243. {{if .UnitTypeExternalTracker.UnitGlobalDisabled}}
  244. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  245. {{else}}
  246. <div class="ui radio checkbox">
  247. {{end}}
  248. <input class="hidden enable-system-radio" tabindex="0" name="enable_external_tracker" type="radio" value="true" data-context="#internal_issue_box" data-target="#external_issue_box" {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}checked{{end}}/>
  249. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  250. </div>
  251. </div>
  252. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
  253. <div class="field">
  254. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  255. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
  256. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  257. </div>
  258. <div class="field">
  259. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  260. <input id="tracker_url_format" name="tracker_url_format" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerFormat}}" placeholder="e.g. https://github.com/{user}/{repo}/issues/{index}">
  261. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  262. </div>
  263. <div class="inline fields">
  264. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  265. <div class="field">
  266. <div class="ui radio checkbox">
  267. {{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}}
  268. {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
  269. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if $externalTrackerStyle}}{{if eq $externalTrackerStyle "numeric"}}checked=""{{end}}{{end}}/>
  270. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  271. </div>
  272. </div>
  273. <div class="field">
  274. <div class="ui radio checkbox">
  275. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if $externalTrackerStyle}}{{if eq $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}{{end}} />
  276. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. {{if .Repository.CanEnablePulls}}
  283. <div class="ui divider"></div>
  284. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  285. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  286. <div class="inline field">
  287. <label>{{.i18n.Tr "repo.pulls"}}</label>
  288. {{if .UnitTypePullRequests.UnitGlobalDisabled}}
  289. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  290. {{else}}
  291. <div class="ui checkbox">
  292. {{end}}
  293. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
  294. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  295. </div>
  296. </div>
  297. <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
  298. <div class="field">
  299. <div class="ui checkbox">
  300. <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
  301. <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  302. </div>
  303. </div>
  304. <div class="field">
  305. <div class="ui checkbox">
  306. <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
  307. <label>{{.i18n.Tr "repo.settings.pulls.allow_merge_commits"}}</label>
  308. </div>
  309. </div>
  310. <div class="field">
  311. <div class="ui checkbox">
  312. <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
  313. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
  314. </div>
  315. </div>
  316. <div class="field">
  317. <div class="ui checkbox">
  318. <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
  319. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge_commit"}}</label>
  320. </div>
  321. </div>
  322. <div class="field">
  323. <div class="ui checkbox">
  324. <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
  325. <label>{{.i18n.Tr "repo.settings.pulls.allow_squash_commits"}}</label>
  326. </div>
  327. </div>
  328. </div>
  329. {{end}}
  330. <div class="ui divider"></div>
  331. <div class="field">
  332. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  333. </div>
  334. </form>
  335. </div>
  336. {{if .IsAdmin}}
  337. <h4 class="ui top attached header">
  338. {{.i18n.Tr "repo.settings.admin_settings"}}
  339. </h4>
  340. <div class="ui attached segment">
  341. <form class="ui form" method="post">
  342. {{.CsrfTokenHtml}}
  343. <input type="hidden" name="action" value="admin">
  344. <div class="field">
  345. <div class="ui checkbox">
  346. <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
  347. <label>{{.i18n.Tr "repo.settings.admin_enable_health_check"}}</label>
  348. </div>
  349. </div>
  350. <div class="ui checkbox">
  351. <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{ if .Repository.CloseIssuesViaCommitInAnyBranch }}checked{{end}}>
  352. <label>{{.i18n.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
  353. </div>
  354. <div class="ui divider"></div>
  355. <div class="field">
  356. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  357. </div>
  358. </form>
  359. </div>
  360. {{end}}
  361. {{if .Permission.IsOwner}}
  362. <h4 class="ui top attached warning header">
  363. {{.i18n.Tr "repo.settings.danger_zone"}}
  364. </h4>
  365. <div class="ui attached warning table danger segment">
  366. {{if .Repository.IsMirror}}
  367. <div class="item">
  368. <div class="ui right">
  369. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  370. </div>
  371. <div>
  372. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  373. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  374. </div>
  375. </div>
  376. <div class="ui divider"></div>
  377. {{end}}
  378. <div class="item">
  379. <div class="ui right">
  380. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  381. </div>
  382. <div>
  383. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  384. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  385. </div>
  386. </div>
  387. {{if .Permission.CanRead $.UnitTypeWiki}}
  388. <div class="ui divider"></div>
  389. <div class="item">
  390. <div class="ui right">
  391. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  392. </div>
  393. <div>
  394. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  395. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  396. </div>
  397. </div>
  398. {{end}}
  399. <div class="ui divider"></div>
  400. <div class="item">
  401. <div class="ui right">
  402. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  403. </div>
  404. <div>
  405. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  406. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  407. </div>
  408. </div>
  409. {{if not .Repository.IsMirror}}
  410. <div class="ui divider"></div>
  411. <div class="item">
  412. <div class="ui right">
  413. <button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
  414. {{if .Repository.IsArchived}}
  415. {{.i18n.Tr "repo.settings.unarchive.button"}}
  416. {{else}}
  417. {{.i18n.Tr "repo.settings.archive.button"}}
  418. {{end}}
  419. </button>
  420. </div>
  421. <div>
  422. {{if .Repository.IsArchived}}
  423. <h5>{{.i18n.Tr "repo.settings.unarchive.header"}}</h5>
  424. <p>{{.i18n.Tr "repo.settings.unarchive.text"}}</p>
  425. {{else}}
  426. <h5>{{.i18n.Tr "repo.settings.archive.header"}}</h5>
  427. <p>{{.i18n.Tr "repo.settings.archive.text"}}</p>
  428. {{end}}
  429. </div>
  430. </div>
  431. {{end}}
  432. </div>
  433. {{end}}
  434. </div>
  435. </div>
  436. {{if .Permission.IsOwner}}
  437. {{if .Repository.IsMirror}}
  438. <div class="ui small modal" id="convert-repo-modal">
  439. <div class="header">
  440. {{.i18n.Tr "repo.settings.convert"}}
  441. </div>
  442. <div class="content">
  443. <div class="ui warning message text left">
  444. {{.i18n.Tr "repo.settings.convert_notices_1"}}
  445. </div>
  446. <form class="ui form" action="{{.Link}}" method="post">
  447. {{.CsrfTokenHtml}}
  448. <input type="hidden" name="action" value="convert">
  449. <div class="field">
  450. <label>
  451. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  452. <span class="text red">{{.Repository.Name}}</span>
  453. </label>
  454. </div>
  455. <div class="required field">
  456. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  457. <input id="repo_name" name="repo_name" required>
  458. </div>
  459. <div class="text right actions">
  460. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  461. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  462. </div>
  463. </form>
  464. </div>
  465. </div>
  466. {{end}}
  467. <div class="ui small modal" id="transfer-repo-modal">
  468. <div class="header">
  469. {{.i18n.Tr "repo.settings.transfer"}}
  470. </div>
  471. <div class="content">
  472. <div class="ui warning message text left">
  473. {{.i18n.Tr "repo.settings.transfer_notices_1"}} <br>
  474. {{.i18n.Tr "repo.settings.transfer_notices_2"}}
  475. </div>
  476. <form class="ui form" action="{{.Link}}" method="post">
  477. {{.CsrfTokenHtml}}
  478. <input type="hidden" name="action" value="transfer">
  479. <div class="field">
  480. <label>
  481. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  482. <span class="text red">{{.Repository.Name}}</span>
  483. </label>
  484. </div>
  485. <div class="required field">
  486. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  487. <input id="repo_name" name="repo_name" required>
  488. </div>
  489. <div class="required field">
  490. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  491. <input id="new_owner_name" name="new_owner_name" required>
  492. </div>
  493. <div class="text right actions">
  494. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  495. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  496. </div>
  497. </form>
  498. </div>
  499. </div>
  500. <div class="ui small modal" id="delete-repo-modal">
  501. <div class="header">
  502. {{.i18n.Tr "repo.settings.delete"}}
  503. </div>
  504. <div class="content">
  505. <div class="ui warning message text left">
  506. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  507. {{.i18n.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}}
  508. {{if .Repository.NumForks}}<br>
  509. {{.i18n.Tr "repo.settings.delete_notices_fork_1"}}
  510. {{end}}
  511. </div>
  512. <form class="ui form" action="{{.Link}}" method="post">
  513. {{.CsrfTokenHtml}}
  514. <input type="hidden" name="action" value="delete">
  515. <div class="field">
  516. <label>
  517. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  518. <span class="text red">{{.Repository.Name}}</span>
  519. </label>
  520. </div>
  521. <div class="required field">
  522. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  523. <input id="repo_name" name="repo_name" required>
  524. </div>
  525. <div class="text right actions">
  526. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  527. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
  528. </div>
  529. </form>
  530. </div>
  531. </div>
  532. {{if .Repository.UnitEnabled $.UnitTypeWiki}}
  533. <div class="ui small modal" id="delete-wiki-modal">
  534. <div class="header">
  535. {{.i18n.Tr "repo.settings.wiki_delete"}}
  536. </div>
  537. <div class="content">
  538. <div class="ui warning message text left">
  539. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  540. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
  541. </div>
  542. <form class="ui form" action="{{.Link}}" method="post">
  543. {{.CsrfTokenHtml}}
  544. <input type="hidden" name="action" value="delete-wiki">
  545. <div class="field">
  546. <label>
  547. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  548. <span class="text red">{{.Repository.Name}}</span>
  549. </label>
  550. </div>
  551. <div class="required field">
  552. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  553. <input id="repo_name" name="repo_name" required>
  554. </div>
  555. <div class="text right actions">
  556. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  557. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_wiki_delete"}}</button>
  558. </div>
  559. </form>
  560. </div>
  561. </div>
  562. {{end}}
  563. {{if not .Repository.IsMirror}}
  564. <div class="ui basic modal" id="archive-repo-modal">
  565. <div class="ui icon header">
  566. {{if .Repository.IsArchived}}
  567. {{.i18n.Tr "repo.settings.unarchive.header"}}
  568. {{else}}
  569. {{.i18n.Tr "repo.settings.archive.header"}}
  570. {{end}}
  571. </div>
  572. <div class="content center">
  573. <p>
  574. {{if .Repository.IsArchived}}
  575. {{.i18n.Tr "repo.settings.unarchive.text"}}
  576. {{else}}
  577. {{.i18n.Tr "repo.settings.archive.text"}}
  578. {{end}}
  579. </p>
  580. </div>
  581. <form action="{{.Link}}" method="post">
  582. {{.CsrfTokenHtml}}
  583. <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
  584. <input type="hidden" name="repo_id" value="{{.Repository.ID}}">
  585. <div class="center actions">
  586. <div class="ui basic cancel inverted button">{{.i18n.Tr "settings.cancel"}}</div>
  587. <button class="ui basic inverted yellow button">{{.i18n.Tr "modal.yes"}}</button>
  588. </div>
  589. </form>
  590. </div>
  591. {{end}}
  592. {{end}}
  593. {{template "base/footer" .}}