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 29 kB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  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" id="create_repo_form">
  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="alias" value="{{.Repository.Alias}}" data-repo-name="{{.Repository.Alias}}" autofocus required>
  17. <input type="hidden" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  18. </div> -->
  19. <div class="required field {{if .Err_Alias}}error{{end}}">
  20. <label for="Alias">{{.i18n.Tr "form.Alias"}}</label>
  21. <input name="alias" value="{{.Repository.Alias}}" data-repo-name="{{.Repository.Alias}}" autofocus required>
  22. <span class="help">{{.i18n.Tr "form.reponame_dash_dot_error"}}</span>
  23. </div>
  24. <div class="required field">
  25. <label>{{.i18n.Tr "form.RepoPath"}}</label>
  26. <div class="fields">
  27. <div class="eight wide required field {{if .Err_Owner}}error{{end}}">
  28. <div class="ui selection owner dropdown" id="ownerDropdown">
  29. <input type="hidden" id="uid" name="uid" value="{{.Owner.Name}}" required>
  30. <div class="text" title="{{.Owner.Name}}">
  31. <img class="ui mini image" src="{{.Owner.RelAvatarLink}}">
  32. {{.Owner.ShortName 40}}
  33. </div>
  34. </div>
  35. </div>
  36. <div class="ui interval" style="width: 0.6em;font-size: 2rem;line-height: 38px;text-align: center;">/</div>
  37. <div class="eight wide required field {{if .Err_Alias}}error{{end}}">
  38. <!-- <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label> -->
  39. <input style="width: 100% !important;" id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
  40. <span class="help">{{.i18n.Tr "form.repoadd_dash_dot_error"}}</span>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="inline field" id="repoAdress" style="display: none;">
  45. <label for="">{{.i18n.Tr "form.RepoAdress"}}:</label>
  46. <span></span>
  47. </div>
  48. <div class="inline field">
  49. <label>{{.i18n.Tr "repo.repo_size"}}</label>
  50. <span>{{SizeFmt .Repository.Size}}</span>
  51. </div>
  52. <div class="inline field">
  53. <label>{{.i18n.Tr "repo.template"}}</label>
  54. <div class="ui checkbox">
  55. <input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
  56. <label>{{.i18n.Tr "repo.template_helper"}}</label>
  57. </div>
  58. </div>
  59. {{if not .Repository.IsFork}}
  60. <div class="inline field">
  61. <label>{{.i18n.Tr "repo.visibility"}}</label>
  62. <div class="ui checkbox">
  63. {{if .IsAdmin}}
  64. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
  65. {{else}}
  66. <input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}{{if and $.ForcePrivate .Repository.IsPrivate}} readonly{{end}}>
  67. {{end}}
  68. <label>{{.i18n.Tr "repo.visibility_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visibility_fork_helper"}}</span>{{end}}</label>
  69. </div>
  70. </div>
  71. {{end}}
  72. <div class="field {{if .Err_Description}}error{{end}}">
  73. <label for="description">{{$.i18n.Tr "repo.repo_desc"}}</label>
  74. <textarea id="description" name="description" rows="2" maxlength="254">{{.Repository.Description}}</textarea>
  75. </div>
  76. <div class="field {{if .Err_Website}}error{{end}}">
  77. <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
  78. <input id="website" name="website" type="url" value="{{.Repository.Website}}">
  79. </div>
  80. <div class="field">
  81. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  82. </div>
  83. </form>
  84. <div class="ui divider"></div>
  85. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  86. {{.CsrfTokenHtml}}
  87. <div class="inline field">
  88. <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  89. <input name="avatar" type="file" >
  90. </div>
  91. <div class="field">
  92. <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  93. <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  94. </div>
  95. </form>
  96. </div>
  97. {{if .Repository.IsMirror}}
  98. <h4 class="ui top attached header">
  99. {{.i18n.Tr "repo.settings.mirror_settings"}}
  100. </h4>
  101. <div class="ui attached segment">
  102. <form class="ui form" method="post">
  103. {{.CsrfTokenHtml}}
  104. <input type="hidden" name="action" value="mirror">
  105. <div class="inline field {{if .Err_EnablePrune}}error{{end}}">
  106. <label>{{.i18n.Tr "repo.mirror_prune"}}</label>
  107. <div class="ui checkbox">
  108. <input id="enable_prune" name="enable_prune" type="checkbox" {{if .MirrorEnablePrune}}checked{{end}}>
  109. <label>{{.i18n.Tr "repo.mirror_prune_desc"}}</label>
  110. </div>
  111. </div>
  112. <div class="inline field {{if .Err_Interval}}error{{end}}">
  113. <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
  114. <input id="interval" name="interval" value="{{.MirrorInterval}}">
  115. </div>
  116. <div class="field {{if .Err_MirrorAddress}}error{{end}}">
  117. <label for="mirror_address">{{.i18n.Tr "repo.mirror_address"}}</label>
  118. <input id="mirror_address" name="mirror_address" value="{{MirrorFullAddress .Mirror}}" required>
  119. <p class="help">{{.i18n.Tr "repo.mirror_address_desc"}}</p>
  120. </div>
  121. <div class="ui accordion optional field">
  122. <label class="ui title {{if .Err_Auth}}text red active{{end}}">
  123. <i class="icon dropdown"></i>
  124. <label for="">{{.i18n.Tr "repo.need_auth"}}</label>
  125. </label>
  126. <div class="content {{if .Err_Auth}}active{{else if (MirrorUserName .Mirror)}}active{{end}}">
  127. <div class="inline field {{if .Err_Auth}}error{{end}}">
  128. <label for="mirror_username">{{.i18n.Tr "username"}}</label>
  129. <input id="mirror_username" name="mirror_username" value="{{MirrorUserName .Mirror}}" {{if not .mirror_username}}data-need-clear="true"{{end}}>
  130. </div>
  131. <input class="fake" type="password">
  132. <div class="inline field {{if .Err_Auth}}error{{end}}">
  133. <label for="mirror_password">{{.i18n.Tr "password"}}</label>
  134. <input id="mirror_password" name="mirror_password" type="password" value="{{MirrorPassword .Mirror}}" {{if not .mirror_password}}data-need-clear="true"{{end}}>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="field">
  139. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  140. </div>
  141. </form>
  142. <div class="ui divider"></div>
  143. <form class="ui form" method="post">
  144. {{.CsrfTokenHtml}}
  145. <input type="hidden" name="action" value="mirror-sync">
  146. <div class="inline field">
  147. <label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
  148. <span>{{.Mirror.UpdatedUnix.AsTime}}</span>
  149. </div>
  150. <div class="field">
  151. <button class="ui blue button">{{$.i18n.Tr "repo.settings.sync_mirror"}}</button>
  152. </div>
  153. </form>
  154. </div>
  155. {{end}}
  156. <h4 class="ui top attached header">
  157. {{.i18n.Tr "repo.settings.advanced_settings"}}
  158. </h4>
  159. <div class="ui attached segment">
  160. <form class="ui form" method="post">
  161. {{.CsrfTokenHtml}}
  162. <input type="hidden" name="action" value="advanced">
  163. {{$isDatasetEnabled := .Repository.UnitEnabled $.UnitTypeDatasets }}
  164. <div class="inline field">
  165. <label>{{.i18n.Tr "repo.datasets"}}</label>
  166. <div class="ui checkbox">
  167. <input class="enable-system" name="enable_dataset" type="checkbox" {{if $isDatasetEnabled}}checked{{end}}>
  168. <label>{{.i18n.Tr "repo.settings.dataset_desc"}}</label>
  169. </div>
  170. </div>
  171. {{$isModelMangeEnabled := .Repository.UnitEnabled $.UnitTypeModelManage }}
  172. <div class="inline field">
  173. <label>{{.i18n.Tr "repo.model_manager"}}</label>
  174. <div class="ui checkbox">
  175. <input class="enable-system" name="enable_model_manager" type="checkbox" {{if $isModelMangeEnabled}}checked{{end}}>
  176. <label>{{.i18n.Tr "repo.settings.model_desc"}}</label>
  177. </div>
  178. </div>
  179. {{$isCloudBrainEnabled := .Repository.UnitEnabled $.UnitTypeCloudBrain }}
  180. <div class="inline field">
  181. <label>{{.i18n.Tr "repo.cloudbrain"}}</label>
  182. <div class="ui checkbox">
  183. <input class="enable-system" name="enable_cloud_brain" type="checkbox" {{if $isCloudBrainEnabled}}checked{{end}}>
  184. <label>{{.i18n.Tr "repo.settings.cloudbrain_desc"}}</label>
  185. </div>
  186. </div>
  187. {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  188. <div class="inline field">
  189. <label>{{.i18n.Tr "repo.wiki"}}</label>
  190. {{if and (.UnitTypeWiki.UnitGlobalDisabled) (.UnitTypeExternalWiki.UnitGlobalDisabled)}}
  191. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  192. {{else}}
  193. <div class="ui checkbox">
  194. {{end}}
  195. <input class="enable-system" name="enable_wiki" type="checkbox" data-target="#wiki_box" {{if $isWikiEnabled}}checked{{end}}>
  196. <label>{{.i18n.Tr "repo.settings.wiki_desc"}}</label>
  197. </div>
  198. </div>
  199. <div class="field {{if not $isWikiEnabled}}disabled{{end}}" id="wiki_box">
  200. <div class="field">
  201. {{if .UnitTypeWiki.UnitGlobalDisabled}}
  202. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  203. {{else}}
  204. <div class="ui radio checkbox">
  205. {{end}}
  206. <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}}/>
  207. <label>{{.i18n.Tr "repo.settings.use_internal_wiki"}}</label>
  208. </div>
  209. </div>
  210. <div class="field">
  211. {{if .UnitTypeExternalWiki.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_wiki" type="radio" value="true" data-target="#external_wiki_box" {{if .Repository.UnitEnabled $.UnitTypeExternalWiki}}checked{{end}}/>
  217. <label>{{.i18n.Tr "repo.settings.use_external_wiki"}}</label>
  218. </div>
  219. </div>
  220. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}disabled{{end}}" id="external_wiki_box">
  221. <label for="external_wiki_url">{{.i18n.Tr "repo.settings.external_wiki_url"}}</label>
  222. <input id="external_wiki_url" name="external_wiki_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}">
  223. <p class="help">{{.i18n.Tr "repo.settings.external_wiki_url_desc"}}</p>
  224. </div>
  225. </div>
  226. <div class="ui divider"></div>
  227. {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
  228. <div class="inline field">
  229. <label>{{.i18n.Tr "repo.issues"}}</label>
  230. {{if and (.UnitTypeIssues.UnitGlobalDisabled) (.UnitTypeExternalTracker.UnitGlobalDisabled)}}
  231. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  232. {{else}}
  233. <div class="ui checkbox">
  234. {{end}}
  235. <input class="enable-system" name="enable_issues" type="checkbox" data-target="#issue_box" {{if $isIssuesEnabled}}checked{{end}}>
  236. <label>{{.i18n.Tr "repo.settings.issues_desc"}}</label>
  237. </div>
  238. </div>
  239. <div class="field {{if not $isIssuesEnabled}}disabled{{end}}" id="issue_box">
  240. <div class="field">
  241. {{if .UnitTypeIssues.UnitGlobalDisabled}}
  242. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  243. {{else}}
  244. <div class="ui radio checkbox">
  245. {{end}}
  246. <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}}/>
  247. <label>{{.i18n.Tr "repo.settings.use_internal_issue_tracker"}}</label>
  248. </div>
  249. </div>
  250. <div class="field {{if (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="internal_issue_box">
  251. {{if .Repository.CanEnableTimetracker}}
  252. <div class="field">
  253. <div class="ui checkbox">
  254. <input name="enable_timetracker" class="enable-system" data-target="#only_contributors" type="checkbox" {{if .Repository.IsTimetrackerEnabled}}checked{{end}}>
  255. <label>{{.i18n.Tr "repo.settings.enable_timetracker"}}</label>
  256. </div>
  257. </div>
  258. <div class="field {{if not .Repository.IsTimetrackerEnabled}}disabled{{end}}" id="only_contributors">
  259. <div class="ui checkbox">
  260. <input name="allow_only_contributors_to_track_time" type="checkbox" {{if .Repository.AllowOnlyContributorsToTrackTime}}checked{{end}}>
  261. <label>{{.i18n.Tr "repo.settings.allow_only_contributors_to_track_time"}}</label>
  262. </div>
  263. </div>
  264. {{end}}
  265. <div class="field">
  266. <div class="ui checkbox">
  267. <input name="enable_issue_dependencies" type="checkbox" {{if (.Repository.IsDependenciesEnabled)}}checked{{end}}>
  268. <label>{{.i18n.Tr "repo.issues.dependency.setting"}}</label>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="field">
  273. {{if .UnitTypeExternalTracker.UnitGlobalDisabled}}
  274. <div class="ui radio checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  275. {{else}}
  276. <div class="ui radio checkbox">
  277. {{end}}
  278. <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}}/>
  279. <label>{{.i18n.Tr "repo.settings.use_external_issue_tracker"}}</label>
  280. </div>
  281. </div>
  282. <div class="field {{if not (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}disabled{{end}}" id="external_issue_box">
  283. <div class="field">
  284. <label for="external_tracker_url">{{.i18n.Tr "repo.settings.external_tracker_url"}}</label>
  285. <input id="external_tracker_url" name="external_tracker_url" type="url" value="{{(.Repository.MustGetUnit $.UnitTypeExternalTracker).ExternalTrackerConfig.ExternalTrackerURL}}">
  286. <p class="help">{{.i18n.Tr "repo.settings.external_tracker_url_desc"}}</p>
  287. </div>
  288. <div class="field">
  289. <label for="tracker_url_format">{{.i18n.Tr "repo.settings.tracker_url_format"}}</label>
  290. <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}">
  291. <p class="help">{{.i18n.Tr "repo.settings.tracker_url_format_desc" | Str2html}}</p>
  292. </div>
  293. <div class="inline fields">
  294. <label for="issue_style">{{.i18n.Tr "repo.settings.tracker_issue_style"}}</label>
  295. <div class="field">
  296. <div class="ui radio checkbox">
  297. {{$externalTracker := (.Repository.MustGetUnit $.UnitTypeExternalTracker)}}
  298. {{$externalTrackerStyle := $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle}}
  299. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="numeric" {{if $externalTrackerStyle}}{{if eq $externalTrackerStyle "numeric"}}checked=""{{end}}{{end}}/>
  300. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.numeric"}} <span class="ui light grey text">(#1234)</span></label>
  301. </div>
  302. </div>
  303. <div class="field">
  304. <div class="ui radio checkbox">
  305. <input class="hidden" tabindex="0" name="tracker_issue_style" type="radio" value="alphanumeric" {{if $externalTrackerStyle}}{{if eq $externalTracker.ExternalTrackerConfig.ExternalTrackerStyle "alphanumeric"}}checked=""{{end}}{{end}} />
  306. <label>{{.i18n.Tr "repo.settings.tracker_issue_style.alphanumeric"}} <span class="ui light grey text">(ABC-123, DEFG-234)</span></label>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. {{if .Repository.CanEnablePulls}}
  313. <div class="ui divider"></div>
  314. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  315. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  316. <div class="inline field">
  317. <label>{{.i18n.Tr "repo.pulls"}}</label>
  318. {{if .UnitTypePullRequests.UnitGlobalDisabled}}
  319. <div class="ui checkbox poping up disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
  320. {{else}}
  321. <div class="ui checkbox">
  322. {{end}}
  323. <input class="enable-system" name="enable_pulls" type="checkbox" data-target="#pull_box" {{if $pullRequestEnabled}}checked{{end}}>
  324. <label>{{.i18n.Tr "repo.settings.pulls_desc"}}</label>
  325. </div>
  326. </div>
  327. <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box">
  328. <div class="field">
  329. <div class="ui checkbox">
  330. <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}>
  331. <label>{{.i18n.Tr "repo.settings.pulls.ignore_whitespace"}}</label>
  332. </div>
  333. </div>
  334. <div class="field">
  335. <div class="ui checkbox">
  336. <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}>
  337. <label>{{.i18n.Tr "repo.settings.pulls.allow_merge_commits"}}</label>
  338. </div>
  339. </div>
  340. <div class="field">
  341. <div class="ui checkbox">
  342. <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}>
  343. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge"}}</label>
  344. </div>
  345. </div>
  346. <div class="field">
  347. <div class="ui checkbox">
  348. <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}>
  349. <label>{{.i18n.Tr "repo.settings.pulls.allow_rebase_merge_commit"}}</label>
  350. </div>
  351. </div>
  352. <div class="field">
  353. <div class="ui checkbox">
  354. <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}>
  355. <label>{{.i18n.Tr "repo.settings.pulls.allow_squash_commits"}}</label>
  356. </div>
  357. </div>
  358. </div>
  359. {{end}}
  360. <div class="ui divider"></div>
  361. <div class="field">
  362. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  363. </div>
  364. </form>
  365. </div>
  366. {{if .IsAdmin}}
  367. <h4 class="ui top attached header">
  368. {{.i18n.Tr "repo.settings.admin_settings"}}
  369. </h4>
  370. <div class="ui attached segment">
  371. <form class="ui form" method="post">
  372. {{.CsrfTokenHtml}}
  373. <input type="hidden" name="action" value="admin">
  374. <div class="field">
  375. <div class="ui checkbox">
  376. <input name="enable_health_check" type="checkbox" {{if .Repository.IsFsckEnabled}}checked{{end}}>
  377. <label>{{.i18n.Tr "repo.settings.admin_enable_health_check"}}</label>
  378. </div>
  379. </div>
  380. <div class="ui checkbox">
  381. <input name="enable_close_issues_via_commit_in_any_branch" type="checkbox" {{ if .Repository.CloseIssuesViaCommitInAnyBranch }}checked{{end}}>
  382. <label>{{.i18n.Tr "repo.settings.admin_enable_close_issues_via_commit_in_any_branch"}}</label>
  383. </div>
  384. <div class="ui divider"></div>
  385. <div class="field">
  386. <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
  387. </div>
  388. </form>
  389. </div>
  390. {{end}}
  391. {{if .Permission.IsOwner}}
  392. <h4 class="ui top attached warning header">
  393. {{.i18n.Tr "repo.settings.danger_zone"}}
  394. </h4>
  395. <div class="ui attached warning table danger segment">
  396. {{if .Repository.IsMirror}}
  397. <div class="item">
  398. <div class="ui right">
  399. <button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
  400. </div>
  401. <div>
  402. <h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
  403. <p>{{.i18n.Tr "repo.settings.convert_desc"}}</p>
  404. </div>
  405. </div>
  406. <div class="ui divider"></div>
  407. {{end}}
  408. <div class="item">
  409. <div class="ui right">
  410. <button class="ui basic red show-modal button" data-modal="#transfer-repo-modal">{{.i18n.Tr "repo.settings.transfer"}}</button>
  411. </div>
  412. <div>
  413. <h5>{{.i18n.Tr "repo.settings.transfer"}}</h5>
  414. <p>{{.i18n.Tr "repo.settings.transfer_desc"}}</p>
  415. </div>
  416. </div>
  417. {{if .Permission.CanRead $.UnitTypeWiki}}
  418. <div class="ui divider"></div>
  419. <div class="item">
  420. <div class="ui right">
  421. <button class="ui basic red show-modal button" data-modal="#delete-wiki-modal">{{.i18n.Tr "repo.settings.wiki_delete"}}</button>
  422. </div>
  423. <div>
  424. <h5>{{.i18n.Tr "repo.settings.wiki_delete"}}</h5>
  425. <p>{{.i18n.Tr "repo.settings.wiki_delete_desc"}}</p>
  426. </div>
  427. </div>
  428. {{end}}
  429. <div class="ui divider"></div>
  430. <div class="item">
  431. <div class="ui right">
  432. <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.i18n.Tr "repo.settings.delete"}}</button>
  433. </div>
  434. <div>
  435. <h5>{{.i18n.Tr "repo.settings.delete"}}</h5>
  436. <p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
  437. </div>
  438. </div>
  439. {{if not .Repository.IsMirror}}
  440. <div class="ui divider"></div>
  441. <div class="item">
  442. <div class="ui right">
  443. <button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
  444. {{if .Repository.IsArchived}}
  445. {{.i18n.Tr "repo.settings.unarchive.button"}}
  446. {{else}}
  447. {{.i18n.Tr "repo.settings.archive.button"}}
  448. {{end}}
  449. </button>
  450. </div>
  451. <div>
  452. {{if .Repository.IsArchived}}
  453. <h5>{{.i18n.Tr "repo.settings.unarchive.header"}}</h5>
  454. <p>{{.i18n.Tr "repo.settings.unarchive.text"}}</p>
  455. {{else}}
  456. <h5>{{.i18n.Tr "repo.settings.archive.header"}}</h5>
  457. <p>{{.i18n.Tr "repo.settings.archive.text"}}</p>
  458. {{end}}
  459. </div>
  460. </div>
  461. {{end}}
  462. </div>
  463. {{end}}
  464. </div>
  465. </div>
  466. {{if .Permission.IsOwner}}
  467. {{if .Repository.IsMirror}}
  468. <div class="ui small modal" id="convert-repo-modal">
  469. <div class="header">
  470. {{.i18n.Tr "repo.settings.convert"}}
  471. </div>
  472. <div class="content">
  473. <div class="ui warning message text left">
  474. {{.i18n.Tr "repo.settings.convert_notices_1"}}
  475. </div>
  476. <form class="ui form" action="{{.Link}}" method="post">
  477. {{.CsrfTokenHtml}}
  478. <input type="hidden" name="action" value="convert">
  479. <div class="field">
  480. <label>
  481. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  482. <span class="text red">{{.Repository.Alias}}</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="text right actions">
  490. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  491. <button class="ui red button">{{.i18n.Tr "repo.settings.convert_confirm"}}</button>
  492. </div>
  493. </form>
  494. </div>
  495. </div>
  496. {{end}}
  497. <div class="ui small modal" id="transfer-repo-modal">
  498. <div class="header">
  499. {{.i18n.Tr "repo.settings.transfer"}}
  500. </div>
  501. <div class="content">
  502. <div class="ui warning message text left">
  503. {{.i18n.Tr "repo.settings.transfer_notices_1"}} <br>
  504. {{.i18n.Tr "repo.settings.transfer_notices_2"}}
  505. </div>
  506. <form class="ui form" action="{{.Link}}" method="post">
  507. {{.CsrfTokenHtml}}
  508. <input type="hidden" name="action" value="transfer">
  509. <div class="field">
  510. <label>
  511. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  512. <span class="text red">{{.Repository.Alias}}</span>
  513. </label>
  514. </div>
  515. <div class="required field">
  516. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  517. <input id="repo_name" name="repo_name" required>
  518. </div>
  519. <div class="required field">
  520. <label for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
  521. <input id="new_owner_name" name="new_owner_name" required>
  522. </div>
  523. <div class="text right actions">
  524. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  525. <button class="ui red button">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
  526. </div>
  527. </form>
  528. </div>
  529. </div>
  530. <div class="ui small modal" id="delete-repo-modal">
  531. <div class="header">
  532. {{.i18n.Tr "repo.settings.delete"}}
  533. </div>
  534. <div class="content">
  535. <div class="ui warning message text left">
  536. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  537. {{.i18n.Tr "repo.settings.delete_notices_2" .Repository.Alias | Safe}}
  538. {{if .Repository.NumForks}}<br>
  539. {{.i18n.Tr "repo.settings.delete_notices_fork_1"}}
  540. {{end}}
  541. </div>
  542. <form class="ui form" action="{{.Link}}" method="post">
  543. {{.CsrfTokenHtml}}
  544. <input type="hidden" name="action" value="delete">
  545. <div class="field">
  546. <label>
  547. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  548. <span class="text red">{{.Repository.Alias}}</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_delete"}}</button>
  558. </div>
  559. </form>
  560. </div>
  561. </div>
  562. {{if .Repository.UnitEnabled $.UnitTypeWiki}}
  563. <div class="ui small modal" id="delete-wiki-modal">
  564. <div class="header">
  565. {{.i18n.Tr "repo.settings.wiki_delete"}}
  566. </div>
  567. <div class="content">
  568. <div class="ui warning message text left">
  569. {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br>
  570. {{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Alias | Safe}}
  571. </div>
  572. <form class="ui form" action="{{.Link}}" method="post">
  573. {{.CsrfTokenHtml}}
  574. <input type="hidden" name="action" value="delete-wiki">
  575. <div class="field">
  576. <label>
  577. {{.i18n.Tr "repo.settings.transfer_form_title"}}
  578. <span class="text red">{{.Repository.Alias}}</span>
  579. </label>
  580. </div>
  581. <div class="required field">
  582. <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
  583. <input id="repo_name" name="repo_name" required>
  584. </div>
  585. <div class="text right actions">
  586. <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div>
  587. <button class="ui red button">{{.i18n.Tr "repo.settings.confirm_wiki_delete"}}</button>
  588. </div>
  589. </form>
  590. </div>
  591. </div>
  592. {{end}}
  593. {{if not .Repository.IsMirror}}
  594. <div class="ui basic modal" id="archive-repo-modal">
  595. <div class="ui icon header">
  596. {{if .Repository.IsArchived}}
  597. {{.i18n.Tr "repo.settings.unarchive.header"}}
  598. {{else}}
  599. {{.i18n.Tr "repo.settings.archive.header"}}
  600. {{end}}
  601. </div>
  602. <div class="content center">
  603. <p>
  604. {{if .Repository.IsArchived}}
  605. {{.i18n.Tr "repo.settings.unarchive.text"}}
  606. {{else}}
  607. {{.i18n.Tr "repo.settings.archive.text"}}
  608. {{end}}
  609. </p>
  610. </div>
  611. <form action="{{.Link}}" method="post">
  612. {{.CsrfTokenHtml}}
  613. <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
  614. <input type="hidden" name="repo_id" value="{{.Repository.ID}}">
  615. <div class="center actions">
  616. <div class="ui basic cancel inverted button">{{.i18n.Tr "settings.cancel"}}</div>
  617. <button class="ui basic inverted yellow button">{{.i18n.Tr "modal.yes"}}</button>
  618. </div>
  619. </form>
  620. </div>
  621. {{end}}
  622. {{end}}
  623. {{template "base/footer" .}}